Commit 88fee8ab authored by Łukasz Nowak's avatar Łukasz Nowak

Use query from url instead of magical internal value.

parent 4266fd44
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts21967421.72</string> </value>
<value> <string>ts21969328.27</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -106,19 +106,18 @@ function drawSoftwareReleaseList(data) {\n
\n
function updateSoftwareReleaseList(event) {\n
event.preventDefault();\n
q = $(\'#software_release_query\')[0][\'value\']\n
$.getJSON(\n
vifib[\'site_url\'] + "/ERP5Site_getSoftwareReleaseListAsJSON",\n
{"title":q},\n
drawSoftwareReleaseList);\n
query_kw = $.deparam.fragment();\n
query_kw[\'query\'] = $(\'#software_release_query\')[0][\'value\'];\n
window.location.hash = $.param(query_kw);\n
}\n
\n
function softwareReleaseController() {\n
function softwareReleaseController(query) {\n
js_container = $("#js_container");\n
js_container.empty();\n
var input = $(\'<input type="text">\');\n
input.attr(\'id\', "software_release_query");\n
input.addClass("software_release_input");\n
input.val(query);\n
$(\'form\').submit(updateSoftwareReleaseList);\n
js_container.append(input);\n
\n
......@@ -130,8 +129,10 @@ function softwareReleaseController() {\n
software_release_container.attr(\'id\', \'software_release_container\');\n
search.after(software_release_container);\n
search.click(updateSoftwareReleaseList);\n
$.getJSON(\n
vifib[\'site_url\'] + "/ERP5Site_getSoftwareReleaseListAsJSON",\n
if (query) { q = {\'title\': query}; }\n
else {q = {};}\n
console.log(q);\n
$.getJSON(vifib[\'site_url\'] + "/ERP5Site_getSoftwareReleaseListAsJSON", q,\n
drawSoftwareReleaseList);\n
}\n
\n
......@@ -232,12 +233,7 @@ function requestController(software_release_id) {\n
\n
function hashController ()\n
{\n
var hash = \'\';\n
if (window.location.hash.length)\n
{\n
hash = window.location.hash.split(\'#\')[1];\n
}\n
query_kw = $.deparam(hash);\n
query_kw = $.deparam.fragment();\n
software_release = query_kw[\'software_release\'];\n
query = query_kw[\'query\'];\n
if (software_release) { requestController(software_release);}\n
......@@ -253,7 +249,7 @@ function hashController ()\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>6896</int> </value>
<value> <int>6869</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
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