Commit 251c964d authored by Ivan Tyagov's avatar Ivan Tyagov

ERP5 front tabs rewriten using jQuery.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42415 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 861794aa
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<tal:block define="dummy python: request.RESPONSE.setHeader(\'Content-Type\', \'application/javascript;; charset=utf-8\')"/>\n
\n
/*\n
Copyright (c) 2011-2012 Nexedi SARL and Contributors. All Rights Reserved.\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
*/\n
\n
function selectTab(clicked_node) {\n
clicked_node = $(this);\n
$("#tab_box").find("li").each(\n
function (index){\n
tab = $(this);\n
node = tab.find("a").first();\n
class_name = tab.attr("class");\n
if (clicked_node.attr("href") == node.attr("href")){\n
if (class_name != "selected"){tab.attr("class", "selected");}\n
}\n
else{\n
if (class_name != "non_selected"){tab.attr("class", "non_selected");}\n
}\n
}\n
);\n
\n
var mapping = {\n
<tal:block \n
tal:replace="structure python: \',\\n\'.join([\'%s: \\x22%s\\x22\' %(x[\'id\'], x[\'renderer\']) for x in context.ERP5Site_getTabList(add_all_tabs=1)])"></tal:block>\n
};\n
\n
$("#container") .css("opacity", 0.5);\n
\n
var url = mapping[this.parentNode.id];\n
$.ajax({url:url,\n
success: function (data){\n
$("#container") .css("opacity", 1.0);\n
$("#container").html(data);},\n
error: function (data){\n
$("#container").innerHTML = "Server side error.";}});\n
// Set a cookie.\n
document.cookie = \'erp5_site_selected_tab=\' + escape(this.parentNode.id);\n
return false;\n
}\n
\n
function addOnClickEventsToTabs() {\n
$("#tab_box").find("li").each(\n
function (index){\n
var node = $(this).find("a").first();\n
node.bind("click", selectTab);})\n
return true;\n
}\n
\n
$(document).ready(addOnClickEventsToTabs);
]]></unicode> </value>
</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>
<key> <string>output_encoding</string> </key>
<value> <string>iso-8859-15</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
7 8
\ 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