diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 744eff569..8ef04bea5 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -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'; diff --git a/www/code/main.js b/www/code/main.js index e02335579..aad7dc7bc 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -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) { diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index be886517b..58bc11244 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -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; }; diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 8d8f011b0..110f8cc9e 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -180,9 +180,10 @@ define([ var lagLight = $('
', { '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; diff --git a/www/pad/main.js b/www/pad/main.js index e243f3e0a..63dcac029 100644 --- a/www/pad/main.js +++ b/www/pad/main.js @@ -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) { diff --git a/www/poll/main.js b/www/poll/main.js index 8c8c540c6..349ebc9fa 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -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; diff --git a/www/slide/main.js b/www/slide/main.js index fd1835355..de3c55f31 100644 --- a/www/slide/main.js +++ b/www/slide/main.js @@ -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 = $('', { + var $language = $('', { 'style': "margin-right: 10px;" }).text(Messages.type.slide + " (Markdown)"); $rightside.append($language);