summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/YUI
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/YUI') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/YUI/Collapser.js22
-rw-r--r--frontend/beta/js/Clipperz/YUI/DomHelper.js22
-rw-r--r--frontend/beta/js/Clipperz/YUI/DomQuery.js22
-rw-r--r--frontend/beta/js/Clipperz/YUI/Drawer.js22
-rw-r--r--frontend/beta/js/Clipperz/YUI/IBLayoutManager.js22
-rw-r--r--frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js22
-rw-r--r--frontend/beta/js/Clipperz/YUI/MessageBox.js22
7 files changed, 70 insertions, 84 deletions
diff --git a/frontend/beta/js/Clipperz/YUI/Collapser.js b/frontend/beta/js/Clipperz/YUI/Collapser.js
index b104877..849cbe9 100644
--- a/frontend/beta/js/Clipperz/YUI/Collapser.js
+++ b/frontend/beta/js/Clipperz/YUI/Collapser.js
@@ -1,70 +1,68 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } 25if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; }
28 26
29 //found on YUI-EXT forum (http://www.yui-ext.com/forum/viewtopic.php?t=683&highlight=accordion) 27 //found on YUI-EXT forum (http://www.yui-ext.com/forum/viewtopic.php?t=683&highlight=accordion)
30Clipperz.YUI.Collapser = function(clickEl, collapseEl, initiallyCollapsed) { 28Clipperz.YUI.Collapser = function(clickEl, collapseEl, initiallyCollapsed) {
31 this.clickEl = getEl(clickEl); 29 this.clickEl = getEl(clickEl);
32 this.collapseEl = getEl(collapseEl); 30 this.collapseEl = getEl(collapseEl);
33 this.clickEl.addClass('collapser-expanded'); 31 this.clickEl.addClass('collapser-expanded');
34 if (initiallyCollapsed == true) { 32 if (initiallyCollapsed == true) {
35 this.afterCollapse(); 33 this.afterCollapse();
36 } 34 }
37 this.clickEl.mon('click', function(){ 35 this.clickEl.mon('click', function(){
38 this.collapsed === true ? this.expand() : this.collapse(); 36 this.collapsed === true ? this.expand() : this.collapse();
39 }, this, true); 37 }, this, true);
40}; 38};
41 39
42Clipperz.YUI.Collapser.prototype = { 40Clipperz.YUI.Collapser.prototype = {
43 'collapse': function(){ 41 'collapse': function(){
44 this.collapseEl.clip(); 42 this.collapseEl.clip();
45 this.collapseEl.setHeight(1, true, .35, this.afterCollapse.createDelegate(this), YAHOO.util.Easing.easeOut); 43 this.collapseEl.setHeight(1, true, .35, this.afterCollapse.createDelegate(this), YAHOO.util.Easing.easeOut);
46 this.clickEl.replaceClass('collapser-expanded','collapser-collapsed'); 44 this.clickEl.replaceClass('collapser-expanded','collapser-collapsed');
47 }, 45 },
48 46
49 'afterCollapse': function(){ 47 'afterCollapse': function(){
50 this.collapsed = true; 48 this.collapsed = true;
51 this.collapseEl.setDisplayed(false); 49 this.collapseEl.setDisplayed(false);
52 this.clickEl.replaceClass('collapser-expanded','collapser-collapsed'); 50 this.clickEl.replaceClass('collapser-expanded','collapser-collapsed');
53 }, 51 },
54 52
55 'expand': function(){ 53 'expand': function(){
56 this.collapseEl.setDisplayed(true); 54 this.collapseEl.setDisplayed(true);
57 this.collapseEl.autoHeight(true, .35, this.afterExpand.createDelegate(this), YAHOO.util.Easing.easeOut); 55 this.collapseEl.autoHeight(true, .35, this.afterExpand.createDelegate(this), YAHOO.util.Easing.easeOut);
58 this.clickEl.replaceClass('collapser-collapsed','collapser-expanded'); 56 this.clickEl.replaceClass('collapser-collapsed','collapser-expanded');
59 }, 57 },
60 58
61 'afterExpand': function(){ 59 'afterExpand': function(){
62 this.collapsed = false; 60 this.collapsed = false;
63 this.collapseEl.unclip(); 61 this.collapseEl.unclip();
64 this.collapseEl.setStyle('height', ''); 62 this.collapseEl.setStyle('height', '');
65 this.clickEl.replaceClass('collapser-collapsed','collapser-expanded'); 63 this.clickEl.replaceClass('collapser-collapsed','collapser-expanded');
66 }, 64 },
67 65
68 //----------------------------------------------------- 66 //-----------------------------------------------------
69 __syntaxFix__: '__syntaxFix__' 67 __syntaxFix__: '__syntaxFix__'
70}; 68};
diff --git a/frontend/beta/js/Clipperz/YUI/DomHelper.js b/frontend/beta/js/Clipperz/YUI/DomHelper.js
index 05edc49..2c0ba34 100644
--- a/frontend/beta/js/Clipperz/YUI/DomHelper.js
+++ b/frontend/beta/js/Clipperz/YUI/DomHelper.js
@@ -1,118 +1,116 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.ext) == 'undefined') { Clipperz.ext = {}; } 25if (typeof(Clipperz.ext) == 'undefined') { Clipperz.ext = {}; }
28 26
29/** 27/**
30 * @class Clipperz.YUI.DomHelper 28 * @class Clipperz.YUI.DomHelper
31 * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM. 29 * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM.
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>. 30 * 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>.
33 * @singleton 31 * @singleton
34 */ 32 */
35Clipperz.YUI.DomHelper = new function(){ 33Clipperz.YUI.DomHelper = new function(){
36 /**@private*/ 34 /**@private*/
37 var d = document; 35 var d = document;
38 var tempTableEl = null; 36 var tempTableEl = null;
39 /** True to force the use of DOM instead of html fragments @type Boolean */ 37 /** True to force the use of DOM instead of html fragments @type Boolean */
40 this.useDom = false; 38 this.useDom = false;
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; 39 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;
42 /** 40 /**
43 * Applies a style specification to an element 41 * Applies a style specification to an element
44 * @param {String/HTMLElement} el The element to apply styles to 42 * @param {String/HTMLElement} el The element to apply styles to
45 * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or 43 * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or
46 * a function which returns such a specification. 44 * a function which returns such a specification.
47 */ 45 */
48 this.applyStyles = function(el, styles){ 46 this.applyStyles = function(el, styles){
49 if(styles){ 47 if(styles){
50 var D = YAHOO.util.Dom; 48 var D = YAHOO.util.Dom;
51 if (typeof styles == "string"){ 49 if (typeof styles == "string"){
52 var re = /\s?([a-z\-]*)\:([^;]*);?/gi; 50 var re = /\s?([a-z\-]*)\:([^;]*);?/gi;
53 var matches; 51 var matches;
54 while ((matches = re.exec(styles)) != null){ 52 while ((matches = re.exec(styles)) != null){
55 D.setStyle(el, matches[1], matches[2]); 53 D.setStyle(el, matches[1], matches[2]);
56 } 54 }
57 }else if (typeof styles == "object"){ 55 }else if (typeof styles == "object"){
58 for (var style in styles){ 56 for (var style in styles){
59 D.setStyle(el, style, styles[style]); 57 D.setStyle(el, style, styles[style]);
60 } 58 }
61 }else if (typeof styles == "function"){ 59 }else if (typeof styles == "function"){
62 Clipperz.YUI.DomHelper.applyStyles(el, styles.call()); 60 Clipperz.YUI.DomHelper.applyStyles(el, styles.call());
63 } 61 }
64 } 62 }
65 }; 63 };
66 64
67 // build as innerHTML where available 65 // build as innerHTML where available
68 /** @ignore */ 66 /** @ignore */
69 var createHtml = function(o){ 67 var createHtml = function(o){
70 var b = ''; 68 var b = '';
71 69
72 if(typeof(o['html']) != 'undefined') { 70 if(typeof(o['html']) != 'undefined') {
73 o['html'] = Clipperz.Base.sanitizeString(o['html']); 71 o['html'] = Clipperz.Base.sanitizeString(o['html']);
74 } else if (typeof(o['htmlString']) != 'undefined') { 72 } else if (typeof(o['htmlString']) != 'undefined') {
75 o['html'] = o['htmlString']; 73 o['html'] = o['htmlString'];
76 delete o.htmlString; 74 delete o.htmlString;
77 } 75 }
78 76
79 b += '<' + o.tag; 77 b += '<' + o.tag;
80 for(var attr in o){ 78 for(var attr in o){
81 if(attr == 'tag' || attr == 'children' || attr == 'html' || typeof o[attr] == 'function') continue; 79 if(attr == 'tag' || attr == 'children' || attr == 'html' || typeof o[attr] == 'function') continue;
82 if(attr == 'style'){ 80 if(attr == 'style'){
83 var s = o['style']; 81 var s = o['style'];
84 if(typeof s == 'function'){ 82 if(typeof s == 'function'){
85 s = s.call(); 83 s = s.call();
86 } 84 }
87 if(typeof s == 'string'){ 85 if(typeof s == 'string'){
88 b += ' style="' + s + '"'; 86 b += ' style="' + s + '"';
89 }else if(typeof s == 'object'){ 87 }else if(typeof s == 'object'){
90 b += ' style="'; 88 b += ' style="';
91 for(var key in s){ 89 for(var key in s){
92 if(typeof s[key] != 'function'){ 90 if(typeof s[key] != 'function'){
93 b += key + ':' + s[key] + ';'; 91 b += key + ':' + s[key] + ';';
94 } 92 }
95 } 93 }
96 b += '"'; 94 b += '"';
97 } 95 }
98 }else{ 96 }else{
99 if(attr == 'cls'){ 97 if(attr == 'cls'){
100 b += ' class="' + o['cls'] + '"'; 98 b += ' class="' + o['cls'] + '"';
101 }else if(attr == 'htmlFor'){ 99 }else if(attr == 'htmlFor'){
102 b += ' for="' + o['htmlFor'] + '"'; 100 b += ' for="' + o['htmlFor'] + '"';
103 }else{ 101 }else{
104 b += ' ' + attr + '="' + o[attr] + '"'; 102 b += ' ' + attr + '="' + o[attr] + '"';
105 } 103 }
106 } 104 }
107 } 105 }
108 if(emptyTags.test(o.tag)){ 106 if(emptyTags.test(o.tag)){
109 b += ' />'; 107 b += ' />';
110 }else{ 108 }else{
111 b += '>'; 109 b += '>';
112 if(o.children){ 110 if(o.children){
113 for(var i = 0, len = o.children.length; i < len; i++) { 111 for(var i = 0, len = o.children.length; i < len; i++) {
114 b += createHtml(o.children[i], b); 112 b += createHtml(o.children[i], b);
115 } 113 }
116 } 114 }
117 if(o.html){ 115 if(o.html){
118 b += o.html; 116 b += o.html;
diff --git a/frontend/beta/js/Clipperz/YUI/DomQuery.js b/frontend/beta/js/Clipperz/YUI/DomQuery.js
index 4ad4193..6e54b6c 100644
--- a/frontend/beta/js/Clipperz/YUI/DomQuery.js
+++ b/frontend/beta/js/Clipperz/YUI/DomQuery.js
@@ -1,118 +1,116 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26/* 24/*
27 * yui-ext 0.40 25 * yui-ext 0.40
28 * Copyright(c) 2006, Jack Slocum. 26 * Copyright(c) 2006, Jack Slocum.
29 */ 27 */
30 28
31/** 29/**
32 * @class Ext.DomQuery 30 * @class Ext.DomQuery
33 * Provides high performance selector/xpath processing by compiling queries into reusable functions. 31 * Provides high performance selector/xpath processing by compiling queries into reusable functions.
34 * New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in). 32 * New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in).
35 * @singleton 33 * @singleton
36 */ 34 */
37Ext.DomQuery = function(){ 35Ext.DomQuery = function(){
38 var cache = {}, simpleCache = {}, valueCache = {}; 36 var cache = {}, simpleCache = {}, valueCache = {};
39 var nonSpace = /\S/; 37 var nonSpace = /\S/;
40 var trimRe = /^\s*(.*?)\s*$/; 38 var trimRe = /^\s*(.*?)\s*$/;
41 var tplRe = /\{(\d+)\}/g; 39 var tplRe = /\{(\d+)\}/g;
42 var modeRe = /^(\s?[\/>]\s?|\s|$)/; 40 var modeRe = /^(\s?[\/>]\s?|\s|$)/;
43 var clsRes = {}; 41 var clsRes = {};
44 42
45 function child(p, index){ 43 function child(p, index){
46 var i = 0; 44 var i = 0;
47 var n = p.firstChild; 45 var n = p.firstChild;
48 while(n){ 46 while(n){
49 if(n.nodeType == 1){ 47 if(n.nodeType == 1){
50 i++; 48 i++;
51 if(i == index){ 49 if(i == index){
52 return n; 50 return n;
53 } 51 }
54 } 52 }
55 n = n.nextSibling; 53 n = n.nextSibling;
56 } 54 }
57 return null; 55 return null;
58 }; 56 };
59 57
60 function next(d){ 58 function next(d){
61 var n = d.nextSibling; 59 var n = d.nextSibling;
62 while(n && n.nodeType != 1){ 60 while(n && n.nodeType != 1){
63 n = n.nextSibling; 61 n = n.nextSibling;
64 } 62 }
65 return n; 63 return n;
66 }; 64 };
67 65
68 function prev(d){ 66 function prev(d){
69 var n = d.previousSibling; 67 var n = d.previousSibling;
70 while(n && n.nodeType != 1){ 68 while(n && n.nodeType != 1){
71 n = n.previousSibling; 69 n = n.previousSibling;
72 } 70 }
73 return n; 71 return n;
74 }; 72 };
75 73
76 function clean(d){ 74 function clean(d){
77 var n = d.firstChild, ni = -1; 75 var n = d.firstChild, ni = -1;
78 while(n){ 76 while(n){
79 var nx = n.nextSibling; 77 var nx = n.nextSibling;
80 if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){ 78 if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){
81 d.removeChild(n); 79 d.removeChild(n);
82 }else{ 80 }else{
83 n.nodeIndex = ++ni; 81 n.nodeIndex = ++ni;
84 } 82 }
85 n = nx; 83 n = nx;
86 } 84 }
87 return this; 85 return this;
88 }; 86 };
89 87
90 function byClassName(c, a, v){ 88 function byClassName(c, a, v){
91 if(!v){ 89 if(!v){
92 return c; 90 return c;
93 } 91 }
94 var re = clsRes[v]; 92 var re = clsRes[v];
95 if(!re){ 93 if(!re){
96 re = new RegExp('(?:^|\\s)(?:' + v + ')(?:\\s|$)'); 94 re = new RegExp('(?:^|\\s)(?:' + v + ')(?:\\s|$)');
97 clsRes[v] = re; 95 clsRes[v] = re;
98 } 96 }
99 var r = []; 97 var r = [];
100 for(var i = 0, ci; ci = c[i]; i++){ 98 for(var i = 0, ci; ci = c[i]; i++){
101 if(re.test(ci.className)){ 99 if(re.test(ci.className)){
102 r[r.length] = ci; 100 r[r.length] = ci;
103 } 101 }
104 } 102 }
105 return r; 103 return r;
106 }; 104 };
107 105
108 function convert(c){ 106 function convert(c){
109 if(c.slice){ 107 if(c.slice){
110 return c; 108 return c;
111 } 109 }
112 var r = []; 110 var r = [];
113 for(var i = 0, l = c.length; i < l; i++){ 111 for(var i = 0, l = c.length; i < l; i++){
114 r[r.length] = c[i]; 112 r[r.length] = c[i];
115 } 113 }
116 return r; 114 return r;
117 }; 115 };
118 116
diff --git a/frontend/beta/js/Clipperz/YUI/Drawer.js b/frontend/beta/js/Clipperz/YUI/Drawer.js
index 508bfe5..2105363 100644
--- a/frontend/beta/js/Clipperz/YUI/Drawer.js
+++ b/frontend/beta/js/Clipperz/YUI/Drawer.js
@@ -1,118 +1,116 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } 25if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; }
28 26
29 27
30Clipperz.YUI.Drawer = function(anElement, aRegion) { 28Clipperz.YUI.Drawer = function(anElement, aRegion) {
31 this._status = 'slideIn'; 29 this._status = 'slideIn';
32 30
33 this._element = YAHOO.ext.Element.get(anElement); 31 this._element = YAHOO.ext.Element.get(anElement);
34 this._region = aRegion || null; 32 this._region = aRegion || null;
35 33
36 this._collapsedElement = this.element().getChildrenByClassName("drawer-collapsed")[0]; 34 this._collapsedElement = this.element().getChildrenByClassName("drawer-collapsed")[0];
37 this._contentElement = this.element().getChildrenByClassName("drawer-content")[0]; 35 this._contentElement = this.element().getChildrenByClassName("drawer-content")[0];
38 36
39 37
40 this._wholeCollapedElement = this.enhanceCollapsedElement(); 38 this._wholeCollapedElement = this.enhanceCollapsedElement();
41 this._wholeCollapedElement.setWidth(this.region().element().getWidth()); 39 this._wholeCollapedElement.setWidth(this.region().element().getWidth());
42 this._wholeCollapedElement.setHeight(this.region().element().getHeight()); 40 this._wholeCollapedElement.setHeight(this.region().element().getHeight());
43 41
44 this._contentWrapper = this.enhanceContentElement(); 42 this._contentWrapper = this.enhanceContentElement();
45 this._contentElementActor = new YAHOO.ext.Actor(this.contentWrapper().dom); 43 this._contentElementActor = new YAHOO.ext.Actor(this.contentWrapper().dom);
46 this.contentElementActor().hide(); 44 this.contentElementActor().hide();
47 45
48 this._contentWidth = 200; 46 this._contentWidth = 200;
49}; 47};
50 48
51YAHOO.extendX(Clipperz.YUI.Drawer, YAHOO.ext.util.Observable, { 49YAHOO.extendX(Clipperz.YUI.Drawer, YAHOO.ext.util.Observable, {
52 50
53 'element': function() { 51 'element': function() {
54 return this._element; 52 return this._element;
55 }, 53 },
56 54
57 //----------------------------------------------------- 55 //-----------------------------------------------------
58 56
59 'status': function() { 57 'status': function() {
60 return this._status; 58 return this._status;
61 }, 59 },
62 60
63 'setStatus': function(aValue) { 61 'setStatus': function(aValue) {
64 this._status = aValue; 62 this._status = aValue;
65 }, 63 },
66 64
67 //----------------------------------------------------- 65 //-----------------------------------------------------
68 66
69 'collapsedElement': function() { 67 'collapsedElement': function() {
70 return this._collapsedElement; 68 return this._collapsedElement;
71 }, 69 },
72 70
73 //----------------------------------------------------- 71 //-----------------------------------------------------
74 72
75 'contentElement': function() { 73 'contentElement': function() {
76 return this._contentElement; 74 return this._contentElement;
77 }, 75 },
78 76
79 //----------------------------------------------------- 77 //-----------------------------------------------------
80 78
81 'contentElementActor': function() { 79 'contentElementActor': function() {
82 return this._contentElementActor; 80 return this._contentElementActor;
83 }, 81 },
84 82
85 //----------------------------------------------------- 83 //-----------------------------------------------------
86 84
87 'contentWrapper': function() { 85 'contentWrapper': function() {
88 return this._contentWrapper; 86 return this._contentWrapper;
89 }, 87 },
90 88
91 //----------------------------------------------------- 89 //-----------------------------------------------------
92 90
93 'contentWidth': function() { 91 'contentWidth': function() {
94 return this._contentWidth; 92 return this._contentWidth;
95 }, 93 },
96 94
97 //----------------------------------------------------- 95 //-----------------------------------------------------
98 96
99 'region': function() { 97 'region': function() {
100 return this._region; 98 return this._region;
101 }, 99 },
102 100
103 //----------------------------------------------------- 101 //-----------------------------------------------------
104 102
105 'enhanceCollapsedElement': function() { 103 'enhanceCollapsedElement': function() {
106 varwrapper; 104 varwrapper;
107 var link; 105 var link;
108 106
109 wrapper = this.collapsedElement().wrap({tag:'div', cls:'drawer-collapsedElement-wrapper', children:[ 107 wrapper = this.collapsedElement().wrap({tag:'div', cls:'drawer-collapsedElement-wrapper', children:[
110 {tag:'div', cls:'drawer-pin-button', children:[ 108 {tag:'div', cls:'drawer-pin-button', children:[
111 {tag:'a', cls:'drawer-pin-button', href:"#", children:[ 109 {tag:'a', cls:'drawer-pin-button', href:"#", children:[
112 {tag:'img', src:'./images/directLogins/drawer/mm-expand.gif'} 110 {tag:'img', src:'./images/directLogins/drawer/mm-expand.gif'}
113 ]} 111 ]}
114 ]} 112 ]}
115 ]}); 113 ]});
116 114
117 link = wrapper.getChildrenByClassName('drawer-pin-button', 'a')[0]; 115 link = wrapper.getChildrenByClassName('drawer-pin-button', 'a')[0];
118 MochiKit.Signal.connect(link.dom, 'onclick', this, 'pinDrawer'); 116 MochiKit.Signal.connect(link.dom, 'onclick', this, 'pinDrawer');
diff --git a/frontend/beta/js/Clipperz/YUI/IBLayoutManager.js b/frontend/beta/js/Clipperz/YUI/IBLayoutManager.js
index 6e2138e..d6b5782 100644
--- a/frontend/beta/js/Clipperz/YUI/IBLayoutManager.js
+++ b/frontend/beta/js/Clipperz/YUI/IBLayoutManager.js
@@ -1,111 +1,109 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } 25if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; }
28 26
29 27
30Clipperz.YUI.IBLayoutManager = function(container, config) { 28Clipperz.YUI.IBLayoutManager = function(container, config) {
31 var regionName; 29 var regionName;
32 varelement; 30 varelement;
33 31
34 config = config || {}; 32 config = config || {};
35 33
36 Clipperz.YUI.IBLayoutManager.superclass.constructor.call(this, container); 34 Clipperz.YUI.IBLayoutManager.superclass.constructor.call(this, container);
37 this.hideOnLayout = config.hideOnLayout || false; 35 this.hideOnLayout = config.hideOnLayout || false;
38 36
39 element = YAHOO.ext.Element.get(container); 37 element = YAHOO.ext.Element.get(container);
40 element.setStyle('position', 'absolute'); 38 element.setStyle('position', 'absolute');
41 element.setStyle('overflow', 'hidden'); 39 element.setStyle('overflow', 'hidden');
42 40
43 for (regionName in config.regions) { 41 for (regionName in config.regions) {
44 var newRegion; 42 var newRegion;
45 43
46 newRegion = new new Clipperz.YUI.IBLayoutRegion(this, regionName, config.regions[regionName]); 44 newRegion = new new Clipperz.YUI.IBLayoutRegion(this, regionName, config.regions[regionName]);
47 this.addRegion(regionName, newRegion); 45 this.addRegion(regionName, newRegion);
48 } 46 }
49 47
50 this.layout(); 48 this.layout();
51}; 49};
52 50
53YAHOO.extendX(Clipperz.YUI.IBLayoutManager, YAHOO.ext.LayoutManager, { 51YAHOO.extendX(Clipperz.YUI.IBLayoutManager, YAHOO.ext.LayoutManager, {
54 52
55 'toString': function() { 53 'toString': function() {
56 return "IBLayoutManager (" + this.el.id + ")"; 54 return "IBLayoutManager (" + this.el.id + ")";
57 }, 55 },
58 56
59 //----------------------------------------------------- 57 //-----------------------------------------------------
60 58
61 'add': function(aName, aPanel) { 59 'add': function(aName, aPanel) {
62 var regionName; 60 var regionName;
63 61
64 regionName = aName.toLowerCase(); 62 regionName = aName.toLowerCase();
65 return this.regions[regionName].add(aPanel); 63 return this.regions[regionName].add(aPanel);
66 }, 64 },
67 65
68 //----------------------------------------------------- 66 //-----------------------------------------------------
69 67
70 'addRegion': function(aRegion) { 68 'addRegion': function(aRegion) {
71 var regionName; 69 var regionName;
72 70
73 regionName = aRegion.name().toLowerCase(); 71 regionName = aRegion.name().toLowerCase();
74 if (!this.regions[regionName]) { 72 if (!this.regions[regionName]) {
75//MochiKit.Logging.logDebug("--- adding region with name: " + aRegion.name()); 73//MochiKit.Logging.logDebug("--- adding region with name: " + aRegion.name());
76 this.regions[regionName] = aRegion; 74 this.regions[regionName] = aRegion;
77 } else { 75 } else {
78 // ???? 76 // ????
79 } 77 }
80 78
81 return aRegion; 79 return aRegion;
82 }, 80 },
83 81
84 //----------------------------------------------------- 82 //-----------------------------------------------------
85 83
86 'getRegion': function(target){ 84 'getRegion': function(target){
87 return this.regions[target.toLowerCase()]; 85 return this.regions[target.toLowerCase()];
88 }, 86 },
89 87
90 //----------------------------------------------------- 88 //-----------------------------------------------------
91 89
92 'layout': function(){ 90 'layout': function(){
93 varregion; 91 varregion;
94 92
95//MochiKit.Logging.logDebug(">>> IBLayoutManager.layout - regions: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(this.regions))); 93//MochiKit.Logging.logDebug(">>> IBLayoutManager.layout - regions: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(this.regions)));
96 for (region in this.regions) { 94 for (region in this.regions) {
97//MochiKit.Logging.logDebug("--- IBLayoutManager.layout - region: " + region); 95//MochiKit.Logging.logDebug("--- IBLayoutManager.layout - region: " + region);
98 this.regions[region].layout(); 96 this.regions[region].layout();
99 } 97 }
100//MochiKit.Logging.logDebug("<<< IBLayoutManager.layout"); 98//MochiKit.Logging.logDebug("<<< IBLayoutManager.layout");
101 }, 99 },
102 100
103 //----------------------------------------------------- 101 //-----------------------------------------------------
104 102
105 'getSize': function() { 103 'getSize': function() {
106 return this.el.getSize(); 104 return this.el.getSize();
107 }, 105 },
108 106
109 //----------------------------------------------------- 107 //-----------------------------------------------------
110 __syntaxFix__: '__syntaxFix__' 108 __syntaxFix__: '__syntaxFix__'
111}); 109});
diff --git a/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js b/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js
index f8e0cb1..11b7a6c 100644
--- a/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js
+++ b/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js
@@ -1,118 +1,116 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } 25if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; }
28 26
29 27
30Clipperz.YUI.IBLayoutRegion = function(aManager, aName, aConfig) { 28Clipperz.YUI.IBLayoutRegion = function(aManager, aName, aConfig) {
31 this._configuration = aConfig; 29 this._configuration = aConfig;
32 30
33 //Clipperz.YUI.IBLayoutRegion.superclass.constructor.call(); 31 //Clipperz.YUI.IBLayoutRegion.superclass.constructor.call();
34 Clipperz.YUI.IBLayoutRegion.superclass.constructor.call(this, aManager, aConfig, aName); 32 Clipperz.YUI.IBLayoutRegion.superclass.constructor.call(this, aManager, aConfig, aName);
35}; 33};
36 34
37YAHOO.extendX(Clipperz.YUI.IBLayoutRegion, YAHOO.ext.LayoutRegion, { 35YAHOO.extendX(Clipperz.YUI.IBLayoutRegion, YAHOO.ext.LayoutRegion, {
38 36
39 'toString': function() { 37 'toString': function() {
40 return "IBLayoutRegion (" + this.name() + ")"; 38 return "IBLayoutRegion (" + this.name() + ")";
41 }, 39 },
42 40
43 //----------------------------------------------------- 41 //-----------------------------------------------------
44 42
45 'name': function() { 43 'name': function() {
46 return this.position; 44 return this.position;
47 }, 45 },
48 46
49 //----------------------------------------------------- 47 //-----------------------------------------------------
50 48
51 'manager': function() { 49 'manager': function() {
52 return this.mgr; 50 return this.mgr;
53 }, 51 },
54 52
55 'configuration': function() { 53 'configuration': function() {
56 return this._configuration; 54 return this._configuration;
57 }, 55 },
58 56
59 //----------------------------------------------------- 57 //-----------------------------------------------------
60 58
61 'getAttributeValue': function(anAttribute) { 59 'getAttributeValue': function(anAttribute) {
62 var result; 60 var result;
63 61
64 switch(anAttribute) { 62 switch(anAttribute) {
65 case "top": 63 case "top":
66 result = this.element().getTop(); 64 result = this.element().getTop();
67 break; 65 break;
68 case "left": 66 case "left":
69 result = this.element().getLeft(); 67 result = this.element().getLeft();
70 break; 68 break;
71 case "bottom": 69 case "bottom":
72 result = this.element().getBottom(); 70 result = this.element().getBottom();
73 break; 71 break;
74 case "right": 72 case "right":
75 result = this.element().getRight(); 73 result = this.element().getRight();
76 break; 74 break;
77 case "height": 75 case "height":
78 result = this.element().getHeight(); 76 result = this.element().getHeight();
79 break; 77 break;
80 case "width": 78 case "width":
81 result = this.element().getWidth(); 79 result = this.element().getWidth();
82 break; 80 break;
83 } 81 }
84//MochiKit.Logging.logDebug("--- " + this.name() + " [" + anAttribute + "] = " + result); 82//MochiKit.Logging.logDebug("--- " + this.name() + " [" + anAttribute + "] = " + result);
85 83
86 return result; 84 return result;
87 }, 85 },
88 86
89 //----------------------------------------------------- 87 //-----------------------------------------------------
90 88
91 'normalizeConfigureValue': function(aConfigurationValue) { 89 'normalizeConfigureValue': function(aConfigurationValue) {
92 var result; 90 var result;
93 91
94//MochiKit.Logging.logDebug("--- normalizeConfigureValue - " + aConfigurationValue); 92//MochiKit.Logging.logDebug("--- normalizeConfigureValue - " + aConfigurationValue);
95 if (typeof(aConfigurationValue) == 'number') { 93 if (typeof(aConfigurationValue) == 'number') {
96 result = aConfigurationValue; 94 result = aConfigurationValue;
97 } else if (aConfigurationValue == 'auto') { 95 } else if (aConfigurationValue == 'auto') {
98 result = aConfigurationValue; 96 result = aConfigurationValue;
99 } else { 97 } else {
100 var splitValues; 98 var splitValues;
101 var referenceValue; 99 var referenceValue;
102 var deltaValue; 100 var deltaValue;
103 var targetRegion; 101 var targetRegion;
104 var targetAttribute; 102 var targetAttribute;
105 103
106 splitValues = aConfigurationValue.split('+'); 104 splitValues = aConfigurationValue.split('+');
107 referenceValue = Clipperz.Base.trim(splitValues[0]); 105 referenceValue = Clipperz.Base.trim(splitValues[0]);
108 deltaValue = Clipperz.Base.trim(splitValues[1] || ""); 106 deltaValue = Clipperz.Base.trim(splitValues[1] || "");
109 107
110 splitValues = referenceValue.split('.'); 108 splitValues = referenceValue.split('.');
111 targetRegion = splitValues[0]; 109 targetRegion = splitValues[0];
112 targetAttribute = splitValues[1]; 110 targetAttribute = splitValues[1];
113 111
114//MochiKit.Logging.logDebug("> " + aConfigurationValue); 112//MochiKit.Logging.logDebug("> " + aConfigurationValue);
115//MochiKit.Logging.logDebug(">> manager: " + this.manager()); 113//MochiKit.Logging.logDebug(">> manager: " + this.manager());
116//MochiKit.Logging.logDebug(">> targetRegion: " + targetRegion); 114//MochiKit.Logging.logDebug(">> targetRegion: " + targetRegion);
117//MochiKit.Logging.logDebug(">>> " + this.manager().getRegion(targetRegion)); 115//MochiKit.Logging.logDebug(">>> " + this.manager().getRegion(targetRegion));
118 targetValue = this.manager().getRegion(targetRegion).getAttributeValue(targetAttribute); 116 targetValue = this.manager().getRegion(targetRegion).getAttributeValue(targetAttribute);
diff --git a/frontend/beta/js/Clipperz/YUI/MessageBox.js b/frontend/beta/js/Clipperz/YUI/MessageBox.js
index c7b4702..8b8ca7f 100644
--- a/frontend/beta/js/Clipperz/YUI/MessageBox.js
+++ b/frontend/beta/js/Clipperz/YUI/MessageBox.js
@@ -1,118 +1,116 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.YUI.MessageBox = function(){ 24Clipperz.YUI.MessageBox = function(){
27 var dlg, opt, mask; 25 var dlg, opt, mask;
28 var bodyEl, msgEl, textboxEl, textareaEl, progressEl, pp; 26 var bodyEl, msgEl, textboxEl, textareaEl, progressEl, pp;
29 var buttons, activeTextEl, bwidth; 27 var buttons, activeTextEl, bwidth;
30 28
31 var handleButton = function(button){ 29 var handleButton = function(button){
32 if(typeof opt.fn == 'function'){ 30 if(typeof opt.fn == 'function'){
33 if(opt.fn.call(opt.scope||window, button, activeTextEl.dom.value) !== false){ 31 if(opt.fn.call(opt.scope||window, button, activeTextEl.dom.value) !== false){
34 dlg.hide(); 32 dlg.hide();
35 } 33 }
36 }else{ 34 }else{
37 dlg.hide(); 35 dlg.hide();
38 } 36 }
39 }; 37 };
40 38
41 return { 39 return {
42 updateButtons: function(b){ 40 updateButtons: function(b){
43 var width = 0; 41 var width = 0;
44 if(!b){ 42 if(!b){
45 buttons['ok'].hide(); 43 buttons['ok'].hide();
46 buttons['cancel'].hide(); 44 buttons['cancel'].hide();
47 buttons['yes'].hide(); 45 buttons['yes'].hide();
48 buttons['no'].hide(); 46 buttons['no'].hide();
49 return width; 47 return width;
50 } 48 }
51 for(var k in buttons){ 49 for(var k in buttons){
52 if(typeof buttons[k] != 'function'){ 50 if(typeof buttons[k] != 'function'){
53 if(b[k]){ 51 if(b[k]){
54 buttons[k].show(); 52 buttons[k].show();
55 buttons[k].setText(typeof b[k] == 'string' ? b[k] : YAHOO.ext.MessageBox.buttonText[k]); 53 buttons[k].setText(typeof b[k] == 'string' ? b[k] : YAHOO.ext.MessageBox.buttonText[k]);
56 width += buttons[k].el.getWidth()+15; 54 width += buttons[k].el.getWidth()+15;
57 }else{ 55 }else{
58 buttons[k].hide(); 56 buttons[k].hide();
59 } 57 }
60 } 58 }
61 } 59 }
62 return width; 60 return width;
63 }, 61 },
64 62
65 getDialog : function(){ 63 getDialog : function(){
66 if(!dlg){ 64 if(!dlg){
67 dlg = new YAHOO.ext.BasicDialog('mb-dlg', { 65 dlg = new YAHOO.ext.BasicDialog('mb-dlg', {
68 autoCreate:true, 66 autoCreate:true,
69 shadow:true, 67 shadow:true,
70 draggable:true, 68 draggable:true,
71 resizable:false, 69 resizable:false,
72 constraintoviewport:true, 70 constraintoviewport:true,
73 fixedcenter:true, 71 fixedcenter:true,
74 shim:true, 72 shim:true,
75 modal:true, 73 modal:true,
76 width:400, height:100, 74 width:400, height:100,
77 buttonAlign:'center', 75 buttonAlign:'center',
78 closeClick : function(){ 76 closeClick : function(){
79 if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){ 77 if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){
80 handleButton('no'); 78 handleButton('no');
81 }else{ 79 }else{
82 handleButton('cancel'); 80 handleButton('cancel');
83 } 81 }
84 } 82 }
85 }); 83 });
86 dlg.closeClick = function(){ 84 dlg.closeClick = function(){
87 alert('wtf'); 85 alert('wtf');
88 }; 86 };
89 mask = dlg.mask; 87 mask = dlg.mask;
90 dlg.addKeyListener(27, dlg.hide, dlg); 88 dlg.addKeyListener(27, dlg.hide, dlg);
91 buttons = {}; 89 buttons = {};
92 buttons['ok'] = dlg.addButton(this.buttonText['ok'], handleButton.createCallback('ok')); 90 buttons['ok'] = dlg.addButton(this.buttonText['ok'], handleButton.createCallback('ok'));
93 buttons['yes'] = dlg.addButton(this.buttonText['yes'], handleButton.createCallback('yes')); 91 buttons['yes'] = dlg.addButton(this.buttonText['yes'], handleButton.createCallback('yes'));
94 buttons['no'] = dlg.addButton(this.buttonText['no'], handleButton.createCallback('no')); 92 buttons['no'] = dlg.addButton(this.buttonText['no'], handleButton.createCallback('no'));
95 buttons['cancel'] = dlg.addButton(this.buttonText['cancel'], handleButton.createCallback('cancel')); 93 buttons['cancel'] = dlg.addButton(this.buttonText['cancel'], handleButton.createCallback('cancel'));
96 bodyEl = dlg.body.createChild({ 94 bodyEl = dlg.body.createChild({
97 tag:'div', 95 tag:'div',
98 html:'<span class="ext-mb-text"></span><br /><input type="text" class="ext-mb-input"><textarea class="ext-mb-textarea"></textarea><div class="ext-mb-progress-wrap"><div class="ext-mb-progress"><div class="ext-mb-progress-bar">&#160;</div></div></div>' 96 html:'<span class="ext-mb-text"></span><br /><input type="text" class="ext-mb-input"><textarea class="ext-mb-textarea"></textarea><div class="ext-mb-progress-wrap"><div class="ext-mb-progress"><div class="ext-mb-progress-bar">&#160;</div></div></div>'
99 }); 97 });
100 msgEl = bodyEl.dom.firstChild; 98 msgEl = bodyEl.dom.firstChild;
101 textboxEl = getEl(bodyEl.dom.childNodes[2]); 99 textboxEl = getEl(bodyEl.dom.childNodes[2]);
102 textboxEl.enableDisplayMode(); 100 textboxEl.enableDisplayMode();
103 textboxEl.addKeyListener([10,13], function(){ 101 textboxEl.addKeyListener([10,13], function(){
104 if(dlg.isVisible() && opt && opt.buttons){ 102 if(dlg.isVisible() && opt && opt.buttons){
105 if(opt.buttons.ok){ 103 if(opt.buttons.ok){
106 handleButton('ok'); 104 handleButton('ok');
107 }else if(opt.buttons.yes){ 105 }else if(opt.buttons.yes){
108 handleButton('yes'); 106 handleButton('yes');
109 } 107 }
110 } 108 }
111 }); 109 });
112 textareaEl = getEl(bodyEl.dom.childNodes[3]); 110 textareaEl = getEl(bodyEl.dom.childNodes[3]);
113 textareaEl.enableDisplayMode(); 111 textareaEl.enableDisplayMode();
114 progressEl = getEl(bodyEl.dom.childNodes[4]); 112 progressEl = getEl(bodyEl.dom.childNodes[4]);
115 progressEl.enableDisplayMode(); 113 progressEl.enableDisplayMode();
116 pp = getEl(progressEl.dom.firstChild.firstChild); 114 pp = getEl(progressEl.dom.firstChild.firstChild);
117 } 115 }
118 return dlg; 116 return dlg;