rhodes 5.5.0.3 → 5.5.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationSingleton.java +20 -8
  4. data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +1 -2
  5. data/lib/commonAPI/coreapi/ext/system.xml +1 -1
  6. data/platform/android/build/android.rake +1 -0
  7. data/platform/iphone/Classes/AppManager/AppManager.m +44 -3
  8. data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +4 -3
  9. data/platform/iphone/Classes/NativeView/RhoNativeViewManagerOC.h +1 -1
  10. data/platform/iphone/Classes/RhoMainView.h +8 -2
  11. data/platform/iphone/Classes/RhoUIWebView.h +75 -0
  12. data/platform/iphone/Classes/RhoUIWebView.m +142 -0
  13. data/platform/iphone/Classes/RhoWKWebView.h +87 -0
  14. data/platform/iphone/Classes/RhoWKWebView.m +187 -0
  15. data/platform/iphone/Classes/RhoWebView.h +72 -0
  16. data/platform/iphone/Classes/RhoWebViewFabrique.h +35 -0
  17. data/platform/iphone/Classes/RhoWebViewFabrique.m +87 -0
  18. data/platform/iphone/Classes/Rhodes.m +17 -6
  19. data/platform/iphone/Classes/Signature.old/SignatureDelegate.m +11 -4
  20. data/platform/iphone/Classes/Signature/SignatureDelegate.m +3 -4
  21. data/platform/iphone/Classes/SimpleMainView.h +7 -5
  22. data/platform/iphone/Classes/SimpleMainView.m +174 -179
  23. data/platform/iphone/Classes/SplitView/RightViewController.h +2 -2
  24. data/platform/iphone/Classes/SplitView/RightViewController.m +9 -10
  25. data/platform/iphone/Classes/SplitView/SplittedMainView.h +2 -3
  26. data/platform/iphone/Classes/SplitView/SplittedMainView.m +10 -7
  27. data/platform/iphone/Classes/TabbedMainView.h +2 -1
  28. data/platform/iphone/Classes/TabbedMainView.m +13 -10
  29. data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +21 -5
  30. data/platform/iphone/Classes/WebView.m +1 -1
  31. data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +40 -3
  32. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
  33. data/platform/iphone/rbuild/iphone.rake +51 -0
  34. data/platform/shared/common/RhoNativeViewManager.h +9 -9
  35. data/platform/shared/common/RhodesApp.cpp +13 -1
  36. data/platform/shared/net/HttpServer.cpp +12 -2
  37. data/platform/shared/qt/rhodes/ExternalWebView.ui +11 -2
  38. data/platform/shared/qt/rhodes/QtMainWindow.cpp +9 -7
  39. data/platform/shared/qt/rhodes/QtMainWindow.ui +13 -4
  40. data/platform/shared/qt/rhodes/qkineticscroller.cpp +1245 -0
  41. data/platform/shared/qt/rhodes/qkineticscroller.h +165 -0
  42. data/platform/shared/qt/rhodes/qkineticscroller_p.h +168 -0
  43. data/platform/shared/qt/rhodes/qtflickgesture.cpp +696 -0
  44. data/platform/shared/qt/rhodes/qtflickgesture_p.h +107 -0
  45. data/platform/shared/qt/rhodes/qtscroller.cpp +2080 -0
  46. data/platform/shared/qt/rhodes/qtscroller.h +138 -0
  47. data/platform/shared/qt/rhodes/qtscroller_p.h +205 -0
  48. data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +350 -0
  49. data/platform/shared/qt/rhodes/qtscrollerfilter_p.h +110 -0
  50. data/platform/shared/qt/rhodes/qtscrollerproperties.cpp +412 -0
  51. data/platform/shared/qt/rhodes/qtscrollerproperties.h +135 -0
  52. data/platform/shared/qt/rhodes/qtscrollerproperties_p.h +90 -0
  53. data/platform/shared/qt/rhodes/qtscrollevent.cpp +190 -0
  54. data/platform/shared/qt/rhodes/qtscrollevent.h +100 -0
  55. data/platform/shared/qt/rhodes/qtscrollevent_p.h +33 -0
  56. data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +347 -0
  57. data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +90 -0
  58. data/platform/shared/qt/rhodes/qwebviewselectionsuppressor.h +113 -0
  59. data/platform/shared/qt/rhodes/rhodes.pro +19 -0
  60. data/res/generators/rhogen.rb +307 -15
  61. data/res/generators/templates/application/app/Settings/err_sync.erb +12 -6
  62. data/res/generators/templates/application/app/Settings/home.erb +32 -17
  63. data/res/generators/templates/application/app/Settings/index.erb +55 -26
  64. data/res/generators/templates/application/app/Settings/javascript_index.html +111 -0
  65. data/res/generators/templates/application/app/Settings/javascript_login.html +65 -0
  66. data/res/generators/templates/application/app/Settings/login.erb +25 -19
  67. data/res/generators/templates/application/app/Settings/reset.erb +18 -9
  68. data/res/generators/templates/application/app/Settings/wait.erb +10 -7
  69. data/res/generators/templates/application/app/index.erb +32 -20
  70. data/res/generators/templates/application/app/javascript_index.html +66 -0
  71. data/res/generators/templates/application/app/javascript_index.js +250 -0
  72. data/res/generators/templates/application/app/layout.erb +12 -67
  73. data/res/generators/templates/application/javascript_build.yml +41 -0
  74. data/res/generators/templates/application/javascript_rhoconfig.txt +123 -0
  75. data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.css +587 -0
  76. data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.css.map +1 -0
  77. data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.min.css +6 -0
  78. data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.min.css.map +1 -0
  79. data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.css +6757 -0
  80. data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.css.map +1 -0
  81. data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.min.css +6 -0
  82. data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.min.css.map +1 -0
  83. data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.eot +0 -0
  84. data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.svg +288 -0
  85. data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.ttf +0 -0
  86. data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff +0 -0
  87. data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff2 +0 -0
  88. data/res/generators/templates/application/public/bootstrap-3.3.7/js/bootstrap.js +2377 -0
  89. data/res/generators/templates/application/public/bootstrap-3.3.7/js/bootstrap.min.js +7 -0
  90. data/res/generators/templates/application/public/bootstrap-3.3.7/js/npm.js +13 -0
  91. data/res/generators/templates/application/public/css/style.css +3 -0
  92. data/res/generators/templates/application/public/jquery/jquery-3.1.1.min.js +4 -0
  93. data/res/generators/templates/application/public/jquery/jquery-3.1.1.min.map +1 -0
  94. data/res/generators/templates/application/rhoconfig.txt +16 -0
  95. data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +4 -0
  96. data/res/generators/templates/model/edit.erb +22 -21
  97. data/res/generators/templates/model/index.erb +24 -22
  98. data/res/generators/templates/model/javascript_edit.html +65 -0
  99. data/res/generators/templates/model/javascript_index.html +56 -0
  100. data/res/generators/templates/model/javascript_index.js +83 -0
  101. data/res/generators/templates/model/javascript_model.js +16 -0
  102. data/res/generators/templates/model/javascript_new.html +64 -0
  103. data/res/generators/templates/model/javascript_show.html +66 -0
  104. data/res/generators/templates/model/new.erb +22 -19
  105. data/res/generators/templates/model/show.erb +22 -14
  106. data/res/prebuild_base_app/app/index.erb +31 -18
  107. data/res/prebuild_base_app/app/layout.erb +11 -56
  108. data/version +1 -1
  109. metadata +59 -24
  110. data/res/generators/templates/application/public/css/android.css +0 -418
  111. data/res/generators/templates/application/public/css/iphone.css +0 -378
  112. data/res/generators/templates/application/public/css/jqmobile-patch.css +0 -62
  113. data/res/generators/templates/application/public/css/re_webkit.css +0 -736
  114. data/res/generators/templates/application/public/css/re_webkit_flat.css +0 -753
  115. data/res/generators/templates/application/public/css/windows_mobile.css +0 -327
  116. data/res/generators/templates/application/public/jqmobile/images/ajax-loader.gif +0 -0
  117. data/res/generators/templates/application/public/jqmobile/images/icon-search-black.png +0 -0
  118. data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
  119. data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
  120. data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
  121. data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
  122. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.css +0 -3
  123. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.js +0 -10
  124. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.map +0 -1
  125. data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.4.5.min.css +0 -3
  126. data/res/generators/templates/application/public/jqmobile/jquery.mobile.theme-1.4.5.min.css +0 -3
  127. data/res/generators/templates/application/public/jquery/jquery-1.9.1.min.js +0 -5
  128. data/res/generators/templates/application/public/jquery/jquery-1.9.1.min.map +0 -1
  129. data/res/generators/templates/application/public/js/application.js +0 -1
  130. data/res/generators/templates/application/public/js/jqmobile-patch.js +0 -466
  131. data/res/generators/templates/application/public/js/syncengine.js +0 -504
