Skip to content

Commit 8ea3eca

Browse files
committed
client: Added some debug symbols (for easier profiling etc)
1 parent 9a839c0 commit 8ea3eca

22 files changed

+183
-185
lines changed

src/client/javascript/api.js

Lines changed: 49 additions & 51 deletions
Large diffs are not rendered by default.

src/client/javascript/core/authenticator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
* @param {CallbackHandler} callback Callback function
129129
*/
130130
Authenticator.prototype.login = function(data, callback) {
131-
API.call('login', data, function(error, result) {
131+
API.call('login', data, function onLoginResponse(error, result) {
132132
if ( result ) {
133133
callback(false, result);
134134
} else {
@@ -149,7 +149,7 @@
149149
Authenticator.prototype.logout = function(callback) {
150150
var opts = {};
151151

152-
API.call('logout', opts, function(error, result) {
152+
API.call('logout', opts, function onLogoutResponse(error, result) {
153153
if ( result ) {
154154
callback(false, true);
155155
} else {
@@ -170,7 +170,7 @@
170170
Authenticator.prototype.onLoginRequest = function(data, callback) {
171171
var self = this;
172172

173-
this.login(data, function(err, result) {
173+
this.login(data, function onLoginRequest(err, result) {
174174
if ( err ) {
175175
callback(err);
176176
} else {
@@ -300,7 +300,7 @@
300300
*
301301
* @return {OSjs.Core.Authenticator}
302302
*/
303-
OSjs.Core.getAuthenticator = function() {
303+
OSjs.Core.getAuthenticator = function Core_getAuthenticator() {
304304
return _authInstance;
305305
};
306306

src/client/javascript/core/connection.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949
});
5050

51-
data.onprogress = function(ev) {
51+
data.onprogress = function XHR_onprogress(ev) {
5252
if ( ev.lengthComputable ) {
5353
onprogress(ev, ev.loaded / ev.total);
5454
} else {
@@ -344,13 +344,13 @@
344344
url: OSjs.VFS.Transports.Internal.path(),
345345
method: 'POST',
346346
body: form,
347-
onsuccess: function(result) {
347+
onsuccess: function Connection_POST_success(result) {
348348
onsuccess(false, result);
349349
},
350-
onerror: function(result) {
350+
onerror: function Connection_POST_error(result) {
351351
onerror('error', null, result);
352352
},
353-
oncanceled: function(evt) {
353+
oncanceled: function Connection_POST_cancel(evt) {
354354
onerror('canceled', null, evt);
355355
}
356356
}, options));
@@ -382,14 +382,14 @@
382382
url: args.url || OSjs.VFS.Transports.Internal.path(args.path),
383383
method: args.method || 'GET',
384384
responseType: 'arraybuffer',
385-
onsuccess: function(response, xhr) {
385+
onsuccess: function Connection_GET_success(response, xhr) {
386386
if ( !xhr || xhr.status === 404 || xhr.status === 500 ) {
387387
onsuccess({error: xhr.statusText || response, result: null});
388388
return;
389389
}
390390
onsuccess({error: false, result: response});
391391
},
392-
onerror: function() {
392+
onerror: function Connection_GET_error() {
393393
onerror.apply(self, arguments);
394394
}
395395
}, options));
@@ -423,10 +423,10 @@
423423
method: 'POST',
424424
json: true,
425425
body: args,
426-
onsuccess: function(/*response, request, url*/) {
426+
onsuccess: function Connection_XHR_onsuccess(/*response, request, url*/) {
427427
onsuccess.apply(self, arguments);
428428
},
429-
onerror: function(/*error, response, request, url*/) {
429+
onerror: function Connection_XHR_onerror(/*error, response, request, url*/) {
430430
onerror.apply(self, arguments);
431431
}
432432
}, options));
@@ -482,7 +482,7 @@
482482
*
483483
* @return {OSjs.Core.Connection}
484484
*/
485-
OSjs.Core.getConnection = function() {
485+
OSjs.Core.getConnection = function Core_getConnection() {
486486
return _connectionInstance;
487487
};
488488

src/client/javascript/core/dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
this.className = className;
112112
this.buttonClicked = false;
113113

114-
this.closeCallback = function(ev, button, result) {
114+
this.closeCallback = function Dialog_closeCallback(ev, button, result) {
115115
if ( self._destroyed ) {
116116
return;
117117
}

src/client/javascript/core/mount-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@
530530
* @memberof OSjs.Core
531531
* @return {OSjs.Core.MountManager}
532532
*/
533-
OSjs.Core.getMountManager = function() {
533+
OSjs.Core.getMountManager = function Core_getMountManager() {
534534
return MountManager;
535535
};
536536

src/client/javascript/core/package-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@
496496
*
497497
* @return {OSjs.Core.PackageManager}
498498
*/
499-
OSjs.Core.getPackageManager = function() {
499+
OSjs.Core.getPackageManager = function Core_getPackageManager() {
500500
return PackageManager;
501501
};
502502

src/client/javascript/core/search-engine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
*
344344
* @return {OSjs.Core.SearchEngine}
345345
*/
346-
OSjs.Core.getSearchEngine = function() {
346+
OSjs.Core.getSearchEngine = function Core_getSearchEngine() {
347347
return SearchEngine;
348348
};
349349

src/client/javascript/core/settings-manager.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
*
6666
* @param {Object} settings Entire settings tree
6767
*/
68-
SettingsManager.init = function(settings) {
68+
SettingsManager.init = function SettingsManager_init(settings) {
6969
this.storage = settings || {};
7070
};
7171

@@ -80,7 +80,7 @@
8080
*
8181
* @return {Mixed}
8282
*/
83-
SettingsManager.get = function(pool, key) {
83+
SettingsManager.get = function SettingsManager_get(pool, key) {
8484
try {
8585
if ( this.storage[pool] && Object.keys(this.storage[pool]).length ) {
8686
return key ? this.storage[pool][key] : this.storage[pool];
@@ -108,7 +108,7 @@
108108
*
109109
* @return {Boolean}
110110
*/
111-
SettingsManager.set = function(pool, key, value, save, triggerWatch) {
111+
SettingsManager.set = function SettingsManager_set(pool, key, value, save, triggerWatch) {
112112
try {
113113
if ( key ) {
114114
if ( typeof this.storage[pool] === 'undefined' ) {
@@ -146,7 +146,7 @@
146146
* @param {String} pool Name of settings pool
147147
* @param {Function} callback Callback
148148
*/
149-
SettingsManager.save = function(pool, callback) {
149+
SettingsManager.save = function SettingsManager_save(pool, callback) {
150150
console.debug('SettingsManager::save()', pool, this.storage);
151151
if ( typeof callback !== 'function' ) {
152152
callback = function() {};
@@ -165,7 +165,7 @@
165165
* @param {String} pool Name of settings pool
166166
* @param {Object} [defaults] Default settings tree
167167
*/
168-
SettingsManager.defaults = function(pool, defaults) {
168+
SettingsManager.defaults = function SettingsManager_defaults(pool, defaults) {
169169
this.defaults[pool] = defaults;
170170
};
171171

@@ -180,7 +180,7 @@
180180
*
181181
* @return {Object}
182182
*/
183-
SettingsManager.instance = function(pool, defaults) {
183+
SettingsManager.instance = function SettingsManager_instance(pool, defaults) {
184184
if ( !this.storage[pool] || (this.storage[pool] instanceof Array) ) {
185185
this.storage[pool] = {};
186186
}
@@ -202,7 +202,7 @@
202202
*
203203
* @param {Number} index The index from watch()
204204
*/
205-
SettingsManager.unwatch = function(index) {
205+
SettingsManager.unwatch = function SettingsManager_unwatch(index) {
206206
if ( typeof this.watches[index] !== 'undefined' ) {
207207
delete this.watches[index];
208208
}
@@ -219,7 +219,7 @@
219219
*
220220
* @return {Mixed} false on error, index for unwatch() otherwise
221221
*/
222-
SettingsManager.watch = function(pool, callback) {
222+
SettingsManager.watch = function SettingsMananger_watch(pool, callback) {
223223
if ( !this.storage[pool] ) {
224224
return false;
225225
}
@@ -242,7 +242,7 @@
242242
*
243243
* @return {OSjs.Core.SettingsManager} this
244244
*/
245-
SettingsManager.changed = function(pool) {
245+
SettingsManager.changed = function SettingsManager_changed(pool) {
246246
var self = this;
247247
this.watches.forEach(function(watch) {
248248
if ( watch && watch.pool === pool ) {
@@ -264,7 +264,7 @@
264264
*
265265
* @return {OSjs.Core.SettingsManager} this
266266
*/
267-
SettingsManager.clear = function(pool, save) {
267+
SettingsManager.clear = function SettingsManager_clear(pool, save) {
268268
save = (typeof save === 'undefined') || (save === true);
269269
this.set(pool, null, {}, save);
270270
return this;
@@ -283,7 +283,7 @@
283283
* @memberof OSjs.Core
284284
* @return {OSjs.Core.SettingsManager}
285285
*/
286-
OSjs.Core.getSettingsManager = function() {
286+
OSjs.Core.getSettingsManager = function Core_getSettingsManager() {
287287
return SettingsManager;
288288
};
289289

src/client/javascript/core/storage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156

157157
console.info('Storage::loadSession()');
158158

159-
this.getLastSession(function(err, list) {
159+
this.getLastSession(function onGetLastSession(err, list) {
160160
if ( err ) {
161161
callback();
162162
} else {
@@ -179,7 +179,7 @@
179179
*
180180
* @return {OSjs.Core.Storage}
181181
*/
182-
OSjs.Core.getStorage = function() {
182+
OSjs.Core.getStorage = function Core_getStorage() {
183183
return _storageInstance;
184184
};
185185

src/client/javascript/core/window.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@
16631663
var wm = OSjs.Core.getWindowManager();
16641664
var anim = wm ? wm.getSetting('animations') : false;
16651665
if ( anim ) {
1666-
self._animationCallback = function() {
1666+
self._animationCallback = function Window_animationCallback() {
16671667
self._emit('resized');
16681668
};
16691669
} else {

src/client/javascript/core/windowmanager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@
11271127
*
11281128
* @return {OSjs.Core.WindowManager}
11291129
*/
1130-
OSjs.Core.getWindowManager = function() {
1130+
OSjs.Core.getWindowManager = function Core_getWindowManager() {
11311131
return _WM;
11321132
};
11331133

src/client/javascript/gui/_scheme.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
element: el,
123123
uri: el.getAttribute('data-fragment-external')
124124
};
125-
}), function(iter, index, next) {
125+
}), function asyncIter(iter, index, next) {
126126
var uri = iter.uri.replace(/^\//, '');
127127
if ( uri.length < 3 ) {
128128
console.warn('resolveExternalFragments()', 'invalid', iter);
@@ -141,7 +141,7 @@
141141
next();
142142
}
143143
});
144-
}, function() {
144+
}, function asyncDone() {
145145
cb(doc.innerHTML);
146146

147147
doc = null;
@@ -283,7 +283,7 @@
283283
onsuccess: function(html) {
284284
html = cleanScheme(html);
285285

286-
resolveExternalFragments(root, html, function(result) {
286+
resolveExternalFragments(root, html, function onFragmentResolved(result) {
287287
// This is normally used for the preloader for caching
288288
cbxhr(false, result);
289289

src/client/javascript/gui/menus.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
* @function createMenu
453453
* @memberof OSjs.GUI.Helpers
454454
*/
455-
OSjs.GUI.Helpers.createMenu = function(items, ev, customInstance) {
455+
OSjs.GUI.Helpers.createMenu = function createMenu(items, ev, customInstance) {
456456
items = items || [];
457457
blurMenu();
458458

src/client/javascript/helpers/iframe-application.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
*
6464
* @link https://os.js.org/manual/package/iframe/
6565
*/
66-
var IFrameApplicationWindow = function(name, opts, app) {
66+
function IFrameApplicationWindow(name, opts, app) {
6767
opts = Utils.argumentDefaults(opts, {
6868
src: 'about:blank',
6969
focus: function() {},
@@ -81,7 +81,7 @@
8181

8282
this._iwin = null;
8383
this._frame = null;
84-
};
84+
}
8585

8686
IFrameApplicationWindow.prototype = Object.create(Window.prototype);
8787

@@ -234,15 +234,15 @@
234234
* @memberof OSjs.Helpers
235235
* @see OSjs.Core.Application
236236
*/
237-
var IFrameApplication = function(name, args, metadata, opts) {
237+
function IFrameApplication(name, args, metadata, opts) {
238238
Application.call(this, name, args, metadata);
239239

240240
this.options = Utils.argumentDefaults(opts, {
241241
icon: '',
242242
title: 'IframeApplicationWindow'
243243
});
244244
this.options.src = OSjs.API.getApplicationResource(this, this.options.src);
245-
};
245+
}
246246

247247
IFrameApplication.prototype = Object.create(Application.prototype);
248248

0 commit comments

Comments
 (0)