From 471b9a7b7b3e1b5667b80e787fa184b8ceac0337 Mon Sep 17 00:00:00 2001 From: Carsten Schmitz Date: Fri, 26 Aug 2011 13:30:57 +0000 Subject: [PATCH] Removed obsolete tabpane library git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@10856 b72ed6b6-b9f8-46b5-92b4-906544132732 --- .../helpers/expressions/em_manager_helper.php | 12 +- application/views/admin/Super/header.php | 9 +- installer/sql/create-postgre.sql | 3 +- scripts/admin/admin_core.js | 171 ++- scripts/admin/tabpane/css/tab.css | 61 - scripts/admin/tabpane/css/tab.winclassic.css | 59 - scripts/admin/tabpane/demo.html | 213 --- scripts/admin/tabpane/js/tabpane.js | 327 ----- scripts/admin/tabpane/local/helptip.css | 37 - scripts/admin/tabpane/local/helptip.js | 91 -- scripts/admin/tabpane/local/howto.txt | 3 - .../admin/tabpane/local/title-background.png | Bin 1024 -> 0 bytes scripts/admin/tabpane/local/webfxapi.css | 1 - scripts/admin/tabpane/local/webfxapi.js | 20 - scripts/admin/tabpane/local/webfxlayout.css | 281 ---- scripts/admin/tabpane/local/webfxlayout.js | 111 -- scripts/admin/tabpane/memdemo.html | 89 -- scripts/admin/tabpane/tabpane.html | 1208 ----------------- 18 files changed, 96 insertions(+), 2600 deletions(-) delete mode 100644 scripts/admin/tabpane/css/tab.css delete mode 100644 scripts/admin/tabpane/css/tab.winclassic.css delete mode 100644 scripts/admin/tabpane/demo.html delete mode 100644 scripts/admin/tabpane/js/tabpane.js delete mode 100644 scripts/admin/tabpane/local/helptip.css delete mode 100644 scripts/admin/tabpane/local/helptip.js delete mode 100644 scripts/admin/tabpane/local/howto.txt delete mode 100644 scripts/admin/tabpane/local/title-background.png delete mode 100644 scripts/admin/tabpane/local/webfxapi.css delete mode 100644 scripts/admin/tabpane/local/webfxapi.js delete mode 100644 scripts/admin/tabpane/local/webfxlayout.css delete mode 100644 scripts/admin/tabpane/local/webfxlayout.js delete mode 100644 scripts/admin/tabpane/memdemo.html delete mode 100644 scripts/admin/tabpane/tabpane.html diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index d8cd660326d..fd66d0b6141 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -14,7 +14,7 @@ class LimeExpressionManager { private $em; // Expression Manager private $groupRelevanceInfo; private $groupNum; - private $debugLEM = true; // set this to false to turn off debugging + private $debugLEM = false; // set this to false to turn off debugging private $debugLEMonlyVars = true; //set this to true to only show log replacements of questions (e.g. no tokens or templates) private $knownVars; private $pageRelevanceInfo; @@ -25,9 +25,9 @@ class LimeExpressionManager { private $jsVar2qid; // reverse mapping of JavaScript Variable name to Question private $alias2varName; // JavaScript array of mappings of aliases to the JavaScript variable names private $varNameAttr; // JavaScript array of mappings of canonical JavaScript variable name to key attributes. - + // A private constructor; prevents direct creation of object - private function __construct() + private function __construct() { $this->em = new ExpressionManager(); } @@ -41,7 +41,7 @@ public static function singleton() } return self::$instance; } - + // Prevent users to clone the instance public function __clone() { @@ -419,7 +419,7 @@ public function setVariableAndTokenMappingsForExpressionManager($forceRefresh=fa $debugLog_html .= ""; file_put_contents('/tmp/LimeExpressionManager-page.html',$debugLog_html); } - + $this->knownVars = $knownVars; $this->qid2code = $qid2code; $this->jsVar2qid = $jsVar2qid; @@ -797,7 +797,7 @@ static function GetRelevanceAndTailoringJavaScript() $jsParts[] = "\n"; } } - + return implode('',$jsParts); } diff --git a/application/views/admin/Super/header.php b/application/views/admin/Super/header.php index fc80180be2f..bacb38f0dd3 100644 --- a/application/views/admin/Super/header.php +++ b/application/views/admin/Super/header.php @@ -3,7 +3,6 @@ - @@ -32,20 +31,20 @@ diff --git a/installer/sql/create-postgre.sql b/installer/sql/create-postgre.sql index ba162979e5b..947976f4500 100644 --- a/installer/sql/create-postgre.sql +++ b/installer/sql/create-postgre.sql @@ -410,8 +410,7 @@ CREATE TABLE prefix_participants ( "email" character varying( 80 ) NOT NULL, "language" character varying( 2 ) NOT NULL, "blacklisted" character( 1 ) NOT NULL, - "owner_uid" integer NOT NULL, - PRIMARY KEY (participant_id) + "owner_uid" integer NOT NULL ); diff --git a/scripts/admin/admin_core.js b/scripts/admin/admin_core.js index 1251b79be18..a8749d530b4 100644 --- a/scripts/admin/admin_core.js +++ b/scripts/admin/admin_core.js @@ -1,37 +1,36 @@ -//$Id: admin_core.js 10154 2011-05-31 11:45:24Z c_schmitz $ +//$Id: admin_core.js 10154 2011-05-31 11:45:24Z c_schmitz $ $(document).ready(function(){ - setupAllTabs(); - if(typeof(userdateformat) !== 'undefined') + if(typeof(userdateformat) !== 'undefined') { - $(".popupdate").each(function(i,e) { + $(".popupdate").each(function(i,e) { format=$('#dateformat'+e.name).val(); if(!format) format = userdateformat; - $(e).datepicker({ dateFormat: format, + $(e).datepicker({ dateFormat: format, showOn: 'button', - changeYear: true, - changeMonth: true, + changeYear: true, + changeMonth: true, duration: 'fast' }, $.datepicker.regional[userlanguage]); }); - $(".popupdatetime").datepicker({ dateFormat: userdateformat+' 00:00', + $(".popupdatetime").datepicker({ dateFormat: userdateformat+' 00:00', showOn: 'button', - changeYear: true, - changeMonth: true, + changeYear: true, + changeMonth: true, duration: 'fast' }, $.datepicker.regional[userlanguage]); } - $('button,input[type=submit],input[type=button],input[type=reset]').addClass("limebutton ui-state-default ui-corner-all"); + $('button,input[type=submit],input[type=button],input[type=reset]').addClass("limebutton ui-state-default ui-corner-all"); $('button,input[type=submit],input[type=button],input[type=reset]').hover( - function(){ - $(this).addClass("ui-state-hover"); + function(){ + $(this).addClass("ui-state-hover"); }, - function(){ - $(this).removeClass("ui-state-hover"); + function(){ + $(this).removeClass("ui-state-hover"); } ) - + // Loads the tooltips for the toolbars except the surveybar $('img[alt],input[src]').not('.surveybar img').each(function() { @@ -39,14 +38,14 @@ $(document).ready(function(){ { $(this).qtip({ style: {name: 'cream', - tip:true, - color:'#1D2D45', + tip:true, + color:'#1D2D45', border: { width: 1, radius: 5, color: '#EADF95'} - }, - position: {adjust: { + }, + position: {adjust: { screen: true, scroll:true}, corner: { target: 'bottomRight'} @@ -57,11 +56,11 @@ $(document).ready(function(){ }); } - }); + }); $(".progressbar").each(function(){ var pValue = parseInt($(this).attr('name')); - + $(this).progressbar({ value: pValue }); @@ -69,25 +68,25 @@ $(document).ready(function(){ if (pValue > 85){ $("div",$(this)).css({ 'background': 'Red' }); } - + $("div",this).html(pValue + "%"); }); - - - + + + $('label[title]').each(function() { if($(this).attr('title') != '') { $(this).qtip({ style: {name: 'cream', - tip:true, - color:'#1D2D45', + tip:true, + color:'#1D2D45', border: { width: 1, radius: 5, color: '#EADF95'} - }, - position: {adjust: { + }, + position: {adjust: { screen: true, scroll:true}, corner: { target: 'bottomRight'} @@ -95,21 +94,21 @@ $(document).ready(function(){ show: {effect: {length:50}} }); } - }); - + }); + $('.dosurvey').qtip({ content:{ text:$('#dosurveylangpopup') }, style: {name: 'cream', - tip:true, - color:'#1D2D45', + tip:true, + color:'#1D2D45', border: { width: 1, radius: 5, color: '#EADF95'} - }, - position: {adjust: { + }, + position: {adjust: { screen: true, scroll:true}, corner: { target: 'bottomMiddle', @@ -123,21 +122,21 @@ $(document).ready(function(){ when: { event:'unfocus' }} - }); + }); $('#previewquestion').qtip({ content:{ text:$('#previewquestionpopup') }, style: {name: 'cream', - tip:true, - color:'#111111', + tip:true, + color:'#111111', border: { width: 1, radius: 5, color: '#EADF95'} - }, - position: {adjust: { + }, + position: {adjust: { screen: true, scroll:true}, corner: { target: 'bottomMiddle', @@ -151,21 +150,21 @@ $(document).ready(function(){ when: { event:'unfocus' }} - }); - + }); + $('.tipme').each(function() { if($(this).attr('alt') != '') { $(this).qtip({ style: {name: 'cream', - tip:true, - color:'#111111', + tip:true, + color:'#111111', border: { width: 1, radius: 5, color: '#EADF95'} - }, - position: {adjust: { + }, + position: {adjust: { screen: true, scroll:true}, corner: { target: 'topRight', @@ -176,11 +175,11 @@ $(document).ready(function(){ }); } - }); - + }); + if ($('#showadvancedattributes').length>0) updatequestionattributes(); - + $('#showadvancedattributes').click(function(){ $('#showadvancedattributes').hide(); $('#hideadvancedattributes').show(); @@ -188,7 +187,7 @@ $(document).ready(function(){ "height": "toggle", "opacity": "toggle" }); - }) + }) $('#hideadvancedattributes').click(function(){ $('#showadvancedattributes').show(); $('#hideadvancedattributes').hide(); @@ -196,12 +195,12 @@ $(document).ready(function(){ "height": "toggle", "opacity": "toggle" }); - }) + }) $('#question_type').change(updatequestionattributes); $('#MinimizeGroupWindow').click(function(){ $('#groupdetails').hide(); - }); + }); $('#MaximizeGroupWindow').click(function(){ $('#groupdetails').show(); }); @@ -224,7 +223,7 @@ $(document).ready(function(){ },function(oData) { old_owner = $($(oldThis).parent()).html(); - + old_owner = (old_owner.split("("))[0]; $($(oldThis).parent()).html('' + ''); @@ -251,9 +250,9 @@ $(document).ready(function(){ newowner: newowner, survey_id : survey_id }, function (data){ - + var objToUpdate = $($(oldThis).parent()); - + if (data.record_count>0) $(objToUpdate).html(data.newowner); else @@ -271,9 +270,9 @@ $(document).ready(function(){ OtherSelection(selected_value); }); } - - - + + + }); function qTypeDropdownInit() @@ -303,9 +302,9 @@ function qTypeDropdownInit() }); } - - - + + + var aToolTipData = { @@ -318,7 +317,7 @@ function getToolTip(type){ var code = qDescToCode[''+type]; var multiple = 0; if (code=='S') multiple = 2; - + if (code == ":") code = "COLON"; else if(code == "|") code = "PIPE"; @@ -345,26 +344,26 @@ function updatequestionattributes() sid:$('#sid').val() }, function(){ // Loads the tooltips for the toolbars - + // Loads the tooltips for the toolbars $('.loader').hide(); $('label[title]').qtip({ - style: {name: 'cream', - tip: true, - color:'#111111', + style: {name: 'cream', + tip: true, + color:'#111111', border: { width: 1, radius: 5, color: '#EADF95'} - }, - position: {adjust: { + }, + position: {adjust: { screen: true, scroll:true}, corner: { target: 'bottomRight'} }, show: {effect: {length:50}} - });} - ); + });} + ); } function validatefilename (form, strmessage ) @@ -393,10 +392,10 @@ function codeCheck(prefix, elementcount, helperMsg, reservedKeywordMsg) { var i, j; var X = new Array(); - + for (i=0; i<=elementcount; i++) { j = document.getElementById(prefix+i); - if (j != undefined) + if (j != undefined) { j.value=trim(j.value); if (j.value == "other") @@ -406,7 +405,7 @@ function codeCheck(prefix, elementcount, helperMsg, reservedKeywordMsg) } X.push(j.value); } - } + } if (arrHasDupes(X)) { alert(helperMsg); @@ -429,10 +428,10 @@ function arrHasDupes( A ) { // finds any duplicate arra // (c) 2006 Simon Wunderlin, License: GPL, hacks want to be free ;) -// This fix forces Firefox to fire the onchange event if someone changes select box with cursor keys +// This fix forces Firefox to fire the onchange event if someone changes select box with cursor keys function ev_gecko_select_keyup_ev(Ev) { // prevent tab, alt, ctrl keys from fireing the event - if (Ev.keyCode && (Ev.keyCode == 1 || Ev.keyCode == 9 || + if (Ev.keyCode && (Ev.keyCode == 1 || Ev.keyCode == 9 || Ev.keyCode == 16 || Ev.altKey || Ev.ctrlKey)) return true; Ev.target.onchange(); @@ -450,8 +449,8 @@ function init_gecko_select_hack() { function getkey(e) { if (window.event) return window.event.keyCode; - else - if (e) return e.which; + else + if (e) return e.which; else return null; } @@ -460,20 +459,20 @@ function goodchars(e, goods) var key, keychar; key = getkey(e); if (key == null) return true; - + // get character keychar = String.fromCharCode(key); keychar = keychar.toLowerCase(); goods = goods.toLowerCase(); - + // check goodkeys if (goods.indexOf(keychar) != -1) return true; - + // control keys if ( key==null || key==0 || key==8 || key==9 || key==27 ) return true; - + // else return false return false; } @@ -643,7 +642,7 @@ String.prototype.splitCSV = function(sep) { }return foo; }; -// This is a helper function to extract the question ID from a DOM ID element +// This is a helper function to extract the question ID from a DOM ID element function removechars(strtoconvert){ return strtoconvert.replace(/[-a-zA-Z_]/g,""); } @@ -664,7 +663,7 @@ function htmlspecialchars(str) { function saveaslabelset() { var lang = langs.split(";"); - + dataToSend = {}; dataToSend['langs'] = lang; @@ -685,12 +684,12 @@ function saveaslabelset() }; $(lang).each(function(index,element){ dataToSend[code]['text_'+element] = $("#answer_"+element+"_"+code+"_0").val(); - + }); }); var label_name = prompt("Enter new label name", ""); - + var data = { action: 'ajaxmodlabelsetanswers', lid:'1', diff --git a/scripts/admin/tabpane/css/tab.css b/scripts/admin/tabpane/css/tab.css deleted file mode 100644 index 8c091a3390d..00000000000 --- a/scripts/admin/tabpane/css/tab.css +++ /dev/null @@ -1,61 +0,0 @@ -.dynamic-tab-pane-control.tab-pane { - position: relative; - width: 100%; -} - -.dynamic-tab-pane-control .tab-row .tab { - font: Menu; - cursor: Default; - display: inline; - margin: 1px -1px 1px 2px; - float: left; - padding: 2px 5px 3px 5px; - background: ActiveBorder; - border: 0; /* 1px solid; */ - border-color: ThreeDHighlight ThreeDDarkShadow ThreeDDarkShadow - ThreeDHighlight; - border-bottom: 0; - z-index: 1; - white-space: nowrap; - position: relative; - top: 0; -} - -.dynamic-tab-pane-control .tab-row .tab.selected { - background: ThreeDHighlight !important; - border: 1px solid ThreeDDarkShadow; - border-bottom: 0; - z-index: 3; - padding: 2px 6px 4px 6px; - margin: 1px -3px -3px 0px; - top: -2px; -} - -.dynamic-tab-pane-control .tab-row .tab a { - font: Menu; - color: WindowText; - text-decoration: none; - cursor: default; -} - -.dynamic-tab-pane-control .tab-row .tab.hover { - background: Highlight; -} - -.dynamic-tab-pane-control .tab-page { - clear: both; - border: 1px solid ThreeDDarkShadow; - background: ThreeDHighlight; - z-index: 2; - position: relative; - top: -2px; - color: WindowText; - font: Message-Box; - padding: 10px; - height: 200px; -} - -.dynamic-tab-pane-control .tab-row { - z-index: 1; - white-space: nowrap; -} \ No newline at end of file diff --git a/scripts/admin/tabpane/css/tab.winclassic.css b/scripts/admin/tabpane/css/tab.winclassic.css deleted file mode 100644 index 16a23403a32..00000000000 --- a/scripts/admin/tabpane/css/tab.winclassic.css +++ /dev/null @@ -1,59 +0,0 @@ -.dynamic-tab-pane-control.tab-pane { - position: relative; - width: 100%; -} - -.dynamic-tab-pane-control .tab-row .tab { - font: Menu; - cursor: Default; - display: inline; - margin: 1px -2px 1px 2px; - float: left; - padding: 2px 5px 3px 5px; - background: ThreeDFace; - border: 1px solid; - border-color: ThreeDHighlight ThreeDDarkShadow ThreeDDarkShadow - ThreeDHighlight; - border-bottom: 0; - z-index: 1; - position: relative; - top: 0; -} - -.dynamic-tab-pane-control .tab-row .tab.selected { - border-bottom: 0; - z-index: 3; - padding: 2px 6px 5px 7px; - margin: 1px -3px -2px 0px; - top: -2px; -} - -.dynamic-tab-pane-control .tab-row .tab a { - font: Menu; - color: WindowText; - text-decoration: none; - cursor: default; -} - -.dynamic-tab-pane-control .tab-row .hover a { - color: blue; -} - -.dynamic-tab-pane-control .tab-page { - clear: both; - border: 1px solid; - border-color: ThreeDHighlight ThreeDDarkShadow ThreeDDarkShadow - ThreeDHighlight; - background: ThreeDFace; - z-index: 2; - position: relative; - top: -2px; - color: WindowText; - font: Message-Box; - padding: 10px; -} - -.dynamic-tab-pane-control .tab-row { - z-index: 1; - white-space: nowrap; -} \ No newline at end of file diff --git a/scripts/admin/tabpane/demo.html b/scripts/admin/tabpane/demo.html deleted file mode 100644 index 9057334751f..00000000000 --- a/scripts/admin/tabpane/demo.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - -Tab Pane Demo (WebFX) - - - - - - - - - - - - - - - - - - -
-
Select Style Sheet
- -
- -
-
- -

 

- -
- -
-

General

- - - -This is text of tab 1. This is text of tab 1. This is text of tab 1. -This is text of tab 1. This is text of tab 1. This is text of tab 1. -This is text of tab 1. This is text of tab 1. This is text of tab 1.
- -
-

Security

- - - -This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2.
-
-This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2.
- -
-

Privacy

- - - -This is text of tab 3. This is text of tab 3. This is text of tab 3. -This is text of tab 3. This is text of tab 3. This is text of tab 3. -This is text of tab 3. This is text of tab 3. This is text of tab 3.
- -
-

Content

- - - -
Content This is text of tab 4. -This is text of tab 4. This is text of tab 4. This is text of tab 4. -This is text of tab 4. This is text of tab 4. This is text of tab 4. -This is text of tab 4. This is text of tab 4.
- -
- -
- - -

Another tab below

- - - -
- -
-

General

- -This is text of tab 1. This is text of tab 1. This is text of tab 1. -This is text of tab 1. This is text of tab 1. This is text of tab 1. -This is text of tab 1. This is text of tab 1. This is text of tab 1.
- -
-

Security

- -This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2.
-
-This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2.
- -
-

Nested

- - -
- -
-

General

- -This is text of tab 1. This is text of tab 1. This is text of tab 1. -This is text of tab 1. This is text of tab 1. This is text of tab 1. -This is text of tab 1. This is text of tab 1. This is text of tab 1.
- -
-

Privacy

- -This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2. -This is text of tab 2. This is text of tab 2. This is text of tab 2.
- -
- -
- -
- - - - - - diff --git a/scripts/admin/tabpane/js/tabpane.js b/scripts/admin/tabpane/js/tabpane.js deleted file mode 100644 index 92bce6ac15e..00000000000 --- a/scripts/admin/tabpane/js/tabpane.js +++ /dev/null @@ -1,327 +0,0 @@ -/*----------------------------------------------------------------------------\ -| Tab Pane 1.02 | -|-----------------------------------------------------------------------------| -| Created by Erik Arvidsson | -| (http://webfx.eae.net/contact.html#erik) | -| For WebFX (http://webfx.eae.net/) | -|-----------------------------------------------------------------------------| -| Copyright (c) 2002, 2003, 2006 Erik Arvidsson | -|-----------------------------------------------------------------------------| -| Licensed under the Apache License, Version 2.0 (the "License"); you may not | -| use this file except in compliance with the License. You may obtain a copy | -| of the License at http://www.apache.org/licenses/LICENSE-2.0 | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | -| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | -| License for the specific language governing permissions and limitations | -| under the License. | -|-----------------------------------------------------------------------------| -| 2002-01-?? | First working version | -| 2002-02-17 | Cleaned up for 1.0 public version | -| 2003-02-18 | Changed from javascript uri for anchors to return false | -| 2003-03-03 | Added dispose methods to release IE memory | -| 2006-05-28 | Changed license to Apache Software License 2.0. | -|-----------------------------------------------------------------------------| -| Dependencies: *.css a css file to define the layout | -|-----------------------------------------------------------------------------| -| Created 2002-01-?? | All changes are in the log above. | Updated 2006-05-28 | -\----------------------------------------------------------------------------*/ - -// This function is used to define if the browser supports the needed -// features -function hasSupport() { - - if (typeof hasSupport.support != "undefined") - return hasSupport.support; - - var ie55 = /msie 5\.[56789]/i.test( navigator.userAgent ); - - hasSupport.support = ( typeof document.implementation != "undefined" && - document.implementation.hasFeature( "html", "1.0" ) || ie55 ) - - // IE55 has a serious DOM1 bug... Patch it! - if ( ie55 ) { - document._getElementsByTagName = document.getElementsByTagName; - document.getElementsByTagName = function ( sTagName ) { - if ( sTagName == "*" ) - return document.all; - else - return document._getElementsByTagName( sTagName ); - }; - } - - return hasSupport.support; -} - -/////////////////////////////////////////////////////////////////////////////////// -// The constructor for tab panes -// -// el : HTMLElement The html element used to represent the tab pane -// bUseCookie : Boolean Optional. Default is true. Used to determine whether to us -// persistance using cookies or not -// -function WebFXTabPane( el, bUseCookie ) { - if ( !hasSupport() || el == null ) return; - - this.element = el; - this.element.tabPane = this; - this.pages = []; - this.selectedIndex = null; - this.useCookie = bUseCookie != null ? bUseCookie : true; - - // add class name tag to class name - this.element.className = this.classNameTag + " " + this.element.className; - - // add tab row - this.tabRow = document.createElement( "div" ); - this.tabRow.className = "tab-row"; - el.insertBefore( this.tabRow, el.firstChild ); - - var tabIndex = 0; - if ( this.useCookie ) { - tabIndex = Number( WebFXTabPane.getCookie( "webfxtab_" + this.element.id ) ); - if ( isNaN( tabIndex ) ) - tabIndex = 0; - } - this.selectedIndex = tabIndex; - - // loop through child nodes and add them - var c=this; - var b=$(el).find(".tab-page"); - jQuery.each(b, function() { - c.addTabPage( this ); - } - ); -} - -WebFXTabPane.prototype.classNameTag = "dynamic-tab-pane-control"; - -WebFXTabPane.prototype.setSelectedIndex = function ( n ) { - if (this.selectedIndex != n) { - if (this.selectedIndex != null && this.pages[ this.selectedIndex ] != null ) - this.pages[ this.selectedIndex ].hide(); - this.selectedIndex = n; - this.pages[ this.selectedIndex ].show(); - - if ( this.useCookie ) - WebFXTabPane.setCookie( "webfxtab_" + this.element.id, n ); // session cookie - } -}; - -WebFXTabPane.prototype.getSelectedIndex = function () { - return this.selectedIndex; -}; - -WebFXTabPane.prototype.addTabPage = function ( oElement ) { - if ( !hasSupport() ) return; - - if ( oElement.tabPage == this ) // already added - return oElement.tabPage; - - var n = this.pages.length; - var tp = this.pages[n] = new WebFXTabPage( oElement, this, n ); - tp.tabPane = this; - - // move the tab out of the box - this.tabRow.appendChild( tp.tab ); - - if ( n == this.selectedIndex ) - tp.show(); - else - tp.hide(); - - return tp; -}; - -WebFXTabPane.prototype.dispose = function () { - this.element.tabPane = null; - this.element = null; - this.tabRow = null; - - for (var i = 0; i < this.pages.length; i++) { - this.pages[i].dispose(); - this.pages[i] = null; - } - this.pages = null; -}; - - - -// Cookie handling -WebFXTabPane.setCookie = function ( sName, sValue, nDays ) { - var expires = ""; - if ( nDays ) { - var d = new Date(); - d.setTime( d.getTime() + nDays * 24 * 60 * 60 * 1000 ); - expires = "; expires=" + d.toGMTString(); - } - - document.cookie = sName + "=" + sValue + expires + "; path=/"; -}; - -WebFXTabPane.getCookie = function (sName) { - var re = new RegExp( "(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)" ); - var res = re.exec( document.cookie ); - return res != null ? res[3] : null; -}; - -WebFXTabPane.removeCookie = function ( name ) { - setCookie( name, "", -1 ); -}; - - - - - - - - -/////////////////////////////////////////////////////////////////////////////////// -// The constructor for tab pages. This one should not be used. -// Use WebFXTabPage.addTabPage instead -// -// el : HTMLElement The html element used to represent the tab pane -// tabPane : WebFXTabPane The parent tab pane -// nindex : Number The index of the page in the parent pane page array -// -function WebFXTabPage( el, tabPane, nIndex ) { - if ( !hasSupport() || el == null ) return; - - this.element = el; - this.element.tabPage = this; - this.index = nIndex; - - var cs = el.childNodes; - for (var i = 0; i < cs.length; i++) { - if (cs[i].nodeType == 1 && cs[i].className == "tab") { - this.tab = cs[i]; - break; - } - } - - // insert a tag around content to support keyboard navigation - - - var a = document.createElement( "A" ); - this.aElement = a; - a.href = "#"; - a.onclick = function () { return false; }; - while ( this.tab.hasChildNodes() ) - a.appendChild( this.tab.firstChild ); - this.tab.appendChild( a ); - - - // hook up events, using DOM0 - var oThis = this; - this.tab.onclick = function () { oThis.select(); }; - this.tab.onmouseover = function () { WebFXTabPage.tabOver( oThis ); }; - this.tab.onmouseout = function () { WebFXTabPage.tabOut( oThis ); }; -} - -WebFXTabPage.prototype.show = function () { - var el = this.tab; - var s = el.className + " selected"; - s = s.replace(/ +/g, " "); - el.className = s; - - this.element.style.display = "block"; -}; - -WebFXTabPage.prototype.hide = function () { - var el = this.tab; - var s = el.className; - s = s.replace(/ selected/g, ""); - el.className = s; - - this.element.style.display = "none"; -}; - -WebFXTabPage.prototype.select = function () { - this.tabPane.setSelectedIndex( this.index ); -}; - -WebFXTabPage.prototype.dispose = function () { - this.aElement.onclick = null; - this.aElement = null; - this.element.tabPage = null; - this.tab.onclick = null; - this.tab.onmouseover = null; - this.tab.onmouseout = null; - this.tab = null; - this.tabPane = null; - this.element = null; -}; - -WebFXTabPage.tabOver = function ( tabpage ) { - var el = tabpage.tab; - var s = el.className + " hover"; - s = s.replace(/ +/g, " "); - el.className = s; -}; - -WebFXTabPage.tabOut = function ( tabpage ) { - var el = tabpage.tab; - var s = el.className; - s = s.replace(/ hover/g, ""); - el.className = s; -}; - - -// This function initializes all uninitialized tab panes and tab pages -function setupAllTabs() { - if ( !hasSupport() ) return; - - var all = document.getElementsByTagName( "*" ); - var l = all.length; - var tabPaneRe = /tab\-pane/; - var tabPageRe = /tab\-page/; - var cn, el; - var parentTabPane; - - for ( var i = 0; i < l; i++ ) { - el = all[i] - cn = el.className; - - // no className - if ( cn == "" ) continue; - - // uninitiated tab pane - if ( tabPaneRe.test( cn ) && !el.tabPane ) - new WebFXTabPane( el, true ); - - // unitiated tab page wit a valid tab pane parent - else if ( tabPageRe.test( cn ) && !el.tabPage && - tabPaneRe.test( el.parentNode.className ) ) { - el.parentNode.tabPane.addTabPage( el ); - } - } -} - -function disposeAllTabs() { - if ( !hasSupport() ) return; - - var all = document.getElementsByTagName( "*" ); - var l = all.length; - var tabPaneRe = /tab\-pane/; - var cn, el; - var tabPanes = []; - - for ( var i = 0; i < l; i++ ) { - el = all[i] - cn = el.className; - - // no className - if ( cn == "" ) continue; - - // tab pane - if ( tabPaneRe.test( cn ) && el.tabPane ) - tabPanes[tabPanes.length] = el.tabPane; - } - - for (var i = tabPanes.length - 1; i >= 0; i--) { - tabPanes[i].dispose(); - tabPanes[i] = null; - } -} - diff --git a/scripts/admin/tabpane/local/helptip.css b/scripts/admin/tabpane/local/helptip.css deleted file mode 100644 index 60ee7f57d96..00000000000 --- a/scripts/admin/tabpane/local/helptip.css +++ /dev/null @@ -1,37 +0,0 @@ -/* - Notice that IE has a display problem if the help link is on - the last line of a container with no padding. If this is the - case increase the padding bottom to at least 1px -*/ -a.helpLink { - color: Green; - text-decoration: none; - border-bottom: 1px dashed Green; -} - -a.helpLink:hover { - color: Red; - text-decoration: none; - border-bottom: 1px dashed Red; -} - -.help-tooltip { - position: absolute; - width: 250px; - border: 1px Solid WindowFrame; - background: Infobackground; - color: InfoText; - font: StatusBar; - font: Status-Bar; - padding: 3px; - filter: progid : DXImageTransform.Microsoft.Shadow ( - color = - - "#777777", Direction = 135, Strength = 3 ); - z-index: 10000; -} - -.help-tooltip a,.help-tooltip a:hover { - color: blue !important; - background: none; -} \ No newline at end of file diff --git a/scripts/admin/tabpane/local/helptip.js b/scripts/admin/tabpane/local/helptip.js deleted file mode 100644 index f0f83cf0626..00000000000 --- a/scripts/admin/tabpane/local/helptip.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This script was created by Erik Arvidsson (erik(at)eae.net) - * for WebFX (http://webfx.eae.net) - * Copyright 2001 - * - * For usage see license at http://webfx.eae.net/license.html - * - * Version: 1.0 - * Created: 2001-09-27 * Updated: 2001-11-25 Added a resize to the tooltip if the document width is too small - * - * Dependencies: helptip.css (To set up the CSS of the help-tooltip class) - * - * Usage: - * - * - * - * - * Help - * - */ - -function showHelpTip(e, s) { - // find anchor element - var el = e.target ? e.target : e.srcElement; - while (el.tagName != "A") - el = el.parentNode; - - // is there already a tooltip? If so, remove it - if (el._helpTip) { - document.body.removeChild(el._helpTip); - el._helpTip = null; - el.onblur = null; - return; - } - - // create element and insert last into the body - var d = document.createElement("DIV"); - d.className = "help-tooltip"; - document.body.appendChild(d); - d.innerHTML = s; - - // Allow clicks on A elements inside tooltip - d.onmousedown = function (e) { - if (!e) e = event; - var t = e.target ? e.target : e.srcElement; - while (t.tagName != "A" && t != d) - t = t.parentNode; - if (t == d) return; - - el._onblur = el.onblur; - el.onblur = null; - }; - d.onmouseup = function () { - el.onblur = el._onblur; - el.focus(); - }; - - // position tooltip - var dw = document.width ? document.width : document.documentElement.offsetWidth - 25; - if (d.offsetWidth >= dw) - d.style.width = dw - 10 + "px"; else - d.style.width = ""; - var scroll = getScroll(); - if (e.clientX > dw - d.offsetWidth) - d.style.left = dw - d.offsetWidth + scroll.x + "px"; - else - d.style.left = e.clientX - 2 + scroll.x + "px"; - d.style.top = e.clientY + 18 + scroll.y + "px"; - - // add a listener to the blur event. When blurred remove tooltip and restore anchor - el.onblur = function () { - document.body.removeChild(d); - el.onblur = null; - el._helpTip = null; - }; - - // store a reference to the tooltip div - el._helpTip = d; -} - -// returns the scroll left and top for the browser viewport. -function getScroll() { - if (document.all && document.body.scrollTop != undefined) { // IE model - var ieBox = document.compatMode != "CSS1Compat"; - var cont = ieBox ? document.body : document.documentElement; - return {x : cont.scrollLeft, y : cont.scrollTop}; - } - else { - return {x : window.pageXOffset, y : window.pageYOffset}; - } -} \ No newline at end of file diff --git a/scripts/admin/tabpane/local/howto.txt b/scripts/admin/tabpane/local/howto.txt deleted file mode 100644 index 43be1710a96..00000000000 --- a/scripts/admin/tabpane/local/howto.txt +++ /dev/null @@ -1,3 +0,0 @@ -Creata a sub folder in the zip directory and copy all these files to that dir. -Replace the include statements of webfxlayout.js and webfxapi.js to point at local/webfxlayout.js and -local/webfxapi.js \ No newline at end of file diff --git a/scripts/admin/tabpane/local/title-background.png b/scripts/admin/tabpane/local/title-background.png deleted file mode 100644 index 93b9aada09ce9d2c145ca74a8157d0dc11b2f076..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmV+b1poVqP)i^>H|Eaw4#n=1P)%^X={V>GJ>Z@cNy-`tJ4r{QdvB%JzVx^7{P$@%R7c=Jti9 z^4#3>=;-&^+3>s3{O0igoVoUar}dY=|AVCReXsxh{{Q~||Dd+={{R2%^Z(fA|JvH} zp}zUK&ic#W|K8s8u*Uba$M*L2{E4XYufOuZ&-e23`yEHpumAu8#z{m$RCwC$+-q~v zKp2K$Qa}MgRFq3Od8s}wY%RbpmXB{t2hL5@J7ptgMOhtT% zh3d%2pz+UxtY;!?5=YTkzLW-JmC9OEz8^wXsjP*=S&&sxmaqj`koDxU_F|x<1z8nj zO{g3BlDAtSOALps6S5?(ZnrCCwOTD9Y5-ZKvP9WWWWmaVtP)w=!4^F}?jfs+EP87U zAgih@+rD5~;w??*Kvs#Y=@mB|2|yCo6tW7aFcC4=V0pR~WR=S5_ec34t5DX8E0-ls zb&yqAmY8^Og)YddAZv0%S&&slma^q$Wp!0HWL1$xKWjo3WI+~WLDn;pCA2_RnJh;W z5eqiwTpQL?R(m>~`c$7gA}S~AzTUEgt&|@w&^38(-4nB25|*RCLRNCJ67yR-SR>JhRa3$h>!vLFkx>LrUW z5qOQ%o8V()9S%gQLmRQQtO0fDvW%S|HNtFqSnzKfSv)%DlcK|3uB>DZ z>pGF;b1lxu;u(gWc}hN_1w$LMAPce}3$h>!vLFkxAnPe)(ZjqfweT3nwUi}qXHC=c z{nW~#E+dN;47-;uOHEnjcR0-WKKzNETv&M4$@E=_mo96${KF-(hFr+PAgi!BWI+~W zK^9~|7G#|*OMZZlBFH)^OJ6BI^in}q(FFjNIc!~J5v$H2gsg%*Z#Jj@2hxamb24P* uWYM~`sO@q?y`=%N@|nr21V#Km%lZrT6q%g#R7M{F0000<\/script>" ); -document.write( "" ); -document.write( "" ); - -function toggleMethodArguments( e, a ) { - if ( a && a.nextSibling && - typeof a.nextSibling.innerHTML != "undefined" && - typeof showHelpTip != "undefined" ) { - - showHelpTip( e, a.nextSibling.innerHTML ); - - } -} - \ No newline at end of file diff --git a/scripts/admin/tabpane/local/webfxlayout.css b/scripts/admin/tabpane/local/webfxlayout.css deleted file mode 100644 index 1b6e9464c62..00000000000 --- a/scripts/admin/tabpane/local/webfxlayout.css +++ /dev/null @@ -1,281 +0,0 @@ -/* - -bright: rgb(234,242,255); -normal: rgb(120,172,255); -dark: rgb(0,66,174); - -*/ /* import menu css */ /* @import "dhtml/xmenu/xmenu.css"; */ -#webfx-about { - position: absolute; - background: white; - top: 102px; - right: 10px; - width: 20px; - writing-mode: tb-rl; - filter: flipH() flipV() alpha(opacity = 50); -} - -/* headers css */ -#webfx-title { - position: absolute; - left: 90px; - top: -5px; - color: black; - background: transparent; - border: 0; - padding: 0; - margin: 0; - font-family: Arial Black, Verdana, Helvetica, Sans-Serif; - font-weight: bold; - font-style: italic; - font-size: 45px; - letter-spacing: -5px; -} - -#webfx-title-background { - width: 100%; - height: 67px; - background: white no-repeat; /*rgb(100,100,100) no-repeat;*/ - background-image: url("images/title-background.png"); - background-position: 0 0; -} - -#webfx-sub-title { - position: absolute; - left: 96px; - top: 45px; - color: black; - background: transparent; - padding: 0; - margin: 0; - border: 0; - font-family: Verdana, Helvetica, Sans-Serif; - font-size: 11px; -} - -#webfx-menu-bar-1,#webfx-menu-bar-2,#webfx-menu-bar-3,#webfx-menu-bar-4,#webfx-menu-bar-5 - { - height: 2px; - font-size: 0; - overflow: hidden; - background: rgb(120, 172, 255); /*#ff8800;*/ - padding: 0; -} - -#webfx-menu-bar-1 { - background: rgb(0, 66, 174); - /*rgb(120,172,255);/*black;/*rgb(234,242,255);*/ - height: 1px; -} - -#webfx-menu-bar-2 { - background: rgb(120, 172, 255); /*#ff8800;*/ - height: 1px; -} - -#webfx-menu-bar-3 { - background: rgb(120, 172, 255); /*#ff8800;*/ - height: 1px; -} - -#webfx-menu-bar-4 { - background: rgb(0, 66, 174); - height: 1px; -} - -#webfx-menu-bar-5 { - background: #dddddd; - height: 3px; -} - -/* headers css end */ -html,body { - height: 100%; - margin: 0; - padding: 0; - background: url("images/background-shadow.gif") repeat-y white; - color: black; - font-size: 13px; - font-family: "Verdana", "Tahoma", "Helvetica", "Sans-Serif"; -} - -.webfx-main-body { - margin-left: 100px; - width: 500px; - border-left: 1px solid rgb(120, 172, 255); -} - -/* h1 only used in header */ -h2,h3,h4,h5,h6 { - margin-top: 10px; - margin-left: 10px; - margin-right: 10px; - padding: 2px 10px 2px 10px; - background: rgb(234, 242, 255); - border-bottom: 1px solid rgb(120, 172, 255); -} - -h1,h2 { - font-weight: normal; -} - -h3,h4,h5,h6 { - font-weight: bold; -} - -h1 { - font-size: 50px; -} - -h2 { - font-size: 20px; -} - -h3 { - font-size: 15px; -} - -h4 { - font-size: 12px; -} - -p { - margin: 10px; - font-size: 13px; - color: black; - text-align: justify; -} - -td { - font-size: 13px; - font-family: "Verdana", "Tahoma", "Helvetica", "Sans-Serif"; -} - -pre { - margin: 20px; - margin-right: 10px; - background: #eeeeee; - padding: 10px; - border: 1px solid #dddddd; - color: black; -} - -code { - background: #eeeeee; - border: 1px solid #dddddd; - color: black; -} - -a { - text-decoration: underline; - color: rgb(0, 66, 174); -} - -a:hover { /*rgb(0,66,174)*/ - color: rgb(0, 66, 174); - background: rgb(234, 242, 255); -} - -a:visited { - color: rgb(120, 172, 255); -} - -a:visited:hover { - color: rgb(0, 66, 174); -} - -hr { - margin-left: 10px; - margin-right: 10px; - padding: 0; - text-align: left; - height: 1px; - color: rgb(120, 172, 255); - background-color: rgb(120, 172, 255); - border-bottom: 1px solid rgb(120, 172, 255); - border: 0; -} - -h2 a,h3 a { - display: block; - text-decoration: none; - width: expression("100%"); -} - -table { - margin: 10px; - font-size: 13px; - color: black; -} - -thead td { - background: rgb(234, 242, 255); - border-bottom: 1px solid rgb(120, 172, 255); - font-weight: bold; -} - -.author { - margin-top: 50px; - font-style: italic; -} - -.date { - color: rgb(0, 66, 174); -} - -.warning,.warning a { - color: red; -} - -.warning a:visited,.warning a:hover { - color: red; -} - -.warning a:hover { - background: rgb(255, 230, 230); -} - -/* copied from xmenu.css */ -.webfx-menu-bar { - background: rgb(120, 172, 255); /*rgb(255,128,0);*/ - padding: 2px; - font-family: Verdana, Helvetica, Sans-Serif; - font-size: 11px; -} - -.webfx-menu-bar a,.webfx-menu-bar a:visited { - color: black; - border: 1px solid rgb(120, 172, 255); /*rgb(255,128,0);*/ - text-decoration: none; - padding: 1px; - padding-left: 5px; - padding-right: 5px; -} - -.webfx-menu-bar a:hover { - color: black; - background: rgb(120, 172, 255); - border-left: 1px solid rgb(234, 242, 255); /*#ffcc88;*/ - border-right: 1px solid rgb(0, 66, 174); /*#884400;*/ - border-top: 1px solid rgb(234, 242, 255); /*#ffcc88;*/ - border-bottom: 1px solid rgb(0, 66, 174); /*#884400;*/ -} - -.webfx-menu-bar a .arrow { - border: 0; - float: none; - /* - float: right; - width: 6px; - height: 16px; - - margin-right: 2px; - background: red; -*/ -} - -.webfx-menu-bar a:active,.webfx-menu-bar a:focus { - -moz-outline: none; - outline: none; -} -/* end xmenu.css copy */ \ No newline at end of file diff --git a/scripts/admin/tabpane/local/webfxlayout.js b/scripts/admin/tabpane/local/webfxlayout.js deleted file mode 100644 index 77aa2b1493f..00000000000 --- a/scripts/admin/tabpane/local/webfxlayout.js +++ /dev/null @@ -1,111 +0,0 @@ -/* this is a dummy webfxlayout file to be used in download zip files */ - - -/* Do includes */ - -if (window.pathToRoot == null) - pathToRoot = "./"; - -document.write(''); -webfxMenuDefaultImagePath = pathToRoot + "images/"; - -/* end includes */ - -/* set up browser checks and add a simple emulation for IE4 */ - -// check browsers -var op = /opera 5|opera\/5/i.test(navigator.userAgent); -var ie = !op && /msie/i.test(navigator.userAgent); // preventing opera to be identified as ie -var mz = !op && /mozilla\/5/i.test(navigator.userAgent); // preventing opera to be identified as mz - -if (ie && document.getElementById == null) { // ie4 - document.getElementById = function(sId) { - return document.all[sId]; - }; -} - -/* end browser checks */ - -webfxLayout = { - writeTitle : function (s, s2) { - document.write("
"); - if (op) { - document.write("

" + s + "

"); - } - else { - document.write("

" + s + "

"); - } - - if (s2 == null) - s2 = "WebFX - What you never thought possible!"; - - if (op) { - document.write("" + s2 + ""); - } - else { - document.write("" + s2 + ""); - } - }, - writeMainTitle : function () { - this.writeTitle("WebFX", "What you never thought possible!"); - }, - writeTopMenuBar : function () { - document.write("
"); - if (op) { - document.write(""); - document.write("
"); - } - else - document.write("
"); - document.write("
");// div is closed in writeBottomMenuBar - }, - writeBottomMenuBar : function () { - document.write("
"); - if (op) - document.write("
"); - else - document.write("
"); - document.write("
"); - document.write("
"); - }, - writeMenu : function () { - this.writeTopMenuBar(); - //document.write(webfxMenuBar); - document.write(""); - this.writeBottomMenuBar(); - }, - writeDesignedByEdger : function () { - if (ie && document.body.currentStyle.writingMode != null) - document.write("
Page designed and maintained by " + - "Erik Arvidsson & " + - "Emil A Eklund.
"); - } -}; - -if (ie && window.attachEvent) { - window.attachEvent("onload", function () { - var scrollBorderColor = "rgb(120,172,255)"; - var scrollFaceColor = "rgb(234,242,255)"; - with (document.body.style) { - scrollbarDarkShadowColor = scrollBorderColor; - scrollbar3dLightColor = scrollBorderColor; - scrollbarArrowColor = "black"; - scrollbarBaseColor = scrollFaceColor; - scrollbarFaceColor = scrollFaceColor; - scrollbarHighlightColor = scrollFaceColor; - scrollbarShadowColor = scrollFaceColor; - scrollbarTrackColor = "white"; - } - }); -} - -/* we also need some dummy constructors */ -webfxMenuBar = { - add : function () {} -}; -function WebFXMenu() { - this.add = function () {}; -} -function WebFXMenuItem() {} -function WebFXMenuSeparator() {} -function WebFXMenuButton() {} \ No newline at end of file diff --git a/scripts/admin/tabpane/memdemo.html b/scripts/admin/tabpane/memdemo.html deleted file mode 100644 index 7bde7475d1c..00000000000 --- a/scripts/admin/tabpane/memdemo.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - -Tab Pane Demo 2 (WebFX) - - - - - - - -

This page reloads as soon as the page is loaded... look at the -memory consuption.

- -
- -
-

General

- - - - - -
This is text of tab 1. This is text of tab 1. This is text of - tab 1. This is text of tab 1. This is text of tab 1. This is text of - tab 1. This is text of tab 1. This is text of tab 1. This is text of - tab 1.
- -
- -
-

Security

- - - - - -
This is text of tab 2. This is text of tab 2. This is text of - tab 2. This is text of tab 2. This is text of tab 2. This is text of - tab 2. This is text of tab 2. This is text of tab 2. This is text of - tab 2.
-
- This is text of tab 2. This is text of tab 2. This is text of tab 2. - This is text of tab 2. This is text of tab 2. This is text of tab 2. - This is text of tab 2. This is text of tab 2. This is text of tab 2.
- -
- -
-

Privacy

- - - - - -
This is text of tab 3. This is text of tab 3. This is text of - tab 3. This is text of tab 3. This is text of tab 3. This is text of - tab 3. This is text of tab 3. This is text of tab 3. This is text of - tab 3.
- -
- -
-

Content

- - - - - -
This is text of tab 4. This is text of tab 4. This is text of - tab 4. This is text of tab 4. This is text of tab 4. This is text of - tab 4. This is text of tab 4. This is text of tab 4. This is text of - tab 4.
- -
- -
- - - diff --git a/scripts/admin/tabpane/tabpane.html b/scripts/admin/tabpane/tabpane.html deleted file mode 100644 index 37283645836..00000000000 --- a/scripts/admin/tabpane/tabpane.html +++ /dev/null @@ -1,1208 +0,0 @@ - - - - -Tab Pane (WebFX) - - - - - - - - - - - - - - - -
- -

2002-02-17: Original version posted.
-2003-03-03: 1.02 - Fixes IE memory leakage.
-2006-05-26: Changed license to Apache Software -License 2.0.
-

- - -
-
-

Introduction

- - - -

You might remember that we used to have a pretty good tab strip -control here at WebFX a long time ago. This control was removed when we -redesigned the site with the argument that we should fix it to work in -Mozilla. Now, more than three years later we finally got down and -created a tab pane control that we think is a worthy replacement.

- -

This Tab Pane control is fairly similar to the tab system Tim -Scarfe created for developer-x.com -and the basic idea is the same. That idea is to be able to use a normal -XHTML document structure and if the browser supports DOM -level 1 then the structure of the elements is slightly adjusted and a -the className is changed for the tab pane container so that -the css rules specially defined for the tab are applied.

- -

The Tab Pane has support for persistence using cookies so that -you can navigate between pages without having to reselect the selected -tab for all your tab panes in your document. The look and feel is -entirely decided by CSS so it is fairly easy to create the look and feel -you need for your web application. As of this writing there are three -different styles available; Luna, Windows Classic and the WebFX look and -feel that this pane is currently using. See the demo -page for the look and feel of the other two.

- -
- -
-

Usage

- - - -

Include the Files

- -

To use the tab pane you should include two files. One JavaScript -file and on css file.

- -
-<script type="text/javascript" src="js/tabpane.js"></script>
-<link type="text/css" rel="StyleSheet" href="css/tab.webfx.css" />
-
- -

The XHTML Structure

- -

The basic structure for the tab pane consists of an element with -the class name tab-pane that in turn contains elements with -the class names tab-page. The tab page element should -contain one element with the class name tab. -This last one should preferably be a header of some kind in case the -browser does not support DOM1 and therefore will leave the structure -intact. The other two elements can be almost anything but a div -element is good because it usually does not change the rendering.

- -

Below is the code for a simple tab pane with the tab pages.

- -
-<div class="tab-pane" id="tab-pane-1">
-
-   <div class="tab-page">
-      <h2 class="tab">General</h2>
-
-      This is text of tab 1. This is text of tab 1.
-      This is text of tab 1. This is text of tab 1.
-
-   </div>
-
-   <div class="tab-page">
-      <h2 class="tab">Privacy</h2>
-
-      This is text of tab 2. This is text of tab 2.
-      This is text of tab 2. This is text of tab 2.
-
-   </div>
-</div>
-
- -

Notice that the id is not needed unless two or more -tab panes are present in the same document and you are using the -persistence feature.

- -

Initialization

- -

The code above is a complete working tab pane. You do not have to -add any more js code but there are a few good reasons why you would want -to do this. If no js code is added all the tab panes in the document are -initialized when the document is loaded. If you have lots of text and/or -images this will take quite some time and the layout of the page will -feel jerky. A better way is to call the function setupAllTabs -after all your XHTML has been defined. This works much better but if you -have a lot of text this is not optional either because the browser might -render some of the text before the entire tab structure is available.

- -
-      ...
-   </div>
-</div>
-<!-- tab pane closed -->
-
-<script type="text/javascript">
-setupAllTabs();
-</script>
-
- -

The best way to go is to create as much as possible as soon as -possible. This involves adding calls to js after the tab pane is opened -and as soon as every page is opened.

- -
-<div class="tab-pane" id="tab-pane-1">
-
-<script type="text/javascript">
-var tabPane1 = new WebFXTabPane( document.getElementById( "tab-pane-1" ) );
-</script>
-
-   <div class="tab-page" id="tab-page-1">
-      <h2 class="tab">General</h2>
-
-      <script type="text/javascript">
-      tabPane1.addTabPage( document.getElementById( "tab-page-1" ) );
-      </script>
-
-      This is text of tab 1. This is text of tab 1.
-      This is text of tab 1. This is text of tab 1.
-
-   </div>
-
-   <div class="tab-page" id="tab-page-2">
-      <h2 class="tab">Privacy</h2>
-
-      <script type="text/javascript">
-      tabPane1.addTabPage( document.getElementById( "tab-page-2" ) );
-      </script>
-
-      This is text of tab 2. This is text of tab 2.
-      This is text of tab 2. This is text of tab 2.
-
-   </div>
-</div>
-
- -

The code for this is, as you can see, not half as nice and you -should decide from time to time if you really need this. In most web -applications (especially intranet apps) this is not needed because the -amount of data inside each tab page is limited (or added later).

- -

One thing to note about this last method is that some browser -have trouble changing the content model during the page load (noticeably -Konqueror).

- -
- -
-

API

- - -

WebFXTabPane

-

This is the class representing a tab pane.

-

Syntax

-

new WebFXTabPane(oElement [, -bUseCookie])

-

Parameters

- - - - - - - - - - - - - - - - - - - - -
NameTypeDescripton
oElementHTMLElementThe html element that represents the tab pane
bUseCookieBooleanOptional. If this is set to - true then the selected tab is persisted. The default value is true. -
-

Static Methods

- - - - - - - - - - - - - - - - - - - - - -
NameDescription
setCookie -
-
-

Syntax

-

object.setCookie(sName, sValue [, - nDays])

-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescripton
sNameStringThe name of the cookie
sValueStringThe value of the cookie
nDaysNumberOptional. The number of - days to store the cookie
-

Return Type

-

void

-
-
-
Sets a cookie
getCookie -
-
-

Syntax

-

object.getCookie(sName)

-

Arguments

- - - - - - - - - - - - - - - -
NameTypeDescripton
sNameStringThe name of the cookie
-

Return Type

-

String

-
-
-
Retrieves a cookie by name
removeCookie -
-
-

Syntax

-

object.removeCookie(sName)

-

Arguments

- - - - - - - - - - - - - - - -
NameTypeDescripton
sNameStringThe name of the cookie to remove
-

Return Type

-

void

-
-
-
Removes a cookie by name
-

Static Fields

- - - - - - - - - - - - - -
NameTypeDescripton
None.
-

Methods

- - - - - - - - - - - - - - - - - - - - - -
NameDescription
addTabPage -
-
-

Syntax

-

object.addTabPage(oElement)

-

Arguments

- - - - - - - - - - - - - - - -
NameTypeDescripton
oElementHTMLElementThe html element that represents the tab page
-

Return Type

-

WebFXTabPage

-
-
-
Adds a tab page by passing an html element
getSelectedIndex -
-
-

Syntax

-

object.getSelectedIndex()

-

Arguments

-

No Arguments.

-

Return Type

-

Number

-
-
-
The index of the selected tab page
setSelectedIndex -
-
-

Syntax

-

object.setSelectedIndex(n)

-

Arguments

- - - - - - - - - - - - - - - -
NameTypeDescripton
nNumberThe index of the tab page to select
-

Return Type

-

void

-
-
-
Sets the selected tab page by index
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescripton
classNameTagStringThis string is added to the class name to tag the tab pane - as beeing created
elementHTMLElementRead only.The html element - being that represents the tab pane
pagesWebFXTabPages[]Read only.An array containing - the tab pages
selectedIndexNumberRead only.The index of the - selected tab page
tabRowHTMLElementRead only.The html element - that encloses all tabs
useCookieBooleanIs used to decide if the selected tab page index should be - persisted using a cookie.
-

Remarks

-

None.

-

WebFXTabPage

-

This is the class representing a tab page.

-

Syntax

-

new WebFXTabPage(oElement, -oTabPane, nIndex)

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescripton
oElementHTMLElementThe html element that represents the tab page
oTabPaneWebFXTabPaneThe tab pane to add the page to
nIndexNumberThe index of the tab page
-

Static Methods

- - - - - - - - - - - - -
NameDescription
None.
-

Static Fields

- - - - - - - - - - - - - -
NameTypeDescripton
None.
-

Methods

- - - - - - - - - - - - - - - - - - - - - -
NameDescription
hide -
-
-

Syntax

-

object.hide()

-

Arguments

-

No Arguments.

-

Return Type

-

void

-
-
-
Hides the tab page
select -
-
-

Syntax

-

object.select()

-

Arguments

-

No Arguments.

-

Return Type

-

void

-
-
-
Selects the tab page
show -
-
-

Syntax

-

object.show()

-

Arguments

-

No Arguments.

-

Return Type

-

void

-
-
-
Makes the tab page visible
-

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescripton
elementHTMLElementRead only.The html element - being used as the page
indexNumberRead only. The index of the - tab page in the tab pane pages array.
tabHTMLElementRead only.The html element - being used as the tab.
-

Remarks

-

Do not use this constructor manually. Use addTabPage of the -WebFXTabPane class instead.

-

Globals

-

Functions

- - - - - - - - - - - - - - - - - -
NameDescription
hasSupport -
-
-

Syntax

-

hasSupport()

-

Arguments

-

No Arguments.

-

Return Type

-

Boolean

-
-
-
Returns whether the browser is supported or not
setupAllTabs -
-
-

Syntax

-

setupAllTabs()

-

Arguments

-

No Arguments.

-

Return Type

-

void

-
-
-
Initializes all tab panes and tab pages that have not been - initialized already.
-

Objects

- - - - - - - - - - - - - -
NameTypeDescripton
None.
-
- -
-

Implementation

- - - -

Check for support

- -

The way to check the browser whether it support a certain feature -in the DOM is to use the method document.implementation.hasFeature. -However since IE5.5 supports all the features that this script needs but -it does not support this way of checking for support we have to add a -separate check for IE55.

- -
-function hasSupport() {
-
-   if (typeof hasSupport.support != "undefined")
-      return hasSupport.support;
-
-   var ie55 = /msie 5\.[56789]/i.test( navigator.userAgent );
-
-   hasSupport.support = ( typeof document.implementation != "undefined" &&
-         document.implementation.hasFeature( "html", "1.0" ) || ie55 )
-
-   // IE55 has a serious DOM1 bug... Patch it!
-   if ( ie55 ) {
-      document._getElementsByTagName = document.getElementsByTagName;
-      document.getElementsByTagName = function ( sTagName ) {
-         if ( sTagName == "*" )
-            return document.all;
-         else
-            return document._getElementsByTagName( sTagName );
-      };
-   }
-
-   return hasSupport.support;
-}
-
- -

As you can see in the code above IE55 has a bug an therefore we -also patch that. Too many people are still using IE55 to just ignore it.

- -

WebFXTabPane

- -

The constructor for the tab pane creates the tabRow -div that is used to place all the actual tabs in. It also checks the -cookie state so that the selected tab can be persisted. Besides from -this it sets up some properties needed to keep track of the states. Last -but not least it checks the childNodes of the element and -adds the found tab pages.

- -
-function WebFXTabPane( el, bUseCookie ) {
-   if ( !hasSupport() || el == null ) return;
-
-   this.element = el;
-   this.element.tabPane = this;
-   this.pages = [];
-   this.selectedIndex = null;
-   this.useCookie = bUseCookie != null ? bUseCookie : true;
-
-   // add class name tag to class name
-   this.element.className = this.classNameTag + " " + this.element.className;
-
-   // add tab row
-   this.tabRow = document.createElement( "div" );
-   this.tabRow.className = "tab-row";
-   el.insertBefore( this.tabRow, el.firstChild );
-
-   var tabIndex = 0;
-   if ( this.useCookie ) {
-      tabIndex = Number( WebFXTabPane.getCookie( "webfxtab_" + this.element.id ) );
-      if ( isNaN( tabIndex ) )
-         tabIndex = 0;
-   }
-   this.selectedIndex = tabIndex;
-
-   // loop through child nodes and add them
-   var cs = el.childNodes;
-   var n;
-   for (var i = 0; i < cs.length; i++) {
-      if (cs[i].nodeType == 1 && cs[i].className == "tab-page") {
-         this.addTabPage( cs[i] );
-      }
-   }
-}
-
- -

There are a few methods added to the WebFXTabPane -class and one of the more important ones is the method addTabPage. -This method takes the element that represents the tab page and uses that -to create a WebFXTabPage object that is added to the pages -array. Once the tab page has been added it also checks if this page is -the selected one and if it is it shows it.

- -
-WebFXTabPane.prototype = {
-
-   ...
-
-   addTabPage:   function ( oElement ) {
-      if ( !hasSupport() ) return;
-
-      if ( oElement.tabPage == this )   // already added
-         return oElement.tabPage;
-
-      var n = this.pages.length;
-      var tp = this.pages[n] = new WebFXTabPage( oElement, this, n );
-      tp.tabPane = this;
-
-      // move the tab out of the box
-      this.tabRow.appendChild( tp.tab );
-
-      if ( n == this.selectedIndex )
-         tp.show();
-      else
-         tp.hide();
-
-      return tp;
-   }
-};
-
- -

WebFXTabPage

- -

This class is used to keep track of the actual tab page. Once -created it moves the tab element to the tabRow of the tab -pane. It also adds an anchor around the text so that the user can use -the keyboard to activate the tabs.

- -
-function WebFXTabPage( el, tabPane, nIndex ) {
-   if ( !hasSupport() || el == null ) return;
-
-   this.element = el;
-   this.element.tabPage = this;
-   this.index = nIndex;
-
-   var cs = el.childNodes;
-   for (var i = 0; i < cs.length; i++) {
-      if (cs[i].nodeType == 1 && cs[i].className == "tab") {
-         this.tab = cs[i];
-         break;
-      }
-   }
-
-   // insert a tag around content to support keyboard navigation
-   var a = document.createElement( "A" );
-   a.href = "javascript:void 0;";
-   while ( this.tab.hasChildNodes() )
-      a.appendChild( this.tab.firstChild );
-   this.tab.appendChild( a );
-
-   // hook up events, using DOM0
-   var oThis = this;
-   this.tab.onclick = function () { oThis.select(); };
-   this.tab.onmouseover = function () { WebFXTabPage.tabOver( oThis ); };
-   this.tab.onmouseout = function () { WebFXTabPage.tabOut( oThis ); };
-}
-
- -

Initialization

- -

The initialization uses the global function setupAllTabs -that goes through all elements and checks their class names and if the -class names match the classes used by the tab pane controls it checks -whether this element belongs to an uninitialized control and in that -case it initializes it now.

- -
-function setupAllTabs() {
-   if ( !hasSupport() ) return;
-
-   var all = document.getElementsByTagName( "*" );
-   var l = all.length;
-   var tabPaneRe = /tab\-pane/;
-   var tabPageRe = /tab\-page/;
-   var cn, el;
-   var parentTabPane;
-
-   for ( var i = 0; i < l; i++ ) {
-      el = all[i]
-      cn = el.className;
-
-      // no className
-      if ( cn == "" ) continue;
-
-      // uninitiated tab pane
-      if ( tabPaneRe.test( cn ) && !el.tabPane )
-         new WebFXTabPane( el );
-
-      // unitiated tab page wit a valid tab pane parent
-      else if ( tabPageRe.test( cn ) && !el.tabPage &&
-               tabPaneRe.test( el.parentNode.className ) ) {
-         el.parentNode.tabPane.addTabPage( el );
-      }
-   }
-}
-
- -

This function can be called manually at any time but the script -makes hooks to the load event for the window. This is done -using DOM level 2 events if available. If not we test if it supports the -IE5 way of attaching events and last we fall back on classic way of -setting events.

- -
-// DOM2
-if ( typeof window.addEventListener != "undefined" )
-   window.addEventListener( "load", setupAllTabs, false );
-
-// IE
-else if ( typeof window.attachEvent != "undefined" )
-   window.attachEvent( "onload", setupAllTabs );
-
-else {
-   if ( window.onload != null ) {
-      var oldOnload = window.onload;
-      window.onload = function ( e ) {
-         oldOnload( e );
-         setupAllTabs();
-      };
-   }
-   else
-      window.onload = setupAllTabs;
-}
-
- -
-

Look & Feel

- - - - -

The structure

- -

To be able to change the look and feel one needs to understand -the structure of the tab pane. When the original XHTML source tree is -transformed into the tab pane the class name of the element representing -the tab pane is tagged with the property classNameTag. The -default tag is dynamic-tab-pane-control and therefore all -your css rules should take this into account. If you want different look -on different tab panes in the same document this tag can be changed to -make the css rules easier to set up.

- -
-<div class="dynamic-tab-pane-control tab-pane" id="tab-pane-1">
-   <div class="tab-row">
-      <h2 class="tab selected"><a ... >General</a></h2>
-      <h2 class="tab hover"><a ... >Privacy</a></h2>
-   </div>
-   <div class="tab-page">
-
-      This is text of tab 1. This is text of tab 1.
-      This is text of tab 1. This is text of tab 1.
-
-   </div>
-
-   <div class="tab-page">
-
-      This is text of tab 2. This is text of tab 2.
-      This is text of tab 2. This is text of tab 2.
-
-   </div>
-</div>
-
- -

The selected tab will have the class name tab -selected and the tab that the mouse hovers over will have the class name -tab hover. If the selected tab is hovered it will have the -class name tab selected hover. These rules allow you to -differentiate the look of tabs between the different states.

- -

The CSS Rules

- -

Here we will walk through the Windows -Classic css file. First we set the width and position of the tab pane to -prevent a few rendering bugs in IE6.

- -
-.dynamic-tab-pane-control.tab-pane {
-   position:        relative;
-   width:           100%;
-}
-
-.dynamic-tab-pane-control .tab-row {
-   z-index:         1;
-   white-space:     nowrap;
-}
-
- -

Then we setup the css for the tab. Notice how the position is set -to relative to allow the top position to be slightly changed and to -allow the z-index property to be changed to position the tabs below the -tab pages.

- -
-.dynamic-tab-pane-control .tab-row .tab {
-   font:            Menu;
-   cursor:          Default;
-   display:         inline;
-   margin:          1px -2px 1px 2px;
-   float:           left;
-   padding:         2px 5px 3px 5px;
-   background:      ThreeDFace;
-   border:          1px solid;
-   border-color:    ThreeDHighlight ThreeDDarkShadow
-                    ThreeDDarkShadow ThreeDHighlight;
-   border-bottom:   0;
-   z-index:         1;
-   position:        relative;
-   top:             0;
-}
-
- -

For the selected tab we set the z-index to 3 to put it above the -tab pages. We also move it a little and change some other properties to -make it look more like the classic window tab control.

- -
-.dynamic-tab-pane-control .tab-row .tab.selected {
-   border-bottom:   0;
-   z-index:         3;
-   padding:         2px 6px 5px 7px;
-   margin:          1px -3px -2px 0px;
-   top:             -2px;
-}
-
- -

Then we override the text properties on the tabs as well as for -the .hover rule.

- -
-.dynamic-tab-pane-control .tab-row .tab a {
-   font:            Menu;
-   color:           WindowText;
-   text-decoration: none;
-   cursor:          default;
-}
-
-.dynamic-tab-pane-control .tab-row .hover a {
-   color:           blue;
-}
-
- -

Then we set the z-index for the tab pages to 2 so that it will be -shown above tabs but below the selected tab. We also set the borders and -and a few other properties.

- -
-.dynamic-tab-pane-control .tab-page {
-   clear:           both;
-   border:          1px solid;
-   border-color:    ThreeDHighlight ThreeDDarkShadow
-                    ThreeDDarkShadow ThreeDHighlight;
-   background:      ThreeDFace;
-   z-index:         2;
-   position:        relative;
-   top:             -2px;
-   color:           WindowText;
-   font:            MessageBox;
-   font:            Message-Box;
-   padding:         10px;
-}
-
-
- - - -

Tab Pane
-Usage
-API
-Implementation
-Look & Feel
-Demo
-Download

- -

Author: Erik Arvidsson

- -
- - -