Diffstat (limited to 'frontend/beta/js/Clipperz/YUI/Collapser.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/YUI/Collapser.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/YUI/Collapser.js b/frontend/beta/js/Clipperz/YUI/Collapser.js index 5c0ac0f..b104877 100644 --- a/frontend/beta/js/Clipperz/YUI/Collapser.js +++ b/frontend/beta/js/Clipperz/YUI/Collapser.js | |||
@@ -1,73 +1,70 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer 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 | ||
29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
30 | if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } | 27 | if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } |
31 | 28 | ||
32 | //found on YUI-EXT forum (http://www.yui-ext.com/forum/viewtopic.php?t=683&highlight=accordion) | 29 | //found on YUI-EXT forum (http://www.yui-ext.com/forum/viewtopic.php?t=683&highlight=accordion) |
33 | Clipperz.YUI.Collapser = function(clickEl, collapseEl, initiallyCollapsed) { | 30 | Clipperz.YUI.Collapser = function(clickEl, collapseEl, initiallyCollapsed) { |
34 | this.clickEl = getEl(clickEl); | 31 | this.clickEl = getEl(clickEl); |
35 | this.collapseEl = getEl(collapseEl); | 32 | this.collapseEl = getEl(collapseEl); |
36 | this.clickEl.addClass('collapser-expanded'); | 33 | this.clickEl.addClass('collapser-expanded'); |
37 | if (initiallyCollapsed == true) { | 34 | if (initiallyCollapsed == true) { |
38 | this.afterCollapse(); | 35 | this.afterCollapse(); |
39 | } | 36 | } |
40 | this.clickEl.mon('click', function(){ | 37 | this.clickEl.mon('click', function(){ |
41 | this.collapsed === true ? this.expand() : this.collapse(); | 38 | this.collapsed === true ? this.expand() : this.collapse(); |
42 | }, this, true); | 39 | }, this, true); |
43 | }; | 40 | }; |
44 | 41 | ||
45 | Clipperz.YUI.Collapser.prototype = { | 42 | Clipperz.YUI.Collapser.prototype = { |
46 | 'collapse': function(){ | 43 | 'collapse': function(){ |
47 | this.collapseEl.clip(); | 44 | this.collapseEl.clip(); |
48 | this.collapseEl.setHeight(1, true, .35, this.afterCollapse.createDelegate(this), YAHOO.util.Easing.easeOut); | 45 | this.collapseEl.setHeight(1, true, .35, this.afterCollapse.createDelegate(this), YAHOO.util.Easing.easeOut); |
49 | this.clickEl.replaceClass('collapser-expanded','collapser-collapsed'); | 46 | this.clickEl.replaceClass('collapser-expanded','collapser-collapsed'); |
50 | }, | 47 | }, |
51 | 48 | ||
52 | 'afterCollapse': function(){ | 49 | 'afterCollapse': function(){ |
53 | this.collapsed = true; | 50 | this.collapsed = true; |
54 | this.collapseEl.setDisplayed(false); | 51 | this.collapseEl.setDisplayed(false); |
55 | this.clickEl.replaceClass('collapser-expanded','collapser-collapsed'); | 52 | this.clickEl.replaceClass('collapser-expanded','collapser-collapsed'); |
56 | }, | 53 | }, |
57 | 54 | ||
58 | 'expand': function(){ | 55 | 'expand': function(){ |
59 | this.collapseEl.setDisplayed(true); | 56 | this.collapseEl.setDisplayed(true); |
60 | this.collapseEl.autoHeight(true, .35, this.afterExpand.createDelegate(this), YAHOO.util.Easing.easeOut); | 57 | this.collapseEl.autoHeight(true, .35, this.afterExpand.createDelegate(this), YAHOO.util.Easing.easeOut); |
61 | this.clickEl.replaceClass('collapser-collapsed','collapser-expanded'); | 58 | this.clickEl.replaceClass('collapser-collapsed','collapser-expanded'); |
62 | }, | 59 | }, |
63 | 60 | ||
64 | 'afterExpand': function(){ | 61 | 'afterExpand': function(){ |
65 | this.collapsed = false; | 62 | this.collapsed = false; |
66 | this.collapseEl.unclip(); | 63 | this.collapseEl.unclip(); |
67 | this.collapseEl.setStyle('height', ''); | 64 | this.collapseEl.setStyle('height', ''); |
68 | this.clickEl.replaceClass('collapser-collapsed','collapser-expanded'); | 65 | this.clickEl.replaceClass('collapser-collapsed','collapser-expanded'); |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //----------------------------------------------------- | 68 | //----------------------------------------------------- |
72 | __syntaxFix__: '__syntaxFix__' | 69 | __syntaxFix__: '__syntaxFix__' |
73 | }; | 70 | }; |