← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8612: mobile: minor cleanups

 

------------------------------------------------------------
revno: 8612
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-10-21 17:54:35 +0200
message:
  mobile: minor cleanups
modified:
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/dhis-web-mobile-resources/manifest.appcache


--
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-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm	2012-10-21 15:12:36 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm	2012-10-21 15:54:35 +0000
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
-<!--  <html manifest="../dhis-web-mobile-resources/manifest.appcache"> -->
-<html>
+<html manifest="../dhis-web-mobile-resources/manifest.appcache">
+<!--  <html> -->
 <head>
 	<title>DHIS2</title>
 	<meta name="viewport" content="width=device-width, initial-scale=1">

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm	2012-10-21 15:12:36 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm	2012-10-21 15:54:35 +0000
@@ -29,73 +29,74 @@
         $.mobile.showPageLoadingMsg();
 
         var organisationUnits = fm.organisationUnits();
-
-        var tmpl = jQuery('#organisation-units-template').html();
-
-        jQuery('#organisation-units-page section[data-role="content"]').html(
+        var tmpl = $( '#organisation-units-template' ).html();
+
+        $('#organisation-units-page section[data-role="content"]').html(
             _.template( tmpl, { 'organisationUnits': organisationUnits } )
         );
 
-        jQuery('#organisation-unit-list').listview()
-        jQuery('#organisation-unit-list li a').bind('click', selectOrganisationUnit);
+        $('#organisation-unit-list').listview();
+        $('#organisation-unit-list li a').bind('click', selectOrganisationUnit);
 
         $.mobile.hidePageLoadingMsg();
     }
 
     function loadDataSetsPage() {
-        if(Selected.orgUnit === undefined)
+        if( Selected.orgUnit === undefined )
         {
-            $.mobile.changePage('#organisation-units-page');
+            $.mobile.changePage( '#organisation-units-page' );
             return;
         }
 
         $.mobile.showPageLoadingMsg();
 
-        var organisationUnit = fm.organisationUnit(Selected.orgUnit);
-
-        var tmpl = jQuery('#data-sets-template').html();
-
-        jQuery('#data-sets-page section[data-role="content"]').html(
+        var organisationUnit = fm.organisationUnit( Selected.orgUnit );
+        var tmpl = $( '#data-sets-template' ).html();
+
+        $('#data-sets-page section[data-role="content"]').html(
             _.template( tmpl, { 'dataSets': organisationUnit.dataSets } )
         );
 
-        jQuery('#data-set-list').listview();
-        jQuery('#data-set-list li a').bind('click', selectDataSet);
+        $('#data-set-list').listview();
+        $('#data-set-list li a').bind( 'click', selectDataSet );
+
         $.mobile.hidePageLoadingMsg();
     }
 
     function refreshPeriods() {
-        var tmpl = jQuery('#period-template').html();
-
-        var periods = periodTypeFactory.get(periodType).generatePeriods(periodOffset);
-        periods = periodTypeFactory.filterFuturePeriodsExceptCurrent(periods)
-        periods = periodTypeFactory.reverse(periods);
-        jQuery('#period-page section[data-role="content"]').html(
+        var tmpl = $('#period-template').html();
+
+        var periods = periodTypeFactory.get( periodType ).generatePeriods( periodOffset );
+        periods = periodTypeFactory.filterFuturePeriodsExceptCurrent( periods );
+        periods = periodTypeFactory.reverse( periods );
+
+        $('#period-page section[data-role="content"]').html(
                 _.template(tmpl, { 'periods' : periods })
         );
-        jQuery('#period-page').trigger('pagecreate')
-        jQuery('#period-list').listview('refresh');
-
-        jQuery('#previous_year').bind('click', function() {
+
+        $('#period-page').trigger( 'pagecreate' );
+        $('#period-list').listview( 'refresh' );
+
+        $('#previous_year').bind( 'click', function() {
             periodOffset--;
             refreshPeriods();
         });
 
-        jQuery('#next_year').bind('click', function() {
+        $('#next_year').bind( 'click', function() {
             periodOffset++;
             refreshPeriods();
         });
 
-        jQuery('#period-list li a').bind('click', selectPeriod);
+        $('#period-list li a').bind( 'click', selectPeriod );
     }
 
     function loadPeriodPage() {
-        if(Selected.dataSet === undefined)
+        if( Selected.dataSet === undefined )
         {
-            if(Selected.orgUnit === undefined) {
-                $.mobile.changePage('#organisation-units-page');
+            if( Selected.orgUnit === undefined ) {
+                $.mobile.changePage( '#organisation-units-page' );
             } else {
-                $.mobile.changePage('#data-sets-page');
+                $.mobile.changePage( '#data-sets-page' );
             }
 
             return;
@@ -103,7 +104,7 @@
 
         $.mobile.showPageLoadingMsg();
 
-        var form = fm.form(Selected.dataSet);
+        var form = fm.form( Selected.dataSet );
         periodType = form.periodType;
         refreshPeriods();
 
@@ -111,36 +112,36 @@
     }
 
     function loadDataEntryPage() {
-        if(Selected.period === undefined && Selected.dataSet === undefined && Selected.orgUnit === undefined )
-        {
-            $.mobile.changePage('#organisation-units-page');
-            return;
-        }
-
-        if(Selected.period === undefined && Selected.dataSet === undefined && Selected.orgUnit !== undefined )
-        {
-            $.mobile.changePage('#data-sets-page');
-            return;
-        }
-
-        if(Selected.period === undefined && Selected.dataSet !== undefined && Selected.orgUnit !== undefined )
-        {
-            $.mobile.changePage('#periods-page');
+        if( Selected.period === undefined && Selected.dataSet === undefined && Selected.orgUnit === undefined )
+        {
+            $.mobile.changePage( '#organisation-units-page' );
+            return;
+        }
+
+        if( Selected.period === undefined && Selected.dataSet === undefined && Selected.orgUnit !== undefined )
+        {
+            $.mobile.changePage( '#data-sets-page' );
+            return;
+        }
+
+        if( Selected.period === undefined && Selected.dataSet !== undefined && Selected.orgUnit !== undefined )
+        {
+            $.mobile.changePage( '#periods-page' );
             return;
         }
 
         $.mobile.showPageLoadingMsg();
 
         function renderFormTemplate(form) {
-            var tmpl = jQuery('#data-entry-template').html();
+            var tmpl = $( '#data-entry-template' ).html();
 
-            jQuery('#data-entry-page section[data-role="content"]').html(
+            $( '#data-entry-page section[data-role="content"]' ).html(
                 _.template( tmpl, form )
             );
 
-            jQuery('#data-entry-page').trigger('pagecreate')
-            jQuery('#data-entry-list').listview('refresh');
-            jQuery('#send_button').bind('click', saveValues);
+            $( '#data-entry-page' ).trigger( 'pagecreate' );
+            $( '#data-entry-list' ).listview( 'refresh' );
+            $( '#send_button' ).bind( 'click', saveValues );
         }
 
         $.ajax({
@@ -193,7 +194,7 @@
         });
     }
 
-    jQuery(document).bind('pagechange', function (event, data) {
+    $(document).bind( 'pagechange', function (event, data) {
         var pageId = data.toPage.attr('id');
 
         if( pageId == 'organisation-units-page' ) {

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm	2012-10-19 22:31:07 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm	2012-10-21 15:54:35 +0000
@@ -22,7 +22,7 @@
                 $('#messages a').append("<span class='ui-li-count'>" + data.unreadMessageConversation + "</span>");
             }
         }).error(function() {
-            $('#messages a').append("<span class='ui-li-count'>Offline</span>")
+            $('#messages a').append("<span class='ui-li-count'>Offline</span>");
             $.mobile.hidePageLoadingMsg();
         });
     }

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/dhis-web-mobile-resources/manifest.appcache'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/dhis-web-mobile-resources/manifest.appcache	2012-10-21 14:38:57 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/dhis-web-mobile-resources/manifest.appcache	2012-10-21 15:54:35 +0000
@@ -1,5 +1,5 @@
 CACHE MANIFEST
-# Version: 4
+# Version: 6
 
 CACHE:
 ../mobile/index