Commit d3d01114 authored by Ivan Tyagov's avatar Ivan Tyagov

Gain around 15% speed rendering improvement by changing from DTML Document to Zope Page Template.

Remove commented logging.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28134 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7ef89a12
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/> <tuple/>
</tuple> </tuple>
</pickle> </pickle>
...@@ -14,23 +14,33 @@ ...@@ -14,23 +14,33 @@
<value> <string>http_cache</string> </value> <value> <string>http_cache</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>_bind_names</string> </key>
<value> <string>erp5_tabber.js</string> </value>
</item>
<item>
<key> <string>_vars</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>globals</string> </key>
<value> <value>
<dictionary/> <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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value> </value>
</item> </item>
<item> <item>
<key> <string>raw</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
var loading_deferred = undefined;\n var loading_deferred = undefined;\n
...@@ -42,9 +52,6 @@ function replaceContent(req) {\n ...@@ -42,9 +52,6 @@ function replaceContent(req) {\n
}\n }\n
\n \n
var container = $(\'container\');\n var container = $(\'container\');\n
//log(\'container is \', container);\n
//log(\'response is \', req.responseText);\n
// replaceChildNodes(container, req.responseXML);\n
container.innerHTML = req.responseText;\n container.innerHTML = req.responseText;\n
\n \n
addOnClickEventsToTabs(req);\n addOnClickEventsToTabs(req);\n
...@@ -77,18 +84,13 @@ function selectTab(e) {\n ...@@ -77,18 +84,13 @@ function selectTab(e) {\n
}\n }\n
\n \n
var mapping = {\n var mapping = {\n
<dtml-in prefix="tab" expr="ERP5Site_getTabList()">\n <tal:block \n
<dtml-var expr="tab_item[\'id\']">: "<dtml-var expr="tab_item[\'renderer\']">"<dtml-if sequence-end><dtml-else>,</dtml-if>\n tal:replace="structure python: \',\\n\'.join([\'%s: \\x22%s\\x22\' %(x[\'id\'], x[\'renderer\']) for x in context.ERP5Site_getTabList()])"></tal:block>\n
\n
</dtml-in>\n
};\n };\n
\n \n
var url = mapping[this.parentNode.id];\n var url = mapping[this.parentNode.id];\n
//log(\'calling \', this, url);\n
var d = doSimpleXMLHttpRequest(url);\n var d = doSimpleXMLHttpRequest(url);\n
d.addBoth(replaceContent)\n d.addBoth(replaceContent)\n
//var container = $(\'container\');\n
//container.innerHTML = \'\';\n
e.stop();\n e.stop();\n
\n \n
loading_deferred = callLater(0.3, showLoadingMessage);\n loading_deferred = callLater(0.3, showLoadingMessage);\n
...@@ -105,7 +107,6 @@ function addOnClickEventsToTabs(e) {\n ...@@ -105,7 +107,6 @@ function addOnClickEventsToTabs(e) {\n
var node = item_list[i].getElementsByTagName(\'a\')[0];\n var node = item_list[i].getElementsByTagName(\'a\')[0];\n
disconnectAll(node, \'onclick\');\n disconnectAll(node, \'onclick\');\n
connect(node, \'onclick\', selectTab);\n connect(node, \'onclick\', selectTab);\n
//log(node);\n
}\n }\n
return true;\n return true;\n
}\n }\n
...@@ -114,6 +115,18 @@ connect(window, \'onload\', addOnClickEventsToTabs); ...@@ -114,6 +115,18 @@ connect(window, \'onload\', addOnClickEventsToTabs);
]]></string> </value> ]]></string> </value>
</item> </item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_tabber.js</string> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
......
781 782
\ 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