Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js index 1835ca9..4cfca32 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js | |||
@@ -1,106 +1,104 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments); |
32 | MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs'); | 30 | MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs'); |
33 | 31 | ||
34 | return this; | 32 | return this; |
35 | } | 33 | } |
36 | 34 | ||
37 | //============================================================================= | 35 | //============================================================================= |
38 | 36 | ||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 37 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
40 | 38 | ||
41 | //------------------------------------------------------------------------- | 39 | //------------------------------------------------------------------------- |
42 | 40 | ||
43 | 'toString': function () { | 41 | 'toString': function () { |
44 | return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component"; | 42 | return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component"; |
45 | }, | 43 | }, |
46 | 44 | ||
47 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
48 | 46 | ||
49 | 'renderSelf': function() { | 47 | 'renderSelf': function() { |
50 | // var bookmarkletUrl; | 48 | // var bookmarkletUrl; |
51 | // | 49 | // |
52 | // if (Clipperz_IEisBroken == true) { | 50 | // if (Clipperz_IEisBroken == true) { |
53 | // bookmarkletUrl = bookmarklet_ie; | 51 | // bookmarkletUrl = bookmarklet_ie; |
54 | // } else { | 52 | // } else { |
55 | /// bookmarkletUrl = bookmarklet; | 53 | /// bookmarkletUrl = bookmarklet; |
56 | // bookmarkletUrl = Clipperz.PM.Strings['bookmarklet']; | 54 | // bookmarkletUrl = Clipperz.PM.Strings['bookmarklet']; |
57 | // } | 55 | // } |
58 | 56 | ||
59 | this.append(this.element(), {tag:'div', cls:'bookmarklet', children: [ | 57 | this.append(this.element(), {tag:'div', cls:'bookmarklet', children: [ |
60 | {tag:'div', id:this.getId('linkBlock'), cls:'bookmarklet_link', children:[ | 58 | {tag:'div', id:this.getId('linkBlock'), cls:'bookmarklet_link', children:[ |
61 | // {tag:'a', id:this.getId('link'), href:bookmarkletUrl, children:[ | 59 | // {tag:'a', id:this.getId('link'), href:bookmarkletUrl, children:[ |
62 | {tag:'a', id:this.getId('link'), href:'#', children:[ | 60 | {tag:'a', id:this.getId('link'), href:'#', children:[ |
63 | {tag:'div', cls:'icon'}, | 61 | {tag:'div', cls:'icon'}, |
64 | {tag:'div', cls:'text', children:[ | 62 | {tag:'div', cls:'text', children:[ |
65 | {tag:'span', html:"add to Clipperz"} | 63 | {tag:'span', html:"add to Clipperz"} |
66 | ]} | 64 | ]} |
67 | ]} | 65 | ]} |
68 | ]} | 66 | ]} |
69 | ]}); | 67 | ]}); |
70 | 68 | ||
71 | new Clipperz.PM.UI.Common.Components.Tooltip({ | 69 | new Clipperz.PM.UI.Common.Components.Tooltip({ |
72 | element:this.getElement('linkBlock'), | 70 | element:this.getElement('linkBlock'), |
73 | text: "Drag and drop the \"add to Clipperz\" link above to the bookmark bar.", | 71 | text: "Drag and drop the \"add to Clipperz\" link above to the bookmark bar.", |
74 | position:'BELOW' | 72 | position:'BELOW' |
75 | }); | 73 | }); |
76 | 74 | ||
77 | MochiKit.Signal.connect(this.getId('link'), 'onclick', this, 'handleOnclick'); | 75 | MochiKit.Signal.connect(this.getId('link'), 'onclick', this, 'handleOnclick'); |
78 | this.updateBookmarkletURLs(); | 76 | this.updateBookmarkletURLs(); |
79 | }, | 77 | }, |
80 | 78 | ||
81 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
82 | 80 | ||
83 | 'handleOnclick': function (anEvent) { | 81 | 'handleOnclick': function (anEvent) { |
84 | anEvent.preventDefault(); | 82 | anEvent.preventDefault(); |
85 | 83 | ||
86 | Clipperz.log("BOOKMARKLET CLICK"); | 84 | Clipperz.log("BOOKMARKLET CLICK"); |
87 | }, | 85 | }, |
88 | 86 | ||
89 | //------------------------------------------------------------------------- | 87 | //------------------------------------------------------------------------- |
90 | 88 | ||
91 | 'updateBookmarkletURLs': function () { | 89 | 'updateBookmarkletURLs': function () { |
92 | var bookmarkletUrl; | 90 | var bookmarkletUrl; |
93 | 91 | ||
94 | if (Clipperz_IEisBroken == true) { | 92 | if (Clipperz_IEisBroken == true) { |
95 | bookmarkletUrl = bookmarklet_ie; | 93 | bookmarkletUrl = bookmarklet_ie; |
96 | } else { | 94 | } else { |
97 | // bookmarkletUrl = bookmarklet; | 95 | // bookmarkletUrl = bookmarklet; |
98 | bookmarkletUrl = Clipperz.PM.Strings.getValue('bookmarklet'); | 96 | bookmarkletUrl = Clipperz.PM.Strings.getValue('bookmarklet'); |
99 | } | 97 | } |
100 | 98 | ||
101 | this.getElement('link').href = bookmarkletUrl; | 99 | this.getElement('link').href = bookmarkletUrl; |
102 | }, | 100 | }, |
103 | 101 | ||
104 | //------------------------------------------------------------------------- | 102 | //------------------------------------------------------------------------- |
105 | __syntaxFix__: "syntax fix" | 103 | __syntaxFix__: "syntax fix" |
106 | }); | 104 | }); |