details:   https://code.openbravo.com/erp/devel/pi/rev/42dbbe2c9bec
changeset: 15646:42dbbe2c9bec
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Wed Feb 29 12:05:16 2012 +0100
summary:   Related to issue 19728: Do more JS code formatting

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js
                |   19 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
 |   43 ++--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-attachments.js
    |  101 +++++----
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js
   |   54 ++--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-navbar-test.js
              |   39 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-ui-test.js
                  |   18 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
               |   18 +-
 7 files changed, 150 insertions(+), 142 deletions(-)

diffs (truncated from 395 to 300 lines):

diff -r 7f69d5ac8a7e -r 42dbbe2c9bec 
modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js
     Wed Feb 29 11:46:53 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js
     Wed Feb 29 12:05:16 2012 +0100
@@ -54,17 +54,18 @@
   actionHandler: null,
 
   initWidget: function () {
-    var me = this;
+    var me = this,
+        callBack;
 
     // the data request calls this method, which sets the data in the grid
-    var callBack = function (response, data, request) {
-        me.dataSource = isc.DataSource.create({
-          clientOnly: true,
-          fields: me.fields,
-          testData: data.list
-        });
-        me.filterData();
-        };
+    callBack = function (response, data, request) {
+      me.dataSource = isc.DataSource.create({
+        clientOnly: true,
+        fields: me.fields,
+        testData: data.list
+      });
+      me.filterData();
+    };
 
     // request the data, note the _command value
     OB.RemoteCallManager.call(this.actionHandler, {}, {
diff -r 7f69d5ac8a7e -r 42dbbe2c9bec 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
      Wed Feb 29 11:46:53 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
      Wed Feb 29 12:05:16 2012 +0100
@@ -52,28 +52,29 @@
     // * {{{recordId}}} the record to show
     //
     openLinkedItem: function (tabId, recordId) {
-      var doOpenClassicWindow = function (response, data, request) {
+      var doOpenClassicWindow;
+      doOpenClassicWindow = function (response, data, request) {
 
-          if (!data.recordId || data.recordId.length === 0) {
-            L.ViewManager.openView('OBClassicWindow', {
-              tabTitle: data.tabTitle,
-              windowId: data.windowId,
-              tabId: data.tabId,
-              mappingName: data.mappingName,
-              command: 'DEFAULT'
-            });
-          } else {
-            L.ViewManager.openView('OBClassicWindow', {
-              tabTitle: data.tabTitle,
-              windowId: data.windowId,
-              tabId: data.tabId,
-              mappingName: data.mappingName,
-              keyParameter: data.keyParameter,
-              recordId: data.recordId,
-              command: 'DIRECT'
-            });
-          }
-          };
+        if (!data.recordId || data.recordId.length === 0) {
+          L.ViewManager.openView('OBClassicWindow', {
+            tabTitle: data.tabTitle,
+            windowId: data.windowId,
+            tabId: data.tabId,
+            mappingName: data.mappingName,
+            command: 'DEFAULT'
+          });
+        } else {
+          L.ViewManager.openView('OBClassicWindow', {
+            tabTitle: data.tabTitle,
+            windowId: data.windowId,
+            tabId: data.tabId,
+            mappingName: data.mappingName,
+            keyParameter: data.keyParameter,
+            recordId: data.recordId,
+            command: 'DIRECT'
+          });
+        }
+      };
 
       
OB.RemoteCallManager.call('org.openbravo.client.application.ComputeWindowActionHandler',
 {}, {
         'tabId': tabId,
diff -r 7f69d5ac8a7e -r 42dbbe2c9bec 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-attachments.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-attachments.js
 Wed Feb 29 11:46:53 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-attachments.js
 Wed Feb 29 12:05:16 2012 +0100
@@ -272,30 +272,31 @@
           theForm: form,
           canvas: me,
           click: function () {
-            var fileName, form = this.theForm;
-            var addFunction = function (clickedOK) {
-                if (clickedOK) {
-                  var hTempLayout = isc.HLayout.create();
-                  form.theCanvas.addMember(hTempLayout, 
form.theCanvas.getMembers().size());
-                  var uploadingFile = isc.Label.create({
-                    contents: fileName
-                  });
-                  var uploading = isc.Label.create({
-                    className: 'OBLinkButtonItemFocused',
-                    contents: '    ' + 
OB.I18N.getLabel('OBUIAPP_AttachmentUploading')
-                  });
-                  hTempLayout.addMember(uploadingFile);
-                  hTempLayout.addMember(uploading);
-                  var button = 
form.theCanvas.getForm().view.toolBar.getLeftMember(isc.OBToolbar.TYPE_ATTACHMENTS);
-                  if (!button) {
-                    button = 
form.theCanvas.getForm().view.toolBar.getLeftMember("attachExists");
-                  }
-                  button.customState = 'Progress';
-                  button.resetBaseStyle();
-                  form.submitForm();
-                  form.popup.hide();
+            var fileName, form = this.theForm,
+                addFunction;
+            addFunction = function (clickedOK) {
+              if (clickedOK) {
+                var hTempLayout = isc.HLayout.create();
+                form.theCanvas.addMember(hTempLayout, 
form.theCanvas.getMembers().size());
+                var uploadingFile = isc.Label.create({
+                  contents: fileName
+                });
+                var uploading = isc.Label.create({
+                  className: 'OBLinkButtonItemFocused',
+                  contents: '    ' + 
OB.I18N.getLabel('OBUIAPP_AttachmentUploading')
+                });
+                hTempLayout.addMember(uploadingFile);
+                hTempLayout.addMember(uploading);
+                var button = 
form.theCanvas.getForm().view.toolBar.getLeftMember(isc.OBToolbar.TYPE_ATTACHMENTS);
+                if (!button) {
+                  button = 
form.theCanvas.getForm().view.toolBar.getLeftMember("attachExists");
                 }
-                };
+                button.customState = 'Progress';
+                button.resetBaseStyle();
+                form.submitForm();
+                form.popup.hide();
+              }
+            };
             var value = this.theForm.getItem('inpname').getElement().value;
             if (!value) {
               isc.say(OB.I18N.getLabel('OBUIAPP_AttachmentsSpecifyFile'));
@@ -382,34 +383,36 @@
     hLayout.addMember(downloadAllButton);
     hLayout.addMember(removeAllButton);
 
-    var downloadActions = function () {
-        var d = {
-          Command: 'DISPLAY_DATA',
-          inpcFileId: this.attachId
-        };
-        
OB.Utilities.postThroughHiddenForm('./businessUtility/TabAttachments_FS.html', 
d);
-        };
+    var downloadActions;
+    downloadActions = function () {
+      var d = {
+        Command: 'DISPLAY_DATA',
+        inpcFileId: this.attachId
+      };
+      
OB.Utilities.postThroughHiddenForm('./businessUtility/TabAttachments_FS.html', 
d);
+    };
 
-    var removeActions = function () {
-        var i, length, d = {
-          Command: 'DELETE',
-          tabId: this.canvas.tabId,
-          buttonId: this.canvas.ID,
-          recordIds: this.canvas.recordId,
-          attachId: this.attachmentId
-        },
-            canvas = this.canvas;
+    var removeActions;
+    removeActions = function () {
+      var i, length, d = {
+        Command: 'DELETE',
+        tabId: this.canvas.tabId,
+        buttonId: this.canvas.ID,
+        recordIds: this.canvas.recordId,
+        attachId: this.attachmentId
+      },
+          canvas = this.canvas;
 
-        isc.confirm(OB.I18N.getLabel('OBUIAPP_ConfirmRemove'), function 
(clickedOK) {
-          if (clickedOK) {
-            
OB.RemoteCallManager.call('org.openbravo.client.application.window.AttachmentsAH',
 {}, d, function (response, data, request) {
-              canvas.fillAttachments(data.attachments);
-            });
-          }
-        }, {
-          title: OB.I18N.getLabel('OBUIAPP_DialogTitle_RemoveAttachment')
-        });
-        };
+      isc.confirm(OB.I18N.getLabel('OBUIAPP_ConfirmRemove'), function 
(clickedOK) {
+        if (clickedOK) {
+          
OB.RemoteCallManager.call('org.openbravo.client.application.window.AttachmentsAH',
 {}, d, function (response, data, request) {
+            canvas.fillAttachments(data.attachments);
+          });
+        }
+      }, {
+        title: OB.I18N.getLabel('OBUIAPP_DialogTitle_RemoveAttachment')
+      });
+    };
 
     length = attachments.length;
     for (i = 0; i < attachments.length; i++) {
diff -r 7f69d5ac8a7e -r 42dbbe2c9bec 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js
        Wed Feb 29 11:46:53 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js
        Wed Feb 29 12:05:16 2012 +0100
@@ -135,21 +135,22 @@
 
     var that = this;
 
-    var callback = function (response, data, request) {
-        var msg = data.msg;
-        var usedByLinkData = data.usedByLinkData;
-        if (msg !== null) {
-          that.messageLabel.setContents(msg);
-        }
+    var callback;
+    callback = function (response, data, request) {
+      var msg = data.msg;
+      var usedByLinkData = data.usedByLinkData;
+      if (msg !== null) {
+        that.messageLabel.setContents(msg);
+      }
 
-        if (usedByLinkData === null) {
-          usedByLinkData = [];
-        }
+      if (usedByLinkData === null) {
+        usedByLinkData = [];
+      }
 
-        that.linkedItemCategoryDS.setCacheData(usedByLinkData, true);
-        that.linkedItemCategoryListGrid.invalidateCache();
-        that.linkedItemCategoryListGrid.filterData();
-        };
+      that.linkedItemCategoryDS.setCacheData(usedByLinkData, true);
+      that.linkedItemCategoryListGrid.invalidateCache();
+      that.linkedItemCategoryListGrid.filterData();
+    };
 
     var reqObj = {
       params: {
@@ -179,20 +180,21 @@
     var selCatItems = this.linkedItemCategoryListGrid.getSelectedRecord();
 
     var that = this; /* loads linked items to the child grid */
-    var callback = function (response, data, request) {
-        var msg = data.msg;
-        var usedByLinkData = data.usedByLinkData;
-        if (msg !== null) {
-          that.messageLabel.setContents(msg);
-        }
+    var callback;
+    callback = function (response, data, request) {
+      var msg = data.msg;
+      var usedByLinkData = data.usedByLinkData;
+      if (msg !== null) {
+        that.messageLabel.setContents(msg);
+      }
 
-        if (usedByLinkData === null) {
-          usedByLinkData = [];
-        }
-        that.linkedItemListGrid.invalidateCache();
-        that.linkedItemDS.setCacheData(usedByLinkData, true);
-        that.linkedItemListGrid.filterData();
-        };
+      if (usedByLinkData === null) {
+        usedByLinkData = [];
+      }
+      that.linkedItemListGrid.invalidateCache();
+      that.linkedItemDS.setCacheData(usedByLinkData, true);
+      that.linkedItemListGrid.filterData();
+    };
 
     if (!selCatItems) {
       this.linkedItemCategoryListGrid.filterEditorSubmit();
diff -r 7f69d5ac8a7e -r 42dbbe2c9bec 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-navbar-test.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-navbar-test.js
   Wed Feb 29 11:46:53 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-navbar-test.js
   Wed Feb 29 12:05:16 2012 +0100
@@ -28,28 +28,29 @@
 
   expect(16);
 
-  var callback = function (rpcResponse, data, rpcRequest) {
-      ok(data.language, 'Language present');
-      ok(data.language.value, 'Language value present');
-      ok(data.language.valueMap, 'Language valueMap present');
-      ok(data.language.value, 'Language value present');
+  var callback;
+  callback = function (rpcResponse, data, rpcRequest) {
+    ok(data.language, 'Language present');
+    ok(data.language.value, 'Language value present');
+    ok(data.language.valueMap, 'Language valueMap present');
+    ok(data.language.value, 'Language value present');
 
-      ok(data.initialValues.role, 'Initial role value set');

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to