@@ -1,24 +1,36 @@
1
- <div data-role="page" data-url="<%%= Rho::Application.startURI %>/">
1
+ <div class="container-fluid">
2
2
 
3
- <% if @rhoconnectclient_ext %>
4
- <div data-role="header" data-position="inline">
5
- <h1><%= class_name %></h1>
6
- <%% if Rho::RhoConnectClient.isLoggedIn %>
7
- <a href="<%%= url_for :controller => :Settings, :action => :do_sync %>" class="ui-btn-left" data-icon="refresh">
8
- Sync
9
- </a>
10
- <a href="<%%= url_for :controller => :Settings, :action => :logout %>" class="ui-btn-right" data-icon="star">
11
- Logout
12
- </a>
13
- <%% else %>
14
- <a href="<%%= url_for :controller => :Settings, :action => :login %>" class="ui-btn-right" data-icon="star">Login</a>
15
- <%% end %>
16
- </div>
17
- <% end %>
18
- <div data-role="content">
19
- <ul data-role="listview">
20
- <li><a href="#">Add link here...</a></li>
21
- </ul>
3
+ <% if @rhoconnectclient_ext %>
4
+ <div class="row page-title">
5
+ <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
6
+ <%% if Rho::RhoConnectClient.isLoggedIn %>
7
+ <a href="<%%= url_for :controller => :Settings, :action => :do_sync %>" class="btn btn-default btn-sm pull-left">
8
+ Sync
9
+ </a>
10
+ <%% end %>
11
+ </div>
12
+ <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
13
+ <h3 class="text-center"><%= class_name %></h3>
14
+ </div>
15
+ <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
16
+ <%% if Rho::RhoConnectClient.isLoggedIn %>
17
+ <a href="<%%= url_for :controller => :Settings, :action => :logout %>" class="btn btn-default btn-sm pull-right">
18
+ Logout
19
+ </a>
20
+ <%% else %>
21
+ <a href="<%%= url_for :controller => :Settings, :action => :login %>" class="btn btn-primary btn-sm pull-right">Login</a>
22
+ <%% end %>
23
+ </div>
24
+ </div>
25
+ <% end %>
26
+
27
+ <div class="row">
28
+ <div class="list-group">
29
+ <a href="#" class="list-group-item">
30
+ <span class="glyphicon glyphicon-chevron-right pull-right" aria-hidden="true"></span>
31
+ Add link here...
32
+ </a>
33
+ </div>
22
34
  </div>
