diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/js/extra.js | 6 | ||||
-rw-r--r-- | public/js/index.js | 7 | ||||
-rw-r--r-- | public/js/locale.js | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index bc6092db..65ea44a1 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -476,10 +476,10 @@ function finishView(view) { var code = ""; if (codeDiv.length > 0) code = codeDiv.html(); else code = langDiv.html(); - code = md.utils.unescapeAll(code); + code = S(code).unescapeHTML().s; if (!reallang) { var result = { - value: md.utils.escapeHtml(code) + value: S(code).escapeHTML().s }; } else if (reallang == "tiddlywiki" || reallang == "mediawiki") { var result = { @@ -881,7 +881,7 @@ md.use(require('../vendor/markdown-it-mathjax')); md.use(require('markdown-it-imsize')); md.use(require('markdown-it-emoji'), { - shortcuts: false + shortcuts: {} }); emojify.setConfig({ diff --git a/public/js/index.js b/public/js/index.js index 77ab089c..8080b9c7 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2308,11 +2308,9 @@ socket.on('delete', function () { }); } }); -var retryOnDisconnect = false; var retryTimer = null; socket.on('maintenance', function () { cmClient.revision = -1; - retryOnDisconnect = true; }); socket.on('disconnect', function (data) { showStatus(statusType.offline); @@ -2322,7 +2320,7 @@ socket.on('disconnect', function (data) { } if (!editor.getOption('readOnly')) editor.setOption('readOnly', true); - if (retryOnDisconnect && !retryTimer) { + if (!retryTimer) { retryTimer = setInterval(function () { if (!needRefresh) socket.connect(); }, 1000); @@ -2337,7 +2335,6 @@ socket.on('reconnect', function (data) { socket.on('connect', function (data) { clearInterval(retryTimer); retryTimer = null; - retryOnDisconnect = false; personalInfo['id'] = socket.id; showStatus(statusType.connected); socket.emit('version'); @@ -2651,7 +2648,7 @@ socket.on('doc', function (obj) { obj = JSON.parse(obj); var body = obj.str; var bodyMismatch = editor.getValue() !== body; - var setDoc = !cmClient || (cmClient && cmClient.revision === -1) || obj.force; + var setDoc = !cmClient || (cmClient && (cmClient.revision === -1 || (cmClient.revision !== obj.revision && Object.keys(cmClient.state).length <= 0))) || obj.force; saveInfo(); if (setDoc && bodyMismatch) { diff --git a/public/js/locale.js b/public/js/locale.js index 702496e7..e6d11cd2 100644 --- a/public/js/locale.js +++ b/public/js/locale.js @@ -16,6 +16,8 @@ if (Cookies.get('locale')) { } locale.val(lang); +$('select.ui-locale option[value="' + lang + '"]').attr('selected','selected'); + locale.change(function() { Cookies.set('locale', $(this).val(), { expires: 365 |