Commit 7f43f0c6 authored by Łukasz Nowak's avatar Łukasz Nowak

Checkpoint: prepare all data for request.

parent b01444f6
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>result = []\n
for computer in context.getPortalObject().portal_catalog(portal_type=\'Computer\', validation_state=\'validated\'):\n
result.append({\'id\': computer.getReference(), \'title\': computer.getTitle()})\n
return context.asJSON(result)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getComputerListAsJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts21370506.58</string> </value> <value> <string>ts21374348.43</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -113,11 +113,19 @@ function softwareProductController () {\n ...@@ -113,11 +113,19 @@ function softwareProductController () {\n
\n \n
}\n }\n
\n \n
function processRequest() {\n
computer = $(\'#computer\').val();\n
url = $(\'#url\').val();\n
title = $(\'#software_instance_title\').val();\n
xml = $(\'#software_instance_xml\').val();\n
alert(computer + url + title + xml);\n
}\n
\n
function drawRequest(data) {\n function drawRequest(data) {\n
js_container = $("#js_container");\n js_container = $("#js_container");\n
js_container.empty();\n js_container.empty();\n
url_a = $(\'<input type="hidden">\');\n url_a = $(\'<input type="hidden">\');\n
url_a.attr({\'value\': data.url, \'name\': \'url\'});\n url_a.attr({\'value\': data.url, \'name\': \'url\', \'id\': \'url\'});\n
js_container.append(url_a);\n js_container.append(url_a);\n
title_q = $(\'<div>\');\n title_q = $(\'<div>\');\n
title_q.html(\'Software Instance Title:\');\n title_q.html(\'Software Instance Title:\');\n
...@@ -136,9 +144,28 @@ function drawRequest(data) {\n ...@@ -136,9 +144,28 @@ function drawRequest(data) {\n
computer_q = $(\'<div>\');\n computer_q = $(\'<div>\');\n
computer_q.html(\'Computer:\');\n computer_q.html(\'Computer:\');\n
js_container.append(computer_q);\n js_container.append(computer_q);\n
computer_a = $(\'<select>\');\n
computer_a.attr({\'name\': \'computer\', \'id\': \'computer\'});\n
js_container.append(computer_a)\n
$.getJSON(vifib[\'site_url\'] + "/ERP5Site_getComputerListAsJSON", function(data) {\n
option = $(\'<option>\');\n
option.attr(\'value\', \'\');\n
option.appendTo(computer_a);\n
$.each(data, function(i, item){\n
computer_a = $(\'#computer\');\n
option = $(\'<option>\');\n
option.attr(\'value\', item.id);\n
option.html(item.title + \' (\' + item.id +\')\');\n
option.appendTo(computer_a);\n
});\n
});\n
summary = $(\'<div>\');\n summary = $(\'<div>\');\n
summary.html(\'Software Release: \' + data.title + \' (\' + data.version + \'), url: \' + data.url);\n summary.html(\'Software Release: \' + data.title + \' (\' + data.version + \'), url: \' + data.url);\n
js_container.append(summary);\n js_container.append(summary);\n
request = $(\'<input type="button">\');\n
request.attr(\'value\', \'Request\');\n
request.click(processRequest);\n
js_container.append(request);\n
}\n }\n
\n \n
function requestController() {\n function requestController() {\n
...@@ -177,6 +204,8 @@ function hashController ()\n ...@@ -177,6 +204,8 @@ function hashController ()\n
{\n {\n
hash = window.location.hash;\n hash = window.location.hash;\n
}\n }\n
\n
console.log(\'In hashController with \' + hash);\n
\n \n
var list_len = hash_list.length; \n var list_len = hash_list.length; \n
var i = 0;\n var i = 0;\n
...@@ -192,6 +221,7 @@ function hashController ()\n ...@@ -192,6 +221,7 @@ function hashController ()\n
}\n }\n
\n \n
function mainController() {\n function mainController() {\n
console.log(\'In mainController with \' + window.location.hash);\n
$.ajaxSetup ({cache: false});\n $.ajaxSetup ({cache: false});\n
$(window).hashchange( hashController() );\n $(window).hashchange( hashController() );\n
$(window).hashchange();\n $(window).hashchange();\n
...@@ -206,7 +236,7 @@ function mainController() {\n ...@@ -206,7 +236,7 @@ function mainController() {\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>4842</int> </value> <value> <int>5869</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
327 328
\ 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