From 0eccba44f08ade04d7a9ca13a63140769050bb68 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 29 Jul 2015 12:15:12 +0500 Subject: [PATCH 1/4] add word breaking for post preview --- css/style.css | 1 + theme_calm/css/style.css | 1 + theme_nin/css/style.css | 1 + theme_nin/sass/style.sass | 1 + 4 files changed, 4 insertions(+) diff --git a/css/style.css b/css/style.css index 27ad9f1..9af07f6 100644 --- a/css/style.css +++ b/css/style.css @@ -654,6 +654,7 @@ textarea.splited-post { font-size: 11px; margin: 4px 0; padding: 4px; + word-wrap: break-word; } #post-preview a { diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index 6183598..008787e 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -783,6 +783,7 @@ textarea.splited-post { font-size: 11px; margin: 4px 0; padding: 4px; + word-wrap: break-word; } .splited-post-counter { diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index c5e3673..eae9d9a 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -2276,6 +2276,7 @@ textarea.splited-post { font-size: 12px; margin: 4px 0; padding: 4px; + word-wrap: break-word; } #post-preview a { diff --git a/theme_nin/sass/style.sass b/theme_nin/sass/style.sass index 094055f..207dd7e 100755 --- a/theme_nin/sass/style.sass +++ b/theme_nin/sass/style.sass @@ -360,6 +360,7 @@ ul.userMenu-search-profiles font-size: 12px margin: 4px 0 padding: 4px + word-wrap: break-word a color: #AAA a:hover From c4e0b265f49262f046605aa7b18c1158e75e158c Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 29 Jul 2015 14:21:03 +0500 Subject: [PATCH 2/4] add CSS rule for samp in post preview, change CSS background to background-color for it --- css/style.css | 6 +++++- theme_calm/css/style.css | 6 +++++- theme_nin/css/style.css | 6 +++++- theme_nin/sass/_postboard.sass | 2 +- theme_nin/sass/style.sass | 2 ++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/css/style.css b/css/style.css index 9af07f6..6b6a8ee 100644 --- a/css/style.css +++ b/css/style.css @@ -661,6 +661,10 @@ textarea.splited-post { color: #E34F42; } +#post-preview samp { + background-color: #F0EFCC; +} + .splited-post-counter { color: rgba(0, 0, 0, 0.3); font-weight: bold; @@ -1046,7 +1050,7 @@ ol.toptrends-list { } .post-text samp { - background: #f0efcc; + background-color: #F0EFCC; } .post-context diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index 008787e..6e3933b 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -786,6 +786,10 @@ textarea.splited-post { word-wrap: break-word; } +#post-preview samp { + background-color: #EEE; +} + .splited-post-counter { color: rgba(0, 0, 0, 0.3); font-weight: bold; @@ -1248,7 +1252,7 @@ textarea.splited-post { } .post-text samp { - background: #eee; + background: #EEE; } .post-context diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index eae9d9a..e0d724f 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -879,7 +879,7 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, } .post-text samp { - background: #eee; + background-color: #EEE; } /* line 138, ../sass/_postboard.sass */ @@ -2287,6 +2287,10 @@ textarea.splited-post { color: #B4C669; } +#post-preview samp { + background-color: #EEE; +} + /* line 384, ../sass/style.sass */ .splited-post-counter { color: rgba(0, 0, 0, 0.3); diff --git a/theme_nin/sass/_postboard.sass b/theme_nin/sass/_postboard.sass index 61bdd00..8b599da 100755 --- a/theme_nin/sass/_postboard.sass +++ b/theme_nin/sass/_postboard.sass @@ -135,7 +135,7 @@ min-height: 25px padding: 0 samp - background: #eee + background-color: #EEE .post-context font-size: 11px diff --git a/theme_nin/sass/style.sass b/theme_nin/sass/style.sass index 207dd7e..8e29cc2 100755 --- a/theme_nin/sass/style.sass +++ b/theme_nin/sass/style.sass @@ -365,6 +365,8 @@ ul.userMenu-search-profiles color: #AAA a:hover color: $color-green + samp + background-color: #EEE #postboard-top clear: both From c3e1f03c0078b72029fb8d5e0cc1e28c84b14237 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 29 Jul 2015 17:13:32 +0500 Subject: [PATCH 3/4] fix post preview to don't do it if it is turned off --- js/interface_common.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index 40252a5..6946899 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -704,10 +704,12 @@ function replyTextInput(event) { } } - if (textArea[0].value.length) - textAreaForm.find('#post-preview').html(htmlFormatMsg(textArea[0].value, [])).show(); - else - textAreaForm.find('#post-preview').html('').hide(); + if ($.Options.postPreview.val) { + if (textArea[0].value.length) + textAreaForm.find('#post-preview').html(htmlFormatMsg(textArea[0].value, [])).show(); + else + textAreaForm.find('#post-preview').html('').hide(); + } } function getPostSplitingPML() { From 4a9069189fc61880017ef7ce22a29da031f3abe7 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 29 Jul 2015 19:53:20 +0500 Subject: [PATCH 4/4] delete modal closing after post sending, no reason to do it --- js/interface_common.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index 6946899..ee8e95f 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -1278,9 +1278,7 @@ function postSubmit(e, oldLastPostId) { var remainingCount = tweetForm.find('.post-area-remaining'); remainingCount.text(140); - if ($this.parents('.modal-wrapper').length) - closeModal(); - else if ($this.parents('.prompt-wrapper').length) + if ($this.parents('.prompt-wrapper').length) closeModalHandler('.prompt-wrapper'); if ($this.closest('.post-area,.post-reply-content')) {