diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 3e3bbd88b..7544d562f 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -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); diff --git a/www/common/notify.js b/www/common/notify.js index 9df2e4767..8f52d7c51 100644 --- a/www/common/notify.js +++ b/www/common/notify.js @@ -110,8 +110,6 @@ define(['/api/config'], function (ApiConfig) { cancel: cancel, }; }; - return Module; - }; return Module; }); \ No newline at end of file diff --git a/www/common/sframe-boot.js b/www/common/sframe-boot.js index 4abac6e37..f230373c6 100644 --- a/www/common/sframe-boot.js +++ b/www/common/sframe-boot.js @@ -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')); }; } diff --git a/www/common/sframe-chainpad-netflux-outer.js b/www/common/sframe-chainpad-netflux-outer.js index 904cb9521..f1186d79d 100644 --- a/www/common/sframe-chainpad-netflux-outer.js +++ b/www/common/sframe-chainpad-netflux-outer.js @@ -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); }); diff --git a/www/common/sframe-common-history.js b/www/common/sframe-common-history.js index 530691645..e6c342b94 100644 --- a/www/common/sframe-common-history.js +++ b/www/common/sframe-common-history.js @@ -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 = {}; diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index fa513c72e..ae1c9a6ae 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -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", diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index e254dbb55..7a8c3eb64 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -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 = $('', {'class': 'avatar'}); var $rightCol = $('', {'class': 'right-col'}); - var $nameSpan = $('', {'class': 'name'}).text(name).appendTo($rightCol); + //var $nameSpan = $('', {'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) { diff --git a/www/drive/main.js b/www/drive/main.js index 02bfeb91f..97d67a03d 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -1818,7 +1818,7 @@ define([ var limit = 20; var i = 0; filesList.forEach(function (id) { - if (i >= 20) { return; } + if (i >= limit) { return; } // Check path (pad exists and not in trash) var paths = filesOp.findFile(id); if (!paths.length) { return; } diff --git a/www/pad2/main.js b/www/pad2/main.js index f0e1e063b..3027bab63 100644 --- a/www/pad2/main.js +++ b/www/pad2/main.js @@ -281,6 +281,7 @@ define([ var readOnly = false; // TODO var cpNfInner; var metadataMgr; + var onLocal; var $bar = $('#cke_1_toolbox'); @@ -670,7 +671,7 @@ define([ realtimeOptions.onError = onConnectError; - var onLocal = realtimeOptions.onLocal = function () { + onLocal = realtimeOptions.onLocal = function () { console.log('onlocal'); if (initializing) { return; } if (isHistoryMode) { return; } @@ -751,7 +752,7 @@ define([ customConfig: '/customize/ckeditor-config.js', }); editor.on('instanceReady', waitFor()); - }).nThen(function (waitFor) { + }).nThen(function (/*waitFor*/) { Links.addSupportForOpeningLinksInNewTab(Ckeditor); Cryptpad.onError(function (info) { if (info && info.type === "store") { diff --git a/www/pad2/outer.js b/www/pad2/outer.js index 5f603eab6..1e55c987d 100644 --- a/www/pad2/outer.js +++ b/www/pad2/outer.js @@ -42,7 +42,7 @@ define([ secret.channel = Cryptpad.createChannelId(); } Cryptpad.getShareHashes(secret, waitFor(function (err, h) { hashes = h; })); - }).nThen(function (waitFor) { + }).nThen(function (/*waitFor*/) { var readOnly = secret.keys && !secret.keys.editKeyStr; if (!secret.keys) { secret.keys = secret.key; } var parsed = Cryptpad.parsePadUrl(window.location.href); @@ -57,7 +57,7 @@ define([ if (err) { console.log(err); } name = n; })); - }).nThen(function (waitFor) { + }).nThen(function (/*waitFor*/) { sframeChan.event('EV_METADATA_UPDATE', { doc: { defaultTitle: defaultTitle,