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

Code cleanup

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