Commit 4e1e4ba0 authored by Sven Franck's avatar Sven Franck Committed by Sebastien Robin

Code cleanup

parent 3612323d
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
\n \n
breadcrumb_options.title = result.data.title ||\n breadcrumb_options.title = result.data.title ||\n
result.data.reference || options.jio_key;\n result.data.reference || options.jio_key;\n
breadcrumb_options.parent_link = result.data._links.parent;\n breadcrumb_options.parent_link = result.data._links.parent || result.data._links.site_root;\n
\n \n
uri = new URI(\n uri = new URI(\n
result.data._embedded._view._links.form_definition.href\n result.data._embedded._view._links.form_definition.href\n
...@@ -563,7 +563,7 @@ ...@@ -563,7 +563,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.54931.34982.25019</string> </value> <value> <string>936.56327.51436.15564</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -581,7 +581,7 @@ ...@@ -581,7 +581,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407849144.68</float> <float>1407932681.24</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -99,76 +99,74 @@ ...@@ -99,76 +99,74 @@
</item> </item>
<item> <item>
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string>/*global rJS, RSVP, jQuery, Handlebars,\n <value> <string>/*global rJS, RSVP, jQuery, Handlebars, promiseEventListener, console */\n
promiseEventListener, console */\n
/*global window, rJS, RSVP, StatelessJS, alert, FormData, document, console */\n
/*jslint maxlen:200, nomen: true */\n /*jslint maxlen:200, nomen: true */\n
(function (window, rJS, RSVP, $) {\n (function (window, rJS, RSVP, $) {\n
"use strict";\n "use strict";\n
\n \n
rJS(window)\n rJS(window)\n
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
// ready\n // ready\n
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
// Init local properties\n // Init local properties\n
.ready(function (g) {\n .ready(function (g) {\n
g.props = {};\n g.props = {};\n
})\n })\n
\n \n
// Assign the element to a variable\n // Assign the element to a variable\n
.ready(function (g) {\n .ready(function (g) {\n
return g.getElement()\n return g.getElement()\n
.push(function (element) {\n .push(function (element) {\n
g.props.element = element;\n g.props.element = element;\n
});\n });\n
})\n })\n
\n \n
.declareAcquiredMethod("pleasePublishMyState", "pleasePublishMyState")\n .declareAcquiredMethod("pleasePublishMyState", "pleasePublishMyState")\n
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n .declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
// declared methods\n // declared methods\n
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
.declareMethod(\'render\', function (options) {\n .declareMethod(\'render\', function (options) {\n
this.props.element.querySelector("input").value = options.extended_search || "";\n this.props.element.querySelector("input").value = options.extended_search || "";\n
})\n })\n
\n \n
.declareMethod(\'getContent\', function () {\n .declareMethod(\'getContent\', function () {\n
var input = this.__element.querySelector(\'input\'),\n var input = this.__element.querySelector(\'input\'),\n
result = {};\n result = {};\n
\n \n
result[input.getAttribute(\'name\')] = input.value;\n result[input.getAttribute(\'name\')] = input.value;\n
return result;\n return result;\n
})\n })\n
\n \n
.declareService(function () {\n .declareService(function () {\n
var search_form = this;\n var search_form = this;\n
\n \n
function formSubmit() {\n function formSubmit() {\n
var form_data;\n var form_data;\n
\n \n
return new RSVP.Queue()\n return new RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return search_form.getContent();\n return search_form.getContent();\n
})\n })\n
.push(function (data) {\n .push(function (data) {\n
return search_form.pleasePublishMyState({\n return search_form.pleasePublishMyState({\n
"extended_search": data.search\n "extended_search": data.search\n
});\n
})\n
.push(function (url) {\n
return search_form.pleaseRedirectMyHash(url);\n
});\n });\n
}\n })\n
\n .push(function (url) {\n
// Listen to form submit\n return search_form.pleaseRedirectMyHash(url);\n
return loopEventListener(\n });\n
search_form.props.element.querySelector(\'form\'),\n }\n
\'submit\',\n \n
false,\n // Listen to form submit\n
formSubmit\n return loopEventListener(\n
);\n search_form.props.element.querySelector(\'form\'),\n
});\n \'submit\',\n
\n false,\n
formSubmit\n
);\n
});\n
\n
}(window, rJS, RSVP, jQuery));</string> </value> }(window, rJS, RSVP, jQuery));</string> </value>
</item> </item>
<item> <item>
...@@ -304,7 +302,7 @@ ...@@ -304,7 +302,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.39090.50399.1467</string> </value> <value> <string>936.57651.42687.62225</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -322,7 +320,7 @@ ...@@ -322,7 +320,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407167613.11</float> <float>1408012236.29</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
promise_list = [],\n promise_list = [],\n
i;\n i;\n
\n \n
// no views\n // XXX return if no views - do this on the parent gadget\n
if (view_list === undefined) {\n if (view_list === undefined) {\n
return;\n return;\n
}\n }\n
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.54744.40513.43571</string> </value> <value> <string>936.54906.24658.1911</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -349,7 +349,7 @@ ...@@ -349,7 +349,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407838655.15</float> <float>1407848815.35</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -2371,7 +2371,7 @@ function loopEventListener(target, type, useCapture, callback) {\n ...@@ -2371,7 +2371,7 @@ function loopEventListener(target, type, useCapture, callback) {\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.35985.17906.36317</string> </value> <value> <string>936.57662.10223.7219</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -2389,7 +2389,7 @@ function loopEventListener(target, type, useCapture, callback) {\n ...@@ -2389,7 +2389,7 @@ function loopEventListener(target, type, useCapture, callback) {\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1406712314.74</float> <float>1408020541.67</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
54 55
\ No newline at end of file \ No newline at end of file
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