jshint compliance

This commit is contained in:
Caleb James DeLisle
2017-08-23 11:04:44 +02:00
parent 2ad9fcee17
commit acfaaa7d56
10 changed files with 19 additions and 27 deletions

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
var req = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
req.cfg = req.cfg || {};
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'));
};
}

View File

@@ -41,7 +41,7 @@ define([], function () {
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
// message through "network" when it is synced, and it triggers onReady for each channel joined.
if (!initializing) { return; }
@@ -215,7 +215,7 @@ define([], function () {
sframeChan.event('EV_RT_DISCONNECT');
});
network.on('reconnect', function (uid) {
network.on('reconnect', function () {
initializing = true;
connectTo(network, false);
});

View File

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

View File

@@ -1,4 +1,5 @@
define([
'jquery',
'/bower_components/nthen/index.js',
'/customize/messages.js',
'/common/sframe-chainpad-netflux-inner.js',
@@ -10,7 +11,7 @@ define([
'/customize/application_config.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) {
// Chainpad Netflux Inner
@@ -109,7 +110,7 @@ define([
} catch (e) { return void console.error(e); }
}
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;
$.ajax({
type: "HEAD",

View File

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