function Server(url, getScript) { this.url = url; this.nextId = 0; this.getScript = getScript; this.uuid = "_" + ("" + Math.random()).substr(2) + "_"; this.maxSize = 1800; }; Server.prototype = { base64url: function(txt) { return Base64.encode(txt); }, request: function(method, url, request, callback) { var requestId = this.uuid + (this.nextId++); var payload = this.base64url(toJson({'u':url, 'm':method, 'p':request})); var totalPockets = Math.ceil(payload.length / this.maxSize); var baseUrl = this.url + "/$/" + requestId + "/" + totalPockets + "/"; angularCallbacks[requestId] = function(response) { delete angularCallbacks[requestId]; callback(200, response); }; for ( var pocketNo = 0; pocketNo < totalPockets; pocketNo++) { var pocket = payload.substr(pocketNo * this.maxSize, this.maxSize); this.getScript(baseUrl + (pocketNo+1) + "?h=" + pocket, noop); } } }; function FrameServer(frame) { this.frame = frame; }; FrameServer.PREFIX = "$DATASET:"; FrameServer.prototype = { read:function(){ this.data = fromJson(this.frame.name.substr(FrameServer.PREFIX.length)); }, write:function(){ this.frame.name = FrameServer.PREFIX + toJson(this.data); }, request: function(method, url, request, callback) { //alert(method + " " + url + " " + toJson(request) + " " + toJson(callback)); } }; function VisualServer(delegate, status, update) { this.delegate = delegate; this.update = update; this.status = status; }; VisualServer.prototype = { request:function(method, url, request, callback) { var self = this; this.status.beginRequest(request); this.delegate.request(method, url, request, function() { self.status.endRequest(); try { callback.apply(this, arguments); } catch (e) { alert(toJson(e)); } self.update(); }); } }; docs.js?h=v1.2.7&id=3e54a1b18ab698d55e1642a120f95ea3adf6af1b'>diffstats
path: root/docs/src/gen-docs.js
blob: 4649bec3e9f444c6795fe2b7f1336e1e154b78e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80