From 9cc3e84ed9ed7b469e5966c6aefa7d01e8e440ae Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 10 Jun 2008 16:45:21 +0000 Subject: [PATCH] Prune old EventManagementSystem stuff in www/extras --- docs/upgrades/upgrade_7.5.10-7.5.11.pl | 3 + .../EventManagementSystem/script/button.js | 158 --- .../EventManagementSystem/script/buttonbar.js | 98 -- .../script/dynamicForms.js | 230 --- .../EventManagementSystem/script/jsdomenu.js | 1243 ----------------- .../EventManagementSystem/script/locale_EN.js | 32 - .../script/movtableInc.js | 1127 --------------- .../EventManagementSystem/script/tab.js | 115 -- .../style/common_style.css | 107 -- .../EventManagementSystem/style/default.css | 42 - .../EventManagementSystem/style/movtable.css | 170 --- .../style/newyork_style.css | 494 ------- .../EventManagementSystem/style/office_xp.css | 186 --- .../style/office_xp_menu_left.png | Bin 136 -> 0 bytes .../EventManagementSystem/style/win2k.css | 41 - .../EventManagementSystem/style/win2k_ie.css | 69 - .../EventManagementSystem/style/win2k_mz.css | 79 -- 17 files changed, 3 insertions(+), 4191 deletions(-) delete mode 100644 www/extras/wobject/EventManagementSystem/script/button.js delete mode 100644 www/extras/wobject/EventManagementSystem/script/buttonbar.js delete mode 100644 www/extras/wobject/EventManagementSystem/script/dynamicForms.js delete mode 100644 www/extras/wobject/EventManagementSystem/script/jsdomenu.js delete mode 100644 www/extras/wobject/EventManagementSystem/script/locale_EN.js delete mode 100644 www/extras/wobject/EventManagementSystem/script/movtableInc.js delete mode 100644 www/extras/wobject/EventManagementSystem/script/tab.js delete mode 100644 www/extras/wobject/EventManagementSystem/style/common_style.css delete mode 100644 www/extras/wobject/EventManagementSystem/style/default.css delete mode 100644 www/extras/wobject/EventManagementSystem/style/movtable.css delete mode 100644 www/extras/wobject/EventManagementSystem/style/newyork_style.css delete mode 100644 www/extras/wobject/EventManagementSystem/style/office_xp.css delete mode 100644 www/extras/wobject/EventManagementSystem/style/office_xp_menu_left.png delete mode 100644 www/extras/wobject/EventManagementSystem/style/win2k.css delete mode 100644 www/extras/wobject/EventManagementSystem/style/win2k_ie.css delete mode 100644 www/extras/wobject/EventManagementSystem/style/win2k_mz.css diff --git a/docs/upgrades/upgrade_7.5.10-7.5.11.pl b/docs/upgrades/upgrade_7.5.10-7.5.11.pl index e0af04bf2..d10af7c93 100644 --- a/docs/upgrades/upgrade_7.5.10-7.5.11.pl +++ b/docs/upgrades/upgrade_7.5.10-7.5.11.pl @@ -361,6 +361,9 @@ sub upgradeEMS { my $session = shift; print "\tUpgrading Event Manager\n" unless ($quiet); my $db = $session->db; + print "\t\tDeleting unused files in the extras directory.\n" unless ($quiet); + rmtree '../../www/extras/wobject/EventManagementSystem'; + print "\t\tGetting rid of old templates.\n" unless ($quiet); foreach my $namespace (qw(EventManagementSystem EventManagementSystem_checkout EventManagementSystem_managePurchas EventManagementSystem_product EventManagementSystem_viewPurchase EventManagementSystem_search emsbadgeprint emsticketprint)) { my $templates = $db->read("select assetId from template where namespace=?",[$namespace]); diff --git a/www/extras/wobject/EventManagementSystem/script/button.js b/www/extras/wobject/EventManagementSystem/script/button.js deleted file mode 100644 index ff5f940a7..000000000 --- a/www/extras/wobject/EventManagementSystem/script/button.js +++ /dev/null @@ -1,158 +0,0 @@ -/******************************************************************************************** -* BlueShoes Framework; This file is part of the php application framework. -* NOTE: This code is stripped (obfuscated). To get the clean documented code goto -* www.blueshoes.org and register for the free open source *DEVELOPER* version or -* buy the commercial version. -* -* In case you've already got the developer version, then this is one of the few -* packages/classes that is only available to *PAYING* customers. -* To get it go to www.blueshoes.org and buy a commercial version. -* -* @copyright www.blueshoes.org -* @author Samuel Blume -* @author Andrej Arn -*/ -if (!Bs_Objects) {var Bs_Objects = [];};function Bs_Button() { -this._id;this._objectId;this.id;this.group;this._status = 1;this.inactiveStyle = 3;this._imgPathDefault = '/_bsImages/buttons/';this.imgPath;this.imgName;this.height;this.width;this.backgroundColor;this.title;this.caption;this.action;this.cssClassDefault = 'bsBtnDefault';this.cssClassMouseOver = 'bsBtnMouseOver';this.cssClassMouseDown = 'bsBtnMouseDown';this._buttonBar;this.actualizeFromChildren = 0;this._childrenButtonBar;this._isDragAction;this._attachedEvents = new Array;this._constructor = function() { -this._id = Bs_Objects.length;Bs_Objects[this._id] = this;this._objectId = "Bs_Button_"+this._id;} -this.attachEvent = function(fire, e) { -if (typeof(e) == 'undefined') e = 'on';if (typeof(this._attachedEvents[e]) == 'undefined') this._attachedEvents[e] = new Array;this._attachedEvents[e][this._attachedEvents[e].length] = fire;} -this.attachFireOff = function(param) { -} -this.render = function() { -var isGecko = this._isGecko();var out = new Array;var containerStyle = new Array;out[out.length] = '
';var tagType = 'div';out[out.length] = '<' + tagType;out[out.length] = ' id="' + this._getId() + '"';if (typeof(this.title) != 'undefined') { -out[out.length] = ' title="' + this.title + '"';} -out[out.length] = ' unselectable="on"';captionType = typeof(this.caption);if (captionType != 'undefined') { -containerStyle[containerStyle.length] = 'width:auto';} else { -if (typeof(this.width) != 'undefined') containerStyle[containerStyle.length] = 'width:' + this.width + 'px';if (typeof(this.height) != 'undefined') containerStyle[containerStyle.length] = 'height:' + this.height + 'px';} -if (typeof(this.backgroundColor) != 'undefined') containerStyle[containerStyle.length] = 'background-color:' + this.backgroundColor;switch (this._status) { -case 0: -var filter = this._getInactiveStyleFilter();if (typeof(filter) == 'string') { -containerStyle[containerStyle.length] = 'filter:' + filter;} -case 1: -out[out.length] = ' class="' + this.cssClassDefault + '"';break;case 2: -out[out.length] = ' class="' + this.cssClassMouseDown + '"';break;} -out[out.length] = ' style="' + containerStyle.join(';') + '"';out[out.length] = ' onMouseOver="Bs_Objects['+this._id+'].mouseOver(this);"';out[out.length] = ' onMouseOut="Bs_Objects['+this._id+'].mouseOut(this);"';out[out.length] = ' onMouseDown="Bs_Objects['+this._id+'].mouseDown(this);"';out[out.length] = ' onMouseUp="Bs_Objects['+this._id+'].mouseUp(this);"';out[out.length] = '>';if (typeof(this.imgName) != 'undefined') { -var imgFullPath = '';imgFullPath += this._getImgPath();imgFullPath += this.imgName;if (this.imgName.substr(this.imgName.length -4) != '.gif') imgFullPath += '.gif';out[out.length] = ' 18)) out[out.length] = ' style="vertical-align:top;"';out[out.length] = '>';} -captionType = typeof(this.caption);if (captionType != 'undefined') { -if (captionType == 'string') { -out[out.length] = this.caption;} else { -out[out.length] = this.title;} -if (!isGecko) out[out.length] = ' ';} -if ((typeof(this._childrenButtonBar) != 'undefined') && (this.numberOfAttachedEvents('on') == 0)) { -this.group = this._objectId + '_pseudoGroup';var imgFullPath = '';if (this.imgPath) imgFullPath += this._getImgPath();imgFullPath += 'small_black_arrow_down.gif';out[out.length] = '  ';var subBarString = this._childrenButtonBar.render();subBarString = '';out[out.length] = subBarString;} -out[out.length] = '';out[out.length] = '
';return out.join('');} -this.drawOut = function() { -document.writeln(this.render());} -this.drawInto = function(elm) { -if (typeof(elm) == 'string') { -elm = document.getElementById(elm);} -if (elm != null) { -var x = this.render(); //x = x.replace(//, ''); - //x = x.replace(/<\/nobr>/, ''); - x = x.replace(//, ''); - x = x.replace(/<\/nobr>/, '<\/span>'); -elm.innerHTML = x;} -} -this.mouseOver = function(div) { -if (this._status == 2) return;if (this._status == 0) return;if (!this._isGecko()) { -div.className = this.cssClassMouseOver;} -this._fireEvent('over');} -this.mouseOut = function(div) { -if (this._status == 2) return;if (this._status == 0) return;if (!this._isGecko()) { -div.className = this.cssClassDefault;} -this._fireEvent('out');} -this.mouseDown = function(div) { -if (this._status == 0) return;this._isDragAction = false;div.className = this.cssClassMouseDown;} -this.mouseUp = function(div) { -if (this._status == 0) return;var doFireOn = true;var doFireOff = false;if (this._isGecko()) { -div.className = this.cssClassDefault;} else { -div.className = this.cssClassMouseOver;} -if (typeof(this.group) != 'undefined') { -if (this._status == 2) { -this._status = 1;doFireOn = false;doFireOff = true;} else { -div.className = this.cssClassMouseDown;this._status = 2;this._deactivateOtherGroupButtons();} -} -if (this._isDragAction) doFireOn = false;if (doFireOn) { -this._fireEvent('on');} else if (doFireOff) { -this._fireEvent('off');} -} -this.dragStart = function(div) { -if (this._status == 0) return false;this._isDragAction = true;div.className = this.cssClassMouseOver;return false;} -this._deactivateOtherGroupButtons = function() { -if (typeof(this._buttonBar) == 'undefined') return;for (var i=0; i -* @author Andrej Arn -*/ -if (!Bs_Objects) {var Bs_Objects = [];}; - -function Bs_ButtonBar() { - this._id; - this._objectId; - this.imgPath = '/_bsImages/buttons/'; - this.useHelpBar; - this.alignment = 'hor'; - this.ignoreEvents = false; - this.helpBarStyle = "font-family:arial; font-size:11px; height:16px;"; - this._buttons = new Array; - this._parentButton; - this._constructor = function() { - this._id = Bs_Objects.length; - Bs_Objects[this._id] = this; - this._objectId = "Bs_ButtonBar_"+this._id; - } - - this.addButton = function(btn, helpBarText) { - btn._buttonBar = this; - this._buttons[this._buttons.length] = new Array(btn, helpBarText); - } - - this.newGroup = function() { - this._buttons[this._buttons.length] = '|'; - } - - this.render = function() { - var out = new Array; - if (this._isGecko()) { - out[out.length] = '
'; - } else { - out[out.length] = '
'; - } - out[out.length] = '
'; - for (var i=0; i'; - } else { - var btn = this._buttons[i][0]; - var helpBarDiv = false; - if (typeof(this.useHelpBar) == 'string') { - var helpBarDiv = this.useHelpBar; - } else if (this.useHelpBar) { - var helpBarDiv = this._objectId + '_helpBarDiv'; - } - if (helpBarDiv != false) { - btn.attachEvent("document.getElementById('" + helpBarDiv + "').innerHTML = \"" + this._buttons[i][1] + "\";", 'over'); - btn.attachEvent("document.getElementById('" + helpBarDiv + "').innerHTML = \"\";", 'out'); - } - out[out.length] = btn.render(); - } - if (this.alignment != 'hor') { - out[out.length] = '
'; - } - } - out[out.length] = '
'; - if (this.useHelpBar) { - if (this.useHelpBar == 2) { - out[out.length] = '
'; - out[out.length] = ' '; - out[out.length] = '
'; - } else if (this.useHelpBar == true) { - out[out.length] = '
'; - } - } - out[out.length] = '
'; - return out.join(''); - } -this.drawOut = function() { -document.writeln(this.render());} -this.drawInto = function(elm) { -if (typeof(elm) == 'string') { -elm = document.getElementById(elm);} -if (elm) { -elm.innerHTML = this.render();} -} -this._isGecko = function() { -if (navigator.appName == "Microsoft Internet Explorer") return false; var x = navigator.userAgent.match(/gecko/i); -return (x);return false;} -this._constructor();} diff --git a/www/extras/wobject/EventManagementSystem/script/dynamicForms.js b/www/extras/wobject/EventManagementSystem/script/dynamicForms.js deleted file mode 100644 index 65ebc9f0e..000000000 --- a/www/extras/wobject/EventManagementSystem/script/dynamicForms.js +++ /dev/null @@ -1,230 +0,0 @@ -var textCompareList = { - "eq":"equals", - "like":"contains", - "ne":"is not", - "notlike":"not like", - "starts":"starts with", - "ends":"ends with" - }; - -var numericCompareList = { - "eq":"=", - "ne":"is not", - "gt":">", - "lt":"<", - "gte":">=", - "lte":"<=" - }; -var booleanCompareList = { - "eq":"is", - "ne":"is not" - }; -function addField() { - var tb = document.getElementById('filterbody'); - filterCount++; - - var newtr = document.createElement('tr'); - newtr.setAttribute("id","cfilter_id"+filterCount); - //Create right table data - var newtd1 = document.createElement('td'); - newtd1.className="searchDisplay"; - //Add fields to choose from - var newDD = newtd1.appendChild(addFilterSelect()); - - //Create left table data - var newtd2 = document.createElement('td'); - newtd2.className="searchDisplay"; - newtd2.setAttribute("id","cfilter_td_"+filterCount); - //Add default compare select list - var compareSelect = addSelectList('cfilter_c'+filterCount,textCompareList); - compareSelect.className="compare-select"; - newtd2.appendChild(compareSelect); - //Add default filter field - var filterText = addTextField('cfilter_t'+filterCount); - filterText.className="filter-text"; - newtd2.appendChild(filterText); - //Add remove button - var filterButton = addButton('cbutton_'+filterCount,'-'); - filterButton.className="button"; - filterButton.onclick = removeField; - newtd2.appendChild(filterButton); - //Add tds to trs - newtr.appendChild(newtd1); - newtr.appendChild(newtd2); - //Add trs to tbody - tb.appendChild(newtr); - return newDD; -} - - -function getTarget(e) { - var targ; - if (!e) var e = window.event; - if (e.target) targ = e.target; - else if (e.srcElement) targ = e.srcElement; - if (targ.nodeType == 3) // defeat Safari bug - targ = targ.parentNode; - return targ -} - -function getFilterId(button) { - if(button == null) return; - var name = button.name; - var strs = name.split("_"); - var end = strs[1]; - if(isNaN(end)) { - end = end.substring(1,end.length); - } - return end; -} - -function removeField (event) { - var button = getTarget(event); - var filterId = getFilterId(button); - var idName = "cfilter_id"+filterId; - removeElement('filterbody',idName); -} - -function changeField (event) { - var button = getTarget(event); - var filterId = getFilterId(button); - var idName = 'cfilter_s'+filterId+'_id'; - var sel = document.getElementById(idName); - - var field = sel.options[sel.selectedIndex].value; - changeToType(field,filterId); -} - -function changeToType(field,filterId) { - var fieldType = filterList[field]["type"]; - var fieldCompare = filterList[field]["compare"]; - var tr = document.getElementById("cfilter_id"+filterId); - var td = document.getElementById("cfilter_td_"+filterId); - //Remove old td - tr.removeChild(td); - //Create new td - var newtd = document.createElement('td'); - newtd.className="searchDisplay"; - newtd.setAttribute("id","cfilter_td_"+filterId); - - //Add default compare select list - var arr; - if(fieldCompare == "text") { - arr = textCompareList; - } else if(fieldCompare == "numeric") { - arr = numericCompareList; - } else if(fieldCompare == "boolean") { - arr = booleanCompareList; - } - var compareSelect = addSelectList('cfilter_c'+filterId,arr); - compareSelect.className="compare-select"; - newtd.appendChild(compareSelect); - - var filterFieldName = 'cfilter_t'+filterId; - - if(fieldType == "text") { - var filterField = addTextField(filterFieldName); - filterField.className="filter-text"; - newtd.appendChild(filterField); - } else if(fieldType == "select") { - var filterField = addSelectList(filterFieldName,filterList[field]["list"]); - filterField.className="filter-text"; - newtd.appendChild(filterField); - } else if(fieldType == "date") { - var filterField = addTextField(filterFieldName); - //filterField.setAttribute("id",dateFieldId); - filterField.className="filter-text"; - newtd.appendChild(filterField); - } else if(fieldType == "dateTime") { - var filterField = addTextField(filterFieldName); - //filterField.setAttribute("id",dateFieldId); - filterField.className="filter-text"; - newtd.appendChild(filterField); - } - - //Add remove button - var filterButton = addButton('cbutton_'+filterId,'-'); - filterButton.className="button"; - filterButton.onclick = removeField; - newtd.appendChild(filterButton); - - //Add new td to tr - tr.appendChild(newtd); - if(fieldType == "date") { - var dateFieldId = filterFieldName+"_id"; - Calendar.setup({ - "inputField":dateFieldId, - "ifFormat": "%Y-%m-%d", - "showsTime": false, - "timeFormat": "12", - "mondayFirst": false - }); - } - if(fieldType == "dateTime") { - var dateFieldId = filterFieldName+"_id"; - Calendar.setup({ - "inputField":dateFieldId, - "ifFormat": "%Y-%m-%d %H:%M:%S", - "showsTime": true, - "step": 1, - "timeFormat": "12", - "mondayFirst": false - }); - } -} - - - -function addFilterSelect() { - var sel = document.createElement("select"); - sel.setAttribute('name','cfilter_s'+filterCount); - sel.setAttribute('id','cfilter_s'+filterCount+'_id'); - sel.className="filter-select"; - sel.onchange=changeField; - //one way to write a function... you have to write it yourself! - //myOnChange = new Function("e", "location.href=myselect.options[myselect.selectedIndex].value"); - //first option - for (var word in filterList) { - //listString += items[word] + ", "; - var opt = document.createElement("option"); - opt.setAttribute("value",word); - opt.appendChild(document.createTextNode(filterList[word]["name"])); - sel.appendChild(opt); - } - return sel; -} - -function addSelectList(fieldName,array) { - var sel = document.createElement("select"); - sel.setAttribute('name',fieldName); - sel.setAttribute("id",fieldName+"_id"); - for (var word in array) { - var opt = document.createElement("option"); - opt.setAttribute("value",word); - opt.appendChild(document.createTextNode(array[word])); - sel.appendChild(opt); - } - return sel; -} - -function addTextField(fieldName) { - var text = document.createElement("input"); - text.setAttribute('type','text'); - text.setAttribute('name',fieldName); - text.setAttribute("id",fieldName+"_id"); - return text; -} - -function addButton(name,value) { - var button = document.createElement('input'); - button.setAttribute('type','button'); - button.setAttribute('value',value); - button.setAttribute('name',name); - return button; -} - -function removeElement(parent,child) { - var p = document.getElementById(parent); - var c = document.getElementById(child); - p.removeChild(c); -} diff --git a/www/extras/wobject/EventManagementSystem/script/jsdomenu.js b/www/extras/wobject/EventManagementSystem/script/jsdomenu.js deleted file mode 100644 index dc9431018..000000000 --- a/www/extras/wobject/EventManagementSystem/script/jsdomenu.js +++ /dev/null @@ -1,1243 +0,0 @@ -/* - - jsDOMenu Version 1.3.1 - Copyright (C) 2003 - 2005 Toh Zhiqiang - Released on 12 February 2005 - jsDOMenu is distributed under the terms of the GNU GPL license - Refer to license.txt for more informatiom - -*/ - -/* -Determine whether the browser is IE5.0. -*/ -function isIE50() { // Private method - return isIE5() && !isIE55(); -} - -/* -Determine whether the browser is IE5.5. -*/ -function isIE55() { // Private method - return navigator.userAgent.indexOf("MSIE 5.5") > -1; -} - -/* -Determine whether the browser is IE5.0 or IE5.5. -*/ -function isIE5() { // Private method - return navigator.userAgent.indexOf("MSIE 5") > -1; -} - -/* -Determine whether the browser is IE6. -*/ -function isIE6() { // Private method - return navigator.userAgent.indexOf("MSIE 6") > -1 && navigator.userAgent.indexOf("Opera") == -1; -} - -/* -Determine whether the browser is IE. -*/ -function isIE() { // Private method - return isIE5() || isIE6(); -} - -/* -Determine whether the browser is Opera. -*/ -function isOpera() { // Private method - return navigator.userAgent.indexOf("Opera") > -1; -} - -/* -Determine whether the browser is Safari. -*/ -function isSafari() { // Private method - return navigator.userAgent.indexOf("Safari") > -1; -} - -/* -Determine if is konqueror -*/ -function isKonqueror() { // Private method - return navigator.userAgent.indexOf("Konqueror") > -1; -} - - -/* -Determine the page render mode. - -0: Quirks mode. -1: Strict mode. -*/ -function getPageMode() { // Private method - if (document.compatMode) { - switch (document.compatMode) { - case "BackCompat": - return 0; - case "CSS1Compat": - return 1; - case "QuirksMode": - return 0; - } - } - else { - if (ie5) { - return 0; - } - if (safari) { - return 1; - } - } - return 0; -} - -/* -Alias for document.getElementById(). -*/ -function getElmId(id) { // Private method - return document.getElementById(id); -} - -/* -Alias for document.createElement(). -*/ -function createElm(tagName) { // Private method - return document.createElement(tagName); -} - -/* -Get the x-coordinate of the cursor position relative to the window. -*/ -function getX(e) { // Private method - if (!e) { - var e = window.event; - } - if (safari) { - return e.clientX - getScrollLeft(); - } - else { - return e.clientX; - } -} - -/* -Get the y-coordinate of the cursor position relative to the window. -*/ -function getY(e) { // Private method - if (!e) { - var e = window.event; - } - if (safari) { - return e.clientY - getScrollTop(); - } - else { - return e.clientY; - } -} - -/* -Get the scrollLeft property. -*/ -function getScrollLeft() { // Private method - switch (pageMode) { - case 0: - return document.body.scrollLeft; - case 1: - if (document.documentElement && document.documentElement.scrollLeft > 0) { - return document.documentElement.scrollLeft; - } - else { - return document.body.scrollLeft; - } - } -} - -/* -Get the scrollTop property. -*/ -function getScrollTop() { // Private method - switch (pageMode) { - case 0: - return document.body.scrollTop; - case 1: - if (document.documentElement && document.documentElement.scrollTop > 0) { - return document.documentElement.scrollTop; - } - else { - return document.body.scrollTop; - } - } -} - -/* -Get the clientHeight property. -*/ -function getClientHeight() { // Private method - switch (pageMode) { - case 0: - return document.body.clientHeight; - case 1: - if (safari) { - return self.innerHeight; - } - else { - if (!opera && document.documentElement && document.documentElement.clientHeight > 0) { - return document.documentElement.clientHeight; - } - else { - return document.body.clientHeight; - } - } - } -} - -/* -Get the clientWidth property. -*/ -function getClientWidth() { // Private method - switch (pageMode) { - case 0: - return document.body.clientWidth; - case 1: - if (safari) { - return self.innerWidth; - } - else { - if (!opera && document.documentElement && document.documentElement.clientWidth > 0) { - return document.documentElement.clientWidth; - } - else { - return document.body.clientWidth; - } - } - } -} - -/* -Convert the string into lower camel case. -*/ -function toCamelCase(input) { // Private method - var inputArray = input.split("-"); - if (inputArray.length == 1) { - return inputArray[0]; - } - else { - var camelCase = inputArray[0]; - for (var i = 1, len = inputArray.length; i < len; i++) { - camelCase += inputArray[i].charAt(0).toUpperCase() + inputArray[i].substring(1); - } - return camelCase; - } -} - -/* -Get the value of the property of the object. -*/ -function getPropVal(obj, propertyName) { // Private method - var propertyValue = obj.style[toCamelCase(propertyName)]; - if (propertyValue) { - return propertyValue; - } - else { - if (document.defaultView && document.defaultView.getComputedStyle) { - return document.defaultView.getComputedStyle(obj, null).getPropertyValue(propertyName); - } - else { - if (obj.currentStyle) { - return obj.currentStyle[toCamelCase(propertyName)]; - } - else { - return null; - } - } - } -} - -/* -Get the integer value of the property of the object. -*/ -function getPropIntVal(obj, propertyName) { // Private method - return parseInt(getPropVal(obj, propertyName)); -} - -/* -Get the left position of the pop-up menu. -*/ -function getMainMenuLeftPos(menuObj, x) { // Private method - if (x + menuObj.offsetWidth <= getClientWidth()) { - return x; - } - else { - return x - menuObj.offsetWidth; - } -} - -/* -Get the top position of the pop-up menu. -*/ -function getMainMenuTopPos(menuObj, y) { // Private method - if (y + menuObj.offsetHeight <= getClientHeight()) { - return y; - } - else { - return y - menuObj.offsetHeight; - } -} - -/* -Get the left position of the submenu. -*/ -function getSubMenuLeftPos(menuObj, x, offset) { // Private method - if (x + menuObj.offsetWidth - 2 <= getClientWidth()) { - return x - 2; - } - else { - return x - menuObj.offsetWidth - offset; - } -} - -/* -Get the top position of the submenu. -*/ -function getSubMenuTopPos(menuObj, y, offset) { // Private method - var top = getPropIntVal(menuObj, btw); - var bottom = getPropIntVal(menuObj, bbw); - if (y + menuObj.offsetHeight <= getClientHeight()) { - if (safari) { - return y - top; - } - else { - return y; - } - } - else { - if (safari) { - return y - menuObj.offsetHeight + offset + bottom; - } - else { - return y - menuObj.offsetHeight + offset + top + bottom; - } - } -} - -/* -Pop up the submenu. -*/ -function popUpSubMenu(menuItemObj) { // Private method - var parentMenuObj = menuItemObj.parent.menuObj; - var menuObj = menuItemObj.subMenu.menuObj; - var x; - var y; - if (parentMenuObj.style.position == "fixed") { - x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, brw); - y = parentMenuObj.offsetTop + menuItemObj.offsetTop + getPropIntVal(parentMenuObj, btw) - getPropIntVal(menuObj, btw); - menuObj.style.position = "absolute"; - menuObj.style.left = getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + px; - menuObj.style.top = getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + px; - menuObj.style.position = "fixed"; - } - else { - if (parentMenuObj.mode == "static" && !ie50) { - x = menuItemObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, blw) - getPropIntVal(parentMenuObj, brw) - getScrollLeft(); - y = menuItemObj.offsetTop - getPropIntVal(menuObj, btw) - getScrollTop(); - if (ie55 || ie6) { - x += getPropIntVal(parentMenuObj, blw); - y += getPropIntVal(parentMenuObj, btw); - } - if (safari) { - x += 8; - y += getPropIntVal(menuObj, btw) + 13; - } - menuObj.style.left = (getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + getScrollLeft()) + px; - menuObj.style.top = (getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + getScrollTop()) + px; - } - else { - x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, brw) - getScrollLeft(); - y = parentMenuObj.offsetTop + menuItemObj.offsetTop + getPropIntVal(parentMenuObj, btw) - getPropIntVal(menuObj, btw) - getScrollTop(); - menuObj.style.left = (getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + getScrollLeft()) + px; - menuObj.style.top = (getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + getScrollTop()) + px; - } - } - if (ie && menuObj.mode == "fixed") { - menuObj.initialLeft = parseInt(menuObj.style.left) - getScrollLeft(); - menuObj.initialTop = parseInt(menuObj.style.top) - getScrollTop(); - } - menuObj.style.visibility = "visible"; -} - -/* -Pop up the main menu. -*/ -function popUpMainMenu(menuObj, e) { // Private method - menuObj.style.left = (getMainMenuLeftPos(menuObj, getX(e)) + getScrollLeft()) + px; - menuObj.style.top = (getMainMenuTopPos(menuObj, getY(e)) + getScrollTop()) + px; - var display = popUpMenuObj.menuObj.style.display; - popUpMenuObj.menuObj.style.display = "none"; - popUpMenuObj.menuObj.style.visibility = "visible"; - popUpMenuObj.menuObj.style.display = display; -} - -/* -Refresh the menu items. -*/ -function refreshMenuItems(menuObj) { // Private method - for (var i = 0, len = menuObj.childNodes.length; i < len; i++) { - if (menuObj.childNodes[i].enabled) { - menuObj.childNodes[i].className = menuObj.childNodes[i].itemClassName; - if (menuObj.childNodes[i].subMenu) { - menuObj.childNodes[i].arrowObj.className = menuObj.childNodes[i].arrowClassName; - } - if (menuObj.childNodes[i].iconObj) { - menuObj.childNodes[i].iconObj.className = menuObj.childNodes[i].iconClassName; - } - } - } -} - -/* -Event handler that handles onmouseover event of the menu item. -*/ -function menuItemOver(e) { // Private method - var previousItem = this.parent.previousItem; - if (previousItem) { - if (previousItem.className == previousItem.itemClassNameOver) { - previousItem.className = previousItem.itemClassName; - } - if (previousItem.subMenu) { - previousItem.className = previousItem.itemClassName; - previousItem.arrowObj.className = previousItem.arrowClassName; - if (previousItem.iconObj) { - previousItem.iconObj.className = previousItem.iconClassName; - } - } - var menuObj = getElmId(this.parent.menuObj.id); - for (var i = 0, len = menuObj.childNodes.length; i < len; i++) { - if (menuObj.childNodes[i].enabled && menuObj.childNodes[i].subMenu) { - hideMenus(menuObj.childNodes[i].subMenu.menuObj); - } - } - } - if (this.enabled) { - this.className = this.itemClassNameOver; - if (this.subMenu) { - this.arrowObj.className = this.arrowClassNameOver; - popUpSubMenu(this); - } - if (this.iconObj && this.iconClassNameOver) { - this.iconObj.className = this.iconClassNameOver; - } - } - this.parent.previousItem = this; -} - -/* -Event handler that handles onclick event of the menu item. -*/ -function menuItemClick(e) { // Private method - if (this.enabled && this.actionOnClick) { - var action = this.actionOnClick; - if (action.indexOf("link:") == 0) { - location.href = action.substr(5); - } - else { - if (action.indexOf("code:") == 0) { - eval(action.substr(5)); - } - else { - location.href = action; - } - } - } - if (!e) { - var e = window.event; - e.cancelBubble = true; - } - if (e.stopPropagation) { - e.stopPropagation(); - } - if (this.parent.menuObj.mode == "cursor") { - hideCursorMenus(); - } - if (this.parent.menuObj.mode == "absolute" || this.parent.menuObj.mode == "fixed") { - hideVisibleMenus(); - if (typeof(hideMenuBarMenus) == "function") { - hideMenuBarMenus(); - } - } -} - -/* -Event handler that handles onmouseout event of the menu item. -*/ -function menuItemOut() { // Private method - if (this.enabled) { - if (!(this.subMenu && this.subMenu.menuObj.style.visibility == "visible")) { - this.className = this.itemClassName; - } - if (this.subMenu) { - if (this.subMenu.menuObj.style.visibility == "visible") { - this.arrowObj.className = this.arrowClassNameOver; - if (this.iconObj) { - this.iconObj.className = this.iconClassNameOver; - } - } - } - else { - if (this.iconObj) { - this.iconObj.className = this.iconClassName; - } - } - } -} - -/* -Determine whether any of the tag name/tag id pair in the filter matches the tagName/tagId pair. -*/ -function findMatch(tagName, tagId, filter) { // Private method - for (var i = 0, len = filter.length; i < len; i++) { - var filterArray = filter[i].toLowerCase().split("."); - if ((filterArray[0] == "*" && filterArray[1] == "*") || - (filterArray[0] == "*" && filterArray[1] == tagId) || - (filterArray[0] == tagName && filterArray[1] == "*") || - (filterArray[0] == tagName && filterArray[1] == tagId)) { - return true; - } - } - return false; -} - -/* -Determine whether to show or hide the menu. -*/ -function canShowMenu(tagName, tagId, allExcept, noneExcept) { // Private method - if (allExcept.length > 0) { - return (!findMatch(tagName.toLowerCase(), tagId.toLowerCase(), allExcept)); - } - else { - if (noneExcept.length > 0) { - return findMatch(tagName.toLowerCase(), tagId.toLowerCase(), noneExcept); - } - else { - return true; - } - } -} - -/* -Shows/Hides the pop-up menu. -*/ -function activatePopUpMenu(e) { // Private method - if (!popUpMenuObj) { - return; - } - var state = popUpMenuObj.menuObj.style.visibility; - if (state == "visible") { - for (var i = 1; i <= menuCount; i++) { - var menuObj = getElmId("DOMenu" + i); - if (menuObj.mode == "cursor") { - menuObj.style.visibility = "hidden"; - menuObj.style.left = "0px"; - menuObj.style.top = "0px"; - menuObj.initialLeft = 0; - menuObj.initialTop = 0; - refreshMenuItems(menuObj); - } - } - } - else { - if (!e) { - var e = window.event; - } - setPopUpMenu(getPopUpMenuObj(e));if (popUpMenuObj==null) return;//DAMIANO - var targetElm = (e.target) ? e.target : e.srcElement; - if (targetElm.nodeType == 3) { - targetElm = targetElm.parentNode; - } - if (canShowMenu(targetElm.tagName, targetElm.id, popUpMenuObj.menuObj.allExceptFilter, popUpMenuObj.menuObj.noneExceptFilter)) { - popUpMainMenu(popUpMenuObj.menuObj, e); - } - } -} - -/* -Event handler that handles left click event. -*/ -function leftClickHandler(e) { // Private method - if (getX(e) > getClientWidth() || getY(e) > getClientHeight()) { - return; - } - if (!e) { - var e = window.event; - } - if (e.button && e.button == 2) { - return; - } - hideVisibleMenus(); - if (typeof(hideMenuBarMenus) == "function") { - hideMenuBarMenus(); - } - if (popUpMenuObj==null) setPopUpMenu(getPopUpMenuObj(e));//DAMIANO - if (popUpMenuObj) { - var state = popUpMenuObj.menuObj.style.visibility; - if (state == "visible" && (hideValue == 0 || hideValue == 2)) { - activatePopUpMenu(e); - } - if ((state == "hidden" || state == "") && (showValue == 0 || showValue == 2)) { - activatePopUpMenu(e); - } - } -} - -/* -Event handler that handles right click event. -*/ -function rightClickHandler(e) { // Private method - - if (getX(e) > getClientWidth() || getY(e) > getClientHeight()) { - return; - } - hideVisibleMenus(); - if (typeof(hideMenuBarMenus) == "function") { - hideMenuBarMenus(); - } - - if (!e) { - var e = window.event; - } - if (popUpMenuObj==null) setPopUpMenu(getPopUpMenuObj(e)); //DAMIANO - if (popUpMenuObj) { - var state = popUpMenuObj.menuObj.style.visibility; - if (state == "visible" && (hideValue == 1 || hideValue == 2)) { - activatePopUpMenu(e); - return false; - } - if ((state == "hidden" || state == "") && (showValue == 1 || showValue == 2)) { - activatePopUpMenu(e); - return false; - } - } -} - -/* -Event handler that handles scroll event. -*/ -function scrollHandler() { // Private method - for (var i = 1; i <= menuCount; i++) { - var menuObj = getElmId("DOMenu" + i); - if (ie && menuObj.mode == "fixed") { - menuObj.style.left = (menuObj.initialLeft + getScrollLeft()) + px; - menuObj.style.top = (menuObj.initialTop + getScrollTop()) + px; - } - } - if (typeof(menuBarScrollHandler) == "function") { - menuBarScrollHandler(); - } -} - -/* -Show the icon before the display text. -Arguments: -className : Required. String that specifies the CSS class selector for the icon. -classNameOver : Optional. String that specifies the CSS class selector for the icon when - the cursor is over the menu item. -*/ -function showMenuItemIcon() { // Public method - var iconElm = createElm("span"); - iconElm.id = this.id + "Icon"; - iconElm.className = arguments[0]; - this.insertBefore(iconElm, this.firstChild); - var height; - if (ie) { - height = getPropIntVal(iconElm, "height"); - } - else { - height = iconElm.offsetHeight; - } - iconElm.style.top = Math.floor((this.offsetHeight - height) / 2) + px; - if (ie) { - var left = getPropIntVal(iconElm, "left"); - if (ie55 || ie6) { - iconElm.style.left = (left - getPropIntVal(this, "padding-left")) + px; - } - else { - iconElm.style.left = left + px; - } - } - this.iconClassName = iconElm.className; - if (arguments.length > 1 && arguments[1].length > 0) { - this.iconClassNameOver = arguments[1]; - } - this.iconObj = iconElm; - this.setIconClassName = function(className) { // Public method - this.iconClassName = className; - this.iconObj.className = this.iconClassName; - }; - this.setIconClassNameOver = function(classNameOver) { // Public method - this.iconClassNameOver = classNameOver; - }; -} - -/* -Set the menu object that will show up when the cursor is over the menu item object. -Argument: -menuObj : Required. Menu object that will show up when the cursor is over the - menu item object. -*/ -function setSubMenu(menuObj) { // Public method - var arrowElm = createElm("div"); - arrowElm.id = this.id + "Arrow"; - arrowElm.className = this.arrowClassName; - this.appendChild(arrowElm); - var height; - if (ie) { - height = getPropIntVal(arrowElm, "height"); - } - else { - height = arrowElm.offsetHeight; - } - arrowElm.style.top = Math.floor((this.offsetHeight - height) / 2) + px; - this.subMenu = menuObj; - this.arrowObj = arrowElm; - this.setArrowClassName = function(className) { // Public method - this.arrowClassName = className; - this.arrowObj.className = this.arrowClassName; - }; - this.setArrowClassNameOver = function(classNameOver) { // Public method - this.arrowClassNameOver = classNameOver; - }; - menuObj.menuObj.style.zIndex = this.parent.menuObj.level + 1; - menuObj.menuObj.level = this.parent.menuObj.level + 1; -} - -/* -Add a new menu item to the menu. -Argument: -menuItemObj : Required. Menu item object that is going to be added to the menu object. -*/ -function addMenuItem(menuItemObj) { // Public method - if (menuItemObj.displayText == "-") { - var hrElm = createElm("hr"); - var itemElm = createElm("div"); - itemElm.appendChild(hrElm); - itemElm.id = menuItemObj.id; - if (menuItemObj.className.length > 0) { - itemElm.sepClassName = menuItemObj.className; - } - else { - itemElm.sepClassName = menuItemObj.sepClassName; - } - itemElm.className = itemElm.sepClassName; - this.menuObj.appendChild(itemElm); - itemElm.parent = this; - itemElm.setClassName = function(className) { // Public method - this.sepClassName = className; - this.className = this.sepClassName; - }; - itemElm.onclick = function(e) { // Private method - if (!e) { - var e = window.event; - e.cancelBubble = true; - } - if (e.stopPropagation) { - e.stopPropagation(); - } - }; - itemElm.onmouseover = menuItemOver; - if (menuItemObj.itemName.length > 0) { - this.items[menuItemObj.itemName] = itemElm; - } - else { - this.items[this.items.length] = itemElm; - } - } - else { - var itemElm = createElm("div"); - itemElm.id = menuItemObj.id; - itemElm.actionOnClick = menuItemObj.actionOnClick; - itemElm.enabled = menuItemObj.enabled; - itemElm.itemClassName = menuItemObj.className; - itemElm.itemClassNameOver = menuItemObj.classNameOver; - itemElm.className = itemElm.itemClassName; - itemElm.subMenu = null; - itemElm.arrowClassName = arrowClassName; - itemElm.arrowClassNameOver = arrowClassNameOver; - var textNode = document.createTextNode(menuItemObj.displayText); - itemElm.appendChild(textNode); - this.menuObj.appendChild(itemElm); - itemElm.parent = this; - itemElm.setClassName = function(className) { // Public method - this.itemClassName = className; - this.className = this.itemClassName; - }; - itemElm.setClassNameOver = function(classNameOver) { // Public method - this.itemClassNameOver = classNameOver; - }; - itemElm.setDisplayText = function(text) { // Public method - if (this.childNodes[0].nodeType == 3) { - this.childNodes[0].nodeValue = text; - } - else { - this.childNodes[1].nodeValue = text; - } - }; - itemElm.setSubMenu = setSubMenu; - itemElm.showIcon = showMenuItemIcon; - itemElm.onmouseover = menuItemOver; - itemElm.onclick = menuItemClick; - itemElm.onmouseout = menuItemOut; - if (menuItemObj.itemName.length > 0) { - this.items[menuItemObj.itemName] = itemElm; - } - else { - this.items[this.items.length] = itemElm; - } - } -} - -/* -Create a new menu item object. -Arguments: -displayText : Required. String that specifies the text to be displayed on the menu item. If - displayText = "-", a menu separator will be created instead. -itemName : Optional. String that specifies the name of the menu item. Defaults to "" (no - name). -actionOnClick : Optional. String that specifies the action to be done when the menu item is - being clicked. Defaults to "" (no action). -enabled : Optional. Boolean that specifies whether the menu item is enabled/disabled. - Defaults to true. -className : Optional. String that specifies the CSS class selector for the menu item. - Defaults to "jsdomenuitem". -classNameOver : Optional. String that specifies the CSS class selector for the menu item when - the cursor is over it. Defaults to "jsdomenuitemover". -*/ -function menuItem() { // Public method - this.displayText = arguments[0]; - - this.itemName = ""; - this.actionOnClick = ""; - this.enabled = true; - this.classNameOver = menuItemClassNameOver; - this.sepClassName = sepClassName; - var len = arguments.length; - if (len > 1 && arguments[1].length > 0) { - this.itemName = arguments[1]; - } - if (len > 2 && arguments[2].length > 0) { - this.actionOnClick = arguments[2]; - } - if (len > 3 && typeof(arguments[3]) == "boolean") { - this.enabled = arguments[3]; - } - if (len > 4 && arguments[4].length > 0) { - if (arguments[4] == "-") { - this.className = arguments[4]; - this.sepClassName = arguments[4]; - } - else { - this.className = arguments[4]; - } - } - if (len > 5 && arguments[5].length > 0) { - this.classNameOver = arguments[5]; - } - - if (this.displayText == "-") { - this.id = "menuSep" + (++sepCount); - this.className = sepClassName; - } - else { - this.id = "menuItem" + (++menuItemCount); - if (this.enabled) - this.className = menuItemClassName; - else - this.className = menuItemClassNameDisabled; - } -} - -/* -Create a new menu object. -Arguments: -width : Required. Integer that specifies the width of the menu. -mode : Optional. String that specifies the mode of the menu. Defaults to "cursor". -id : Optional, except when mode = "static". String that specifies the id of - the element that will contain the menu. This argument is required when - mode = "static". -alwaysVisible : Optional. Boolean that specifies whether the menu is always visible. Defaults - to false. -className : Optional. String that specifies the CSS class selector for the menu. Defaults - to "jsdomenudiv". -*/ -function jsDOMenu() { // Public method - this.items = new Array(); - var menuElm; - var len = arguments.length; - if (len > 2 && arguments[2].length > 0 && arguments[1] == "static") { - menuElm = getElmId(arguments[2]); - if (!menuElm) { - return; - } - staticMenuId[staticMenuId.length] = arguments[2]; - } - else { - menuElm = createElm("div"); - menuElm.id = "DOMenu" + (++menuCount); - } - menuElm.level = 10; - menuElm.previousItem = null; - menuElm.allExceptFilter = allExceptFilter; - menuElm.noneExceptFilter = noneExceptFilter; - menuElm.className = menuClassName; - menuElm.mode = menuMode; - menuElm.alwaysVisible = false; - menuElm.initialLeft = 0; - menuElm.initialTop = 0; - if (len > 1 && arguments[1].length > 0) { - switch (arguments[1]) { - case "cursor": - menuElm.style.position = "absolute"; - menuMode.mode = "cursor"; - break; - case "absolute": - menuElm.style.position = "absolute"; - menuElm.mode = "absolute"; - break; - case "fixed": - if (ie) { - menuElm.style.position = "absolute"; - } - else { - menuElm.style.position = "fixed"; - } - menuElm.mode = "fixed"; - break; - case "static": - menuElm.style.position = "static"; - menuElm.mode = "static"; - break; - } - } - if (len > 3 && typeof(arguments[3]) == "boolean") { - menuElm.alwaysVisible = arguments[3]; - } - if (len > 4 && arguments[4].length > 0) { - menuElm.className = arguments[4]; - } - menuElm.style.width = arguments[0] + px; - menuElm.style.left = "0px"; - menuElm.style.top = "0px"; - if (menuElm.mode != "static") { - document.body.appendChild(menuElm); - } - if (!getPropVal(menuElm, blw)) { - menuElm.style.borderWidth = menuBorderWidth + px; - } - this.menuObj = menuElm; - this.addMenuItem = addMenuItem; - this.setClassName = function(className) { // Public method - this.menuObj.className = className; - }; - this.setMode = function(mode) { // Public method - switch (mode) { - case "cursor": - this.menuObj.style.position = "absolute"; - this.menuObj.mode = "cursor"; - break; - case "absolute": - this.menuObj.style.position = "absolute"; - this.menuObj.mode = "absolute"; - this.menuObj.initialLeft = parseInt(this.menuObj.style.left); - this.menuObj.initialTop = parseInt(this.menuObj.style.top); - break; - case "fixed": - if (ie) { - this.menuObj.style.position = "absolute"; - this.menuObj.initialLeft = parseInt(this.menuObj.style.left); - this.menuObj.initialTop = parseInt(this.menuObj.style.top); - } - else { - this.menuObj.style.position = "fixed"; - } - this.menuObj.mode = "fixed"; - break; - } - }; - this.setAlwaysVisible = function(alwaysVisible) { // Public method - if (typeof(alwaysVisible) == "boolean") { - this.menuObj.alwaysVisible = alwaysVisible; - } - }; - this.show = function() { // Public method - this.menuObj.style.visibility = "visible"; - }; - this.hide = function() { // Public method - this.menuObj.style.visibility = "hidden"; - if (this.menuObj.mode == "cursor") { - this.menuObj.style.left = "0px"; - this.menuObj.style.top = "0px"; - this.menuObj.initialLeft = 0; - this.menuObj.initialTop = 0; - } - }; - this.setX = function(x) { // Public method - this.menuObj.initialLeft = x; - this.menuObj.style.left = x + px; - }; - this.setY = function(y) { // Public method - this.menuObj.initialTop = y; - this.menuObj.style.top = y + px; - }; - this.moveTo = function(x, y) { // Public method - this.menuObj.initialLeft = x; - this.menuObj.initialTop = y; - this.menuObj.style.left = x + px; - this.menuObj.style.top = y + px; - }; - this.moveBy = function(x, y) { // Public method - var left = parseInt(this.menuObj.style.left); - var top = parseInt(this.menuObj.style.top); - this.menuObj.initialLeft = left + x; - this.menuObj.initialTop = top + y; - this.menuObj.style.left = (left + x) + px; - this.menuObj.style.top = (top + y) + px; - }; - this.setAllExceptFilter = function(filter) { // Public method - this.menuObj.allExceptFilter = filter; - this.menuObj.noneExceptFilter = new Array(); - }; - this.setNoneExceptFilter = function(filter) { // Public method - this.menuObj.noneExceptFilter = filter; - this.menuObj.allExceptFilter = new Array(); - }; - this.setBorderWidth = function(width) { // Public method - this.menuObj.style.borderWidth = width + px; - }; -} - -/* -Specifies how the pop-up menu shows/hide. -Arguments: -showValue : Required. Integer that specifies how the menu shows. -hideValue : Optional. Integer that specifies how the menu hides. If not specified, the - menu shows/hides in the same manner. - -0: Shows/Hides the menu by left click only. -1: Shows/Hides the menu by right click only. -2: Shows/Hides the menu by left or right click. -*/ -function activatePopUpMenuBy() { // Public method - showValue = typeof(arguments[0]) == "number" && arguments[0] > -1 ? arguments[0] : 0; - if (arguments.length > 1) { - hideValue = typeof(arguments[1]) == "number" && arguments[1] > -1 ? arguments[1] : 0; - } - else { - hideValue = showValue; - } - if (showValue == 1 || showValue == 2 || hideValue == 1 || hideValue == 2) { - document.oncontextmenu = rightClickHandler; - } -} - -/* -Hide all menus, except those with alwaysVisible = true. -*/ -function hideAllMenus() { // Public method - for (var i = 1; i <= menuCount; i++) { - var menuObj = getElmId("DOMenu" + i); - if (!menuObj.alwaysVisible) { - if (menuObj.style.position == "fixed") { - menuObj.style.position == "absolute"; - menuObj.style.visibility = "hidden"; - menuObj.style.position == "fixed"; - } - else { - menuObj.style.visibility = "hidden"; - if (menuObj.mode == "cursor") { - menuObj.style.left = "0px"; - menuObj.style.top = "0px"; - menuObj.initialLeft = 0; - menuObj.initialTop = 0; - } - } - } - refreshMenuItems(menuObj); - } - for (var i = 0, len = staticMenuId.length; i < len; i++) { - refreshMenuItems(getElmId(staticMenuId[i])); - } -} - -/* -Hide all menus with mode = "cursor", except those with alwaysVisible = true. -*/ -function hideCursorMenus() { // Public method - for (var i = 1; i <= menuCount; i++) { - var menuObj = getElmId("DOMenu" + i); - if (menuObj.mode == "cursor" && !menuObj.alwaysVisible) { - menuObj.style.visibility = "hidden"; - menuObj.style.left = "0px"; - menuObj.style.top = "0px"; - menuObj.initialLeft = 0; - menuObj.initialTop = 0; - } - if (menuObj.mode == "cursor") { - refreshMenuItems(menuObj); - } - } -} - -/* -Hide all menus with mode = "absolute" or mode = "fixed" or mode = "static", except those with -alwaysVisible = true. -*/ -function hideVisibleMenus() { // Public method - for (var i = 1; i <= menuCount; i++) { - var menuObj = getElmId("DOMenu" + i); - if ((menuObj.mode == "absolute" || menuObj.mode == "fixed") && !menuObj.alwaysVisible) { - if (menuObj.style.position == "fixed") { - menuObj.style.position = "absolute"; - menuObj.style.visibility = "hidden"; - menuObj.style.position = "fixed"; - } - else { - menuObj.style.visibility = "hidden"; - menuObj.style.left = "0px"; - menuObj.style.top = "0px"; - menuObj.initialLeft = 0; - menuObj.initialTop = 0; - } - } - if (menuObj.mode == "absolute" || menuObj.mode == "fixed") { - refreshMenuItems(menuObj); - } - } - for (var i = 0, len = staticMenuId.length; i < len; i++) { - refreshMenuItems(getElmId(staticMenuId[i])); - } - if (typeof(staticMenuBarId) == "object") { - for (var i = 0, len = staticMenuBarId.length; i < len; i++) { - refreshMenuBarItems(getElmId(staticMenuBarId[i])); - } - } - hideVisibleCallback(); -} - -/* -Hide the menu and all its submenus. -Argument: -menuObj : Required. Menu object that specifies the menu and all its submenus to - be hidden. -*/ -function hideMenus(menuObj) { // Public method - refreshMenuItems(menuObj); - for (var i = 0, len = menuObj.childNodes.length; i < len; i++) { - if (menuObj.childNodes[i].enabled && menuObj.childNodes[i].subMenu) { - hideMenus(menuObj.childNodes[i].subMenu.menuObj); - } - } - if (menuObj.style.position == "fixed") { - menuObj.style.position = "absolute"; - menuObj.style.visibility = "hidden"; - menuObj.style.position = "fixed"; - } - else { - menuObj.style.visibility = "hidden"; - menuObj.style.left = "0px"; - menuObj.style.top = "0px"; - menuObj.initialLeft = 0; - menuObj.initialTop = 0; - } -} - -/* -Set the menu object to be the pop-up menu. -Argument: -menuObj : Required. Menu object that specifies the pop-up menu. -*/ -function setPopUpMenu(menuObj) { // Public method - popUpMenuObj = menuObj; -} - -/* -Check browser compatibility and create the menus. -*/ -function initjsDOMenu() { // Public method - if (document.createElement && document.getElementById) { - createjsDOMenu(); - } -} - -if (typeof(allExceptFilter) == "undefined") { - var allExceptFilter = new Array("A.*", - "BUTTON.*", - "IMG.*", - "INPUT.*", - "OBJECT.*", - "OPTION.*", - "SELECT.*", - "TEXTAREA.*"); // Public field -} - -if (typeof(noneExceptFilter) == "undefined") { - var noneExceptFilter = new Array(); // Public field -} - -if (typeof(menuClassName) == "undefined") { - var menuClassName = "jsdomenudiv"; // Public field -} - -if (typeof(menuItemClassName) == "undefined") { - var menuItemClassName = "jsdomenuitem"; // Public field -} - -if (typeof(menuItemClassNameDisabled) == "undefined") { - var menuItemClassNameDisabled = "jsdomenuitemdisabled"; // Public field -} - -if (typeof(menuItemClassNameOver) == "undefined") { - var menuItemClassNameOver = "jsdomenuitemover"; // Public field -} - -if (typeof(sepClassName) == "undefined") { - var sepClassName = "jsdomenusep"; // Public field -} - -if (typeof(arrowClassName) == "undefined") { - var arrowClassName = "jsdomenuarrow"; // Public field -} - -if (typeof(arrowClassNameOver) == "undefined") { - var arrowClassNameOver = "jsdomenuarrowover"; // Public field -} - -if (typeof(menuMode == "undefined")) { - var menuMode = "cursor"; // Public field -} - -if (typeof(menuBorderWidth) == "undefined") { - var menuBorderWidth = 2; // Public field -} - -var ie50 = isIE50(); // Private field -var ie55 = isIE55(); // Private field -var ie5 = isIE5(); // Private field -var ie6 = isIE6(); // Private field -var ie = isIE(); // Private field -var opera = isOpera(); // Private field -var safari = isSafari(); // Private field -var pageMode = getPageMode(); // Private field -var px = "px"; // Private field -var btw = "border-top-width"; // Private field -var bbw = "border-bottom-width"; // Private field -var blw = "border-left-width"; // Private field -var brw = "border-right-width"; // Private field -var menuCount = 0; // Private field -var menuItemCount = 0; // Private field -var sepCount = 0; // Private field -var popUpMenuObj = null; // Private field -var showValue = 0; // Private field -var hideValue = 0; // Private field -var staticMenuId = new Array(); // Private field -document.onclick = leftClickHandler; -window.onscroll = scrollHandler; diff --git a/www/extras/wobject/EventManagementSystem/script/locale_EN.js b/www/extras/wobject/EventManagementSystem/script/locale_EN.js deleted file mode 100644 index 946bd1dc1..000000000 --- a/www/extras/wobject/EventManagementSystem/script/locale_EN.js +++ /dev/null @@ -1,32 +0,0 @@ -/***************************************************************** - Page : locale_EN.js - Description : text for english version - Date : 20/04/05 - Authors:Alessandro Viganò (avigano@Movinfo.it) / Filippo Zanardo (fzanardo@MOViNFO.it) - Copyright (C) 2005-2006 MOViNFO - -MovTable is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -MovTable is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -******************************************************************/ - -var getTextStrings= new Array() -getTextStrings["Nascondi Colonna"]="Hide Column" -getTextStrings["Mostra Colonne"]="Show Columns" -getTextStrings["Tutte"]="All" -getTextStrings["Filtro in base a selezione"]="Filter by selection" -getTextStrings["Filtro ad esclusione selezione"]="Filter out selection" -getTextStrings["Rimuovi filtro"]="Remove Filter" -getTextStrings["Ordinamento crescente"]="Ascending Order" -getTextStrings["Ordinamento decrescente"]="Descending order" -getTextStrings["Copia"]="Copy" diff --git a/www/extras/wobject/EventManagementSystem/script/movtableInc.js b/www/extras/wobject/EventManagementSystem/script/movtableInc.js deleted file mode 100644 index ae595cac4..000000000 --- a/www/extras/wobject/EventManagementSystem/script/movtableInc.js +++ /dev/null @@ -1,1127 +0,0 @@ -/***************************************************************** - Page : movtableinc.js - Description : main javascript - Date : 20/04/05 - Authors:Alessandro Viganò (avigano@Movinfo.it) / Filippo Zanardo (fzanardo@MOViNFO.it) - Copyright (C) 2005-2006 MOViNFO - -MovTable is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public -modify it under the terms of the GNU General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -MovTable is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -******************************************************************/ - -var selectedText; -var selectedElem; -var targetElm; -var myTable; -var hiddenCols; -var activeHeaders= null; -var moveColumn=null; -var dragHeaderDiv=null; -var topElement=null; -var topElementByTag=null; -var originalOnSelect; -var eventProcessed=false; - -/** -* Initializing function, to be called on document onload -* -*/ -function sortableInit() -{ - initjsDOMenu(); - myTable=new table(tableClass); - document.onmousedown=mouseDown; -} - -/** -* Function called by jsDOMenu. It creates the dynamic context menus and it passes them back -* -*/ -function getPopUpMenuObj(e) -{ - - targetElm = (e.target) ? e.target : e.srcElement; - - if (targetElm.nodeType==3) //Text Node returned by Konqueror - targetElm=targetElm.parentNode; - if (targetElm.parentNode.tagName=='TH') targetElm=targetElm.parentNode; - - - if (targetElm.tagName=='TD' || targetElm.tagName=='TH') { - selectedText=selectElement(targetElm); - cursorMenu1 = new jsDOMenu(210); - var colID=getColID(targetElm); - //filterurl=baseurl+'&filterByIndexCol='+myTable.columns.getColByID(colID).index+"&filterByIndexRow="+ (getRow(targetElm)-1); - //removeFilter=baseurl+"&removefilter"; - //sorturl=baseurl+'&sortByIndexCol='+myTable.columns.getColByID(colID).index; - //alert(colID); - //alert(myTable.columns.getColByID(colID).id); - if (targetElm.tagName=='TH') { - - hiddenCols=myTable.columns.listInvisible(); - //Controlla se rimane visibile solo 1 colonna - if (JScolhide==1) - if ((myTable.columns.item.length-hiddenCols.length)==1) - cursorMenu1.addMenuItem(new menuItem("Hide Column", "", "",false)); - else - //cursorMenu1.addMenuItem(new menuItem("Nascondi Colonna", "", "code:myTable.columns.item["+getCellIndex(targetElm)+"].hideColumn()")); - cursorMenu1.addMenuItem(new menuItem("Hide Column", "", "code:myTable.columns.getColByID('"+colID+"').hideColumn()")); - - //Controlla se ci sono colonne nascoste - if (myTable.columns.hidden()) { - cursorMenu1.addMenuItem(new menuItem("Show Columns", "mColonne", "code:myTable.columns.listInvisible()")); - columnsMenu= new jsDOMenu(210); - - for (var x=0;x 1) { - columnsMenu.addMenuItem(new menuItem("-")); - columnsMenu.addMenuItem(new menuItem("All","","code:myTable.columns.show()")); - } - - cursorMenu1.items["mColonne"].setSubMenu(columnsMenu); - } - else - cursorMenu1.addMenuItem(new menuItem("Show Columns", "mColonne", "code:myTable.columns.listInvisible()",false)); - - //cursorMenu1.addMenuItem(new menuItem("Debug", "", "code:debug()")); - } - if (targetElm.tagName=='TD') { - var editUrl = ""; - var transferUrl = ""; - var terminateUrl = ""; - var tr = targetElm.parentNode; - var len=tr.childNodes.length; - var lastElem = tr.childNodes[len-1]; - var lastElemLen = lastElem.childNodes.length; - for (var i=0; i < lastElemLen; i++){ - var lastElemNode = lastElem.childNodes[i]; - if(lastElemNode.tagName == "A") { - if(lastElemNode.id.indexOf("edit") > -1) { - editUrl = lastElemNode.href; - }else if(lastElemNode.id.indexOf("transfer") > -1) { - transferUrl = lastElemNode.href; - }else if(lastElemNode.id.indexOf("terminate") > -1) { - terminateUrl = lastElemNode.href; - } - } - } - //alert(editUrl) - //alert(transferUrl); - //alert(terminateUrl); - - if (myTable.columns.getColByID(colID).filterable) - { - cursorMenu1.addMenuItem(new menuItem("Edit Employee", "", editUrl)); - cursorMenu1.addMenuItem(new menuItem("Transfer Employee", "", transferUrl)); - cursorMenu1.addMenuItem(new menuItem("Terminate Employee", "", terminateUrl)); - } - else - { - cursorMenu1.addMenuItem(new menuItem("Edit Employee", "", "",false)); - cursorMenu1.addMenuItem(new menuItem("Transfer Employee", "", "",false)); - cursorMenu1.addMenuItem(new menuItem("Terminate Employee", "", "",false)); - } - //if (filtered) - // cursorMenu1.addMenuItem(new menuItem(getText("Rimuovi filtro"), "", removeFilter)); - //else - // cursorMenu1.addMenuItem(new menuItem(getText("Rimuovi filtro"), "", removeFilter,false)); - cursorMenu1.addMenuItem(new menuItem("-")); - } - - //Sort menu items - if (myTable.columns.getColByID(colID).sortable) { - var colVars = colID.split("_"); - var sortASCurl = "javascript:void(sortFields('"+colVars[1]+"','asc'));"; - var sortDESCurl = "javascript:void(sortFields('"+colVars[1]+"','desc'));"; - cursorMenu1.addMenuItem(new menuItem("Sort Ascending", "",sortASCurl)); - cursorMenu1.addMenuItem(new menuItem("Sort Descending", "",sortDESCurl)); - } - else - { - cursorMenu1.addMenuItem(new menuItem("Sort Ascending", "", "",false)); - cursorMenu1.addMenuItem(new menuItem("Sort Descending", "", "",false)); - } - //cursorMenu1.addMenuItem(new menuItem(getText("Copia"), "", "code:copyElement(selectedText)")); - return cursorMenu1; - } - else - return null; -} - -function debug() -{ - var colOrder=''; - var rows=myTable.table.getElementsByTagName('TBODY')[0].getElementsByTagName('TR'); - var cols=rows[0].getElementsByTagName('TH'); - - for (var x=0;x 0) - element=anchors[0]; - - return element.innerHTML; -} - -/** -* @class Representation of a column -* @param {tableCell} th TH element -* @param {columns} parent columns object -*/ -function column (th,parent) -{ - //FIELDS - - /** - *The column display name - *@type string - */ - this.displayName=columnGetName(th); - - /** - *The HTML element object - *@type HTMLelement - */ - this.element=th; - - /** - *The real field name - *@type string - */ - this.fieldName=this.element.id.slice(9); - - /** - *Original display order index - *@type int - */ - this.index=getCellIndex(th); - - /** - *Reference to columns object - *@type columns - */ - this.parent=parent; - - /** - *Reference to table object - *@type table - */ - this.table=this.parent.parent; - - /** - *Column is sortable - *@type boolean - */ - this.sortable=sortable[this.index]; - - /** - *Column is filterable - *@type boolean - */ - this.filterable=filterable[this.index]; - - /** - *Column is visible - *@type boolean - */ - this.visible=true; - - - //METHODS - this.hideColumn=column_hideColumn; - this.showColumn=column_showColumn; - this.setVisible=column_setVisible; - this.setWidth=column_setWidth; - this.retrieveStatus=column_retrieveStatus; - this.getAbsoluteIndx=column_getAbsoluteIndx; - this.getRelativeIndx=column_getRelativeIndx; - //constructor code - this.retrieveStatus(); -} - -/** -* It return the right cell index, fixing the IE explorer behaviour -* @return {int} The absolute cell index -*/ -function column_getAbsoluteIndx() -{ - if (isIE()) { - var x=0; - while (this.table.rows[0].getElementsByTagName('TH')[x].id != this.element.id) - x++; - return x; - } - else - if (isKonqueror() || isSafari()) - return getKCellIndex(this.element); - else - return this.element.cellIndex; -} - -/** -* It return the relative cell index, as displayed on screen (as IE does) -* @return {int} The relative cell index -*/ -function column_getRelativeIndx() -{ - if (isIE()) - return this.element.cellIndex; - else - { - if (isKonqueror() || isSafari()) - var colIndx=getKCellIndex(this.element); - else - var colIndx=this.element.cellIndex; - - var stop=colIndx; - - for (var x=0;x l'indice è quello originale - var displayIndex= (col != null) ? getCellIndex(col) : this.index; - var rows=this.table.rows; - for (var x=0;x0) - var cols=rows[x].getElementsByTagName('TD'); - else - var cols=rows[x].getElementsByTagName('TH'); - - cols[displayIndex].style.display='none'; - - } - - this.setVisible(false); - if (isKonqueror() || isSafari()) - this.parent.resetSize(); -} - -/** -* Show the column -*/ -function column_showColumn() { - var rows=this.table.rows; - var displayIndex= this.getAbsoluteIndx(); - for (var x=0;x0) - var cols=rows[x].getElementsByTagName('TD'); - else - var cols=rows[x].getElementsByTagName('TH'); - - if (isKonqueror() || isSafari()) - cols[displayIndex].style.display='table-cell'; - else - cols[displayIndex].removeAttribute('style'); - - } - this.setVisible(true); - var colEl= document.createElement("COL"); - this.table.table.getElementsByTagName('colgroup')[0].appendChild(colEl); - - if (isKonqueror() || isSafari()) - this.parent.resetSize(); -} - -/** -* @class Representation of columns -* @param {tableRow} tr TR element -* @param {table} parent table object -*/ -function columns (tr,parent) -{ - //FIELDS - /** - * Collection of column objects - * @type array of column - */ - this.item= new Array(); - /** - * Reference to table object - * @type table - */ - this.parent= parent; - - //METHODS - this.listInvisible=columns_listInvisible; - this.hidden=columns_hidden; - this.show=columns_show; - this.getColByID=columns_getColByID; - this.recol=columns_recol; - this.setOrder=columns_setOrder; - this.resetSize=columns_resetSize; - - //Constructor Code - var cols=tr.getElementsByTagName('TH'); - - for (var x=0;x