Commit ba03ea2c authored by Vivek's avatar Vivek Committed by Kazuhiko Shiozaki

erp5_gadget_interface_validator: (fixup) used simpler router logic.

parent acb5ca18
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
<script id="panel-template-body" type="text/x-handlebars-template">\n <script id="panel-template-body" type="text/x-handlebars-template">\n
<div class="ui-content">\n <div class="ui-content">\n
<ul data-role="listview" class="ui-listview">\n <ul data-role="listview" class="ui-listview">\n
<li><a href="#/?page=form" data-i18n="Interface Validation Form">Interface Validation Form</a></li>\n <li><a href="#page=form" data-i18n="Interface Validation Form">Interface Validation Form</a></li>\n
</ul>\n </ul>\n
</div>\n </div>\n
</script>\n </script>\n
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>946.44825.62507.52206</string> </value> <value> <string>946.54879.52570.13994</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1446476148.07</float> <float>1446805712.99</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -111,23 +111,15 @@ ...@@ -111,23 +111,15 @@
REDIRECT_TIMEOUT = 5000;\n REDIRECT_TIMEOUT = 5000;\n
\n \n
function listenHashChange(gadget) {\n function listenHashChange(gadget) {\n
// Handle hash in this format: #$path1/path2?a=b&c=d\n
function extractHashAndDispatch(evt) {\n function extractHashAndDispatch(evt) {\n
var hash = (evt.newURL || window.location.toString()).split(\'#\')[1],\n var hash = (evt.newURL || window.location.toString()).split(\'#\')[1],\n
split,\n
command = "",\n
query = "",\n
subhashes,\n subhashes,\n
subhash,\n subhash,\n
keyvalue,\n keyvalue,\n
index,\n index,\n
args = {};\n args = {};\n
if (hash !== undefined) {\n if (hash !== undefined) {\n
split = hash.split(\'?\');\n subhashes = hash.split(\'&\');\n
command = split[0] || "";\n
query = split[1] || "";\n
}\n
subhashes = query.split(\'&\');\n
for (index in subhashes) {\n for (index in subhashes) {\n
if (subhashes.hasOwnProperty(index)) {\n if (subhashes.hasOwnProperty(index)) {\n
subhash = subhashes[index];\n subhash = subhashes[index];\n
...@@ -139,10 +131,9 @@ ...@@ -139,10 +131,9 @@
}\n }\n
}\n }\n
}\n }\n
}\n
\n \n
return gadget.renderApplication({\n return gadget.renderApplication({\n
method: command[0],\n
path: command.substr(1),\n
args: args\n args: args\n
});\n });\n
\n \n
...@@ -165,7 +156,7 @@ ...@@ -165,7 +156,7 @@
})\n })\n
\n \n
.declareMethod("getCommandUrlFor", function(options) {\n .declareMethod("getCommandUrlFor", function(options) {\n
var prefix = \'?\',\n var prefix = \'\',\n
result,\n result,\n
key;\n key;\n
result = "#";\n result = "#";\n
...@@ -354,7 +345,7 @@ ...@@ -354,7 +345,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>946.54883.25521.16366</string> </value> <value> <string>946.58912.52724.48776</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -372,7 +363,7 @@ ...@@ -372,7 +363,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1446718128.25</float> <float>1446805302.57</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment