jshint compliance

pull/1/head
Caleb James DeLisle 7 years ago
parent 2ad9fcee17
commit acfaaa7d56

@ -1198,7 +1198,6 @@ define([
button button
.click(prepareFeedback(type)) .click(prepareFeedback(type))
.click(function() { .click(function() {
var href = window.location.href;
var msg = isLoggedIn() ? Messages.forgetPrompt : Messages.fm_removePermanentlyDialog; var msg = isLoggedIn() ? Messages.forgetPrompt : Messages.fm_removePermanentlyDialog;
common.confirm(msg, function (yes) { common.confirm(msg, function (yes) {
if (!yes) { return; } if (!yes) { return; }
@ -1836,13 +1835,12 @@ define([
var parsed = parsePadUrl(window.location.href); var parsed = parsePadUrl(window.location.href);
if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); } if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); }
var hashes = common.getHashes(secret.channel, secret); var hashes = common.getHashes(secret.channel, secret);
var options = [];
// If we have a stronger version in drive, add it and add a redirect button // If we have a stronger version in drive, add it and add a redirect button
var stronger = recent && common.findStronger(null, recent); var stronger = recent && common.findStronger(null, recent);
if (stronger) { if (stronger) {
var parsed = parsePadUrl(stronger); var parsed2 = parsePadUrl(stronger);
hashes.editHash = parsed.hash; hashes.editHash = parsed2.hash;
} }
cb(null, hashes); cb(null, hashes);

@ -110,8 +110,6 @@ define(['/api/config'], function (ApiConfig) {
cancel: cancel, cancel: cancel,
}; };
}; };
return Module;
};
return Module; return Module;
}); });

@ -4,7 +4,7 @@
var req = JSON.parse(decodeURIComponent(window.location.hash.substring(1))); var req = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
req.cfg = req.cfg || {}; req.cfg = req.cfg || {};
if (req.pfx) { if (req.pfx) {
req.cfg.onNodeCreated = function (node, config, module, path) { req.cfg.onNodeCreated = function (node /*, config, module, path*/) {
node.setAttribute('src', req.pfx + node.getAttribute('src')); node.setAttribute('src', req.pfx + node.getAttribute('src'));
}; };
} }

@ -41,7 +41,7 @@ define([], function () {
messageFromInner(message, cb); messageFromInner(message, cb);
}); });
var onReady = function (wc) { var onReady = function () {
// Trigger onReady only if not ready yet. This is important because the history keeper sends a direct // Trigger onReady only if not ready yet. This is important because the history keeper sends a direct
// message through "network" when it is synced, and it triggers onReady for each channel joined. // message through "network" when it is synced, and it triggers onReady for each channel joined.
if (!initializing) { return; } if (!initializing) { return; }
@ -215,7 +215,7 @@ define([], function () {
sframeChan.event('EV_RT_DISCONNECT'); sframeChan.event('EV_RT_DISCONNECT');
}); });
network.on('reconnect', function (uid) { network.on('reconnect', function () {
initializing = true; initializing = true;
connectTo(network, false); connectTo(network, false);
}); });