23
35
 
24
36
  </div>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+
5
+ <head>
6
+ <title><%= class_name %></title>
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
8
+ <link rel="stylesheet" href="/public/bootstrap-3.3.7/css/bootstrap.min.css">
9
+ <link rel="stylesheet" href="/public/css/style.css">
10
+
11
+ <script type="text/javascript" src="/public/jquery/jquery-3.1.1.min.js"></script>
12
+ <script type="text/javascript" src="/public/bootstrap-3.3.7/js/bootstrap.min.js"></script>
13
+
14
+ <script type="text/javascript" src="/public/api/rhoapi-modules.js"></script>
15
+ <script type="text/javascript" src="/public/api/rhoapi-modules-ORM.js"></script>
16
+ <script type="text/javascript" src="/public/api/rhoapi-modules-ORMHelper.js"></script>
17
+ <script type="text/javascript" src="/public/api/rhoapi-modules-Ruby-RunTime.js"></script>
18
+
19
+ <script type="text/javascript" src="index.js"></script>
20
+ </head>
21
+
22
+ <body>
23
+ <div class="container-fluid">
24
+
25
+ <div class="row page-title">
26
+ <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
27
+ <% if @rhoconnectclient_ext %>
28
+ <button id="syncBtn" class="btn btn-default btn-sm pull-left hidden"> Sync</button>
29
+ <% end %>
30
+ </div>
31
+ <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
32
+ <h3 class="text-center"><%= class_name %></h3>
33
+ </div>
34
+ <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
35
+ <% if @rhoconnectclient_ext %>
36
+ <button id="logoutBtn" class="btn btn-default btn-sm pull-right hidden"> Logout</button>
37
+ <a id="loginBtn" href="settings/login.html" class="btn btn-primary btn-sm pull-right hidden">Login</a>
38
+ <% end %>
39
+ </div>
40
+ </div>
41
+
42
+ <div id="alert" class="alert hidden">
43
+ <strong id="title"></strong>&nbsp;<span id="text"></span>
44
+ </div>
45
+
46
+ <div class="row">
47
+ <div class="list-group">
48
+ <a href="#" class="list-group-item">
49
+ <span class="glyphicon glyphicon-chevron-right pull-right" aria-hidden="true"></span>
50
+ Add link here...
51
+ </a>
52
+ </div>
53
+ </div>
54
+
55
+ </div>
56
+
57
+ <script>
58
+ window.addEventListener("load", function () {
59
+ var page = new App.IndexPage();
60
+ page.init();
61
+ });
62
+ </script>
63
+
64
+ </body>
65
+
66
+ </html>
@@ -0,0 +1,250 @@
1
+ var App = {
2
+
3
+ rhoClientErrorByCode: function (aString) {
4
+ var code = parseInt(aString);
5
+ if (code === 0) {
6
+ return "ERR_NONE";
7
+ }
8
+ if (code === 1) {
9
+ return "ERR_NETWORK";
10
+ }
11
+ if (code === 2) {
12
+ return "ERR_REMOTESERVER";
13
+ }
14
+ if (code === 3) {
15
+ return "ERR_RUNTIME";
16
+ }
17
+ if (code === 4) {
18
+ return "ERR_UNEXPECTEDSERVERRESPONSE";
19
+ }
20
+ if (code === 5) {
21
+ return "ERR_DIFFDOMAINSINSYNCSRC";
22
+ }
23
+ if (code === 6) {
24
+ return "ERR_NOSERVERRESPONSE";
25
+ }
26
+ if (code === 7) {
27
+ return "ERR_CLIENTISNOTLOGGEDIN";
28
+ }
29
+ if (code === 8) {
30
+ return "ERR_CUSTOMSYNCSERVER";
31
+ }
32
+ if (code === 9) {
33
+ return "ERR_UNATHORIZED";
34
+ }
35
+ return "Unknown error " + code;
36
+ },
37
+
38
+ IndexPage: function () {
39
+ var messageTimeout;
40
+ var that = this;
41
+
42
+ this.syncNotify = function (result) {
43
+ if (result.error_code) {
44
+ that.showWarning("Error.", App.rhoClientErrorByCode(result.error_code));
45
+ } else {
46
+ that.showInfo("Success!", "Database has been synced");
47
+ }
48
+ };
49
+
50
+ this.showWarning = function (title, text) {
51
+ var duration = 5000;
52
+ var alertElement = $("#alert");
53
+ alertElement.addClass("alert-warning");
54
+ $("#alert > #title").text(title);
55
+ $("#alert > #text").text(text);
56
+ alertElement.removeClass("hidden");
57
+
58
+ if (messageTimeout != null) {
59
+ clearTimeout(messageTimeout);
60
+ }
61
+ messageTimeout = setTimeout(function () {
62
+ alertElement.removeClass("alert-warning");
63
+ alertElement.addClass("hidden");
64
+ }, duration);
65
+ };
66
+ this.showInfo = function (title, text) {
67
+ var duration = 5000;
68
+ var alertElement = $("#alert");
69
+ alertElement.addClass("alert-info");
70
+ $("#alert > #title").text(title);
71
+ $("#alert > #text").text(text);
72
+ alertElement.removeClass("hidden");
73
+
74
+ if (messageTimeout != null) {
75
+ clearTimeout(messageTimeout);
76
+ }
77
+ messageTimeout = setTimeout(function () {
78
+ alertElement.removeClass("alert-info");
79
+ alertElement.addClass("hidden");
80
+ }, duration);
81
+ };
82
+ this.updateRhoClientControlButtons = function () {
83
+ if (Rho.RhoConnectClient == null) {
84
+ return;
85
+ }
86
+ var loggedIn = Rho.RhoConnectClient.isLoggedIn();
87
+ $("#logoutBtn").toggleClass("hidden", !loggedIn);
88
+ $("#syncBtn").toggleClass("hidden", !loggedIn);
89
+ $("#loginBtn").toggleClass("hidden", loggedIn);
90
+
91
+ };
92
+ this.init = function () {
93
+
94
+ Rho.NativeToolbar.create([
95
+ {action: "back"},
96
+ {action: "separator"},
97
+ {action: "home"},
98
+ {action: "options"},
99
+ {action: "refresh"}
100
+ ], {});
101
+
102
+ if (Rho.RhoConnectClient != null) {
103
+ Rho.RhoConnectClient.setNotification("*", that.syncNotify);
104
+ }
105
+
106
+ $("#logoutBtn").on("click", function () {
107
+ Rho.RhoConnectClient.logout();
108
+ that.updateRhoClientControlButtons();
109
+ });
110
+
111
+ $("#syncBtn").on("click", function () {
112
+ Rho.RhoConnectClient.doSync();
113
+ that.showInfo("Please wait.", "Sync has been triggered.");
114
+ });
115
+
116
+ that.updateRhoClientControlButtons();
117
+ }
118
+ },
119
+
120
+ SettingsPage: function () {
121
+ var messageTimeout;
122
+ var that = this;
123
+
124
+ this.showWarning = function (title, text) {
125
+ var duration = 5000;
126
+ var alertElement = $("#alert");
127
+ alertElement.addClass("alert-warning");
128
+ $("#alert > #title").text(title);
129
+ $("#alert > #text").text(text);
130
+ alertElement.removeClass("hidden");
131
+
132
+ if (messageTimeout != null) {
133
+ clearTimeout(messageTimeout);
134
+ }
135
+ messageTimeout = setTimeout(function () {
136
+ alertElement.removeClass("alert-warning");
137
+ alertElement.addClass("hidden");
138
+ }, duration);
139
+ };
140
+ this.showInfo = function (title, text) {
141
+ var duration = 5000;
142
+ var alertElement = $("#alert");
143
+ alertElement.addClass("alert-info");
144
+ $("#alert > #title").text(title);
145
+ $("#alert > #text").text(text);
146
+ alertElement.removeClass("hidden");
147
+
148
+ if (messageTimeout != null) {
149
+ clearTimeout(messageTimeout);
150
+ }
151
+ messageTimeout = setTimeout(function () {
152
+ alertElement.removeClass("alert-info");
153
+ alertElement.addClass("hidden");
154
+ }, duration);
155
+ };
156
+ this.syncNotify = function (result) {
157
+ if (result.error_code) {
158
+ that.showWarning("Error.", App.rhoClientErrorByCode(result.error_code));
159
+ } else {
160
+ that.showInfo("Success!", "Database has been synced");
161
+ }
162
+ };
163
+
164
+ this.updateUI = function () {
165
+ if (Rho.RhoConnectClient == null) {
166
+ return;
167
+ }
168
+ var loggedIn = Rho.RhoConnectClient.isLoggedIn();
169
+ $("#logoutItem").toggleClass("hidden", !loggedIn);
170
+ $("#performSyncItem").toggleClass("hidden", !loggedIn);
171
+ $("#loginItem").toggleClass("hidden", loggedIn);
172
+ };
173
+ this.init = function () {
174
+ if (Rho.RhoConnectClient != null) {
175
+ Rho.RhoConnectClient.setNotification("*", that.syncNotify);
176
+ }
177
+ that.updateUI();
178
+
179
+ $("#back").on("click", function () {
180
+ history.back();
181
+ });
182
+
183
+ $("#clientId").text(Rho.ORM.getClientId());
184
+
185
+ $("#resetDatabaseItem").on("click", function () {
186
+ $('#resetDatabaseModalDialog').modal('show');
187
+ });
188
+
189
+ $('#resetDatabaseModalDialog').on('hidden.bs.modal', function () {
190
+ Rho.ORM.databaseFullReset();
191
+ that.showInfo("", "Database has been reset.");
192
+ Rho.RhoConnectClient.doSync();
193
+ });
194
+
195
+ $("#performSyncItem").on("click", function () {
196
+ Rho.RhoConnectClient.doSync();
197
+ that.showInfo("Please wait.", "Sync has been triggered.");
198
+ });
199
+
200
+ $("#logoutItem").on("click", function () {
201
+ Rho.RhoConnectClient.logout();
202
+ that.updateUI();
203
+ that.showInfo("", "You have been logged out.");
204
+ });
205
+ }
206
+ },
207
+
208
+ LoginPage: function () {
209
+ var messageTimeout;
210
+ var that = this;
211
+
212
+ this.showWarning = function (title, text) {
213
+ var duration = 5000;
214
+ var alertElement = $("#alert");
215
+ alertElement.addClass("alert-warning");
216
+ $("#alert > #title").text(title);
217
+ $("#alert > #text").text(text);
218
+ alertElement.removeClass("hidden");
219
+
220
+ if (messageTimeout != null) {
221
+ clearTimeout(messageTimeout);
222
+ }
223
+ messageTimeout = setTimeout(function () {
224
+ alertElement.removeClass("alert-warning");
225
+ alertElement.addClass("hidden");
226
+ }, duration);
227
+ };
228
+ this.init = function () {
229
+ $("#back").on("click", function () {
230
+ history.back();
231
+ });
232
+
233
+ $("#loginBtn").on("click", function () {
234
+ var username = $("#username").val();
235
+ var password = $("#password").val();
236
+ Rho.RhoConnectClient.login(username, password, function (err) {
237
+ //The operation has been failed
238
+ if (err.error_code != 0) {
239
+ var errorText = err.error_message != "" ? err.error_message : "Unknown error with code: " + err.error_code;
240
+ that.showWarning("Login error.", errorText);
241
+ }
242
+ else {
243
+ //the operation has been completed successfully
244
+ history.back();
245
+ }
246
+ });
247
+ });
248
+ }
249
+ }
250
+ }
@@ -3,77 +3,22 @@
3
3
  <html xmlns="http://www.w3.org/1999/xhtml">
