summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/YUI/DomHelper.js
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/YUI/DomHelper.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/YUI/DomHelper.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/YUI/DomHelper.js b/frontend/beta/js/Clipperz/YUI/DomHelper.js
index 4f8acde..05edc49 100644
--- a/frontend/beta/js/Clipperz/YUI/DomHelper.js
+++ b/frontend/beta/js/Clipperz/YUI/DomHelper.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.ext) == 'undefined') { Clipperz.ext = {}; } 27if (typeof(Clipperz.ext) == 'undefined') { Clipperz.ext = {}; }
31 28
32/** 29/**
33 * @class Clipperz.YUI.DomHelper 30 * @class Clipperz.YUI.DomHelper
34 * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM. 31 * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM.
35 * For more information see <a href="http://www.jackslocum.com/yui/2006/10/06/domhelper-create-elements-using-dom-html-fragments-or-templates/">this blog post with examples</a>. 32 * For more information see <a href="http://www.jackslocum.com/yui/2006/10/06/domhelper-create-elements-using-dom-html-fragments-or-templates/">this blog post with examples</a>.
36 * @singleton 33 * @singleton
37 */ 34 */
38Clipperz.YUI.DomHelper = new function(){ 35Clipperz.YUI.DomHelper = new function(){
39 /**@private*/ 36 /**@private*/
40 var d = document; 37 var d = document;
41 var tempTableEl = null; 38 var tempTableEl = null;
42 /** True to force the use of DOM instead of html fragments @type Boolean */ 39 /** True to force the use of DOM instead of html fragments @type Boolean */
43 this.useDom = false; 40 this.useDom = false;
44 var emptyTags = /^(?:base|basefont|br|frame|hr|img|input|isindex|link|meta|nextid|range|spacer|wbr|audioscope|area|param|keygen|col|limittext|spot|tab|over|right|left|choose|atop|of)$/i; 41 var emptyTags = /^(?:base|basefont|br|frame|hr|img|input|isindex|link|meta|nextid|range|spacer|wbr|audioscope|area|param|keygen|col|limittext|spot|tab|over|right|left|choose|atop|of)$/i;
45 /** 42 /**
46 * Applies a style specification to an element 43 * Applies a style specification to an element
47 * @param {String/HTMLElement} el The element to apply styles to 44 * @param {String/HTMLElement} el The element to apply styles to
48 * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or 45 * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or
49 * a function which returns such a specification. 46 * a function which returns such a specification.
50 */ 47 */
51 this.applyStyles = function(el, styles){ 48 this.applyStyles = function(el, styles){
52 if(styles){ 49 if(styles){
53 var D = YAHOO.util.Dom; 50 var D = YAHOO.util.Dom;
54 if (typeof styles == "string"){ 51 if (typeof styles == "string"){
55 var re = /\s?([a-z\-]*)\:([^;]*);?/gi; 52 var re = /\s?([a-z\-]*)\:([^;]*);?/gi;
56 var matches; 53 var matches;
57 while ((matches = re.exec(styles)) != null){ 54 while ((matches = re.exec(styles)) != null){
58 D.setStyle(el, matches[1], matches[2]); 55 D.setStyle(el, matches[1], matches[2]);
59 } 56 }
60 }else if (typeof styles == "object"){ 57 }else if (typeof styles == "object"){
61 for (var style in styles){ 58 for (var style in styles){
62 D.setStyle(el, style, styles[style]); 59 D.setStyle(el, style, styles[style]);
63 } 60 }
64 }else if (typeof styles == "function"){ 61 }else if (typeof styles == "function"){
65 Clipperz.YUI.DomHelper.applyStyles(el, styles.call()); 62 Clipperz.YUI.DomHelper.applyStyles(el, styles.call());
66 } 63 }
67 } 64 }
68 }; 65 };
69 66
70 // build as innerHTML where available 67 // build as innerHTML where available
71 /** @ignore */ 68 /** @ignore */
72 var createHtml = function(o){ 69 var createHtml = function(o){