realtime-input.js : fixes for jshint compliance
This commit is contained in:
parent
793149a608
commit
9f9cd8d8cd
@ -14,7 +14,7 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
window.Reflect = { has: (x,y) => { return (y in x); } };
|
window.Reflect = { has: function (x,y) { return (y in x); } };
|
||||||
define([
|
define([
|
||||||
'/common/messages.js',
|
'/common/messages.js',
|
||||||
'/common/netflux-client.js',
|
'/common/netflux-client.js',
|
||||||
@ -130,7 +130,10 @@ define([
|
|||||||
|
|
||||||
var hc = (wc && wc.history_keeper) ? wc.history_keeper : null;
|
var hc = (wc && wc.history_keeper) ? wc.history_keeper : null;
|
||||||
if(wc && (msg === 0 || msg === '0')) {
|
if(wc && (msg === 0 || msg === '0')) {
|
||||||
|
// FIXME onReady is defined below, so JSHINT complains
|
||||||
|
/* jshint ignore:start */
|
||||||
onReady(wc, network);
|
onReady(wc, network);
|
||||||
|
/* jshint ignore:end */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (peer === hc){
|
else if (peer === hc){
|
||||||
@ -255,7 +258,7 @@ define([
|
|||||||
realtime: realtime
|
realtime: realtime
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
var onOpen = function(wc, network) {
|
var onOpen = function(wc, network) {
|
||||||
channel = wc.id;
|
channel = wc.id;
|
||||||
@ -314,10 +317,10 @@ define([
|
|||||||
var findChannelById = function(webChannels, channelId) {
|
var findChannelById = function(webChannels, channelId) {
|
||||||
var webChannel;
|
var webChannel;
|
||||||
webChannels.forEach(function(chan) {
|
webChannels.forEach(function(chan) {
|
||||||
if(chan.id == channelId) { webChannel = chan; return;}
|
if(chan.id === channelId) { webChannel = chan; return;}
|
||||||
});
|
});
|
||||||
return webChannel;
|
return webChannel;
|
||||||
}
|
};
|
||||||
|
|
||||||
// Connect to the WebSocket channel
|
// Connect to the WebSocket channel
|
||||||
Netflux.connect(websocketUrl).then(function(network) {
|
Netflux.connect(websocketUrl).then(function(network) {
|
||||||
@ -331,7 +334,7 @@ define([
|
|||||||
onOpen(wc, network);
|
onOpen(wc, network);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
})
|
});
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
warn(error);
|
warn(error);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user