diff --git a/home.html b/home.html index 082502f..cc36a8d 100644 --- a/home.html +++ b/home.html @@ -391,11 +391,11 @@ - + @@ -632,7 +632,7 @@

@

- +
diff --git a/js/interface_common.js b/js/interface_common.js index 8646cdf..04dc8f7 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -10,7 +10,7 @@ var twister = { focus: {}, // focused elements are counted here html: { detached: $('
'), // here elements go to detach themself - blanka: $('') // to open stuff in new tab, see routeOnClick() + blanka: $('') // to open stuff in new tab, see routeOnClick() }, tmpl: { // templates pointers are stored here root: $('
') // templates should be detached from DOM and attached here; use extractTemplate() @@ -898,16 +898,25 @@ function fetchShortenedURI(req) { ); } -function applyShortenedURI(short, long) { +function applyShortenedURI(short, uriAndMimetype) { + var long = (uriAndMimetype instanceof Array) ? uriAndMimetype[0] : uriAndMimetype; var elems = getElem('.link-shortened[href="' + short + '"]') .attr('href', long) .removeClass('link-shortened') .off('click mouseup') .on('click mouseup', muteEvent) ; + var cropped = (/*$.Options.cropLongURIs &&*/ long.length > 23) ? long.slice(0, 23) + '…' : undefined; for (var i = 0; i < elems.length; i++) if (elems[i].text === short) // there may be some other text, possibly formatted, so we check it - elems[i].text = long; + if (cropped) + $(elems[i]) + .text(cropped) + .on('mouseover', {uri: long}, function (event) {event.target.text = event.data.uri;}) + .on('mouseout', {uri: cropped}, function (event) {event.target.text = event.data.uri;}) + ; + else + elems[i].text = long; } function routeOnClick(event) { @@ -2477,7 +2486,18 @@ $(document).ready(function () { if (!textArea.length) textArea = postAreaNew.find('textarea:last'); event.data.cbReq = textArea; - openRequestShortURIForm(event); + if (postAreaNew.closest('.directMessages').length) + confirmPopup({ + txtMessage: polyglot.t('shorten_URI_its_public_is_it_ok'), + txtConfirm: polyglot.t('shorten_URI'), + cbConfirm: openRequestShortURIForm, + cbConfirmReq: event + }); + else if ($.mobile && postAreaNew.closest('.dm-form').length) { + if (confirm(polyglot.t('shorten_URI_its_public_is_it_ok'))) + openRequestShortURIForm(event); + } else + openRequestShortURIForm(event); } ) ; diff --git a/js/interface_localization.js b/js/interface_localization.js index 43ba06c..9911d10 100644 --- a/js/interface_localization.js +++ b/js/interface_localization.js @@ -174,6 +174,7 @@ if(preferredLanguage == "en"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "The File APIs are not fully supported in this browser.", "time_ago": "%{time} ago", // 5 minutes ago "Time of the last block:": "Time of the last block: ", @@ -507,6 +508,7 @@ if(preferredLanguage == "es"){ "shorten_URI_enter_link": "Introducir el enlace largo.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "Las API de archivos no son totalmente compatibles con este navegador.", "time_ago": "hace %{time}", // 5 minutes ago "Time of the last block:": "Hora del último bloque: ", @@ -825,6 +827,7 @@ if(preferredLanguage == "uk"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "File APIs не повністю підтримується браузером.", "time_ago": "%{time} тому", // 5 minutes ago "Time of the last block:": "Час останнього блоку: ", @@ -1140,6 +1143,7 @@ if(preferredLanguage == "zh-CN"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "这个浏览器不能完全支持 File API。", "time_ago": "%{time} 之前", // 5 minutes ago "Time of the last block:": "最新区块的时间:", @@ -1473,6 +1477,7 @@ if(preferredLanguage == "nl"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "The File APIs are not fully supported in this browser.", "time_ago": "%{time} geleden", // 5 minutes ago "Time of the last block:": "Tijd van de laatste block: ", @@ -1790,6 +1795,7 @@ if(preferredLanguage == "it"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "Le API File non sono interamente supportate da questo browser.", "time_ago": "%{time} fa", // 5 minutes ago "Time of the last block:": "Orario del blocco più recente: ", @@ -2105,6 +2111,7 @@ if(preferredLanguage == "fr"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "L'API de fichier n'est pas entièrement pris en charge dans votre navigateur.", "time_ago": "Il y a %{time}", // 5 minutes ago "Time of the last block:": "Heure du dernier bloc: ", @@ -2424,6 +2431,7 @@ if(preferredLanguage == "ru"){ "shorten_URI_enter_link": "Введи длинную ссылку.\n" + "Примечание: в результате сокращения URL получается 'пустой' твист, содержащий эту URL.\n" + "Этот особый твист не отображается клиентами твистера, но учитывается в числе твоих твистов.", + "shorten_URI_its_public_is_it_ok": "Ссылка будет общедоступной! Это приемлимо для тебя?", "The File APIs are not fully supported in this browser.": "File APIs не полностью поддерживается этим браузером.", "time_ago": "%{time} назад", // 5 minutes ago "Time of the last block:": "Время последнего блока: ", @@ -2746,6 +2754,7 @@ if(preferredLanguage == "de"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "Die File-API's werden von diesem Browser nicht vollständig unterstützt.", "time_ago": "vor %{time}", // 5 minutes ago "Time of the last block:": "Zeit des letzten Blocks: ", @@ -3064,6 +3073,7 @@ if(preferredLanguage == "ja"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "ご使用のブラウザーは完全にファイルAPIに対応していません。", "time_ago": "%{time}前", // 5 minutes ago "Time of the last block:": "最新ブロックの生成日時: ", @@ -3380,6 +3390,7 @@ if(preferredLanguage == "pt-BR"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "O gerenciamento de arquivos não é completamente suportado neste navegador.", "time_ago": "%{time} atrás", // 5 minutes ago "Time of the last block:": "Horário do último bloco: ", @@ -3698,6 +3709,7 @@ if(preferredLanguage == "tr"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "Dosya API'si tarayıcınızda tam olarak desteklenmiyor.", "time_ago": "%{time} önce", // 5 minutes ago "Time of the last block:": "Son blok saati: ", @@ -4015,6 +4027,7 @@ if(preferredLanguage == "cs"){ "shorten_URI_enter_link": "Enter the long link.\n" + "Note: shortening an URL will produce an 'empty' twist on your behalf containing the full URL.\n" + "This special twist is not displayed by twister clients, but your twist counter will increase.", + "shorten_URI_its_public_is_it_ok": "Your link will be public available! Are you OK with that?", "The File APIs are not fully supported in this browser.": "Upozornění: váš webový prohlížeč nepodporuje File API.", "time_ago": "před %{time}", // 5 minutes ago "Time of the last block:": "Čas posledního bloku: ", diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js index d3b5273..8df5aa5 100644 --- a/js/twister_directmsg.js +++ b/js/twister_directmsg.js @@ -212,7 +212,8 @@ function openDmWithUserModal(peerAlias) { requestDmConversationModal(modal.self.find('.direct-messages-thread').empty(), peerAlias); $('.dm-form-template').children().clone(true) - .addClass('open').appendTo(modal.content).fadeIn('fast'); + .addClass('open').appendTo(modal.content).fadeIn('fast') + .find('textarea').focus(); } function openGroupMessagesModal(groupAlias) { @@ -267,7 +268,8 @@ function openGroupMessagesModal(groupAlias) { ); $('.dm-form-template').children().clone(true) - .addClass('open').appendTo(req.modal.content).fadeIn('fast'); + .addClass('open').appendTo(req.modal.content).fadeIn('fast') + .find('textarea').focus(); } }, {groupAlias: groupAlias, modal: modal} ); diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index 2210b6d..c36433f 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -66,14 +66,14 @@ function postToElem(post, kind, promoted) { username = userpost.n; k = userpost.k; time = userpost.time; - msg = userpost.msg; + msg = userpost.msg + (userpost.msg2 || ''); content_to_rt = $.toJSON(userpost); content_to_sigrt = post.sig_userpost; } else { username = rt.n; k = rt.k; time = rt.time; - msg = rt.msg; + msg = rt.msg + (rt.msg2 || ''); content_to_rt = $.toJSON(rt); content_to_sigrt = userpost.sig_rt; } @@ -82,7 +82,7 @@ function postToElem(post, kind, promoted) { username = userpost.n; k = userpost.k; time = userpost.time; - msg = userpost.msg; + msg = userpost.msg + (userpost.msg2 || ''); content_to_rt = $.toJSON(userpost); content_to_sigrt = post.sig_userpost; } @@ -257,7 +257,7 @@ function setPostInfoSent(n, k, item) { function postToElemDM(dmData, localUser, remoteUser) { var senderAlias = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0)) ? dmData.from : (dmData.fromMe ? localUser : remoteUser); - var elem = $('#dm-chat-template').clone(true) + var elem = $('#dm-chat-template').clone(true).appendTo(twister.html.detached) .removeAttr('id') .addClass(dmData.fromMe ? 'sent' : 'received') ; @@ -593,6 +593,7 @@ function htmlFormatMsg(msg, opt) { var stopCharsRight = '>' + whiteSpaces; var stopCharsRightHashtags = '>/\\.,:;?!%\'"[](){}^|«»…\u201C\u201D\u2026\u2014\u4E00\u3002\uFF0C\uFF1A\uFF1F\uFF01\u3010\u3011\u2047\u2048\u2049' // same as stopCharsTrailing but without '*~_-`' plus '>' + whiteSpaces; + var stopCharsRightHashtagsBase64 = stopCharsRightHashtags.replace('/','').replace('+','') // exclude valid base64 chars used in shortened urls var stopCharsMarkout = '/\\*~_-`.,:;?!%+=&\'"[](){}^|«»…\u201C\u201D\u2026\u2014\u4E00\u3002\uFF0C\uFF1A\uFF1F\uFF01\u3010\u3011\u2047\u2048\u2049'; var i, j, k, str; var mentions = []; @@ -642,7 +643,7 @@ function htmlFormatMsg(msg, opt) { .replace(/&(?!lt;|gt;)/g, '&'); if (markoutOpt === 'apply') { if (msg.str.slice(i, i + 6).toLowerCase() === 'twist:' && msg.str[i + 17] === '=' - && getSubStrStart(msg.str, i + 16, stopCharsRightHashtags, false, '') === i + 6) + && getSubStrStart(msg.str, i + 16, stopCharsRightHashtagsBase64, false, '') === i + 6) msg = msgAddHtmlEntity(msg, j - 1, getSubStrEnd(msg.str, k + 1, ')', true, '') + 2, newHtmlEntityLink(twister.tmpl.linkShortened, msg.str.slice(i, i + 18), linkName) @@ -693,7 +694,7 @@ function htmlFormatMsg(msg, opt) { } } } else if (msg.str.slice(i, i + 6).toLowerCase() === 'twist:' && msg.str[i + 17] === '=' - && getSubStrStart(msg.str, i + 16, stopCharsRightHashtags, false, '') === i + 6) { + && getSubStrStart(msg.str, i + 16, stopCharsRightHashtagsBase64, false, '') === i + 6) { str = msg.str.slice(i, i + 18); msg = msgAddHtmlEntity(msg, i, i + str.length, newHtmlEntityLink(twister.tmpl.linkShortened, str, str)); diff --git a/network.html b/network.html index 8f24c4f..dfe79f2 100644 --- a/network.html +++ b/network.html @@ -97,14 +97,14 @@ @@ -262,11 +262,11 @@ - +
diff --git a/options.html b/options.html index d7160f6..afe49c5 100644 --- a/options.html +++ b/options.html @@ -458,11 +458,11 @@ - +
diff --git a/tmobile.html b/tmobile.html index ea233a5..e9a7699 100644 --- a/tmobile.html +++ b/tmobile.html @@ -413,7 +413,7 @@

@

- +
@@ -832,11 +832,11 @@ - +