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.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationSingleton.java +20 -8
- data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +1 -2
- data/lib/commonAPI/coreapi/ext/system.xml +1 -1
- data/platform/android/build/android.rake +1 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +44 -3
- data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +4 -3
- data/platform/iphone/Classes/NativeView/RhoNativeViewManagerOC.h +1 -1
- data/platform/iphone/Classes/RhoMainView.h +8 -2
- data/platform/iphone/Classes/RhoUIWebView.h +75 -0
- data/platform/iphone/Classes/RhoUIWebView.m +142 -0
- data/platform/iphone/Classes/RhoWKWebView.h +87 -0
- data/platform/iphone/Classes/RhoWKWebView.m +187 -0
- data/platform/iphone/Classes/RhoWebView.h +72 -0
- data/platform/iphone/Classes/RhoWebViewFabrique.h +35 -0
- data/platform/iphone/Classes/RhoWebViewFabrique.m +87 -0
- data/platform/iphone/Classes/Rhodes.m +17 -6
- data/platform/iphone/Classes/Signature.old/SignatureDelegate.m +11 -4
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +3 -4
- data/platform/iphone/Classes/SimpleMainView.h +7 -5
- data/platform/iphone/Classes/SimpleMainView.m +174 -179
- data/platform/iphone/Classes/SplitView/RightViewController.h +2 -2
- data/platform/iphone/Classes/SplitView/RightViewController.m +9 -10
- data/platform/iphone/Classes/SplitView/SplittedMainView.h +2 -3
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +10 -7
- data/platform/iphone/Classes/TabbedMainView.h +2 -1
- data/platform/iphone/Classes/TabbedMainView.m +13 -10
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +21 -5
- data/platform/iphone/Classes/WebView.m +1 -1
- data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +40 -3
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
- data/platform/iphone/rbuild/iphone.rake +51 -0
- data/platform/shared/common/RhoNativeViewManager.h +9 -9
- data/platform/shared/common/RhodesApp.cpp +13 -1
- data/platform/shared/net/HttpServer.cpp +12 -2
- data/platform/shared/qt/rhodes/ExternalWebView.ui +11 -2
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +9 -7
- data/platform/shared/qt/rhodes/QtMainWindow.ui +13 -4
- data/platform/shared/qt/rhodes/qkineticscroller.cpp +1245 -0
- data/platform/shared/qt/rhodes/qkineticscroller.h +165 -0
- data/platform/shared/qt/rhodes/qkineticscroller_p.h +168 -0
- data/platform/shared/qt/rhodes/qtflickgesture.cpp +696 -0
- data/platform/shared/qt/rhodes/qtflickgesture_p.h +107 -0
- data/platform/shared/qt/rhodes/qtscroller.cpp +2080 -0
- data/platform/shared/qt/rhodes/qtscroller.h +138 -0
- data/platform/shared/qt/rhodes/qtscroller_p.h +205 -0
- data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +350 -0
- data/platform/shared/qt/rhodes/qtscrollerfilter_p.h +110 -0
- data/platform/shared/qt/rhodes/qtscrollerproperties.cpp +412 -0
- data/platform/shared/qt/rhodes/qtscrollerproperties.h +135 -0
- data/platform/shared/qt/rhodes/qtscrollerproperties_p.h +90 -0
- data/platform/shared/qt/rhodes/qtscrollevent.cpp +190 -0
- data/platform/shared/qt/rhodes/qtscrollevent.h +100 -0
- data/platform/shared/qt/rhodes/qtscrollevent_p.h +33 -0
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +347 -0
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +90 -0
- data/platform/shared/qt/rhodes/qwebviewselectionsuppressor.h +113 -0
- data/platform/shared/qt/rhodes/rhodes.pro +19 -0
- data/res/generators/rhogen.rb +307 -15
- data/res/generators/templates/application/app/Settings/err_sync.erb +12 -6
- data/res/generators/templates/application/app/Settings/home.erb +32 -17
- data/res/generators/templates/application/app/Settings/index.erb +55 -26
- data/res/generators/templates/application/app/Settings/javascript_index.html +111 -0
- data/res/generators/templates/application/app/Settings/javascript_login.html +65 -0
- data/res/generators/templates/application/app/Settings/login.erb +25 -19
- data/res/generators/templates/application/app/Settings/reset.erb +18 -9
- data/res/generators/templates/application/app/Settings/wait.erb +10 -7
- data/res/generators/templates/application/app/index.erb +32 -20
- data/res/generators/templates/application/app/javascript_index.html +66 -0
- data/res/generators/templates/application/app/javascript_index.js +250 -0
- data/res/generators/templates/application/app/layout.erb +12 -67
- data/res/generators/templates/application/javascript_build.yml +41 -0
- data/res/generators/templates/application/javascript_rhoconfig.txt +123 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.css +587 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.css.map +1 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.min.css +6 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.min.css.map +1 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.css +6757 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.css.map +1 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.min.css +6 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.min.css.map +1 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.eot +0 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.svg +288 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff +0 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/js/bootstrap.js +2377 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/js/bootstrap.min.js +7 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/js/npm.js +13 -0
- data/res/generators/templates/application/public/css/style.css +3 -0
- data/res/generators/templates/application/public/jquery/jquery-3.1.1.min.js +4 -0
- data/res/generators/templates/application/public/jquery/jquery-3.1.1.min.map +1 -0
- data/res/generators/templates/application/rhoconfig.txt +16 -0
- data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +4 -0
- data/res/generators/templates/model/edit.erb +22 -21
- data/res/generators/templates/model/index.erb +24 -22
- data/res/generators/templates/model/javascript_edit.html +65 -0
- data/res/generators/templates/model/javascript_index.html +56 -0
- data/res/generators/templates/model/javascript_index.js +83 -0
- data/res/generators/templates/model/javascript_model.js +16 -0
- data/res/generators/templates/model/javascript_new.html +64 -0
- data/res/generators/templates/model/javascript_show.html +66 -0
- data/res/generators/templates/model/new.erb +22 -19
- data/res/generators/templates/model/show.erb +22 -14
- data/res/prebuild_base_app/app/index.erb +31 -18
- data/res/prebuild_base_app/app/layout.erb +11 -56
- data/version +1 -1
- metadata +59 -24
- data/res/generators/templates/application/public/css/android.css +0 -418
- data/res/generators/templates/application/public/css/iphone.css +0 -378
- data/res/generators/templates/application/public/css/jqmobile-patch.css +0 -62
- data/res/generators/templates/application/public/css/re_webkit.css +0 -736
- data/res/generators/templates/application/public/css/re_webkit_flat.css +0 -753
- data/res/generators/templates/application/public/css/windows_mobile.css +0 -327
- data/res/generators/templates/application/public/jqmobile/images/ajax-loader.gif +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icon-search-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.css +0 -3
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.js +0 -10
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.map +0 -1
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.4.5.min.css +0 -3
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.theme-1.4.5.min.css +0 -3
- data/res/generators/templates/application/public/jquery/jquery-1.9.1.min.js +0 -5
- data/res/generators/templates/application/public/jquery/jquery-1.9.1.min.map +0 -1
- data/res/generators/templates/application/public/js/application.js +0 -1
- data/res/generators/templates/application/public/js/jqmobile-patch.js +0 -466
- data/res/generators/templates/application/public/js/syncengine.js +0 -504
@@ -1,504 +0,0 @@
|
|
1
|
-
(function(){
|
2
|
-
// =========================================================================================
|
3
|
-
// This library is for performing ajax calls to sync engine from javascript, no jQuery used.
|
4
|
-
// =========================================================================================
|
5
|
-
|
6
|
-
var BASE_URL = "/system/syncengine/";
|
7
|
-
|
8
|
-
function buildQuery(params) {
|
9
|
-
var query = "";
|
10
|
-
for (var key in params) {
|
11
|
-
if (params.hasOwnProperty(key)) {
|
12
|
-
var type = typeof params[key];
|
13
|
-
if ('string' == type || 'number' == type || 'boolean' == type) {
|
14
|
-
var value = '' + params[key];
|
15
|
-
if (0 < query.length) query = query + '&';
|
16
|
-
query = query + encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
}
|
20
|
-
return query;
|
21
|
-
}
|
22
|
-
|
23
|
-
/*
|
24
|
-
Option names are:
|
25
|
-
type - request type (optional, 'GET' by default)
|
26
|
-
url - request URL
|
27
|
-
query - request query string, may be defined as string or an object with properties (optional)
|
28
|
-
body - request body (optional)
|
29
|
-
success - request success handler (optional)
|
30
|
-
error - request error handler (optional)
|
31
|
-
*/
|
32
|
-
function request(opts, that) {
|
33
|
-
var xhr = false;
|
34
|
-
|
35
|
-
// attempt to create XHR
|
36
|
-
if (!xhr) {
|
37
|
-
try {
|
38
|
-
if ('undefined' != typeof XMLHttpRequest) {
|
39
|
-
xhr = new XMLHttpRequest();
|
40
|
-
} else if (window.createRequest) {
|
41
|
-
xhr = window.createRequest();
|
42
|
-
} else if (window.ActiveXObject) {
|
43
|
-
try {
|
44
|
-
xhr = new ActiveXObject("MSXML2.XMLHTTP");
|
45
|
-
} catch(ex) {
|
46
|
-
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
47
|
-
}
|
48
|
-
} else {
|
49
|
-
//alert('no xhr!');
|
50
|
-
}
|
51
|
-
} catch(ex) {
|
52
|
-
xhr = false;
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
if (xhr) {
|
57
|
-
// ensure required opts are defined
|
58
|
-
if ('object' != typeof opts)
|
59
|
-
opts = {};
|
60
|
-
if ('string' != typeof opts.type)
|
61
|
-
opts.type = 'GET';
|
62
|
-
if ('string' != typeof opts.baseUrl)
|
63
|
-
opts.baseUrl = BASE_URL;
|
64
|
-
if ('string' != typeof opts.relUrl)
|
65
|
-
opts.relUrl = '';
|
66
|
-
if ('string' != typeof opts.url)
|
67
|
-
opts.url = opts.baseUrl + opts.relUrl;
|
68
|
-
if ('undefined' == typeof opts.query)
|
69
|
-
opts.query = '';
|
70
|
-
if ('object' == typeof opts.query)
|
71
|
-
opts.query = buildQuery(opts.query);
|
72
|
-
if ('undefined' == typeof opts.body)
|
73
|
-
opts.body = null;
|
74
|
-
if ('function' != typeof opts.success)
|
75
|
-
opts.success = function(){};
|
76
|
-
if ('function' != typeof opts.error)
|
77
|
-
opts.error = function(){};
|
78
|
-
|
79
|
-
var q = opts.query;
|
80
|
-
if (0 < q.length)
|
81
|
-
q = '?' + q;
|
82
|
-
|
83
|
-
xhr.open(opts.type, opts.url + q, true /*it is async request*/);
|
84
|
-
xhr.onreadystatechange = function () {
|
85
|
-
if (xhr.readyState == 4) {
|
86
|
-
opts.success.apply('undefined' == typeof that ? this : that, [
|
87
|
-
xhr.response || xhr.responseText, xhr.status || xhr.statusText, xhr
|
88
|
-
]);
|
89
|
-
}
|
90
|
-
};
|
91
|
-
if (xhr.onerror) {
|
92
|
-
xhr.onerror = function () {
|
93
|
-
opts.error.apply('undefined' == typeof that ? this : that, [
|
94
|
-
xhr.response || xhr.responseText, "error", xhr
|
95
|
-
]);
|
96
|
-
};
|
97
|
-
}
|
98
|
-
if (xhr.ontimeout) {
|
99
|
-
xhr.ontimeout = function () {
|
100
|
-
opts.error.apply('undefined' == typeof that ? this : that, [
|
101
|
-
"", "timeout", xhr
|
102
|
-
]);
|
103
|
-
};
|
104
|
-
}
|
105
|
-
xhr.send(opts.body);
|
106
|
-
}
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
function logged_in(/*function*/ success, /*function*/ error) {
|
111
|
-
request({
|
112
|
-
relUrl: "logged_in",
|
113
|
-
success: success,
|
114
|
-
error: error
|
115
|
-
});
|
116
|
-
}
|
117
|
-
|
118
|
-
function logout(/*function*/ success, /*function*/ error) {
|
119
|
-
request({
|
120
|
-
relUrl: "logout",
|
121
|
-
success: success,
|
122
|
-
error: error
|
123
|
-
});
|
124
|
-
}
|
125
|
-
|
126
|
-
function dosync(/*bool*/ show_status_popup, /*string*/ query_params,
|
127
|
-
/*function*/ success, /*function*/ error) {
|
128
|
-
request({
|
129
|
-
relUrl: "dosync",
|
130
|
-
success: success,
|
131
|
-
error: error
|
132
|
-
});
|
133
|
-
}
|
134
|
-
|
135
|
-
function dosync_source(/*string*/ srcName, /*bool*/ show_status_popup, /*string*/ query_params,
|
136
|
-
/*function*/ success, /*function*/ error) {
|
137
|
-
request({
|
138
|
-
relUrl: "dosync_source",
|
139
|
-
query: {
|
140
|
-
srcName: srcName
|
141
|
-
},
|
142
|
-
success: success,
|
143
|
-
error: error
|
144
|
-
});
|
145
|
-
}
|
146
|
-
|
147
|
-
function stop_sync(/*function*/ success, /*function*/ error) {
|
148
|
-
request({
|
149
|
-
relUrl: "stop_sync",
|
150
|
-
success: success,
|
151
|
-
error: error
|
152
|
-
});
|
153
|
-
}
|
154
|
-
|
155
|
-
function set_pollinterval(/*number*/ interval, /*function*/ success, /*function*/ error) {
|
156
|
-
request({
|
157
|
-
relUrl: "set_pollinterval",
|
158
|
-
query: {
|
159
|
-
interval: interval
|
160
|
-
},
|
161
|
-
success: success,
|
162
|
-
error: error
|
163
|
-
});
|
164
|
-
}
|
165
|
-
|
166
|
-
function get_pollinterval(/*function*/ success, /*function*/ error) {
|
167
|
-
request({
|
168
|
-
relUrl: "get_pollinterval",
|
169
|
-
success: success,
|
170
|
-
error: error
|
171
|
-
});
|
172
|
-
}
|
173
|
-
|
174
|
-
function set_syncserver(/*string*/ syncserver, /*function*/ success, /*function*/ error) {
|
175
|
-
request({
|
176
|
-
relUrl: "set_syncserver",
|
177
|
-
query: {
|
178
|
-
syncserver: syncserver
|
179
|
-
},
|
180
|
-
success: success,
|
181
|
-
error: error
|
182
|
-
});
|
183
|
-
}
|
184
|
-
|
185
|
-
function set_pagesize(/*number*/ size, /*function*/ success, /*function*/ error) {
|
186
|
-
request({
|
187
|
-
relUrl: "set_pagesize",
|
188
|
-
query: {
|
189
|
-
pagesize: size
|
190
|
-
},
|
191
|
-
success: success,
|
192
|
-
error: error
|
193
|
-
});
|
194
|
-
}
|
195
|
-
|
196
|
-
function get_pagesize(/*function*/ success, /*function*/ error) {
|
197
|
-
request({
|
198
|
-
relUrl: "get_pagesize",
|
199
|
-
success: success,
|
200
|
-
error: error
|
201
|
-
});
|
202
|
-
}
|
203
|
-
|
204
|
-
function get_lastsync_objectcount(/*string*/ srcName, /*function*/ success, /*function*/ error) {
|
205
|
-
request({
|
206
|
-
relUrl: "get_lastsync_objectcount",
|
207
|
-
query: {
|
208
|
-
srcName: srcName
|
209
|
-
},
|
210
|
-
success: success,
|
211
|
-
error: error
|
212
|
-
});
|
213
|
-
}
|
214
|
-
|
215
|
-
function is_syncing(/*function*/ success, /*function*/ error) {
|
216
|
-
request({
|
217
|
-
relUrl: "is_syncing",
|
218
|
-
success: success,
|
219
|
-
error: error
|
220
|
-
});
|
221
|
-
}
|
222
|
-
|
223
|
-
function enable_status_popup(/*boolean*/ enable, /*function*/ success, /*function*/ error) {
|
224
|
-
request({
|
225
|
-
relUrl: "enable_status_popup",
|
226
|
-
query: {
|
227
|
-
enable: enable
|
228
|
-
},
|
229
|
-
success: success,
|
230
|
-
error: error
|
231
|
-
});
|
232
|
-
}
|
233
|
-
|
234
|
-
function set_threaded_mode(/*boolean*/ threaded, /*function*/ success, /*function*/ error) {
|
235
|
-
request({
|
236
|
-
relUrl: "set_threaded_mode",
|
237
|
-
query: {
|
238
|
-
threaded: threaded
|
239
|
-
},
|
240
|
-
success: success,
|
241
|
-
error: error
|
242
|
-
});
|
243
|
-
}
|
244
|
-
|
245
|
-
function register_push(/*function*/ success, /*function*/ error) {
|
246
|
-
request({
|
247
|
-
relUrl: "register_push",
|
248
|
-
success: success,
|
249
|
-
error: error
|
250
|
-
});
|
251
|
-
}
|
252
|
-
|
253
|
-
function set_source_property(/*string*/ srcName, /*string*/ propName, /*string*/ propValue,
|
254
|
-
/*function*/ success, /*function*/ error) {
|
255
|
-
request({
|
256
|
-
relUrl: "set_source_property",
|
257
|
-
query: {
|
258
|
-
srcName: srcName,
|
259
|
-
propName: propName,
|
260
|
-
propValue: propValue
|
261
|
-
},
|
262
|
-
success: success,
|
263
|
-
error: error
|
264
|
-
});
|
265
|
-
}
|
266
|
-
|
267
|
-
function set_ssl_verify_peer(/*boolean*/ verify, /*function*/ success, /*function*/ error) {
|
268
|
-
request({
|
269
|
-
relUrl: "set_ssl_verify_peer",
|
270
|
-
query: {
|
271
|
-
verify: verify
|
272
|
-
},
|
273
|
-
success: success,
|
274
|
-
error: error
|
275
|
-
});
|
276
|
-
}
|
277
|
-
|
278
|
-
function update_blob_attribs(/*string*/ partition, /*string*/ srcName,
|
279
|
-
/*function*/ success, /*function*/ error) {
|
280
|
-
request({
|
281
|
-
relUrl: "update_blob_attribs",
|
282
|
-
query: {
|
283
|
-
partition: partition,
|
284
|
-
srcName: srcName
|
285
|
-
},
|
286
|
-
success: success,
|
287
|
-
error: error
|
288
|
-
});
|
289
|
-
}
|
290
|
-
|
291
|
-
function set_objectnotify(/*function*/ notify, /*function*/ success, /*function*/ error) {
|
292
|
-
var uri = setCallback(nextId('notify'), notify, true /*it is persistent callback*/);
|
293
|
-
request({
|
294
|
-
relUrl: "set_objectnotify_url",
|
295
|
-
query: {
|
296
|
-
url: uri
|
297
|
-
},
|
298
|
-
success: success,
|
299
|
-
error: error
|
300
|
-
});
|
301
|
-
}
|
302
|
-
|
303
|
-
function add_objectnotify(/*string*/ srcName, /*string*/ objectId,
|
304
|
-
/*function*/ success, /*function*/ error) {
|
305
|
-
request({
|
306
|
-
relUrl: "add_objectnotify",
|
307
|
-
query: {
|
308
|
-
srcName: srcName,
|
309
|
-
objectId: objectId
|
310
|
-
},
|
311
|
-
success: success,
|
312
|
-
error: error
|
313
|
-
});
|
314
|
-
}
|
315
|
-
|
316
|
-
function clean_objectnotify(/*function*/ success, /*function*/ error) {
|
317
|
-
request({
|
318
|
-
relUrl: "clean_objectnotify",
|
319
|
-
success: success,
|
320
|
-
error: error
|
321
|
-
});
|
322
|
-
}
|
323
|
-
|
324
|
-
function set_notification(/*string*/ srcName, /*string*/ url, /*string*/ params,
|
325
|
-
/*function*/ success, /*function*/ error) {
|
326
|
-
request({
|
327
|
-
relUrl: "set_notification",
|
328
|
-
query: {
|
329
|
-
srcName: srcName,
|
330
|
-
url: url,
|
331
|
-
params: params
|
332
|
-
},
|
333
|
-
success: success,
|
334
|
-
error: error
|
335
|
-
});
|
336
|
-
}
|
337
|
-
|
338
|
-
function clear_notification(/*string*/ srcName, /*function*/ success, /*function*/ error) {
|
339
|
-
request({
|
340
|
-
relUrl: "clear_notification",
|
341
|
-
query: {
|
342
|
-
srcName: srcName
|
343
|
-
},
|
344
|
-
success: success,
|
345
|
-
error: error
|
346
|
-
});
|
347
|
-
}
|
348
|
-
|
349
|
-
function login(/*string*/ login, /*string*/ password, /*function*/ callback,
|
350
|
-
/*function*/ success, /*function*/ error) {
|
351
|
-
var uri = setCallback(nextId('callback'), callback);
|
352
|
-
request({
|
353
|
-
relUrl: "login",
|
354
|
-
query: {
|
355
|
-
login: login,
|
356
|
-
password: password,
|
357
|
-
callback: uri
|
358
|
-
},
|
359
|
-
success: success,
|
360
|
-
error: error
|
361
|
-
});
|
362
|
-
}
|
363
|
-
|
364
|
-
function dosearch(/*string*/ srcNames, /*string*/ from, /*string*/ params, /*boolean*/ syncChanges,
|
365
|
-
/*number*/ progressStep, /*string*/ callback, /*string*/ callbackParams,
|
366
|
-
/*function*/ success, /*function*/ error) {
|
367
|
-
request({
|
368
|
-
relUrl: "dosearch",
|
369
|
-
query: {
|
370
|
-
srcNames: srcNames,
|
371
|
-
from: from,
|
372
|
-
params: params,
|
373
|
-
syncChanges: syncChanges,
|
374
|
-
progressStep: progressStep,
|
375
|
-
callback: callback,
|
376
|
-
callbackParams: callbackParams
|
377
|
-
},
|
378
|
-
success: success,
|
379
|
-
error: error
|
380
|
-
});
|
381
|
-
}
|
382
|
-
|
383
|
-
function get_src_attrs(/*string*/ partition, /*string*/ srcName,
|
384
|
-
/*function*/ success, /*function*/ error) {
|
385
|
-
request({
|
386
|
-
relUrl: "get_src_attrs",
|
387
|
-
query: {
|
388
|
-
partition: partition,
|
389
|
-
srcName: srcName
|
390
|
-
},
|
391
|
-
success: success,
|
392
|
-
error: error
|
393
|
-
});
|
394
|
-
}
|
395
|
-
|
396
|
-
function is_blob_attr(/*string*/ partition, /*string*/ srcName, /*string*/ attrName,
|
397
|
-
/*function*/ success, /*function*/ error) {
|
398
|
-
request({
|
399
|
-
relUrl: "is_blob_attr",
|
400
|
-
query: {
|
401
|
-
partition: partition,
|
402
|
-
srcName: srcName,
|
403
|
-
attrName: attrName
|
404
|
-
},
|
405
|
-
success: success,
|
406
|
-
error: error
|
407
|
-
});
|
408
|
-
}
|
409
|
-
|
410
|
-
var _rho_callbackId_valuePrefix = "_rhoId#";
|
411
|
-
|
412
|
-
var callbackCount = 0;
|
413
|
-
var pendingCallbacks = {};
|
414
|
-
|
415
|
-
function nextId(tag) {
|
416
|
-
if ('undefined' == typeof tag || !tag)
|
417
|
-
tag = _rho_callbackId_valuePrefix;
|
418
|
-
else
|
419
|
-
tag = '_' +tag +'#';
|
420
|
-
return (tag + callbackCount++);
|
421
|
-
|
422
|
-
}
|
423
|
-
|
424
|
-
function defaultCallback(){}
|
425
|
-
|
426
|
-
function setCallback(id, callback, isPersistent) {
|
427
|
-
if ('undefined' == typeof callback || !callback)
|
428
|
-
callback = defaultCallback;
|
429
|
-
|
430
|
-
pendingCallbacks[id] = {
|
431
|
-
id: id,
|
432
|
-
callback: callback,
|
433
|
-
isPersistent: ('undefined' != typeof isPersistent) && isPersistent
|
434
|
-
};
|
435
|
-
// store options for pending callback
|
436
|
-
return 'javascript:window._rho_syncEngineCallback("' +id +'")';
|
437
|
-
}
|
438
|
-
|
439
|
-
window._rho_syncEngineCallback = function(callbackId) {
|
440
|
-
var cbId = decodeURIComponent(callbackId);
|
441
|
-
//console.log('_rho_syncEngineCallback: callback for: ' +cbId);
|
442
|
-
//console.log('_rho_syncEngineCallback: result: ' +result);
|
443
|
-
|
444
|
-
var opts = pendingCallbacks[cbId];
|
445
|
-
var callback = null;
|
446
|
-
|
447
|
-
if ('undefined' != typeof opts && opts) {
|
448
|
-
//console.log('_rho_syncEngineCallback: callback found!');
|
449
|
-
callback = opts.callback;
|
450
|
-
if (!opts.isPersistent)
|
451
|
-
delete pendingCallbacks[cbId];
|
452
|
-
}
|
453
|
-
return callback;
|
454
|
-
};
|
455
|
-
|
456
|
-
/*
|
457
|
-
int rho_sync_get_lastsync_objectcount(int nSrcID);
|
458
|
-
void rho_sync_clear_notification(int source_id);
|
459
|
-
void set_source_property(int nSrcID, const char* szPropName, const char* szPropValue);
|
460
|
-
void update_blob_attribs(const char* szPartition, int source_id);
|
461
|
-
void add_objectnotify(int nSrcID, const char* szObject);
|
462
|
-
void set_notification(int source_id, const char *url, char* params);
|
463
|
-
VALUE dosearch(VALUE ar_sources, const char *from, const char *params, bool sync_changes, int nProgressStep, const char* callback, const char* callback_params);
|
464
|
-
VALUE get_src_attrs(const char* szPartition, int source_id);
|
465
|
-
VALUE is_blob_attr(const char* szPartition, int source_id, const char* szAttrName);
|
466
|
-
*/
|
467
|
-
|
468
|
-
window.Rho = window.Rho || {};
|
469
|
-
window.Rho.syncengine = window.Rho.syncengine || {};
|
470
|
-
|
471
|
-
window.Rho.syncengine.set_threaded_mode = set_threaded_mode;
|
472
|
-
window.Rho.syncengine.enable_status_popup = enable_status_popup;
|
473
|
-
window.Rho.syncengine.set_ssl_verify_peer = set_ssl_verify_peer;
|
474
|
-
window.Rho.syncengine.register_push = register_push;
|
475
|
-
|
476
|
-
window.Rho.syncengine.set_syncserver = set_syncserver;
|
477
|
-
window.Rho.syncengine.set_pollinterval = set_pollinterval;
|
478
|
-
window.Rho.syncengine.get_pollinterval = get_pollinterval;
|
479
|
-
window.Rho.syncengine.set_pagesize = set_pagesize;
|
480
|
-
window.Rho.syncengine.get_pagesize = get_pagesize;
|
481
|
-
|
482
|
-
window.Rho.syncengine.login = login;
|
483
|
-
window.Rho.syncengine.logged_in = logged_in;
|
484
|
-
window.Rho.syncengine.logout = logout;
|
485
|
-
|
486
|
-
window.Rho.syncengine.dosync = dosync;
|
487
|
-
window.Rho.syncengine.dosync_source = dosync_source;
|
488
|
-
window.Rho.syncengine.is_syncing = is_syncing;
|
489
|
-
window.Rho.syncengine.stop_sync = stop_sync;
|
490
|
-
|
491
|
-
window.Rho.syncengine.set_objectnotify = set_objectnotify;
|
492
|
-
window.Rho.syncengine.clean_objectnotify = clean_objectnotify;
|
493
|
-
|
494
|
-
//window.Rho.syncengine.get_lastsync_objectcount = get_lastsync_objectcount;
|
495
|
-
//window.Rho.syncengine.clear_notification = clear_notification;
|
496
|
-
//window.Rho.syncengine.set_source_property = set_source_property;
|
497
|
-
//window.Rho.syncengine.update_blob_attribs = update_blob_attribs;
|
498
|
-
//window.Rho.syncengine.add_objectnotify = add_objectnotify;
|
499
|
-
//window.Rho.syncengine.set_notification = set_notification;
|
500
|
-
//window.Rho.syncengine.dosearch = dosearch;
|
501
|
-
//window.Rho.syncengine.get_src_attrs = get_src_attrs;
|
502
|
-
//window.Rho.syncengine.is_blob_attr = is_blob_attr;
|
503
|
-
|
504
|
-
})();
|