fix merge errors and reach full jshint compliance

pull/1/head
ansuz 8 years ago
parent a30e17121d
commit dbc8f01b8b

@ -34,7 +34,7 @@ define(function () {
out.anonymous = "Vous êtes actuellement anonyme";
out.greenLight = "Tout fonctionne bien";
out.orangeLight = "Votre connexion est lente, ce qui réduit la qualité de l'éditeur"
out.orangeLight = "Votre connexion est lente, ce qui réduit la qualité de l'éditeur";
out.redLight = "Vous êtes déconnectés de la session";
out.importButton = 'IMPORTER';

@ -146,6 +146,11 @@ define([
var canonicalize = function (t) { return t.replace(/\r\n/g, '\n'); };
var isDefaultTitle = function () {
var parsed = Cryptpad.parsePadUrl(window.location.href);
return Cryptpad.isDefaultName(parsed, document.title);
};
var initializing = true;
var onLocal = config.onLocal = function () {
@ -241,10 +246,6 @@ define([
return text.trim();
};
var isDefaultTitle = function () {
var parsed = Cryptpad.parsePadUrl(window.location.href);
return Cryptpad.isDefaultName(parsed, document.title);
};
var suggestName = function () {
var parsed = Cryptpad.parsePadUrl(window.location.href);
var name = Cryptpad.getDefaultName(parsed, []);
@ -335,14 +336,15 @@ define([
var $import = Cryptpad.createButton('import', true, {}, importText);
$rightside.append($import);
/* add a rename button */
var renameCb = function (err, title) {
if (err) { return; }
document.title = title;
onLocal();
};
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
$rightside.append($setTitle);
/* add a rename button */
var renameCb = function (err, title) {
if (err) { return; }
document.title = title;
onLocal();
};
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
$rightside.append($setTitle);
}
/* add a forget button */
var forgetCb = function (err, title) {

@ -47,8 +47,6 @@ define([
var host = window.location.host;
var url = protocol + '//' + host + path;
console.log(url);
return url;
};
@ -797,7 +795,7 @@ define([
});
}
if (rightside) {
button.addClass('rightside-button')
button.addClass('rightside-button');
}
return button;
};

@ -180,9 +180,10 @@ define([
var lagLight = $('<div>', {
'class': 'lag'
});
var title;
if(lag) {
firstConnection = false;
var title = Messages.lag + ' : ' + lag + ' ms\n';
title = Messages.lag + ' : ' + lag + ' ms\n';
if (lag.waiting || lag > 1000) {
lagLight.addClass('lag-orange');
title += Messages.orangeLight;

@ -297,6 +297,18 @@ define([
var parsed = Cryptpad.parsePadUrl(window.location.href);
return Cryptpad.isDefaultName(parsed, document.title);
};
var getHeadingText = function () {
var text;
if (['h1', 'h2', 'h3'].some(function (t) {
var $header = $(inner).find(t + ':first-of-type');
if ($header.length && $header.text()) {
text = $header.text();
return true;
}
})) { return text; }
};
var suggestName = function () {
var parsed = Cryptpad.parsePadUrl(window.location.href);
var name = Cryptpad.getDefaultName(parsed, []);
@ -477,17 +489,6 @@ define([
return new DOMParser().parseFromString(html, 'text/html');
};
var getHeadingText = function () {
var text;
if (['h1', 'h2', 'h3'].some(function (t) {
var $header = $(inner).find(t + ':first-of-type');
if ($header.length && $header.text()) {
text = $header.text();
return true;
}
})) { return text; }
};
var exportFile = function () {
var html = getHTML();
var suggestion = suggestName();
@ -541,14 +542,15 @@ define([
var $import = Cryptpad.createButton('import', true, {}, importFile);
$rightside.append($import);
/* add a rename button */
var renameCb = function (err, title) {
if (err) { return; }
document.title = title;
editor.fire('change');
};
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
$rightside.append($setTitle);
/* add a rename button */
var renameCb = function (err, title) {
if (err) { return; }
document.title = title;
editor.fire('change');
};
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
$rightside.append($setTitle);
}
/* add a forget button */
var forgetCb = function (err, title) {

@ -726,7 +726,6 @@ define([
var renameCb = function (err, title) {
if (err) { return; }
document.title = title;
module.tabNotification && module.tabNotification.update(title);
var proxy = module.rt.proxy;
if (proxy.metadata) {
proxy.metadata.title = title;

@ -27,6 +27,7 @@ define([
TextPatcher: TextPatcher,
Slide: Slide,
};
var APP = window.APP;
Cryptpad.styleAlerts();
@ -180,6 +181,11 @@ define([
var canonicalize = function (t) { return t.replace(/\r\n/g, '\n'); };
var isDefaultTitle = function () {
var parsed = Cryptpad.parsePadUrl(window.location.href);
return Cryptpad.isDefaultName(parsed, APP.title);
};
var initializing = true;
var onLocal = config.onLocal = function () {
@ -254,10 +260,6 @@ define([
return text.trim();
};
var isDefaultTitle = function () {
var parsed = Cryptpad.parsePadUrl(window.location.href);
return Cryptpad.isDefaultName(parsed, APP.title);
};
var suggestName = function () {
var parsed = Cryptpad.parsePadUrl(window.location.href);
var name = Cryptpad.getDefaultName(parsed, []);
@ -348,15 +350,16 @@ define([
var $import = Cryptpad.createButton('import', true, {}, importText);
$rightside.append($import);
/* add a rename button */
var renameCb = function (err, title) {
if (err) { return; }
APP.title = title;
setTabTitle();
onLocal();
};
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
$rightside.append($setTitle);
/* add a rename button */
var renameCb = function (err, title) {
if (err) { return; }
APP.title = title;
setTabTitle();
onLocal();
};
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
$rightside.append($setTitle);
}
/* add a forget button */
var forgetCb = function (err, title) {
@ -389,7 +392,7 @@ define([
}
$rightside.append($leavePresent);
$language = $('<span>', {
var $language = $('<span>', {
'style': "margin-right: 10px;"
}).text(Messages.type.slide + " (Markdown)");
$rightside.append($language);

Loading…
Cancel
Save