Commit ec1a4987 authored by Christophe Dumez's avatar Christophe Dumez

code clean up

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6828 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b23c1849
...@@ -69,44 +69,49 @@ ...@@ -69,44 +69,49 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
if "files" in context.REQUEST.keys():\n if "files" in context.REQUEST.keys():\n
files=context.REQUEST["files"]\n files = context.REQUEST["files"]\n
else:\n else:\n
files=None\n files = None\n
\n \n
print \'\'\'<script>var tree = null;\n print \'\'\'\n
<script>\n
var tree = null;\n
var business_template;\n var business_template;\n
var is_expanded=false;\n var is_expanded=false;\n
var ie = document.all\n
var ns6 = document.getElementById&&!document.all\n
var isMenu = false ;\n
var menuSelObj = null ;\n
var overpopupmenu = false;\n
\n \n
// This script is intended for use with a minimum of Netscape 4 or IE 4.\n // This script is intended for use with a minimum of Netscape 4 or IE 4.\n
if(document.getElementById) {\n if(document.getElementById) {\n
\t var upLevel = true;\n var upLevel = true;\n
\t} else if(document.layers) {\n } else if(document.layers) {\n
\t var ns4 = true;\n var ns4 = true;\n
\t} else if(document.all) {\n } else if(document.all) {\n
\t var ie4 = true;\n var ie4 = true;\n
\t}\n }\n
\n \n
\tfunction preLoadImages(){\n function preLoadImages(){\n
\t\tvar imSrcAr = new \n var imSrcAr = new \n
Array(\'document.png\',\'iconCheckAll.gif\',\'line2.gif\',\'minus2.gif\',\'minus5.gif\',\'plus2.gif\',\'plus5.gif\',\'folder_open.png\',\'iconCheckGray.gif\',\'line3.gif\',\'minus3.gif\',\'minus_ar.gif\',\'plus3.gif\',\'plus_ar.gif\',\'folder.png\',\'line1.gif\',\'line4.gif\',\'minus4.gif\',\'minus.gif\',\'plus4.gif\',\'plus.gif\',\'iconUnCheckAll.gif\', \'blank.gif\')\n Array(\'document.png\',\'iconCheckAll.gif\',\'line2.gif\',\'minus2.gif\',\'minus5.gif\',\'plus2.gif\',\'plus5.gif\',\'folder_open.png\',\'iconCheckGray.gif\',\'line3.gif\',\'minus3.gif\',\'minus_ar.gif\',\'plus3.gif\',\'plus_ar.gif\',\'folder.png\',\'line1.gif\',\'line4.gif\',\'minus4.gif\',\'minus.gif\',\'plus4.gif\',\'plus.gif\',\'iconUnCheckAll.gif\', \'blank.gif\')\n
\t\tvar imAr = new Array(0);\n var imAr = new Array(0);\n
\t\tfor(var i=0;i<imSrcAr.length;i++){\n for(var i=0;i<imSrcAr.length;i++){\n
\t\t\timAr[imAr.length] = new Image();\n imAr[imAr.length] = new Image();\n
\t\t\timAr[imAr.length-1].src = \'imgs/\'+imSrcAr[i]\n imAr[imAr.length-1].src = \'imgs/\'+imSrcAr[i]\n
\t\t}\n }\n
\t}\n }\n
\n \n
\tfunction doOnLoad(){\n function doOnLoad(){\n
\t\tpreLoadImages();\n preLoadImages();\n
\t\t//tree\n tree=new dhtmlXTreeObject(document.getElementById(\'treebox1\'),\'100%%\',\'100%%\',0);\n
\t\ttree=new dhtmlXTreeObject(document.getElementById(\'treebox1\'),\'100%%\',\'100%%\',0);\n tree.setImagePath(\'imgs/\');\n
\t\ttree.setImagePath(\'imgs/\');\n tree.setDragHandler();\n
\t\ttree.setDragHandler();\n tree.enableCheckBoxes(true)\n
\t\ttree.enableCheckBoxes(true)\n tree.enableThreeStateCheckboxes(true);\n
\t\ttree.enableThreeStateCheckboxes(true);\n tree.enableDragAndDrop(false)\n
\t\ttree.enableDragAndDrop(false)\n
tree.loadXML(\'tree.xml?bt_id=%s\', hideObject)\n tree.loadXML(\'tree.xml?bt_id=%s\', hideObject)\n
//tree.setOnClickHandler(clickHandler)\n
tree.setOnClickHandler(showMenu)\n tree.setOnClickHandler(showMenu)\n
}\n }\n
\n \n
...@@ -178,14 +183,6 @@ print \'\'\'<script>var tree = null;\n ...@@ -178,14 +183,6 @@ print \'\'\'<script>var tree = null;\n
submitAction(form,\'%s/BusinessTemplate_doSvnCommit\');\n submitAction(form,\'%s/BusinessTemplate_doSvnCommit\');\n
}\n }\n
}\n }\n
\n
function clickHandler(item_id){\n
if (tree.isItemChecked(item_id) == 0) {\n
tree.setCheck(item_id, 1);\n
}else{\n
tree.setCheck(item_id, 0);\n
}\n
}\n
\n \n
function viewDiff(popup, form){\n function viewDiff(popup, form){\n
nbModified=0;\n nbModified=0;\n
...@@ -239,13 +236,8 @@ print \'\'\'<script>var tree = null;\n ...@@ -239,13 +236,8 @@ print \'\'\'<script>var tree = null;\n
}\n }\n
}\n }\n
\n \n
var ie = document.all\n function mouseSelect(e)\n
var ns6 = document.getElementById&&!document.all\n {\n
var isMenu = false ;\n
var menuSelObj = null ;\n
var overpopupmenu = false;\n
function mouseSelect(e)\n
{\n
var obj = ns6 ? e.target.parentNode : event.srcElement.parentElement;\n var obj = ns6 ? e.target.parentNode : event.srcElement.parentElement;\n
if( isMenu )\n if( isMenu )\n
{\n {\n
...@@ -257,10 +249,10 @@ function mouseSelect(e)\n ...@@ -257,10 +249,10 @@ function mouseSelect(e)\n
}\n }\n
}\n }\n
return true;\n return true;\n
}\n }\n
\n \n
function showMenu()\n function showMenu()\n
{\n {\n
document.getElementById(\'menudiv\').style.left = mouseX;\n document.getElementById(\'menudiv\').style.left = mouseX;\n
document.getElementById(\'menudiv\').style.top = mouseY;\n document.getElementById(\'menudiv\').style.top = mouseY;\n
document.getElementById(\'menudiv\').style.display = "";\n document.getElementById(\'menudiv\').style.display = "";\n
...@@ -269,10 +261,10 @@ function showMenu()\n ...@@ -269,10 +261,10 @@ function showMenu()\n
document.getElementById(\'item3\').style.backgroundColor=\'#FFFFFF\';\n document.getElementById(\'item3\').style.backgroundColor=\'#FFFFFF\';\n
isMenu = true;\n isMenu = true;\n
return false ;\n return false ;\n
}\n }\n
\n \n
function getMouse(e)\n function getMouse(e)\n
{\n {\n
if(overpopupmenu){\n if(overpopupmenu){\n
document.body.style.cursor = \'default\';\n document.body.style.cursor = \'default\';\n
}\n }\n
...@@ -286,10 +278,10 @@ function getMouse(e)\n ...@@ -286,10 +278,10 @@ function getMouse(e)\n
mouseY = event.clientY+document.body.scrollTop+\'px\';\n mouseY = event.clientY+document.body.scrollTop+\'px\';\n
}\n }\n
return true;\n return true;\n
}\n }\n
\n \n
document.onmousedown = mouseSelect;\n document.onmousedown = mouseSelect;\n
document.onmousemove = getMouse;\n document.onmousemove = getMouse;\n
\n \n
function revert(popup,form){\n function revert(popup,form){\n
if(popup==1){\n if(popup==1){\n
......
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