4
4
 
5
5
  <head>
6
+ <title><%= class_name %></title>
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
8
+ <link rel="stylesheet" href="/public/bootstrap-3.3.7/css/bootstrap.min.css">
9
+ <link rel="stylesheet" href="/public/css/style.css">
10
+ <script src="/public/jquery/jquery-3.1.1.min.js" type="text/javascript"></script>
11
+ <script src="/public/bootstrap-3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
12
+
13
+ <%% if Rho::System.getProperty('platform') == 'APPLE' || Rho::System.getProperty('platform') == 'ANDROID' ||
14
+ ( Rho::System.getProperty('platform') != 'WINDOWS' && Rho::System.getProperty('webviewFramework') =~ /^WEBKIT/) %>
15
+ <script src="/public/api/rhoapi-modules.js" type="text/javascript"></script>
16
+ <%% end %>
6
17
 
7
- <title><%= class_name %></title>
8
-
9
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
10
-
11
- <%% if Rho::System.getProperty('platform') == 'APPLE' || Rho::System.getProperty('platform') == 'ANDROID' ||
12
- ( Rho::System.getProperty('platform') != 'WINDOWS' && Rho::System.getProperty('webviewFramework') =~ /^WEBKIT/) %>
13
- <script src="/public/api/rhoapi-modules.js" type="text/javascript"></script>
14
-
15
- <script src="/public/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
16
-
17
- <link rel="stylesheet" href="/public/jqmobile/jquery.mobile-1.4.5.min.css">
18
- <!--<link rel="stylesheet" href="/public/css/jqmobile-patch.css">-->
19
-
20
- <script type="text/javascript">
21
- $(document).bind("mobileinit", function(){
22
- // jQuery-Mobile init options initialization goes here. For example, you may
23
- // enable automatically generated 'Back' buttons on headers this way:
24
- //$.mobile.page.prototype.options.addBackBtn = true;
25
-
26
- // You can disable (with false value) or change page loading message
27
- $.mobile.loadingMessage = false;
28
- //$.mobile.loadingMessage = "loading"; // it is default value
29
-
30
- // For documented init options look here:
31
- // http://jquerymobile.com/demos/1.3.1/docs/api/globalconfig.html
32
-
33
- // For poorly documented options search for ".prototype.options"
34
- // in the jQuery Mobile source code
35
-
36
- // Rhodes custom option!
37
- // how long to wait transition end before "loading.." message will be shown
38
- //$.mobile.loadingMessageDelay = 300; // in ms
39
-
40
- // Uncomment these options in case of performance problem in pages transition
41
- //$.mobile.defaultPageTransition = 'none';
42
- //$.mobile.defaultDialogTransition = 'none';
43
- //$.mobile.ajaxEnabled = false;
44
- //$.mobile.pushStateEnabled = false;
45
- $.mobile.loadingMessageDelay = 50; // in ms
46
- });
47
- function ScaleContentToDevice(){
48
- scroll(0, 0);
49
- var height = $.mobile.getScreenHeight() - $(".ui-header").outerHeight() - $(".ui-footer").outerHeight() - $(".ui-content").outerHeight() + $(".ui-content").height();
50
- $(".ui-content").height(height);
51
- }
52
- $(document).on( "pagecontainershow", function(){
53
- ScaleContentToDevice();
54
- });
55
- $(window).on("resize orientationchange", function(){
56
- ScaleContentToDevice();
57
- });
58
- </script>
59
- <script type="text/javascript" charset="utf-8" src="/public/jqmobile/jquery.mobile-1.4.5.min.js"></script>
60
- <!--<script type="text/javascript" charset="utf-8" src="/public/js/jqmobile-patch.js"></script>-->
61
-
62
- <%% end %>
63
-
64
- <%% if Rho::System.getProperty('platform') == 'APPLE' %>
65
- <link href="/public/css/iphone.css" type="text/css" rel="stylesheet"/>
66
- <%% elsif Rho::System.getProperty('platform') == 'ANDROID' %>
67
- <link href="/public/css/android.css" type="text/css" rel="stylesheet"/>
68
- <%% elsif Rho::System.getProperty('webviewFramework') =~ /^WEBKIT/ %>
69
- <link href="/public/css/re_webkit.css" type="text/css" rel="stylesheet"/>
70
- <%% elsif Rho::System.getProperty('platform') == 'WINDOWS' %>
71
- <link href="/public/css/windows_mobile.css" type="text/css" rel="stylesheet"/>
72
- <%% end %>
73
18
  </head>
74
19
 
75
20
  <body data-platform="<%%= Rho::System.getProperty('platform') %>">
76
- <%%= @content %>
21
+ <%%= @content %>
77
22
  </body>
78
23
 
79
24
  </html>