Diffstat (limited to 'frontend/gamma/js/main.mobile.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/main.mobile.js | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/frontend/gamma/js/main.mobile.js b/frontend/gamma/js/main.mobile.js index 2fdd920..363d9ed 100644 --- a/frontend/gamma/js/main.mobile.js +++ b/frontend/gamma/js/main.mobile.js | |||
@@ -1,62 +1,81 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2013 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz, the online password manager. | 5 | This file is part of Clipperz, the online password manager. |
6 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
7 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
8 | 8 | ||
9 | * Clipperz is free software: you can redistribute it and/or modify it | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
10 | under the terms of the GNU Affero General Public License as published | 10 | under the terms of the GNU Affero General Public License as published |
11 | by the Free Software Foundation, either version 3 of the License, or | 11 | by the Free Software Foundation, either version 3 of the License, or |
12 | (at your option) any later version. | 12 | (at your option) any later version. |
13 | 13 | ||
14 | * Clipperz is distributed in the hope that it will be useful, but | 14 | * Clipperz is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
18 | 18 | ||
19 | * 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 |
20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
21 | 21 | ||
22 | */ | 22 | */ |
23 | 23 | ||
24 | function _pm_logEvent(anEvent) { | 24 | function _pm_logEvent(anEvent) { |
25 | //console.log("####", anEvent); | 25 | //console.log("####", anEvent); |
26 | 26 | ||
27 | anEvent.preventDefault(); | 27 | anEvent.preventDefault(); |
28 | } | 28 | } |
29 | 29 | ||
30 | function handleGenericDeferredError(anError) { | 30 | function handleGenericDeferredError(anError) { |
31 | var result; | 31 | var result; |
32 | 32 | ||
33 | if (anError instanceof MochiKit.Async.CancelledError) { | 33 | if (anError instanceof MochiKit.Async.CancelledError) { |
34 | result = anError; | 34 | result = anError; |
35 | } else { | 35 | } else { |
36 | MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); | 36 | MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); |
37 | result = new MochiKit.Async.CancelledError(anError); | 37 | result = new MochiKit.Async.CancelledError(anError); |
38 | } | 38 | } |
39 | 39 | ||
40 | return result; | 40 | return result; |
41 | } | 41 | } |
42 | 42 | ||
43 | |||
44 | Clipperz.PM.RunTime = {}; | 43 | Clipperz.PM.RunTime = {}; |
45 | 44 | ||
45 | //============================================================================== | ||
46 | |||
47 | function registerJQMLogEvents () { | ||
48 | var interestingEvents = [ | ||
49 | 'pagebeforeload', 'pageload', 'pageloadfailed', | ||
50 | 'pagebeforechange', 'pagechange','pagechangefailed', | ||
51 | 'pagebeforeshow','pagebeforehide', | ||
52 | 'pageshow', 'pagehide', | ||
53 | 'pagebeforecreate','pagecreate', | ||
54 | 'pageinit', | ||
55 | 'pageremove' | ||
56 | ] | ||
57 | |||
58 | interestingEvents.map(function (anEvent) { | ||
59 | $(document).on(anEvent,MochiKit.Base.partial(logJQMEvent, anEvent)); | ||
60 | }) | ||
61 | } | ||
62 | |||
63 | function logJQMEvent (anEventName, anEvent, someData) { | ||
64 | //console.log(anEventName); | ||
65 | console.log(anEventName, someData); | ||
66 | //console.log(anEventName, anEvent, someData); | ||
67 | } | ||
68 | |||
69 | //============================================================================== | ||
46 | 70 | ||
47 | function run() { | 71 | function run () { |
48 | Clipperz.PM.Strings.Languages.initSetup(); | 72 | Clipperz.PM.Strings.Languages.initSetup(); |
49 | 73 | ||
50 | Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Mobile.Controllers.MainController(); | 74 | Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Mobile.Controllers.MainController(); |
51 | Clipperz.PM.RunTime.mainController.run(); | 75 | Clipperz.PM.RunTime.mainController.run(); |
52 | } | 76 | } |
53 | 77 | ||
54 | // if (navigator.standalone == false) { | 78 | //============================================================================== |
55 | // window.localStorage.setItem('PIN', '1234'); | ||
56 | // alert("Saved PIN"); | ||
57 | // } else { | ||
58 | // alert (window.localStorage.getItem('PIN')); | ||
59 | // } | ||
60 | |||
61 | 79 | ||
80 | //registerJQMLogEvents(); | ||
62 | MochiKit.DOM.addLoadEvent(run); | 81 | MochiKit.DOM.addLoadEvent(run); |