-rw-r--r-- | frontend/gamma/js/main.js | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/frontend/gamma/js/main.js b/frontend/gamma/js/main.js index 352c4c7..a9fd65e 100644 --- a/frontend/gamma/js/main.js +++ b/frontend/gamma/js/main.js | |||
@@ -22,85 +22,72 @@ refer to http://www.clipperz.com. | |||
22 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
23 | 23 | ||
24 | */ | 24 | */ |
25 | 25 | ||
26 | function _pm_logEvent(anEvent) { | 26 | function _pm_logEvent(anEvent) { |
27 | //console.log("####", anEvent); | 27 | //console.log("####", anEvent); |
28 | 28 | ||
29 | anEvent.preventDefault(); | 29 | anEvent.preventDefault(); |
30 | } | 30 | } |
31 | 31 | ||
32 | function handleGenericDeferredError(anError) { | 32 | function handleGenericDeferredError(anError) { |
33 | var result; | 33 | var result; |
34 | 34 | ||
35 | if (anError instanceof MochiKit.Async.CancelledError) { | 35 | if (anError instanceof MochiKit.Async.CancelledError) { |
36 | result = anError; | 36 | result = anError; |
37 | } else { | 37 | } else { |
38 | MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); | 38 | MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); |
39 | //console.log(anError); | 39 | //console.log(anError); |
40 | result = new MochiKit.Async.CancelledError(anError); | 40 | result = new MochiKit.Async.CancelledError(anError); |
41 | } | 41 | } |
42 | 42 | ||
43 | return result; | 43 | return result; |
44 | } | 44 | } |
45 | 45 | ||
46 | 46 | ||
47 | Clipperz.PM.RunTime = {}; | 47 | Clipperz.PM.RunTime = {}; |
48 | 48 | ||
49 | 49 | ||
50 | function run() { | 50 | function run() { |
51 | var shouldShowRegistrationForm; | 51 | var shouldShowRegistrationForm; |
52 | var useCompactDesign; | 52 | var useCompactDesign; |
53 | var controllerParameters; | 53 | var controllerParameters; |
54 | //var iPhoneDesign; | ||
55 | |||
56 | //MochiKit.Signal.connect(document.body, 'onkeydown', _pm_logEvent); | ||
57 | //MochiKit.Signal.connect(document.body, 'onkeypress', _pm_logEvent); | ||
58 | //MochiKit.Signal.connect(document.body, 'onclick', _pm_logEvent); | ||
59 | 54 | ||
60 | controllerParameters = {}; | 55 | controllerParameters = {}; |
61 | 56 | ||
62 | MochiKit.DOM.removeElement('javaScriptAlert'); | 57 | //MochiKit.DOM.removeElement('javaScriptAlert'); |
63 | Clipperz.PM.Strings.Languages.initSetup(); | 58 | Clipperz.PM.Strings.Languages.initSetup(); |
64 | 59 | ||
65 | if (window.location.search.indexOf('registration') != -1) { | 60 | if (window.location.search.indexOf('registration') != -1) { |
66 | shouldShowRegistrationForm = true; | 61 | shouldShowRegistrationForm = true; |
67 | } else { | 62 | } else { |
68 | shouldShowRegistrationForm = false; | 63 | shouldShowRegistrationForm = false; |
69 | } | 64 | } |
70 | 65 | ||
71 | if (window.location.search.indexOf('autocomplete') != -1) { | 66 | if (window.location.search.indexOf('autocomplete') != -1) { |
72 | controllerParameters['autocomplete'] = 'on' | 67 | controllerParameters['autocomplete'] = 'on' |
73 | } | 68 | } |
74 | 69 | ||
75 | //if ((window.location.search.indexOf('iPhone') != -1) || (navigator.userAgent.match('iPhone'))) { | ||
76 | // iPhoneDesign = true; | ||
77 | //} else { | ||
78 | // iPhoneDesign = false; | ||
79 | //} | ||
80 | |||
81 | if (window.location.search.indexOf('compact') != -1) { | 70 | if (window.location.search.indexOf('compact') != -1) { |
82 | useCompactDesign = true; | 71 | useCompactDesign = true; |
83 | } else { | 72 | } else { |
84 | useCompactDesign = false; | 73 | useCompactDesign = false; |
85 | } | 74 | } |
86 | 75 | ||
87 | if (useCompactDesign == true) { | 76 | if (useCompactDesign == true) { |
88 | Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Compact.Controllers.MainController(controllerParameters); | 77 | Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Compact.Controllers.MainController(controllerParameters); |
89 | //} else if (iPhoneDesign == true) { | ||
90 | // Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.iPhone.Controllers.MainController(); | ||
91 | } else { | 78 | } else { |
92 | Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Web.Controllers.MainController(controllerParameters); | 79 | Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Web.Controllers.MainController(controllerParameters); |
93 | } | 80 | } |
94 | 81 | ||
95 | Clipperz.PM.RunTime.mainController.run(shouldShowRegistrationForm); | 82 | Clipperz.PM.RunTime.mainController.run(shouldShowRegistrationForm); |
96 | 83 | ||
97 | //Clipperz.log("HASH: " + window.location.hash); | 84 | //Clipperz.log("HASH: " + window.location.hash); |
98 | if (window.location.hash != "") { | 85 | if (window.location.hash != "") { |
99 | window.location.hash = "" | 86 | window.location.hash = "" |
100 | } | 87 | } |
101 | //Clipperz.log("HASH cleaned"); | 88 | //Clipperz.log("HASH cleaned"); |
102 | //#credentials=base64encoded({username:'joe', passphrase:'clipperz'}) | 89 | //#credentials=base64encoded({username:'joe', passphrase:'clipperz'}) |
103 | //MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'doLogin', {username:'joe', passphrase:'clipperz'}); | 90 | //MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'doLogin', {username:'joe', passphrase:'clipperz'}); |
104 | } | 91 | } |
105 | 92 | ||
106 | MochiKit.DOM.addLoadEvent(run); | 93 | MochiKit.DOM.addLoadEvent(run); |