remove some dead code

pull/1/head
ansuz 8 years ago
parent e87992c7ec
commit fdede0d1fd

@ -168,7 +168,6 @@ define([
return typeof getUserHash() === "string";
};
// var isArray = function (o) { return Object.prototype.toString.call(o) === '[object Array]'; };
var isArray = common.isArray = $.isArray;
var fixHTML = common.fixHTML = function (str) {
@ -289,14 +288,6 @@ define([
throw new Error("Unable to parse the key");
}
var version = hashArray[1];
/*if (version === "1") {
secret.channel = base64ToHex(hashArray[2]);
secret.key = hashArray[3].replace(/-/g, '/');
if (secret.channel.length !== 32 || secret.key.length !== 24) {
common.alert("The channel key and/or the encryption key is invalid");
throw new Error("The channel key and/or the encryption key is invalid");
}
}*/
if (version === "1") {
var mode = hashArray[2];
if (mode === 'edit') {
@ -492,12 +483,6 @@ define([
var untitledIndex = 1;
var name = (Messages.type)[type] + ' - ' + new Date().toString().split(' ').slice(0,4).join(' ');
return name;
/*
* Pad titles are shared in the document so it does not make sense anymore to avoid duplicates
if (isNameAvailable(name, parsed, recentPads)) { return name; }
while (!isNameAvailable(name + ' - ' + untitledIndex, parsed, recentPads)) { untitledIndex++; }
return name + ' - ' + untitledIndex;
*/
};
var isDefaultName = common.isDefaultName = function (parsed, title) {
var name = getDefaultName(parsed, []);
@ -982,30 +967,6 @@ define([
}
callback(null, title);
});
/* Pad titles are shared in the document. We don't check for duplicates anymore.
common.causesNamingConflict(title, function (err, conflicts) {
if (err) {
console.log("Unable to determine if name caused a conflict");
console.error(err);
callback(err, title);
return;
}
if (conflicts) {
common.alert(Messages.renameConflict);
return;
}
common.setPadTitle(title, function (err, data) {
if (err) {
console.log("unable to set pad title");
console.log(err);
return;
}
callback(null, title);
});
});
*/
};
var getUserChannelList = common.getUserChannelList = function () {

@ -9,39 +9,6 @@ define([
Cryptpad: Cryptpad,
};
var then = function (call) {
call.getFileSize('26f014b2ab959418605ea37a6785f317', function (e, msg) {
if (e) {
if (e === 'ENOENT') { return; }
return void console.error(e);
}
console.error("EXPECTED ENOENT");
console.log(msg);
});
call.getFileSize('pewpew', function (e, msg) {
if (e) {
if (e === 'INVALID_CHAN') { return; }
return void console.error(e);
}
console.log(msg);
});
var list = Cryptpad.getUserChannelList();
if (list.length) {
call.getFileSize(list[0], function (e, msg) {
if (e) {
return void console.error(e);
}
console.log(msg);
});
}
call.getServerHash(function (e, hash) {
if (e) { return void console.error(e); }
console.log("the server believes your user hash is [%s]", hash);
});
};
var synchronize = function (call) {
var localHash = call.localChannelsHash();
var serverHash;
@ -65,12 +32,6 @@ define([
return console.log('reset pin list. new hash is [%s]', response);
}
});
/*
console.log(JSON.stringify({
local: localHash,
remote: serverHash,
}, null, 2));*/
});
};
@ -78,7 +39,6 @@ define([
Cryptpad.ready(function (err, env) {
Pinpad.create(function (e, call) {
if (e) { return void console.error(e); }
// then(call);
synchronize(call);
});
});

Loading…
Cancel
Save