removed mods directory from the ATutor codebase
[atutor.git] / mods / phpdoc2 / PhpDocumentor / phpDocumentor / Converters / HTML / frames / templates / DOM / earthli / templates / media / lib / classTree.js
diff --git a/mods/phpdoc2/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/media/lib/classTree.js b/mods/phpdoc2/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates/media/lib/classTree.js
deleted file mode 100644 (file)
index 5989426..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-/*----------------------------------------\\r
-|      Cross Browser Tree Widget 1.1      |\r
-|-----------------------------------------|\r
-| Created by Emil A. Eklund (eae@eae.net) |\r
-|    For WebFX (http://webfx.eae.net/)    |\r
-|-----------------------------------------|\r
-| This script is  provided as is  without |\r
-| any warranty whatsoever. It may be used |\r
-| free of charge for non commerical sites |\r
-| For commerical use contact  the  author |\r
-| of this script for further details.     |\r
-|-----------------------------------------|\r
-| Created 2000-12-11 | Updated 2001-09-06 |\r
-\----------------------------------------*/\r
-\r
-var webFXTreeConfig = {\r
-       rootIcon        : 'media/images/empty.png',\r
-       openRootIcon    : 'media/images/empty.png',\r
-       folderIcon      : 'media/images/empty.png',\r
-       openFolderIcon  : 'media/images/empty.png',\r
-       fileIcon        : 'media/images/empty.png',\r
-       iIcon           : 'media/images/I.png',\r
-       lIcon           : 'media/images/L.png',\r
-       lMinusIcon      : 'media/images/Lminus.png',\r
-       lPlusIcon       : 'media/images/Lplus.png',\r
-       tIcon           : 'media/images/T.png',\r
-       tMinusIcon      : 'media/images/Tminus.png',\r
-       tPlusIcon       : 'media/images/Tplus.png',\r
-       blankIcon       : 'media/images/blank.png',\r
-       defaultText     : 'Tree Item',\r
-       defaultAction   : 'javascript:void(0);',\r
-       defaultTarget   : 'right',\r
-       defaultBehavior : 'classic'\r
-};\r
-\r
-var webFXTreeHandler = {\r
-       idCounter : 0,\r
-       idPrefix  : "webfx-tree-object-",\r
-       all       : {},\r
-       behavior  : null,\r
-       selected  : null,\r
-       getId     : function() { return this.idPrefix + this.idCounter++; },\r
-       toggle    : function (oItem) { this.all[oItem.id.replace('-plus','')].toggle(); },\r
-       select    : function (oItem) { this.all[oItem.id.replace('-icon','')].select(); },\r
-       focus     : function (oItem) { this.all[oItem.id.replace('-anchor','')].focus(); },\r
-       blur      : function (oItem) { this.all[oItem.id.replace('-anchor','')].blur(); },\r
-       keydown   : function (oItem) { return this.all[oItem.id].keydown(window.event.keyCode); },\r
-       cookies   : new WebFXCookie()\r
-};\r
-\r
-/*\r
- * WebFXCookie class\r
- */\r
-\r
-function WebFXCookie() {\r
-       if (document.cookie.length) { this.cookies = ' ' + document.cookie; }\r
-}\r
-\r
-WebFXCookie.prototype.setCookie = function (key, value) {\r
-       document.cookie = key + "=" + escape(value);\r
-}\r
-\r
-WebFXCookie.prototype.getCookie = function (key) {\r
-       if (this.cookies) {\r
-               var start = this.cookies.indexOf(' ' + key + '=');\r
-               if (start == -1) { return null; }\r
-               var end = this.cookies.indexOf(";", start);\r
-               if (end == -1) { end = this.cookies.length; }\r
-               end -= start;\r
-               var cookie = this.cookies.substr(start,end);\r
-               return unescape(cookie.substr(cookie.indexOf('=') + 1, cookie.length - cookie.indexOf('=') + 1));\r
-       }\r
-       else { return null; }\r
-}\r
-\r
-/*\r
- * WebFXTreeAbstractNode class\r
- */\r
-\r
-function WebFXTreeAbstractNode(sText, sAction, sTarget) {\r
-       this.childNodes  = [];\r
-       this.id     = webFXTreeHandler.getId();\r
-       this.text   = sText || webFXTreeConfig.defaultText;\r
-       this.action = sAction || webFXTreeConfig.defaultAction;\r
-       this.targetWindow = sTarget || webFXTreeConfig.defaultTarget;\r
-       this._last  = false;\r
-       webFXTreeHandler.all[this.id] = this;\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.add = function (node) {\r
-       node.parentNode = this;\r
-       this.childNodes[this.childNodes.length] = node;\r
-       var root = this;\r
-       if (this.childNodes.length >=2) {\r
-               this.childNodes[this.childNodes.length -2]._last = false;\r
-       }\r
-       while (root.parentNode) { root = root.parentNode; }\r
-       if (root.rendered) {\r
-               if (this.childNodes.length >= 2) {\r
-                       document.getElementById(this.childNodes[this.childNodes.length -2].id + '-plus').src = ((this.childNodes[this.childNodes.length -2].folder)?webFXTreeConfig.tMinusIcon:webFXTreeConfig.tIcon);\r
-                       if (this.childNodes[this.childNodes.length -2].folder) {\r
-                               this.childNodes[this.childNodes.length -2].plusIcon = webFXTreeConfig.tPlusIcon;\r
-                               this.childNodes[this.childNodes.length -2].minusIcon = webFXTreeConfig.tMinusIcon;\r
-                       }\r
-                       this.childNodes[this.childNodes.length -2]._last = false;\r
-               }\r
-               this._last = true;\r
-               var foo = this;\r
-               while (foo.parentNode) {\r
-                       for (var i = 0; i < foo.parentNode.childNodes.length; i++) {\r
-                               if (foo.id == foo.parentNode.childNodes[i].id) { break; }\r
-                       }\r
-                       if (++i == foo.parentNode.childNodes.length) { foo.parentNode._last = true; }\r
-                       else { foo.parentNode._last = false; }\r
-                       foo = foo.parentNode;\r
-               }\r
-               document.getElementById(this.id + '-cont').insertAdjacentHTML("beforeEnd", node.toString());\r
-               if ((!this.folder) && (!this.openIcon)) {\r
-                       this.icon = webFXTreeConfig.folderIcon;\r
-                       this.openIcon = webFXTreeConfig.openFolderIcon;\r
-               }\r
-               this.folder = true;\r
-               this.indent();\r
-               this.expand();\r
-       }\r
-       return node;\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.toggle = function() {\r
-       if (this.folder) {\r
-               if (this.open) { this.collapse(); }\r
-               else { this.expand(); }\r
-       }\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.select = function() {\r
-       document.getElementById(this.id + '-anchor').focus();\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.focus = function() {\r
-       webFXTreeHandler.selected = this;\r
-       if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.openIcon; }\r
-       document.getElementById(this.id + '-anchor').style.backgroundColor = 'highlight';\r
-       document.getElementById(this.id + '-anchor').style.color = 'highlighttext';\r
-       document.getElementById(this.id + '-anchor').focus();\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.blur = function() {\r
-       if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.icon; }\r
-       document.getElementById(this.id + '-anchor').style.backgroundColor = 'transparent';\r
-       document.getElementById(this.id + '-anchor').style.color = 'menutext';\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.doExpand = function() {\r
-       if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.openIcon; }\r
-       if (this.childNodes.length) {  document.getElementById(this.id + '-cont').style.display = 'block'; }\r
-       this.open = true;\r
-       webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '1');\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.doCollapse = function() {\r
-       if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.icon; }\r
-       if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'none'; }\r
-       this.open = false;\r
-       webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '0');\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.expandAll = function() {\r
-       this.expandChildren();\r
-       if ((this.folder) && (!this.open)) { this.expand(); }\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.expandChildren = function() {\r
-       for (var i = 0; i < this.childNodes.length; i++) {\r
-               this.childNodes[i].expandAll();\r
-} }\r
-\r
-WebFXTreeAbstractNode.prototype.collapseAll = function() {\r
-       if ((this.folder) && (this.open)) { this.collapse(); }\r
-       this.collapseChildren();\r
-}\r
-\r
-WebFXTreeAbstractNode.prototype.collapseChildren = function() {\r
-       for (var i = 0; i < this.childNodes.length; i++) {\r
-               this.childNodes[i].collapseAll();\r
-} }\r
-\r
-WebFXTreeAbstractNode.prototype.indent = function(lvl, del, last, level) {\r
-       /*\r
-        * Since we only want to modify items one level below ourself,\r
-        * and since the rightmost indentation position is occupied by\r
-        * the plus icon we set this to -2\r
-        */\r
-       if (lvl == null) { lvl = -2; }\r
-       var state = 0;\r
-       for (var i = this.childNodes.length - 1; i >= 0 ; i--) {\r
-               state = this.childNodes[i].indent(lvl + 1, del, last, level);\r
-               if (state) { return; }\r
-       }\r
-       if (del) {\r
-               if (level >= this._level) {\r
-                       if (this.folder) {\r
-                               document.getElementById(this.id + '-plus').src = (this.open)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.lPlusIcon;\r
-                               this.plusIcon = webFXTreeConfig.lPlusIcon;\r
-                               this.minusIcon = webFXTreeConfig.lMinusIcon;\r
-                       }\r
-                       else { document.getElementById(this.id + '-plus').src = webFXTreeConfig.lIcon; }\r
-                       return 1;\r
-               }\r
-       }\r
-       var foo = document.getElementById(this.id + '-indent-' + lvl);\r
-       if (foo) {\r
-               if ((del) && (last)) { foo._last = true; }\r
-               if (foo._last) { foo.src =  webFXTreeConfig.blankIcon; }\r
-               else { foo.src =  webFXTreeConfig.iIcon; }\r
-       }\r
-       return 0;\r
-}\r
-\r
-/*\r
- * WebFXTree class\r
- */\r
-\r
-function WebFXTree(sText, sAction, sBehavior, sIcon, sOpenIcon) {\r
-       this.base = WebFXTreeAbstractNode;\r
-       this.base(sText, sAction);\r
-       this.icon      = sIcon || webFXTreeConfig.rootIcon;\r
-       this.openIcon  = sOpenIcon || webFXTreeConfig.openRootIcon;\r
-       /* Defaults to open */\r
-       this.open      = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '0')?false:true;\r
-       this.folder    = true;\r
-       this.rendered  = false;\r
-       if (!webFXTreeHandler.behavior) {  webFXTreeHandler.behavior = sBehavior || webFXTreeConfig.defaultBehavior; }\r
-       this.targetWindow = 'right';\r
-}\r
-\r
-WebFXTree.prototype = new WebFXTreeAbstractNode;\r
-\r
-WebFXTree.prototype.setBehavior = function (sBehavior) {\r
-       webFXTreeHandler.behavior =  sBehavior;\r
-};\r
-\r
-WebFXTree.prototype.getBehavior = function (sBehavior) {\r
-       return webFXTreeHandler.behavior;\r
-};\r
-\r
-WebFXTree.prototype.getSelected = function() {\r
-       if (webFXTreeHandler.selected) { return webFXTreeHandler.selected; }\r
-       else { return null; }\r
-}\r
-\r
-WebFXTree.prototype.remove = function() { }\r
-\r
-WebFXTree.prototype.expand = function() {\r
-       this.doExpand();\r
-}\r
-\r
-WebFXTree.prototype.collapse = function() {\r
-       this.focus();\r
-       this.doCollapse();\r
-}\r
-\r
-WebFXTree.prototype.getFirst = function() {\r
-       return null;\r
-}\r
-\r
-WebFXTree.prototype.getLast = function() {\r
-       return null;\r
-}\r
-\r
-WebFXTree.prototype.getNextSibling = function() {\r
-       return null;\r
-}\r
-\r
-WebFXTree.prototype.getPreviousSibling = function() {\r
-       return null;\r
-}\r
-\r
-WebFXTree.prototype.keydown = function(key) {\r
-       if (key == 39) { this.expand(); return false; }\r
-       if (key == 37) { this.collapse(); return false; }\r
-       if ((key == 40) && (this.open)) { this.childNodes[0].select(); return false; }\r
-       return true;\r
-}\r
-\r
-WebFXTree.prototype.toString = function() {\r
-       var str = "<div id=\"" + this.id + "\" ondblclick=\"webFXTreeHandler.toggle(this);\" class=\"webfx-tree-item\" onkeydown=\"return webFXTreeHandler.keydown(this)\">";\r
-       str += "<img id=\"" + this.id + "-icon\" class=\"webfx-tree-icon\" src=\"" + ((webFXTreeHandler.behavior == 'classic' && this.open)?this.openIcon:this.icon) + "\" onclick=\"webFXTreeHandler.select(this);\"><a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" target=\"" + this.targetWindow + "\" onfocus=\"webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\">" + this.text + "</a></div>";\r
-       str += "<div id=\"" + this.id + "-cont\" class=\"webfx-tree-container\" style=\"display: " + ((this.open)?'block':'none') + ";\">";\r
-       for (var i = 0; i < this.childNodes.length; i++) {\r
-               str += this.childNodes[i].toString(i, this.childNodes.length);\r
-       }\r
-       str += "</div>";\r
-       this.rendered = true;\r
-       return str;\r
-};\r
-\r
-/*\r
- * WebFXTreeItem class\r
- */\r
-\r
-function WebFXTreeItem(sText, sAction, eParent, sIcon, sOpenIcon) {\r
-       this.base = WebFXTreeAbstractNode;\r
-       this.base(sText, sAction);\r
-       /* Defaults to close */\r
-       this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '1')?true:false;\r
-       if (eParent) { eParent.add(this); }\r
-       if (sIcon) { this.icon = sIcon; }\r
-       if (sOpenIcon) { this.openIcon = sOpenIcon; }\r
-}\r
-\r
-WebFXTreeItem.prototype = new WebFXTreeAbstractNode;\r
-\r
-WebFXTreeItem.prototype.remove = function() {\r
-       var parentNode = this.parentNode;\r
-       var prevSibling = this.getPreviousSibling(true);\r
-       var nextSibling = this.getNextSibling(true);\r
-       var folder = this.parentNode.folder;\r
-       var last = ((nextSibling) && (nextSibling.parentNode) && (nextSibling.parentNode.id == parentNode.id))?false:true;\r
-       this.getPreviousSibling().focus();\r
-       this._remove();\r
-       if (parentNode.childNodes.length == 0) {\r
-               parentNode.folder = false;\r
-               parentNode.open = false;\r
-       }\r
-       if (last) {\r
-               if (parentNode.id == prevSibling.id) {\r
-                       document.getElementById(parentNode.id + '-icon').src = webFXTreeConfig.fileIcon;\r
-               }\r
-               else { }\r
-       }\r
-       if ((!prevSibling.parentNode) || (prevSibling.parentNode != parentNode)) {\r
-               parentNode.indent(null, true, last, this._level);\r
-       }\r
-       if (document.getElementById(prevSibling.id + '-plus')) {\r
-               if (nextSibling) {\r
-                       if ((parentNode == prevSibling) && (parentNode.getNextSibling))  { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.tIcon; }\r
-                       else if (nextSibling.parentNode != prevSibling) { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.lIcon; }\r
-               }\r
-               else { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.lIcon; }\r
-       }\r
-}\r
-\r
-WebFXTreeItem.prototype._remove = function() {\r
-       for (var i = this.childNodes.length - 1; i >= 0; i--) {\r
-               this.childNodes[i]._remove();\r
-       }\r
-       for (var i = 0; i < this.parentNode.childNodes.length; i++) {\r
-               if (this.id == this.parentNode.childNodes[i].id) {\r
-                       for (var j = i; j < this.parentNode.childNodes.length; j++) {\r
-                               this.parentNode.childNodes[i] = this.parentNode.childNodes[i+1]\r
-                       }\r
-                       this.parentNode.childNodes.length = this.parentNode.childNodes.length - 1;\r
-                       if (i + 1 == this.parentNode.childNodes.length) { this.parentNode._last = true; }\r
-               }\r
-       }\r
-       webFXTreeHandler.all[this.id] = null;\r
-       if (document.getElementById(this.id)) {\r
-               document.getElementById(this.id).innerHTML = "";\r
-               document.getElementById(this.id).removeNode();\r
-       }\r
-}\r
-\r
-WebFXTreeItem.prototype.expand = function() {\r
-       this.doExpand();\r
-       document.getElementById(this.id + '-plus').src = this.minusIcon;\r
-}\r
-\r
-WebFXTreeItem.prototype.collapse = function() {\r
-       this.focus();\r
-       this.doCollapse();\r
-       document.getElementById(this.id + '-plus').src = this.plusIcon;\r
-}\r
-\r
-WebFXTreeItem.prototype.getFirst = function() {\r
-       return this.childNodes[0];\r
-}\r
-\r
-WebFXTreeItem.prototype.getLast = function() {\r
-       if (this.childNodes[this.childNodes.length - 1].open) { return this.childNodes[this.childNodes.length - 1].getLast(); }\r
-       else { return this.childNodes[this.childNodes.length - 1]; }\r
-}\r
-\r
-WebFXTreeItem.prototype.getNextSibling = function() {\r
-       for (var i = 0; i < this.parentNode.childNodes.length; i++) {\r
-               if (this == this.parentNode.childNodes[i]) { break; }\r
-       }\r
-       if (++i == this.parentNode.childNodes.length) { return this.parentNode.getNextSibling(); }\r
-       else { return this.parentNode.childNodes[i]; }\r
-}\r
-\r
-WebFXTreeItem.prototype.getPreviousSibling = function(b) {\r
-       for (var i = 0; i < this.parentNode.childNodes.length; i++) {\r
-               if (this == this.parentNode.childNodes[i]) { break; }\r
-       }\r
-       if (i == 0) { return this.parentNode; }\r
-       else {\r
-               if ((this.parentNode.childNodes[--i].open) || (b && this.parentNode.childNodes[i].folder)) { return this.parentNode.childNodes[i].getLast(); }\r
-               else { return this.parentNode.childNodes[i]; }\r
-} }\r
-\r
-WebFXTreeItem.prototype.keydown = function(key) {\r
-       if ((key == 39) && (this.folder)) {\r
-               if (!this.open) { this.expand(); return false; }\r
-               else { this.getFirst().select(); return false; }\r
-       }\r
-       else if (key == 37) {\r
-               if (this.open) { this.collapse(); return false; }\r
-               else { this.parentNode.select(); return false; }\r
-       }\r
-       else if (key == 40) {\r
-               if (this.open) { this.getFirst().select(); return false; }\r
-               else {\r
-                       var sib = this.getNextSibling();\r
-                       if (sib) { sib.select(); return false; }\r
-       } }\r
-       else if (key == 38) { this.getPreviousSibling().select(); return false; }\r
-       return true;\r
-}\r
-\r
-WebFXTreeItem.prototype.toString = function (nItem, nItemCount) {\r
-       var foo = this.parentNode;\r
-       var indent = '';\r
-       if (nItem + 1 == nItemCount) { this.parentNode._last = true; }\r
-       var i = 0;\r
-       while (foo.parentNode) {\r
-               foo = foo.parentNode;\r
-               indent = "<img id=\"" + this.id + "-indent-" + i + "\" src=\"" + ((foo._last)?webFXTreeConfig.blankIcon:webFXTreeConfig.iIcon) + "\">" + indent;\r
-               i++;\r
-       }\r
-       this._level = i;\r
-       if (this.childNodes.length) { this.folder = 1; }\r
-       else { this.open = false; }\r
-       if ((this.folder) || (webFXTreeHandler.behavior != 'classic')) {\r
-               if (!this.icon) { this.icon = webFXTreeConfig.folderIcon; }\r
-               if (!this.openIcon) { this.openIcon = webFXTreeConfig.openFolderIcon; }\r
-       }\r
-       else if (!this.icon) { this.icon = webFXTreeConfig.fileIcon; }\r
-       var label = this.text;\r
-       label = label.replace('<', '<');\r
-       label = label.replace('>', '>');\r
-       var str = "<div id=\"" + this.id + "\" ondblclick=\"webFXTreeHandler.toggle(this);\" class=\"webfx-tree-item\" onkeydown=\"return webFXTreeHandler.keydown(this)\">";\r
-       str += indent;\r
-       str += "<img id=\"" + this.id + "-plus\" src=\"" + ((this.folder)?((this.open)?((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon):((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon)):((this.parentNode._last)?webFXTreeConfig.lIcon:webFXTreeConfig.tIcon)) + "\" onclick=\"webFXTreeHandler.toggle(this);\">"\r
-       str += "<img id=\"" + this.id + "-icon\" src=\"" + ((webFXTreeHandler.behavior == 'classic' && this.open)?this.openIcon:this.icon) + "\" onclick=\"webFXTreeHandler.select(this);\"><a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" target=\"" + this.targetWindow + "\" onfocus=\"webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\">" + label + "</a></div>";\r
-       str += "<div id=\"" + this.id + "-cont\" class=\"webfx-tree-container\" style=\"display: " + ((this.open)?'block':'none') + ";\">";\r
-       for (var i = 0; i < this.childNodes.length; i++) {\r
-               str += this.childNodes[i].toString(i,this.childNodes.length);\r
-       }\r
-       str += "</div>";\r
-       this.plusIcon = ((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon);\r
-       this.minusIcon = ((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon);\r
-       return str;\r
-}
\ No newline at end of file