Commit 3b756a8f authored by Ivan Tyagov's avatar Ivan Tyagov

No need to query server generate image URL with AJAX (we have all information...

No need to query server generate image URL with AJAX (we have all information during listbox rendering)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36942 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b6fa99e2
......@@ -247,15 +247,10 @@ function makeThumnailNode(parent_node, frame, src){\n
}\n
\n
function makeThumbnailNodes(start, end){\n
function iter(n, req){\n
if(n>start){\n
makeThumnailNode(parent_node, n-1, req.responseText);\n
}\n
if(n>=end){return;}\n
var d = doSimpleXMLHttpRequest("PDF_getThumbnailUrl", {frame:n});\n
d.addCallback(iter, n+1);\n
}\n
iter(start);\n
forEach(MochiKit.Iter.range(start,end), \n
function(frame_number){\n
makeThumnailNode(parent_node, frame_number, "index_html?frame="+frame_number+"&display=thumbnail&format=png");\n
});\n
}\n
\n
makeThumbnailNodes(START_FRAME, END_FRAME);\n
......
......@@ -56,10 +56,6 @@
<value> <string>content_information = context.getContentInformation()\n
\n
page_number = int(content_information.get(\'Pages\', 0))\n
format = \'jpg\'\n
display = \'thumbnail\'\n
pdf_url = context.absolute_url()\n
\n
limit = kw.get(\'limit\', (0, 0))\n
list_start = int(kw.get(\'list_start\', 0))\n
list_lines = int(kw.get(\'list_lines\', 0))\n
......@@ -69,7 +65,6 @@ list_end = list_start + size\n
page_list = range(page_number)\n
\n
result = []\n
\n
for i in page_list[list_start:list_end]:\n
result.append(context)\n
return result\n
......@@ -115,9 +110,6 @@ return result\n
<string>content_information</string>
<string>int</string>
<string>page_number</string>
<string>format</string>
<string>display</string>
<string>pdf_url</string>
<string>limit</string>
<string>list_start</string>
<string>list_lines</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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>from ZTUtils import make_query\n
\n
display = \'thumbnail\'\n
format = \'jpg\'\n
\n
url = "%s/index_html?%s" % (context.absolute_url(), make_query(display=display, format=format, frame=frame))\n
\n
return url\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>frame</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>frame</string>
<string>ZTUtils</string>
<string>make_query</string>
<string>display</string>
<string>format</string>
<string>_getattr_</string>
<string>context</string>
<string>url</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PDF_getThumbnailUrl</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1157
\ No newline at end of file
1158
\ 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