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.anonymous = "Vous êtes actuellement anonyme";
out.greenLight = "Tout fonctionne bien"; 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.redLight = "Vous êtes déconnectés de la session";
out.importButton = 'IMPORTER'; out.importButton = 'IMPORTER';

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

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

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

@ -297,6 +297,18 @@ define([
var parsed = Cryptpad.parsePadUrl(window.location.href); var parsed = Cryptpad.parsePadUrl(window.location.href);
return Cryptpad.isDefaultName(parsed, document.title); 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 suggestName = function () {
var parsed = Cryptpad.parsePadUrl(window.location.href); var parsed = Cryptpad.parsePadUrl(window.location.href);
var name = Cryptpad.getDefaultName(parsed, []); var name = Cryptpad.getDefaultName(parsed, []);
@ -477,17 +489,6 @@ define([
return new DOMParser().parseFromString(html, 'text/html'); 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 exportFile = function () {
var html = getHTML(); var html = getHTML();
var suggestion = suggestName(); var suggestion = suggestName();
@ -541,14 +542,15 @@ define([
var $import = Cryptpad.createButton('import', true, {}, importFile); var $import = Cryptpad.createButton('import', true, {}, importFile);
$rightside.append($import); $rightside.append($import);
/* add a rename button */ /* add a rename button */
var renameCb = function (err, title) { var renameCb = function (err, title) {
if (err) { return; } if (err) { return; }
document.title = title; document.title = title;
editor.fire('change'); editor.fire('change');
}; };
var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb); var $setTitle = Cryptpad.createButton('rename', true, {suggestName: suggestName}, renameCb);
$rightside.append($setTitle); $rightside.append($setTitle);
}
/* add a forget button */ /* add a forget button */
var forgetCb = function (err, title) { var forgetCb = function (err, title) {

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

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

Loading…
Cancel
Save