3 'include/loader/loader',
5 'remoto!stdlib:js/include/preferences.js',
6 'remoto!stdlib:js/include/objectRegistry.js',
7 'remoto!stdlib:js/include/utils.js',
8 'remoto!stdlib:js/paneManager/footer.js',
9 'remoto!stdlib:js/paneManager/paneManager.js',
10 'remoto!stdlib:js/paneManager/paneMenu.js',
11 'remoto!stdlib:js/panes/paneFactory.js',
49 this._authDenied =
false;
74 "subscribe": { timer:
null, data:{} },
75 "unsubscribe": { timer:
null, data:{} },
76 "read": { timer:
null, data:{} },
77 "delete": { timer:
null, data:{} },
78 "metadata": { timer:
null, data:{} },
79 "saveLayout": { timer:
null, data:
null },
82 this._socket = bootstrap._socket;
84 $(window).bind(
"lsModalRequest",this.
postLSRequest.bind(
this));
85 this._lsRequests = {};
91 $(window).bind(
"footerhide", (
function(e,
hide) {
92 if (
hide) this._footer.hide();
93 else this._footer.show();
98 $(window).bind(
"switchuser",window.switchuser);
99 $(window).bind(
"logout",window.logout);
100 $(window).bind(
"reload",window.reload);
122 document.title =
config.applicationName;
131 this._footer.destroy();
135 this._socket.destroy();
138 this._lsRequests = {};
161 ( (j.attributes && [
'logs/messages',
'logs/warnings',
'logs/errors',
'logs/critical',
'logs/log'].indexOf(j.attributes.path) == -1) )
164 if (j.attributes && j.attributes.path)
165 console.log(
"'"+j.attributes.path+
"'");
171 var command = j.command;
172 var attrs = j.attributes;
189 var m = attrs.metadata;
200 var m = attrs.metadata;
209 var m = attrs.metadata;
232 var entries = attrs.data || {};
233 var
metadata = attrs.metadata || {};
235 var m = this._lsRequests[
id];
239 delete this._lsRequests[
id];
245 { console.error(
"No callback for LS request on "+
path+
" ("+
id+
")");
250 console.error(
"Unknown LS id: "+
id);
284 var
metadata = attrs.metadata || {};
285 var data = attrs.data || {};
286 var
type = attrs.type;
287 var
path = attrs.path;
291 case "form": var title =
metadata.title ||
"form";
293 var
form = data.attributes || data;
297 case "reload": console.warn(
"Server requested a reload...");
298 $(window).trigger(
"reload");
301 default: console.log(
"unknown write metadata type: "+
type);
311 case "requestsuccess":
312 var c = attrs.command;
315 var m = attrs.metadata;
321 var c = attrs.command;
323 var r = attrs.reason;
328 default: console.error(
"Bad command: "+command);
333 this._footer.statusState =
"RECEIVED";
346 send:
function(command,attributes)
348 var p = { command:command };
350 if (attributes) p.attributes = attributes;
354 var m = JSON.stringify(p);
357 this._socket.send(m);
362 this._footer.statusState =
"PENDING";
377 config.username = userinfo.username;
379 config.uidnumber = userinfo.uidnumber;
394 this._footer.user =
config.realname;
395 document.title =
config.applicationName+
" - "+
config.realname;
409 modal.cancelAllModals();
458 if (!d &&
path!==
"logs")
460 console.warn(
"Non-existent diff path: '"+
path+
"', or an exception was thrown." );
485 console.warn(
"Non-existent subscription path: '"+
path+
"'");
486 console.log(arguments);
505 if (!d) console.warn(
"Non-existent read path: "+
path);
522 if (!d) console.warn(
"Non-existent metadata path: "+
path);
539 if (!d) console.warn(
"Non-existent requestlock path: "+
path);
556 if (!d) console.warn(
"Non-existent releaselock path: "+
path);
577 if (!d) console.warn(
"Non-existent requestsuccess path: "+
path);
597 if (command !==
"unsubscribe")
598 if (!d) console.warn(
"No objects with path '"+
path+
"' to catch request error.",arguments);
611 modal.prompt(
"Enter a name for this layout:",
628 console.log(
"SAVE LAYOUT: "+
name);
642 modal.alert(
"Will refine layout here. Will be able to set percentage vs fixed sizes on splits." );
656 modal.alert(
"Will apply layout split here. Will apply split to overall layout." );
672 console.log(
"APPLY LAYOUT",arguments);
688 console.log(
"DELETE LAYOUT",arguments);
744 data.name = data.path;
757 { console.log(
"Disabled createByPath for now.");
817 if (!this._batches.delete.data[p])
818 this._batches.delete.data[p] =
true;
821 if (!this._batches.delete.timer)
823 this._batches.delete.timer = requestAnimationFrame(
function() {
824 THIS.send(
"rm", THIS._batches.delete.data);
825 THIS._batches.delete = { timer:null, data:{} };
845 this._lsRequests[params.id] = { modal:params.modal, callback:params.callback };
848 p[params.id] = {
path:params.path,
metadata:params.metadata };
884 this.
send(
"requestlock", u);
903 this.
send(
"releaselock", u);
919 for (var t in trigger)
930 for (var p in trigger[t])
964 this._batches.saveLayout.data = layout;
966 if (!this._batches.saveLayout.timer)
969 this._batches.saveLayout.timer = requestAnimationFrame(
function() {
970 if (THIS._batches.saveLayout.data)
973 s[
config.interfacePath] = THIS._batches.saveLayout.data;
975 THIS.send(
"write",s);
976 THIS._batches.saveLayout = { timer:null, data:null };
1001 if (!this._batches.subscribe.data[p])
1002 this._batches.subscribe.data[p]=0;
1004 this._batches.subscribe.data[p]++;
1007 if (!this._batches.subscribe.timer)
1010 this._batches.subscribe.timer = requestAnimationFrame(
function() {
1013 THIS.send(
"subscribe", THIS._batches.subscribe.data);
1014 THIS._batches.subscribe = { timer:null, data:{} };
1035 while (paths.length)
1039 if (!this._batches.unsubscribe.data[p])
1040 this._batches.unsubscribe.data[p] = 0;
1042 this._batches.unsubscribe.data[p]++;
1047 if (this._batches.unsubscribe.timer)
1048 clearTimeout( this._batches.unsubscribe.timer );
1050 THIS.send(
"unsubscribe", THIS._batches.unsubscribe.data);
1051 THIS._batches.unsubscribe = { timer:
null, data:{} };
1054 if (!this._batches.unsubscribe.timer && !now)
1056 this._batches.unsubscribe.timer = requestAnimationFrame(
function()
1058 THIS.send(
"unsubscribe", THIS._batches.unsubscribe.data);
1059 THIS._batches.unsubscribe = { timer:null, data:{} };
1073 read:
function( paths )
1075 while (paths.length)
1079 if (!this._batches.read.data[p])
1080 this._batches.read.data[p] = 0;
1082 this._batches.read.data[p]++;
1085 if (!this._batches.read.timer)
1088 this._batches.read.timer = requestAnimationFrame(
function() {
1089 THIS.send(
"read", THIS._batches.read.data);
1090 THIS._batches.read = { timer:null, data:{} };
1111 this.
send(
"read", s);
1125 while (paths.length)
1129 if (!this._batches.metadata.data[p])
1130 this._batches.metadata.data[p] = 0;
1132 this._batches.metadata.data[p]++;
1136 if (!this._batches.metadata.timer)
1139 this._batches.metadata.timer = requestAnimationFrame(
function() {
1140 THIS.send(
"metadata", THIS._batches.metadata.data);
1141 THIS._batches.metadata = { timer:null, data:{} };
applySubscription(data, metadata)
getter id
returns the number of milliseconds since midnight January 1, 1970 UTC
setter name
a setter DOCME
setter type
a setter DOCME
applyDiff(id, diff, user, except)
applyRequestSuccess(command, id, data, metadata)
applyRequestError(command, id, reason)
applySubscription(id, data, metadata)
applyMetadata(id, metadata)
applyReleaseLock(id, data)
applyRead(id, data, metadata)
registerObject(id, o, nosubscribe)
Register an object in the registry, and call the pathAddedCallback.
applyRequestLock(id, data)
The paneFactory dynamically loads pane definitions and registers them to create new pane instances.
setter postUpdate
Assign a callback to the paneFactory class for VFS_node::submit() commands.
setter postReleaseLock
Assign a callback to the paneFactory class for VFS_node::releaseLock() commands.
paneFactory(layout, callback)
Create a pane or paneLoader, and execute the callback once complete.
setter postDelete
Assign a callback to the paneFactory class for VFS_node::rm() commands.
setter postRequestLock
Assign a callback to the paneFactory class for VFS_node::requestLock() commands.
setter postCreate
Assign a callback to the paneFactory class for VFS create() commands.
The paneManager manages panes in a user layout.
openApplicationLayout(event, context, template, metadata)
pathDeleteCallback()
A callback to use for deleting entries in the VFS based on a path.
openModal(path, title, size, context)
pathSubmitCallback()
DOCME.
pathAddedCallback()
DOCME.
setter config
a setter DOCME
openModalForm(path, form, title, size, context, metadata)
pathRemovedCallback()
DOCME.
pathCreateCallback()
A callback to use for creating new entries in the VFS based on a path.
createPane(path)
Create a pane based on path.
getter path
a getter DOCME
applyRequestSuccess()
If an adminstrator has deleted his own preferences, this function will be called on success.
update(dirty)
Process the _queue and apply the settings.
Utility functions for javascript clients.
cleanPath(path)
Clean and normalize a resource path.
The vfsClient manages a connection to the VFS.
readSingle(path, metadata)
openUserPreferences()
If the modal is not already showing, open the preferences.
applyLayoutHandler(menuData, data)
subscribe(paths)
This will aggregate paths for subscription, using a timer of 0.
currentPaneTrigger(event, trigger, exclude=null)
deleteLayoutHandler(tab, data)
createPaneByPathHandler()
postLSRequest(event, params)
saveInterface(layout)
Queue the layout to be saved as soon as control returns.
send(command, attributes)
createPaneHandler(tab, data)
vfsClient(_config, bootstrap)