[Erp5-report] r36975 fabien - in /erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style: Skin...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Jul 8 12:07:13 CEST 2010
Author: fabien
Date: Thu Jul 8 12:07:12 2010
New Revision: 36975
URL: http://svn.erp5.org?rev=36975&view=rev
Log:
check if master is not null, this may happen in some web_sites using other templates than erp5_xhtml one and then make javascript errors.
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml?rev=36975&r1=36974&r2=36975&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml [utf8] Thu Jul 8 12:07:12 2010
@@ -259,40 +259,42 @@ while leaving the page, unless leaving b
*/\n
var addOnChangeEventHandler = function() {\n
var master = document.getElementById("master");\n
- divs = master.getElementsByTagName("div");\n
- for (i=0; i<divs.length; i++) {\n
- if (divs[i].getAttribute("class") == "input") {\n
- nodes = divs[i].childNodes;\n
+ if (master) {\n
+ divs = master.getElementsByTagName("div");\n
+ for (i=0; i<divs.length; i++) {\n
+ if (divs[i].getAttribute("class") == "input") {\n
+ nodes = divs[i].childNodes;\n
\n
- for (j=0; j<nodes.length; j++) {\n
- if (nodes[j].nodeName == "INPUT" ||\n
- nodes[j].nodeName == "SELECT" ||\n
- nodes[j].nodeName == "TEXTAREA") {\n
- if (nodes[j].value == "update..." ||\n
- (nodes[j].nodeName == "INPUT" &&\n
- nodes[j].type == \'submit\')) {\n
- // this is a relation field wheel or a submit form button\n
- nodes[j].onclick = function() { changed = false;};\n
- } else {\n
- if (!nodes[j].onchange) {\n
- nodes[j].onchange = function() { changed = true; };\n
- }\n
- }\n
- } \n
- /* Listbox or MatrixBox */\n
- if (nodes[j].nodeName == "DIV" && (\n
- nodes[j].getAttribute("class") == "listbox" ||\n
- nodes[j].getAttribute("class") == "MatrixContent")) {\n
- trs = nodes[j].getElementsByTagName(\'td\');\n
- for (k=0; k<trs.length; k++){\n
- if (trs[k].getAttribute("class") == "listbox_search_line") {\n
- continue;\n
+ for (j=0; j<nodes.length; j++) {\n
+ if (nodes[j].nodeName == "INPUT" ||\n
+ nodes[j].nodeName == "SELECT" ||\n
+ nodes[j].nodeName == "TEXTAREA") {\n
+ if (nodes[j].value == "update..." ||\n
+ (nodes[j].nodeName == "INPUT" &&\n
+ nodes[j].type == \'submit\')) {\n
+ // this is a relation field wheel or a submit form button\n
+ nodes[j].onclick = function() { changed = false;};\n
+ } else {\n
+ if (!nodes[j].onchange) {\n
+ nodes[j].onchange = function() { changed = true; };\n
+ }\n
}\n
- inputs = trs[k].getElementsByTagName(\'input\');\n
- for (l=0; l<inputs.length; l++){\n
- if (inputs[l].getAttribute("type") != "hidden" &&\n
- !inputs[l].onchange) {\n
- inputs[l].onchange = function() { changed = true; };\n
+ } \n
+ /* Listbox or MatrixBox */\n
+ if (nodes[j].nodeName == "DIV" && (\n
+ nodes[j].getAttribute("class") == "listbox" ||\n
+ nodes[j].getAttribute("class") == "MatrixContent")) {\n
+ trs = nodes[j].getElementsByTagName(\'td\');\n
+ for (k=0; k<trs.length; k++){\n
+ if (trs[k].getAttribute("class") == "listbox_search_line") {\n
+ continue;\n
+ }\n
+ inputs = trs[k].getElementsByTagName(\'input\');\n
+ for (l=0; l<inputs.length; l++){\n
+ if (inputs[l].getAttribute("type") != "hidden" &&\n
+ !inputs[l].onchange) {\n
+ inputs[l].onchange = function() { changed = true; };\n
+ }\n
}\n
}\n
}\n
@@ -307,31 +309,33 @@ var addOnChangeEventHandler = function()
*/\n
var rewriteIndentedSelect = function() {\n
var master = document.getElementById("master");\n
- selects = master.getElementsByTagName("select");\n
- for (i=0; i<selects.length; i++) {\n
- options = selects[i].childNodes;\n
- for (j=0; j<options.length; j++) {\n
- if (options[j].nodeName != "OPTION") {\n
- continue;\n
- }\n
- text = options[j].innerHTML;\n
- if (text.substring(0, 1) == \'\\n\') {\n
- text = text.substring(1, text.length);\n
- }\n
- level = 0;\n
- if (text.substring(0, 6) == \' \') {\n
- for (idx=0; idx <= text.length; idx+=6) {\n
- if (text.substring(idx, idx+6) == \' \') {\n
- level += 1;\n
- } else {\n
- break;\n
+ if (master){\n
+ selects = master.getElementsByTagName("select");\n
+ for (i=0; i<selects.length; i++) {\n
+ options = selects[i].childNodes;\n
+ for (j=0; j<options.length; j++) {\n
+ if (options[j].nodeName != "OPTION") {\n
+ continue;\n
+ }\n
+ text = options[j].innerHTML;\n
+ if (text.substring(0, 1) == \'\\n\') {\n
+ text = text.substring(1, text.length);\n
+ }\n
+ level = 0;\n
+ if (text.substring(0, 6) == \' \') {\n
+ for (idx=0; idx <= text.length; idx+=6) {\n
+ if (text.substring(idx, idx+6) == \' \') {\n
+ level += 1;\n
+ } else {\n
+ break;\n
+ }\n
}\n
}\n
- }\n
- if (level >= 1) {\n
- level = level / 4.;\n
- options[j].innerHTML = text.replace(/^( )+/, "");\n
- options[j].style.paddingLeft = level+"em";\n
+ if (level >= 1) {\n
+ level = level / 4.;\n
+ options[j].innerHTML = text.replace(/^( )+/, "");\n
+ options[j].style.paddingLeft = level+"em";\n
+ }\n
}\n
}\n
}\n
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision?rev=36975&r1=36974&r2=36975&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision [utf8] Thu Jul 8 12:07:12 2010
@@ -1 +1 @@
-958
\ No newline at end of file
+959
\ No newline at end of file
More information about the Erp5-report
mailing list