incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1233510 - in /incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile: app.js generic.js
Date Thu, 19 Jan 2012 18:21:45 GMT
Author: danhaywood
Date: Thu Jan 19 18:21:44 2012
New Revision: 1233510

URL: http://svn.apache.org/viewvc?rev=1233510&view=rev
Log:
ISIS-170: think I have the page management working

Modified:
    incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/app.js
    incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/generic.js

Modified: incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/app.js
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/app.js?rev=1233510&r1=1233509&r2=1233510&view=diff
==============================================================================
--- incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/app.js (original)
+++ incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/app.js Thu Jan
19 18:21:44 2012
@@ -2,10 +2,6 @@ var util    = namespace('org.apache.isis
 var generic = namespace('org.apache.isis.viewer.json.jqmobile.generic');
 
 $(function() {
-  $(document).bind("mobileinit", function() {
-    $.mobile.ajaxEnabled = false;
-  });
-
   $("#settings-theme input").click(function(e) {
     
     var theme = e.currentTarget.value;
@@ -19,7 +15,7 @@ $(function() {
 
   // if user manually refreshes page for domain object, then re-retrieve
   var locationHref = location.href;
-  if(locationHref.indexOf("genericDomainObjectView") != -1) {
+  if(locationHref.indexOf("View") != -1) {
     var urlHref = generic.extract(locationHref);
     generic.submitAndRender(urlHref, "pop");
   } else {

Modified: incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/generic.js
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/generic.js?rev=1233510&r1=1233509&r2=1233510&view=diff
==============================================================================
--- incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/generic.js (original)
+++ incubator/isis/trunk/examples/onlinedemo/webapp/src/main/webapp/mobile/generic.js Thu
Jan 19 18:21:44 2012
@@ -2,7 +2,6 @@ var util = namespace('org.apache.isis.vi
 var generic = namespace('org.apache.isis.viewer.json.jqmobile.generic');
 
 generic.cloneTemplatePage = function(pageBaseId, urlHref, dataOptions) {
-
   var urlHrefEncoded = util.urlencode(urlHref);
 
   var pageId = pageBaseId + "-" + urlHrefEncoded;
@@ -26,12 +25,17 @@ generic.itemLinks = function(jsonItems) 
 }
 
 generic.extract = function(urlHref) {
-  var regex = /.*?url=(.*)/
-  var matches = regex.exec(urlHref)
+  // does it match: foobar.html?url=xxx; if so, then return xxx
+  var matches = /.*?url=(.*)/.exec(urlHref)
   var url = matches && matches[1]
   if(url) {
     return util.urldecode(url)
   }
+  // does it simply match foobar.html; if so, then return null
+  if ( /.*\.html$/.test(urlHref)) {
+    return null
+  }
+  // simply return the URL, assuming it is the data url we need to get.
   return urlHref
 }
 
@@ -103,10 +107,6 @@ generic.handleListRepresentation = funct
   
   util.applyTemplateDiv(items, div, templateDiv);
   
-  // no longer needed?
-  //page.page();
-  //div.listview("refresh");
-  
   return page;
 }
 
@@ -179,11 +179,12 @@ generic.submitRenderAndNavigate = functi
   }
 
   var url = $.mobile.path.parseUrl(data.toPage)
-  if(url.href.search(/^.+\.html.*$/) !== -1) {
+  var urlHref = generic.extract(url.href)
+  if(!urlHref) {
     return;
   }
 
-  generic.submitAndRender(url.href, data.options);
+  generic.submitAndRender(urlHref, data.options);
   e.preventDefault();
 }
 



Mime
View raw message