Diffstat (limited to 'frontend/gamma/js/Clipperz/Style.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/Style.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/gamma/js/Clipperz/Style.js b/frontend/gamma/js/Clipperz/Style.js index d377893..acbe71b 100644 --- a/frontend/gamma/js/Clipperz/Style.js +++ b/frontend/gamma/js/Clipperz/Style.js | |||
@@ -1,91 +1,89 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer 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 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.Style) == 'undefined') { Clipperz.Style = {}; } | 25 | if (typeof(Clipperz.Style) == 'undefined') { Clipperz.Style = {}; } |
28 | 26 | ||
29 | Clipperz.Style.VERSION = "0.1"; | 27 | Clipperz.Style.VERSION = "0.1"; |
30 | Clipperz.Style.NAME = "Clipperz.DOM"; | 28 | Clipperz.Style.NAME = "Clipperz.DOM"; |
31 | 29 | ||
32 | MochiKit.Base.update(Clipperz.Style, { | 30 | MochiKit.Base.update(Clipperz.Style, { |
33 | 31 | ||
34 | //------------------------------------------------------------------------- | 32 | //------------------------------------------------------------------------- |
35 | 33 | ||
36 | '__repr__': function () { | 34 | '__repr__': function () { |
37 | return "[" + this.NAME + " " + this.VERSION + "]"; | 35 | return "[" + this.NAME + " " + this.VERSION + "]"; |
38 | }, | 36 | }, |
39 | 37 | ||
40 | //------------------------------------------------------------------------- | 38 | //------------------------------------------------------------------------- |
41 | 39 | ||
42 | 'toString': function () { | 40 | 'toString': function () { |
43 | return this.__repr__(); | 41 | return this.__repr__(); |
44 | }, | 42 | }, |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'applyZebraStylesToTable': function(aTable) { | 46 | 'applyZebraStylesToTable': function(aTable) { |
49 | var tbody; | 47 | var tbody; |
50 | var tbodyRows; | 48 | var tbodyRows; |
51 | var i,c; | 49 | var i,c; |
52 | 50 | ||
53 | tbody = MochiKit.DOM.getFirstElementByTagAndClassName('tbody', null, aTable); | 51 | tbody = MochiKit.DOM.getFirstElementByTagAndClassName('tbody', null, aTable); |
54 | tbodyRows = tbody.childNodes; | 52 | tbodyRows = tbody.childNodes; |
55 | // tbodyRows = MochiKit.DOM.getElementsByTagAndClassName('tr', null, tbody) | 53 | // tbodyRows = MochiKit.DOM.getElementsByTagAndClassName('tr', null, tbody) |
56 | c = tbodyRows.length; | 54 | c = tbodyRows.length; |
57 | for (i=0; i<c; i++) { | 55 | for (i=0; i<c; i++) { |
58 | var element; | 56 | var element; |
59 | 57 | ||
60 | element = YAHOO.Element.get(tbodyRows[i]); | 58 | element = YAHOO.Element.get(tbodyRows[i]); |
61 | element.addClass(((i%2 == 0) ? "zebra_odd": "zebra_even")); | 59 | element.addClass(((i%2 == 0) ? "zebra_odd": "zebra_even")); |
62 | element.removeClass(((i%2 == 1) ? "zebra_odd": "zebra_even")); | 60 | element.removeClass(((i%2 == 1) ? "zebra_odd": "zebra_even")); |
63 | } | 61 | } |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'getSizeAndPosition': function (anElement) { | 66 | 'getSizeAndPosition': function (anElement) { |
69 | var result; | 67 | var result; |
70 | 68 | ||
71 | if (anElement != null) { | 69 | if (anElement != null) { |
72 | result ={ dimensions:MochiKit.Style.getElementDimensions(anElement), position:MochiKit.Style.getElementPosition(anElement)}; | 70 | result ={ dimensions:MochiKit.Style.getElementDimensions(anElement), position:MochiKit.Style.getElementPosition(anElement)}; |
73 | } else { | 71 | } else { |
74 | result ={ dimensions:MochiKit.Style.getViewportDimensions(), position:MochiKit.Style.getViewportPosition()}; | 72 | result ={ dimensions:MochiKit.Style.getViewportDimensions(), position:MochiKit.Style.getViewportPosition()}; |
75 | } | 73 | } |
76 | 74 | ||
77 | return result; | 75 | return result; |
78 | }, | 76 | }, |
79 | 77 | ||
80 | 'setBackgroundGradient': function (anElement, someParameters) { | 78 | 'setBackgroundGradient': function (anElement, someParameters) { |
81 | // background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff9955), to(#ff6622), color-stop(1,#333333)); | 79 | // background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff9955), to(#ff6622), color-stop(1,#333333)); |
82 | // background: -moz-linear-gradient(0% 100% 90deg,#ff6622, #ff9955); | 80 | // background: -moz-linear-gradient(0% 100% 90deg,#ff6622, #ff9955); |
83 | MochiKit.Style.setStyle(anElement, {'background': '-webkit-gradient(linear, 0% 0%, 0% 100%, from(' + someParameters['from'] + '), to(' + someParameters['to'] + '), color-stop(1,#333333))'}); | 81 | MochiKit.Style.setStyle(anElement, {'background': '-webkit-gradient(linear, 0% 0%, 0% 100%, from(' + someParameters['from'] + '), to(' + someParameters['to'] + '), color-stop(1,#333333))'}); |
84 | MochiKit.Style.setStyle(anElement, {'background': '-moz-linear-gradient(0% 100% 90deg,' + someParameters['to'] + ', ' + someParameters['from'] + ')'}); | 82 | MochiKit.Style.setStyle(anElement, {'background': '-moz-linear-gradient(0% 100% 90deg,' + someParameters['to'] + ', ' + someParameters['from'] + ')'}); |
85 | }, | 83 | }, |
86 | 84 | ||
87 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
88 | __syntaxFix__: "syntax fix" | 86 | __syntaxFix__: "syntax fix" |
89 | 87 | ||
90 | }); | 88 | }); |
91 | 89 | ||