Diffstat (limited to 'frontend/gamma/tests/tests/Components/SimpleMessagePanel/simpleMessagePanel_test.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/tests/tests/Components/SimpleMessagePanel/simpleMessagePanel_test.js | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/frontend/gamma/tests/tests/Components/SimpleMessagePanel/simpleMessagePanel_test.js b/frontend/gamma/tests/tests/Components/SimpleMessagePanel/simpleMessagePanel_test.js new file mode 100644 index 0000000..85128d6 --- a/dev/null +++ b/frontend/gamma/tests/tests/Components/SimpleMessagePanel/simpleMessagePanel_test.js | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer to http://www.clipperz.com | ||
12 | |||
13 | * Javascript Crypto Library is free software: you can redistribute | ||
14 | 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 | ||
16 | 3 of the License, or (at your option) any later version. | ||
17 | |||
18 | * Javascript Crypto Library is distributed in the hope that it will | ||
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
21 | See the GNU Affero General Public License for more details. | ||
22 | |||
23 | * You should have received a copy of the GNU Affero General Public | ||
24 | License along with Javascript Crypto Library. If not, see | ||
25 | <http://www.gnu.org/licenses/>. | ||
26 | |||
27 | */ | ||
28 | |||
29 | Clipperz.Base.module('Clipperz.Tests.SimpleMessagePanel'); | ||
30 | |||
31 | Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose(); | ||
32 | Clipperz.PM.Strings.Languages.initSetup(); | ||
33 | |||
34 | Clipperz.Tests.SimpleMessagePanel.Tester = function(args) { | ||
35 | args = args || {}; | ||
36 | |||
37 | Clipperz.Tests.SimpleMessagePanel.Tester.superclass.constructor.call(this, args); | ||
38 | //this._user = new Clipperz.PM.DataModel.User({username:'test', getPassphraseFunction:function () { return 'test';}}); | ||
39 | |||
40 | return this; | ||
41 | }; | ||
42 | |||
43 | Clipperz.Base.extend(Clipperz.Tests.SimpleMessagePanel.Tester, Object, { | ||
44 | |||
45 | 'toString': function() { | ||
46 | return "Clipperz.Tests.SimpleMessagePanel.Tester"; | ||
47 | }, | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | /* | ||
51 | 'user': function () { | ||
52 | return this._user; | ||
53 | }, | ||
54 | */ | ||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'run': function () { | ||
58 | var deferredResult; | ||
59 | var confirmationDialog; | ||
60 | |||
61 | confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ | ||
62 | title:"Alert", | ||
63 | text:"Should lost pending changes? But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness", | ||
64 | type:'ALERT', | ||
65 | buttons: [ | ||
66 | {text:"Cancel",result:'CANCEL', isDefault:true}, | ||
67 | {text:"Ok", result:'OK'} | ||
68 | ] | ||
69 | }); | ||
70 | |||
71 | deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.askConfirmationForLoosingPendingChanges", {trace:false}); | ||
72 | deferredResult.addMethod(confirmationDialog, 'deferredShow', { | ||
73 | 'openFromElement': null, | ||
74 | 'onOkCloseToElement': null, //this.getElement('cancelButton'), | ||
75 | 'onCancelCloseToElement':null | ||
76 | }); | ||
77 | deferredResult.callback(); | ||
78 | |||
79 | return deferredResult; | ||
80 | }, | ||
81 | |||
82 | //========================================================================= | ||
83 | __syntaxFix__: "syntax fix" | ||
84 | }); | ||
85 | |||
86 | |||
87 | |||
88 | init = function () { | ||
89 | vartester; | ||
90 | |||
91 | tester = new Clipperz.Tests.SimpleMessagePanel.Tester(); | ||
92 | tester.run(); | ||
93 | }; | ||
94 | |||
95 | MochiKit.DOM.addLoadEvent(init); | ||