← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4370: minor javascript fixes

 

------------------------------------------------------------
revno: 4370
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-08-19 11:04:34 +0200
message:
  minor javascript fixes
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.ajax.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/request.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.ajax.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.ajax.js	2011-08-18 12:01:44 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.ajax.js	2011-08-19 09:04:34 +0000
@@ -16,14 +16,8 @@
 
     var categoryOptionComboList = new Array();
 
-    var operandsByDataElementGroup = new Array();
-
     var params = {};
 
-    var jQuerySelectionString;
-
-    var url;
-
     this.loadDataElementGroups = function( jQuerySelectionString )
     {
         var target = jQuery( jQuerySelectionString );

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.js	2011-07-07 11:08:34 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisAjaxSelect.js	2011-08-19 09:04:34 +0000
@@ -98,14 +98,14 @@
 {
     var target_value = $target.data(key);
 
-    if(! $.isArray(target_value) ) {
+    if(! $.isArray(target_value) ) {
         var type = typeof(target_value);
 
         if(type === "number") {
             target_value = [ target_value.toString() ];
         } else {
             target_value = target_value.split(",");
-        }
+        };
     }
 
     if (target_value) {
@@ -130,7 +130,7 @@
         } else {
             dhis2.select.move(jqSelectedList, jqAvailableList.find(":selected"));
         }
-    }
+    };
 }
 
 function dhisAjaxSelect_selectedList_dblclick(sourceId, targetId)
@@ -148,7 +148,7 @@
         }
 
         dhis2.select.moveSorted(jqAvailableList, $children);
-    }
+    };
 }
 
 // -----------------------------------------------
@@ -164,7 +164,7 @@
         option_selected : "<option selected='selected'>${text}</option>",
         filter_input : "<input id='${id}' placeholder='Filter' type='text' style='width: 100%; height: 18px; border: 1px inset gray;' />",
         filter_select : "<select id='${id}' style='width: 100%; margin-bottom: 4px; margin-top: 0;'></select>"
-    }
+    };
 
     var methods = {
         load : function(select_id)
@@ -211,7 +211,7 @@
                 sortSelected: true
             };
 
-            var params = {}
+            var params = {};
 
             $.extend(settings, options);
             $.extend(params, options.params);
@@ -267,8 +267,6 @@
                     key = !!key ? key : "";
                     value = !!value ? value : "";
 
-                    var settings = $("#" + event.data.id).data("settings");
-
                     if(key.length === 0) {
                         $filter_input.removeAttr('disabled');
                     } else {
@@ -289,14 +287,14 @@
 
             var $filter_tr = $("<tr/>");
 
-            var $filter_td1 = $("<td/>")
-            var $filter_td2 = $("<td/>")
+            var $filter_td1 = $("<td/>");
+            var $filter_td2 = $("<td/>");
 
             $filter_td2.css("width", "158px");
 
             $filter_td1.append($.tmpl(templates.filter_input, {
                 "id" : filter_input_id
-            }))
+            }));
 
             $filter_td2.append($.tmpl(templates.button, {
                 "id" : filter_button_id,
@@ -352,7 +350,7 @@
                         dhisAjaxSelect_selectedList_dblclick(settings.connectedTo, $select.attr('id')));
             }
         }
-    }
+    };
 
     $.fn.dhisAjaxSelect = function(method)
     {

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js	2011-05-28 21:04:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js	2011-08-19 09:04:34 +0000
@@ -91,7 +91,7 @@
         }
 
         jqAvailableList.dhisPaging("load", sourceId);
-    }
+    };
 }
 
 /*
@@ -129,7 +129,7 @@
         }
 
         jqAvailableList.dhisPaging("load", targetId);
-    }
+    };
 }
 
 // -----------------------------------------------
@@ -147,7 +147,7 @@
         filter_input : "<input id='${id}' placeholder='Filter' type='text' style='width: 100%; height: 18px; border: 1px inset gray;' />",
         filter_select : "<select id='${id}' style='width: 100%; margin-bottom: 4px; margin-top: 0;'></select>",
         select_page : "Page <select id='${id}' style='width: 50px;'></select>"
-    }
+    };
 
     var methods = {
         load : function(select_id)
@@ -309,13 +309,14 @@
 
             var $filter_tr = $("<tr/>");
 
-            var $filter_td1 = $("<td/>")
-            var $filter_td2 = $("<td/>")
+            var $filter_td1 = $("<td/>");
+            var $filter_td2 = $("<td/>");
             $filter_td2.css("width", "70px");
 
             $filter_td1.append($.tmpl(templates.filter_input, {
                 "id" : filter_input_id
-            }))
+            }));
+
             $filter_td2.append($.tmpl(templates.button, {
                 "id" : filter_button_id,
                 "text" : "filter"
@@ -410,7 +411,7 @@
                 }
             });
         }
-    }
+    };
 
     $.fn.dhisPaging = function(method)
     {

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js	2011-03-31 14:09:51 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js	2011-08-19 09:04:34 +0000
@@ -159,7 +159,7 @@
         setMainPageFullscreen( '20px' );
         document.getElementById( 'leftBar' ).style.display = 'none';
         document.getElementById( 'showLeftBar' ).style.display = 'block';
-    } 
+    };
 
 	function setMainPageFullscreen()
 	{
@@ -181,5 +181,5 @@
     this.openHelpForm = function( id )
     {
 		window.open ("../dhis-web-commons/help/viewDynamicHelp.action?id=" + id,"Help", 'width=800,height=600,scrollbars=yes');
-    }
+    };
 }

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/request.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/request.js	2009-04-17 23:13:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/request.js	2011-08-19 09:04:34 +0000
@@ -20,13 +20,13 @@
 
 function Request()
 {
-    var request;
+    var request = undefined;
     var responseType = 'TEXT';
     var requestMethod = 'GET';
     var requestParameters = null;
-    var rootElementName;
-    var callbackSuccess;
-    var callbackError;
+    var rootElementName = undefined;
+    var callbackSuccess = undefined;
+    var callbackError = undefined;
 
     this.setResponseTypeXML = function( rootElementName_ )
     {