From 045836a020848f8ff05701f2de19e725ca3f046a Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Tue, 18 Aug 2015 19:08:26 +0500 Subject: [PATCH 1/6] fix options image preview showing --- js/options.js | 8 +------- js/twister_formatpost.js | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/js/options.js b/js/options.js index 6941387..dce74a5 100644 --- a/js/options.js +++ b/js/options.js @@ -377,13 +377,7 @@ function tickOptionsPostPreview() { if ($.Options.displayPreview.val === 'enable') { imgPreviewCont.empty(); - var links = elem.children().first().find('a[rel="nofollow"]'); - if (links.length) { - setPostImagePreview(elem, links); - imgPreviewCont.show(); - } else { - imgPreviewCont.hide(); - } + setPostImagePreview(elem, elem.children().first().find('a')); } else { imgPreviewCont.hide(); } diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index c09a9f5..af8ae1a 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -807,5 +807,9 @@ function setPostImagePreview(elem, links) { } } } + if (previewContainer.children().length) + previewContainer.show(); + else + previewContainer.hide(); } } From 5d6b2e4fb90d308d77b54d272b190a95795fbd66 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Tue, 18 Aug 2015 19:11:51 +0500 Subject: [PATCH 2/6] update AUTHORS --- AUTHORS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 5568971..03a5c45 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,7 +11,7 @@ Msjoinder Polyglot support (internationalization), multiple fixes erkan yüksel - Image preview, automatic unicode conversion, split long posts, hiding posts with mentions and more. + Image preview, automatic unicode conversion, split long posts, hiding posts with mentions, retwists with comment and more. Hedgehog Calm theme, CSS + artwork and more. @@ -38,5 +38,5 @@ Julian Steinwachs UI navigation overhaul with proper browser's back button support Сёма Мрачный - Desktop notifications, language filtering, ~markdown, ton of fixes. + Desktop notifications, language filtering, twistday observation, markdout markup, post preview, retwists with comment, ton of fixes. From 8d9c8f00d89d3e673441596b63edb7256b951c8e Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Tue, 18 Aug 2015 19:59:40 +0500 Subject: [PATCH 3/6] delete link to ~calm~ repo from options; obsolete, should be in theme_option.js --- options.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/options.html b/options.html index f895350..bf082f8 100644 --- a/options.html +++ b/options.html @@ -99,9 +99,6 @@ - - For new features check twister-calm repository! - From 22b3ba93ce3d6bbb9435cc71c2d026f31cc190da Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Tue, 18 Aug 2015 20:23:34 +0500 Subject: [PATCH 4/6] fix of #markout chars position data collecting --- js/twister_formatpost.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index af8ae1a..d908a39 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -402,14 +402,19 @@ function htmlFormatMsg(msg) { if (i !== 0) { l = kindOfL(i - 1); + } else { + l = 0; } if (j !== msg.str.length) { r = kindOfR(j); + } else { + r = 0; } - if (i === 0 || l === -10) { + + if ((i === 0 && r < 0) || l === -10) { p.push({i: i, k: j - i, t: -1, w: w, a: -1, p: -1}); w = false; - } else if (j === msg.str.length || r === -10) { + } else if ((j === msg.str.length && l < 0) || r === -10) { p.push({i: i, k: j - i, t: 1, w: w, a: -1, p: -1}); w = false; } else { From 0d2cfc5d83b09efc9d87002302a2fe2c9ab7629b Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Tue, 18 Aug 2015 22:21:03 +0500 Subject: [PATCH 5/6] fix network promoted message set up --- css/style.css | 13 +++++-------- js/twister_network.js | 27 +++++++++++++++----------- network.html | 37 +++++++++++++++++++++++++++--------- theme_calm/css/style.css | 13 +++++-------- theme_nin/css/style.css | 7 +++---- theme_nin/sass/_network.sass | 7 +++---- theme_nin/sass/style.sass | 1 + 7 files changed, 61 insertions(+), 44 deletions(-) diff --git a/css/style.css b/css/style.css index 3243cd3..e291583 100644 --- a/css/style.css +++ b/css/style.css @@ -652,6 +652,7 @@ textarea.splited-post { background-color: #F2FFBA; border: solid 1px #B4C669; font-size: 11px; + line-height: normal; margin: 4px 0; padding: 4px; word-wrap: break-word; @@ -1294,10 +1295,7 @@ ol.toptrends-list { font-size: 13px; list-style: circle; } -.network.singleBlock button -{ - padding: 3px 10px; -} + .network.singleBlock ul li > span { font-weight: bold; @@ -1335,10 +1333,9 @@ ol.toptrends-list { { border: 2px solid green; } -.character-limit -{ - float: right; - margin-right: 18px; + +.network .post-area-extras { + margin-right: 20px; } /************************************* diff --git a/js/twister_network.js b/js/twister_network.js index 41b1aa0..65d4571 100644 --- a/js/twister_network.js +++ b/js/twister_network.js @@ -244,17 +244,20 @@ function getSpamMsg() { }, {}); } -function setSpamMsg() { - var $postArea = $(".spam-msg"); - var $localUsersList = $("select.local-usernames.spam-user"); - var params = [$localUsersList.val(), $postArea.val()] +function setSpamMsg(event) { + event.stopPropagation(); + event.preventDefault(); + + var btnUpdate = $(event.target); + $.MAL.disableButton(btnUpdate); + + var params = [$("select.local-usernames.spam-user").val(), + btnUpdate.closest('.post-area-new').find('textarea.spam-msg').val().trim()]; + twisterRpc("setspammsg", params, - function(args, ret) { - console.log("setspammsg updated"); - }, {}, - function(args, ret) { - console.log("setspammsg error"); - }, {}); + function(args, ret) {console.log("setspammsg updated");}, {}, + function(args, ret) {console.log("setspammsg error");}, {} + ); } function exitDaemon() { @@ -286,7 +289,9 @@ function interfaceNetworkHandlers() { $( ".add-dns").bind( "click", addDNSClick ); $( "select.genblock").change( setGenerate ); $( ".genproclimit").change( setGenerate ); - $( ".update-spam-msg").bind( "click", setSpamMsg ); + $('.network .post-area-new').off('click').on('click', + function (e) {e.stopPropagation(); $(this).addClass('open'); usePostSpliting = false;}); + $('.post-submit.update-spam-msg').off('click').on('click', setSpamMsg); $( ".terminate-daemon").bind( "click", exitDaemon ) } diff --git a/network.html b/network.html index 80b525e..21d8a85 100644 --- a/network.html +++ b/network.html @@ -27,8 +27,8 @@ - - + +