Commit 76accb78 authored by Ivan Tyagov's avatar Ivan Tyagov

Web toolbar's JavaScript code should use JQuery rather than MochiKit which is to be deprecated.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42327 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f2357346
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
dom_id python: (\'%s-%s\' %(box_relative_url, here.getRelativeUrl())).replace(\'/\',\'_\')">\n dom_id python: (\'%s-%s\' %(box_relative_url, here.getRelativeUrl())).replace(\'/\',\'_\')">\n
<div class="document-gadget-quick-preview">\n <div class="document-gadget-quick-preview">\n
<div class="teaser"\n <div class="teaser"\n
tal:attributes="onclick string:toggle(\'${dom_id}\');">\n tal:attributes="onclick string:$(\'#${dom_id}\').toggle();">\n
<img alt="Icon" class="icon"\n <img alt="Icon" class="icon"\n
tal:attributes="src icon" />\n tal:attributes="src icon" />\n
\n \n
...@@ -82,8 +82,7 @@ ...@@ -82,8 +82,7 @@
</div>\n </div>\n
</div>\n </div>\n
\n \n
</tal:block>\n </tal:block>
]]></unicode> </value> ]]></unicode> </value>
</item> </item>
...@@ -101,7 +100,7 @@ ...@@ -101,7 +100,7 @@
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value> <value> <string>iso-8859-15</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts50863427.77</string> </value> <value> <string>ts94991458.99</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -24,30 +24,46 @@ ...@@ -24,30 +24,46 @@
</item> </item>
<item> <item>
<key> <string>data</string> </key> <key> <string>data</string> </key>
<value> <string>function initialize_toolbar(){\n <value> <string>/*\n
// for each menues\n Copyright (c) 2011-2012 Nexedi SARL and Contributors. All Rights Reserved.\n
var menus = getElementsByTagAndClassName(\'li\', \'toolboxSection\');\n \n
forEach(menus, function (menu) {\n This program is Free Software; you can redistribute it and/or\n
var menu_title = getFirstElementByTagAndClassName(\'h3\', \'menu_title\', menu);\n modify it under the terms of the GNU General Public License\n
var item = getFirstElementByTagAndClassName(\'div\', \'menu\', menu);\n as published by the Free Software Foundation; either version 2\n
connect(menu_title, \'onclick\', function (){display_menu(item)});\n of the License, or (at your option) any later version.\n
});\n \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
\n
function initialize_toolbar(){\n
/* initialize all toolbar menues */\n
$("li.toolboxSection").each(\n
function (index, menu){\n
menu = $(this);\n
var menu_title = menu.children("h3.menu_title").first();\n
var item = menu.children("div.menu").first();\n
menu_title.bind("click", function (){display_menu(item)} );\n
})}\n
\n \n
function display_menu(clicked_item){\n function display_menu(clicked_item){\n
toggle(clicked_item, \'appear\', {duration:0});\n /* when called funtion will display current menu and hide rest */\n
// for each menues\n clicked_item.toggle();\n
var menus = getElementsByTagAndClassName(\'li\', \'toolboxSection\');\n $("li.toolboxSection").each(\n
forEach(menus, function (menu) {\n function (index, menu){\n
var item = getFirstElementByTagAndClassName(\'div\', \'menu\', menu);\n menu = $(this);\n
if (item != clicked_item) {\n var item = menu.children("div.menu").first();\n
//item.style.display = \'none\';\n if (item.parent().attr("id") != clicked_item.parent().attr("id")) {item.hide();}\n
fade(item, {duration:0});\n })};\n
}\n
});\n
}\n
\n \n
initialize_toolbar();\n $(document).ready(initialize_toolbar);\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -56,7 +72,7 @@ initialize_toolbar();\n ...@@ -56,7 +72,7 @@ initialize_toolbar();\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>809</int> </value> <value> <int>1497</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
1038 1024
\ 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