@ -1,9 +1,8 @@
define([ define([
'jquery', 'jquery',
'/bower_components/chainpad-json-validator/json-ot.js', '/bower_components/chainpad-json-validator/json-ot.js',
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad/chainpad.dist.js', '/bower_components/chainpad/chainpad.dist.js',
], function ($, JsonOT, Crypto) { ], function ($, JsonOT) {
var ChainPad = window.ChainPad; var ChainPad = window.ChainPad;
var History = {}; var History = {};

@ -1,4 +1,5 @@
define([ define([
'jquery',
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/customize/messages.js', '/customize/messages.js',
'/common/sframe-chainpad-netflux-inner.js', '/common/sframe-chainpad-netflux-inner.js',
@ -10,7 +11,7 @@ define([
'/customize/application_config.js', '/customize/application_config.js',
'/common/cryptpad-common.js' '/common/cryptpad-common.js'
], function (nThen, Messages, CpNfInner, SFrameChannel, Title, UI, History, MetadataMgr, ], function ($, nThen, Messages, CpNfInner, SFrameChannel, Title, UI, History, MetadataMgr,
AppConfig, Cryptpad) { AppConfig, Cryptpad) {
// Chainpad Netflux Inner // Chainpad Netflux Inner
@ -109,7 +110,7 @@ define([
} catch (e) { return void console.error(e); } } catch (e) { return void console.error(e); }
} }
var randomToken = Math.random().toString(16).replace(/0./, ''); var randomToken = Math.random().toString(16).replace(/0./, '');
var origin = ctx.metadataMgr.getPrivateData().origin; //var origin = ctx.metadataMgr.getPrivateData().origin;
var href = /*origin +*/ '/common/feedback.html?' + action + '=' + randomToken; var href = /*origin +*/ '/common/feedback.html?' + action + '=' + randomToken;
$.ajax({ $.ajax({
type: "HEAD", type: "HEAD",

@ -37,7 +37,7 @@ define([
// User admin menu // User admin menu
var USERADMIN_CLS = Bar.constants.user = 'cryptpad-user-dropdown'; var USERADMIN_CLS = Bar.constants.user = 'cryptpad-user-dropdown';
var USERNAME_CLS = Bar.constants.username = 'cryptpad-toolbar-username'; var USERNAME_CLS = Bar.constants.username = 'cryptpad-toolbar-username';
var READONLY_CLS = Bar.constants.readonly = 'cryptpad-readonly'; /*var READONLY_CLS = */Bar.constants.readonly = 'cryptpad-readonly';
var USERBUTTON_CLS = Bar.constants.changeUsername = "cryptpad-change-username"; var USERBUTTON_CLS = Bar.constants.changeUsername = "cryptpad-change-username";
// Create the toolbar element // Create the toolbar element
@ -146,11 +146,6 @@ define([
duplicates: i duplicates: i
}; };
}; };
var arrayIntersect = function(a, b) {
return $.grep(a, function(i) {
return $.inArray(i, b) > -1;
});
};
var avatars = {}; var avatars = {};
var updateUserList = function (toolbar, config) { var updateUserList = function (toolbar, config) {
@ -196,7 +191,7 @@ define([
var name = data.name || Messages.anonymous; var name = data.name || Messages.anonymous;
var $span = $('<span>', {'class': 'avatar'}); var $span = $('<span>', {'class': 'avatar'});
var $rightCol = $('<span>', {'class': 'right-col'}); var $rightCol = $('<span>', {'class': 'right-col'});
var $nameSpan = $('<span>', {'class': 'name'}).text(name).appendTo($rightCol); //var $nameSpan = $('<span>', {'class': 'name'}).text(name).appendTo($rightCol);
//var proxy = Cryptpad.getProxy(); //var proxy = Cryptpad.getProxy();
//var isMe = data.curvePublic === proxy.curvePublic; //var isMe = data.curvePublic === proxy.curvePublic;
@ -532,7 +527,7 @@ define([
if (name === "") { if (name === "") {
name = $input.attr('placeholder'); name = $input.attr('placeholder');
} }
updateTitle(name, function (err, newtitle) { updateTitle(name, function (err/*, newtitle*/) {
if (err) { return console.error(err); } if (err) { return console.error(err); }
//$text.text(newtitle); //$text.text(newtitle);
$input.hide(); $input.hide();
@ -981,7 +976,7 @@ define([
} }
//checkLag(toolbar, config); //checkLag(toolbar, config);
}; };
toolbar.reconnecting = function (userId) { toolbar.reconnecting = function (/*userId*/) {
//if (config.metadataMgr) { config.userList.userNetfluxId = userId; } TODO //if (config.metadataMgr) { config.userList.userNetfluxId = userId; } TODO
toolbar.connected = false; toolbar.connected = false;
if (toolbar.spinner) { if (toolbar.spinner) {

@ -1818,7 +1818,7 @@ define([
var limit = 20; var limit = 20;
var i = 0; var i = 0;
filesList.forEach(function (id) { filesList.forEach(function (id) {
if (i >= 20) { return; } if (i >= limit) { return; }
// Check path (pad exists and not in trash) // Check path (pad exists and not in trash)
var paths = filesOp.findFile(id); var paths = filesOp.findFile(id);
if (!paths.length) { return; } if (!paths.length) { return; }

@ -281,6 +281,7 @@ define([
var readOnly = false; // TODO var readOnly = false; // TODO
var cpNfInner; var cpNfInner;
var metadataMgr; var metadataMgr;
var onLocal;
var $bar = $('#cke_1_toolbox'); var $bar = $('#cke_1_toolbox');
@ -670,7 +671,7 @@ define([
realtimeOptions.onError = onConnectError; realtimeOptions.onError = onConnectError;
var onLocal = realtimeOptions.onLocal = function () { onLocal = realtimeOptions.onLocal = function () {
console.log('onlocal'); console.log('onlocal');
if (initializing) { return; } if (initializing) { return; }
if (isHistoryMode) { return; } if (isHistoryMode) { return; }
@ -751,7 +752,7 @@ define([
customConfig: '/customize/ckeditor-config.js', customConfig: '/customize/ckeditor-config.js',
}); });
editor.on('instanceReady', waitFor()); editor.on('instanceReady', waitFor());
}).nThen(function (waitFor) { }).nThen(function (/*waitFor*/) {
Links.addSupportForOpeningLinksInNewTab(Ckeditor); Links.addSupportForOpeningLinksInNewTab(Ckeditor);
Cryptpad.onError(function (info) { Cryptpad.onError(function (info) {
if (info && info.type === "store") { if (info && info.type === "store") {

@ -42,7 +42,7 @@ define([
secret.channel = Cryptpad.createChannelId(); secret.channel = Cryptpad.createChannelId();
} }
Cryptpad.getShareHashes(secret, waitFor(function (err, h) { hashes = h; })); Cryptpad.getShareHashes(secret, waitFor(function (err, h) { hashes = h; }));
}).nThen(function (waitFor) { }).nThen(function (/*waitFor*/) {
var readOnly = secret.keys && !secret.keys.editKeyStr; var readOnly = secret.keys && !secret.keys.editKeyStr;
if (!secret.keys) { secret.keys = secret.key; } if (!secret.keys) { secret.keys = secret.key; }
var parsed = Cryptpad.parsePadUrl(window.location.href); var parsed = Cryptpad.parsePadUrl(window.location.href);
@ -57,7 +57,7 @@ define([
if (err) { console.log(err); } if (err) { console.log(err); }
name = n; name = n;
})); }));
}).nThen(function (waitFor) { }).nThen(function (/*waitFor*/) {
sframeChan.event('EV_METADATA_UPDATE', { sframeChan.event('EV_METADATA_UPDATE', {
doc: { doc: {
defaultTitle: defaultTitle, defaultTitle: defaultTitle,

Loading…
Cancel
Save