remove unused variables
This commit is contained in:
@@ -4,7 +4,7 @@ define([
|
||||
'/common/cryptpad-common.js'
|
||||
], function ($, Config, Cryptpad) {
|
||||
|
||||
var APP = window.APP = {
|
||||
window.APP = {
|
||||
Cryptpad: Cryptpad,
|
||||
};
|
||||
|
||||
@@ -118,7 +118,7 @@ define([
|
||||
$('button.login').click();
|
||||
});
|
||||
|
||||
$('button.login').click(function (e) {
|
||||
$('button.login').click(function () {
|
||||
Cryptpad.addLoadingScreen(Messages.login_hashing);
|
||||
// We need a setTimeout(cb, 0) otherwise the loading screen is only displayed after hashing the password
|
||||
window.setTimeout(function () {
|
||||
@@ -171,15 +171,14 @@ define([
|
||||
/* End Log in UI */
|
||||
|
||||
var addButtonHandlers = function () {
|
||||
$('button.register').click(function (e) {
|
||||
$('button.register').click(function () {
|
||||
var username = $('#name').val();
|
||||
var passwd = $('#password').val();
|
||||
var remember = $('#rememberme').is(':checked');
|
||||
sessionStorage.login_user = username;
|
||||
sessionStorage.login_pass = passwd;
|
||||
document.location.href = '/register/';
|
||||
});
|
||||
$('button.gotodrive').click(function (e) {
|
||||
$('button.gotodrive').click(function () {
|
||||
document.location.href = '/drive/';
|
||||
});
|
||||
};
|
||||
|
||||
@@ -112,9 +112,7 @@ define(req, function($, Default, Language) {
|
||||
|
||||
if (!selector.length) { return; }
|
||||
|
||||
var $button = $(selector).find('button .buttonTitle');
|
||||
// Select the current language in the list
|
||||
var option = $(selector).find('[data-value="' + language + '"]');
|
||||
selector.setValue(language || 'English');
|
||||
|
||||
// Listen for language change
|
||||
@@ -137,12 +135,12 @@ define(req, function($, Default, Language) {
|
||||
var key = $el.data('localization-append');
|
||||
$el.append(messages[key]);
|
||||
};
|
||||
var translateTitle = function (i, e) {
|
||||
var translateTitle = function () {
|
||||
var $el = $(this);
|
||||
var key = $el.data('localization-title');
|
||||
$el.attr('title', messages[key]);
|
||||
};
|
||||
var translatePlaceholder = function (i, e) {
|
||||
var translatePlaceholder = function () {
|
||||
var $el = $(this);
|
||||
var key = $el.data('localization-placeholder');
|
||||
$el.attr('placeholder', messages[key]);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// create an invisible iframe with a given source
|
||||
// append it to a parent element
|
||||
// execute a callback when it has loaded
|
||||
var create = Frame.create = function (parent, src, onload, timeout) {
|
||||
Frame.create = function (parent, src, onload, timeout) {
|
||||
var iframe = document.createElement('iframe');
|
||||
|
||||
timeout = timeout || 10000;
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
/* given an iframe with an rpc script loaded, create a frame object
|
||||
with an asynchronous 'send' method */
|
||||
var open = Frame.open = function (e, A, timeout) {
|
||||
Frame.open = function (e, A, timeout) {
|
||||
var win = e.contentWindow;
|
||||
|
||||
var frame = {};
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
timeout = timeout || 5000;
|
||||
|
||||
var accepts = frame.accepts = function (o) {
|
||||
frame.accepts = function (o) {
|
||||
return A.some(function (e) {
|
||||
switch (typeof(e)) {
|
||||
case 'string': return e === o;
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
var changeHandlers = frame.changeHandlers = [];
|
||||
|
||||
var change = frame.change = function (f) {
|
||||
frame.change = function (f) {
|
||||
if (typeof(f) !== 'function') {
|
||||
throw new Error('[Frame.change] expected callback');
|
||||
}
|
||||
@@ -94,7 +94,7 @@
|
||||
};
|
||||
window.addEventListener('message', _listener);
|
||||
|
||||
var close = frame.close = function () {
|
||||
frame.close = function () {
|
||||
window.removeEventListener('message', _listener);
|
||||
};
|
||||
|
||||
@@ -130,31 +130,31 @@
|
||||
win.postMessage(JSON.stringify(req), '*');
|
||||
};
|
||||
|
||||
var set = frame.set = function (key, val, cb) {
|
||||
frame.set = function (key, val, cb) {
|
||||
send('set', key, val, cb);
|
||||
};
|
||||
|
||||
var batchset = frame.setBatch = function (map, cb) {
|
||||
frame.setBatch = function (map, cb) {
|
||||
send('batchset', void 0, map, cb);
|
||||
};
|
||||
|
||||
var get = frame.get = function (key, cb) {
|
||||
frame.get = function (key, cb) {
|
||||
send('get', key, void 0, cb);
|
||||
};
|
||||
|
||||
var batchget = frame.getBatch = function (keys, cb) {
|
||||
frame.getBatch = function (keys, cb) {
|
||||
send('batchget', void 0, keys, cb);
|
||||
};
|
||||
|
||||
var remove = frame.remove = function (key, cb) {
|
||||
frame.remove = function (key, cb) {
|
||||
send('remove', key, void 0, cb);
|
||||
};
|
||||
|
||||
var batchremove = frame.removeBatch = function (keys, cb) {
|
||||
frame.removeBatch = function (keys, cb) {
|
||||
send('batchremove', void 0, keys, cb);
|
||||
};
|
||||
|
||||
var keys = frame.keys = function (cb) {
|
||||
frame.keys = function (cb) {
|
||||
send('keys', void 0, void 0, cb);
|
||||
};
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
if (typeof(module) !== 'undefined' && module.exports) {
|
||||
module.exports = Frame;
|
||||
} else if (typeof(define) === 'function' && define.amd) {
|
||||
define(['jquery'], function ($) {
|
||||
define(['jquery'], function () {
|
||||
return Frame;
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -39,7 +39,7 @@ define([
|
||||
return !keys.some(function (k) { return data[k] !== null; });
|
||||
};
|
||||
|
||||
Frame.create(document.body, domain + path, function (err, iframe, loadEvent) {
|
||||
Frame.create(document.body, domain + path, function (err, iframe) {
|
||||
if (handleErr(err)) { return; }
|
||||
console.log("Created iframe");
|
||||
|
||||
@@ -50,7 +50,7 @@ define([
|
||||
|
||||
[function (i) { // test #1
|
||||
var pew = randInt();
|
||||
frame.set('pew', pew, function (err, data) {
|
||||
frame.set('pew', pew, function (err) {
|
||||
if (handleErr(err)) { return; }
|
||||
frame.get('pew', function (err, num) {
|
||||
if (handleErr(err)) { return; }
|
||||
@@ -76,9 +76,9 @@ define([
|
||||
|
||||
var keys = Object.keys(map);
|
||||
|
||||
frame.setBatch(map, function (err, data) {
|
||||
frame.setBatch(map, function (err) {
|
||||
if (handleErr(err)) { return; }
|
||||
frame.getBatch(keys, function (err, data) {
|
||||
frame.getBatch(keys, function (err) {
|
||||
if (handleErr(err)) { return; }
|
||||
frame.removeBatch(Object.keys(map), function (err) {
|
||||
if (handleErr(err)) { return; }
|
||||
|
||||
Reference in New Issue
Block a user