[TIC-Web] source clean up 07/116607/2
authorChangHyun Lee <leechwin.lee@samsung.com>
Mon, 27 Feb 2017 07:52:31 +0000 (16:52 +0900)
committerChangHyun Lee <leechwin.lee@samsung.com>
Mon, 27 Feb 2017 07:54:54 +0000 (16:54 +0900)
- remove unused variable
- eslint convention

Change-Id: I2683f9bd945997dfb99438b902e645d02a05bed8
Signed-off-by: ChangHyun Lee <leechwin.lee@samsung.com>
controller/mariadb.js
public/src/css/style.css
public/src/js/main.js
public/src/js/model/ImageModel.js
public/src/js/model/JobModel.js
public/src/js/model/JobPagingModel.js
public/src/js/page/job.js
public/src/js/page/package.js
public/src/js/util.js

index 1340383..a0784e8 100644 (file)
@@ -362,7 +362,7 @@ mariadb.editImage = function editImage (req, res) {
 /**
  * Connect
  */
-mariadb.connectToClient = function connectToClient (){
+mariadb.connectToClient = function connectToClient () {
     return new Promise(function (resolve, reject) {
         // connect
         mariaSqlClient.connect(function (err) {
index 7acc504..99bacf1 100644 (file)
@@ -76,7 +76,7 @@ body {
     margin: 12px 0;
 }
 
-#tic-page-login-dropdown-menu .social-buttons a{
+#tic-page-login-dropdown-menu .social-buttons a {
     width: 49%;
 }
 
@@ -84,12 +84,12 @@ body {
     margin-bottom: 10px;
 }
 
-@media(max-width:768px){
-    #tic-page-login-dropdown-menu{
+@media(max-width:768px) {
+    #tic-page-login-dropdown-menu {
         background-color: inherit;
         color: #fff;
     }
-    #tic-page-login-dropdown-menu .bottom{
+    #tic-page-login-dropdown-menu .bottom {
         background-color: inherit;
         border-top:0 none;
     }
index 417d117..0946951 100644 (file)
@@ -38,7 +38,7 @@ define([
         });
 
         // Keep the state of the active item on navbar
-        $(".navbar a").on("click", function(){
+        $(".navbar a").on("click", function() {
             $(".navbar").find(".active").removeClass("active");
             $(this).parent().addClass("active");
         });
index 2373e39..fdc33d4 100644 (file)
@@ -2,8 +2,7 @@ define([
     'jquery',
     'lodash',
     'js/util',
-    'js/logger',
-    ''
+    'js/logger'
 ], function (
     $,
     _,
index d7a7e58..ef1a015 100644 (file)
@@ -2,8 +2,7 @@ define([
     'jquery',
     'lodash',
     'js/util',
-    'js/logger',
-    ''
+    'js/logger'
 ], function (
     $,
     _,
@@ -202,15 +201,15 @@ define([
         this.jobImageName = value ? value : '-';
     };
 
-    JobModel.prototype.getJobStatusText = function (){
+    JobModel.prototype.getJobStatusText = function () {
         return this.jobStatusText;
     };
 
-    JobModel.prototype.setJobStatusText = function (value){
+    JobModel.prototype.setJobStatusText = function (value) {
         this.jobStatusText = value || '';
     };
 
-    JobModel.prototype.getJobStatus = function (){
+    JobModel.prototype.getJobStatus = function () {
         return this.jobStatus;
     };
 
index c1b59ce..643e9ed 100644 (file)
@@ -1,12 +1,10 @@
 define([
     'jquery',
     'lodash',
-    'js/util',
     'js/logger'
 ], function (
     $,
     _,
-    Util,
     Logger
 ) {
     'use strict';
index fc2edcf..00d698e 100644 (file)
@@ -41,16 +41,16 @@ define([
     var JOB_STATUS_DONE = 'DONE';
     var JOB_STATUS_FAILED = 'FAILED';
 
-    function gotoPageNum (pageNum) {
+    function gotoPageNum(pageNum) {
         logger.info('gotoPageNum : ' + pageNum);
         _update(pageNum);
     }
 
-    function _update (pageNum) {
+    function _update(pageNum) {
         ModelJobList = [];
         ModelJobPaging;
 
-        function _updateView (arrJobs) {
+        function _updateView(arrJobs) {
             return new Promise(function (resolve, reject) {
                 logger.info('_updateView');
                 var targetTableBody = $('#tic-job-table > tbody');
@@ -67,7 +67,7 @@ define([
             });
         }
 
-        function _updateDataModel (result) {
+        function _updateDataModel(result) {
             return new Promise(function (resolve, reject) {
                 logger.info('_updateDataModel');
 
@@ -81,7 +81,7 @@ define([
             });
         }
 
-        function _getAllListItem () {
+        function _getAllListItem() {
             var msgData = {
                 pageNum: pageNum
             };
@@ -89,7 +89,7 @@ define([
             return Util.POST(AppConfig.EVENT.JOB.JOB_GET_ALL_LISTITEM, msgData);
         }
 
-        function _updatePagingView (dataObj) {
+        function _updatePagingView(dataObj) {
             return new Promise(function (resolve, reject) {
                 logger.info('_updatePagingView');
 
@@ -170,7 +170,7 @@ define([
      *      pathOutput: '/var/tmp/tic-web/1/'
      * }
      */
-    function doCreateAnImage (paramObj) {
+    function doCreateAnImage(paramObj) {
         var msgData;
 
         logger.info('doCreateAnImage');
@@ -186,7 +186,7 @@ define([
         updateList(ModelJobPaging.getCurrentPoint());
     }
 
-    function _initSocket (socket) {
+    function _initSocket(socket) {
         // assign
         client = socket;
 
@@ -235,14 +235,14 @@ define([
             // button enabled
             $('#tic-package-create').prop('disabled', false);
 
-            function onError (err) {
+            function onError(err) {
                 if (err) {
                     logger.error(err);
                     throw err;
                 }
             }
 
-            function updateJobListView () {
+            function updateJobListView() {
                 // upate the list of jobs
                 updateList(ModelJobPaging.getCurrentPoint());
 
@@ -250,7 +250,7 @@ define([
                 Util.showInfoDialog('Image created successfully. The #ID is ' + jobId + '.');
             }
 
-            function updateJobInfo (data) {
+            function updateJobInfo(data) {
                 console.log(data);
                 // update the status and image_id
                 var msgObj = {
@@ -260,7 +260,7 @@ define([
                 return Util.POST(AppConfig.EVENT.JOB.JOB_EDIT_ONE + jobId, msgObj)
             }
 
-            function addAnImage () {
+            function addAnImage() {
                 /**
                  * FIXME
                  */
@@ -272,7 +272,7 @@ define([
                 return Util.POST(AppConfig.EVENT.IMAGE.IMAGE_ADD_ONE, msgObj)
             }
 
-            function getAnImageInfo () {
+            function getAnImageInfo() {
                 return new Promise(function (resolve, reject) {
                     /**
                      * TODO
@@ -328,7 +328,7 @@ define([
         });
     }
 
-    function init () {
+    function init() {
         logger.info('init');
 
         // set the config information for the app
index b02462a..4f3fe3c 100644 (file)
@@ -37,7 +37,7 @@ define([
     // AppConfig
     var AppConfig = null;
 
-    function onClickHandlerForImgCreationBtn () {
+    function onClickHandlerForImgCreationBtn() {
         logger.info('onClickHandlerForImgCreationBtn');
 
         var checkedPackagesList, checkedPackgaesCount, newJobModel;
@@ -54,14 +54,14 @@ define([
         // 'image creation' button is disabled
         $('#tic-package-create').prop('disabled', true);
 
-        function doConfirmCancel () {
+        function doConfirmCancel() {
             new Promise(function (resolve, reject) {
                 logger.info('onClickHandlerForImgCreationBtn.doConfirmCancel');
                 $('#tic-package-create').prop('disabled', false);
             });
         }
 
-        function doCreateAnImage () {
+        function doCreateAnImage() {
             logger.info('onClickHandlerForImgCreationBtn.doCreateAnImage');
 
             // scroll
@@ -89,7 +89,7 @@ define([
             return url ;
         }
 
-        function getRecipeFile () {
+        function getRecipeFile() {
             var msgData;
 
             logger.info('onClickHandlerForImgCreationBtn.getRecipeFile: job_path = ' + newJobModel.getJobPath());
@@ -103,14 +103,14 @@ define([
                 filename: AppConfig.TIC_WEB.KS_FILE_NAME
             };
 
-            function onErrorGetRecipeFile (err) {
+            function onErrorGetRecipeFile(err) {
                 logger.info('onClickHandlerForImgCreationBtn.onErrorGetRecipeFile');
                 logger.error(err);
                 $('#tic-package-create').prop('disabled', false);
                 throw err;
             }
 
-            function onSuccessGetRecipeFile (result) {
+            function onSuccessGetRecipeFile(result) {
                 var msgObj;
                 logger.info('onClickHandlerForImgCreationBtn.onSuccessGetRecipeFile: ' + result.data);
                 msgObj = {
@@ -125,7 +125,7 @@ define([
             .catch(onErrorGetRecipeFile);
         }
 
-        function setJobModel (jobItem) {
+        function setJobModel(jobItem) {
             new Promise(function (resolve, reject) {
                 var jobObj = jobItem[0];
                 newJobModel = new JobModel(jobObj);
@@ -137,13 +137,13 @@ define([
             });
         }
 
-        function getJobId (jobItem) {
+        function getJobId(jobItem) {
             logger.info('onClickHandlerForImgCreationBtn.getJobId');
             var jobId = jobItem.job_id;
             return Util.POST(AppConfig.EVENT.JOB.JOB_GET_BYID + jobId);
         }
 
-        function doConfirmOk () {
+        function doConfirmOk() {
             logger.info('onClickHandlerForImgCreationBtn.doConfirmOk');
             $('#tic-package-create').prop('disabled', true);
 
@@ -152,7 +152,7 @@ define([
         }
 
         // confirm dialog
-        function showConfirmDialog () {
+        function showConfirmDialog() {
             logger.info('onClickHandlerForImgCreationBtn.showConfirmDialog');
             return Util.showConfirmDialog('Are you sure want to create an image ?');
         }
@@ -483,7 +483,7 @@ define([
                             }
                         });
                     }
-                    if (ret.result === true){
+                    if (ret.result === true) {
                         return false;
                     }
                 });
index 7ddca4a..55d111e 100644 (file)
@@ -49,7 +49,7 @@ define([
 
     function bytesToSize(bytes) {
         var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
-        if (bytes == 0) {
+        if (bytes === 0) {
             return '0 Byte';
         }
         var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));