}
return true;
- }
+ };
$.JsonRpcClient.prototype.closeSocket = function() {
if (self.socketReady()) {
- this._ws_socket.onclose = function (w) {console.log("Closing Socket")}
+ this._ws_socket.onclose = function (w) {console.log("Closing Socket");};
this._ws_socket.close();
}
- }
+ };
$.JsonRpcClient.prototype.loginData = function(params) {
self.options.login = params.login;
self.options.passwd = params.passwd;
- }
+ };
$.JsonRpcClient.prototype.connectSocket = function(onmessage_cb) {
var self = this;
self.ws_cnt++;
- if (self.ws_sleep < 3000 && (self.ws_cnt % 10) == 0) {
+ if (self.ws_sleep < 3000 && (self.ws_cnt % 10) === 0) {
self.ws_sleep += 1000;
}
- }
+ };
// Set up sending of message for when the socket is open.
self._ws_socket.onopen = function() {
var req;
// Send the requests.
- while (req = $.JsonRpcClient.q.pop()) {
+ while ((req = $.JsonRpcClient.q.pop())) {
self._ws_socket.send(req);
}
- }
+ };
}
}
return self._ws_socket ? true : false;
- }
+ };
$.JsonRpcClient.prototype._getSocket = function(onmessage_cb) {
// If there is no ws url set, we don't have a socket.
/// @todo Make using the jsonrcp 2.0 check optional, to use this on JSON-RPC 1 backends.
- if (typeof response === 'object'
- && 'jsonrpc' in response
- && response.jsonrpc === '2.0') {
+ if (typeof response === 'object' &&
+ 'jsonrpc' in response &&
+ response.jsonrpc === '2.0') {
/// @todo Handle bad response (without id).
self.authing = true;
this.call("login", { login: self.options.login, passwd: self.options.passwd},
- this._ws_callbacks[response.id].request_obj.method == "login"
- ?
+ this._ws_callbacks[response.id].request_obj.method == "login" ?
function(e) {
self.authing = false;
console.log("logged in");
// Collect all request data and sort handlers by request id.
var batch_request = [];
var handlers = {};
+ var i = 0;
+ var call;
+ var success_cb;
+ var error_cb;
// If we have a WebSocket, just send the requests individually like normal calls.
var socket = self.jsonrpcclient.options.getSocket(self.jsonrpcclient.wsOnMessage);
if (socket !== null) {
- for (var i = 0; i < this._requests.length; i++) {
- var call = this._requests[i];
- var success_cb = ('success_cb' in call) ? call.success_cb : undefined;
- var error_cb = ('error_cb' in call) ? call.error_cb : undefined;
+ for (i = 0; i < this._requests.length; i++) {
+ call = this._requests[i];
+ success_cb = ('success_cb' in call) ? call.success_cb : undefined;
+ error_cb = ('error_cb' in call) ? call.error_cb : undefined;
self.jsonrpcclient._wsCall(socket, call.request, success_cb, error_cb);
}
return;
}
- for (var i = 0; i < this._requests.length; i++) {
- var call = this._requests[i];
+ for (i = 0; i < this._requests.length; i++) {
+ call = this._requests[i];
batch_request.push(call.request);
// If the request has an id, it should handle returns (otherwise it's a notify).
}
}
- var success_cb = function(data) { self._batchCb(data, handlers, self.all_done_cb); };
+ success_cb = function(data) { self._batchCb(data, handlers, self.all_done_cb); };
// No WebSocket, and no HTTP backend? This won't work.
if (self.jsonrpcclient.options.ajaxUrl === null) {
$.verto.confMan = function(verto, params) {
var confMan = this;
- conf
+
confMan.params = $.extend({
tableID: null,
statusID: null,
"<button class='ctlbtn' id='" + play_id + "'>Play</button>" +
"<button class='ctlbtn' id='" + stop_id + "'>Stop</button>" +
"<button class='ctlbtn' id='" + recording_id + "'>Record</button>" +
- "<button class='ctlbtn' id='" + rec_stop_id + "'>Record Stop</button>"
-
- + "<br><br></div>";
+ "<button class='ctlbtn' id='" + rec_stop_id + "'>Record Stop</button>" +
+ "<br><br></div>";
jq.html(html);
if (confMan.params.mainModID) {
genMainMod($(confMan.params.mainModID));
- $(confMan.params.displayID).html("Moderator Controls Ready<br><br>")
+ $(confMan.params.displayID).html("Moderator Controls Ready<br><br>");
} else {
$(confMan.params.mainModID).html("");
}
clearTimeout(confMan.lastTimeout);
confMan.lastTimeout = 0;
}
- confMan.lastTimeout = setTimeout(function() { $(confMan.params.displayID).html(confMan.destroyed ? "" : "Moderator Controls Ready<br><br>")}, 4000);
+ confMan.lastTimeout = setTimeout(function() { $(confMan.params.displayID).html(confMan.destroyed ? "" : "Moderator Controls Ready<br><br>");}, 4000);
}
}
});
"fnRowCallback": row_callback
});
- }
+ };
$.verto.confMan.prototype.modCommand = function(cmd, id, value) {
var confMan = this;
"value": value
}
});
- }
+ };
$.verto.confMan.prototype.destroy = function() {
var confMan = this;
if (confMan.params.mainModID) {
$(confMan.params.mainModID).html("");
}
- }
+ };
$.verto.dialog = function(direction, verto, params) {
var dialog = this;