From bfa925347a133fea3ddcf4a594a9b5a0dbfd68e3 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 21 Aug 2015 10:10:46 +0500 Subject: [PATCH 1/3] fix post preview hiding; clear some CSS --- css/profile.css | 4 ---- js/interface_common.js | 2 +- theme_calm/css/profile.css | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/css/profile.css b/css/profile.css index 96dd839..f0c2b39 100644 --- a/css/profile.css +++ b/css/profile.css @@ -308,7 +308,3 @@ h1.profile-name { h2.profile-screen-name { display: block; } - -.profile-modal .modal-buttons { - display: none; -} diff --git a/js/interface_common.js b/js/interface_common.js index a3d1e93..e7a4065 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -627,7 +627,7 @@ function posPostPreview(event) { if (textArea[0].value.length) postPreview.html(htmlFormatMsg(textArea[0].value).html).show(); else - postPreview.slideUp('fast'); + postPreview.hide(); textArea.before(postPreview); } diff --git a/theme_calm/css/profile.css b/theme_calm/css/profile.css index adf7f4a..929edc9 100644 --- a/theme_calm/css/profile.css +++ b/theme_calm/css/profile.css @@ -385,10 +385,6 @@ h2.profile-screen-name { color: #8f95a4; } -.profile-modal .modal-buttons { - display: none; -} - .profile-modal h1.profile-name, .profile-modal h2.profile-screen-name, .profile-modal span.profile-location, From fe1d11316b0a3ed0844ff1208c9f08e626bff215 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 21 Aug 2015 14:36:05 +0500 Subject: [PATCH 2/3] add quote fetching for retwisted twists with comments --- js/twister_formatpost.js | 61 ++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index 3aa20a9..c7f65c4 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -35,22 +35,6 @@ $(document).ready(function() { // format "userpost" to html element // kind = "original"/"ancestor"/"descendant" function postToElem(post, kind, promoted) { - - function setPostCommon(elem, username, time) { - var postInfoName = elem.find('.post-info-name') - .text(username).attr('href', $.MAL.userUrl(username)); - - getFullname(username, postInfoName); - //elem.find('.post-info-tag').text("@" + username); // FIXME - getAvatar(username, elem.find('.avatar')); - - elem.find('.post-info-time') - .attr('title', timeSincePost(time)) - .find('span:last') - .text(timeGmtToText(time)) - ; - } - /* "userpost" : { @@ -170,19 +154,22 @@ function postToElem(post, kind, promoted) { if (typeof retweeted_by !== 'undefined') { var postContext = elem.find('.post-context'); if (userpost.msg) { - postContext.append(_templatePostRtReference.clone(true)) - .find('.post-rt-reference') - .attr('data-screen-name', rt.n) - .attr('data-id', rt.k) - .attr('data-userpost', $.toJSON({userpost: rt, sig_userpost: userpost.sig_rt})) - .find('.post-text').html(htmlFormatMsg(rt.msg).html) - ; - setPostCommon(postContext, rt.n, rt.time); + setPostReference(postContext, rt, userpost.sig_rt); } else { postContext.append(_templatePostRtBy.clone(true)) .find('.post-retransmited-by') .attr('href', $.MAL.userUrl(retweeted_by)).text('@' + retweeted_by) ; + // let's check original post and grab some possible RT + dhtget(username, 'post' + k, 's', + function(args, post) { + if (post && post.userpost.msg && post.userpost.rt) { + var postContext = $('
'); + setPostReference(postContext, post.userpost.rt, post.userpost.sig_rt); + args.elem.find('.post-text').after(postContext); + } + }, {elem: elem} + ); } postContext.show(); } @@ -226,6 +213,32 @@ function postToElem(post, kind, promoted) { return elem; } +function setPostCommon(elem, username, time) { + var postInfoName = elem.find('.post-info-name') + .text(username).attr('href', $.MAL.userUrl(username)); + + getFullname(username, postInfoName); + //elem.find('.post-info-tag').text("@" + username); // FIXME + getAvatar(username, elem.find('.avatar')); + + elem.find('.post-info-time') + .attr('title', timeSincePost(time)) + .find('span:last') + .text(timeGmtToText(time)) + ; +} + +function setPostReference(elem, rt, sig_rt) { + elem.append(_templatePostRtReference.clone(true)) + .find('.post-rt-reference') + .attr('data-screen-name', rt.n) + .attr('data-id', rt.k) + .attr('data-userpost', $.toJSON({userpost: rt, sig_userpost: sig_rt})) + .find('.post-text').html(htmlFormatMsg(rt.msg).html) + ; + setPostCommon(elem, rt.n, rt.time); +} + function setPostInfoSent(n, k, item) { if( n === defaultScreenName && k >= 0 ) { getPostMaxAvailability(n,k, From 340f12cfe61ed1cefdecf9da22abb68261949078 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 21 Aug 2015 18:15:40 +0500 Subject: [PATCH 3/3] add new mentions posts highlighting for ~calm~ and ~nin~, tune for ~original~ --- css/style.css | 7 ++++--- theme_calm/css/style.css | 5 +++++ theme_nin/css/style.css | 4 ++++ theme_nin/sass/_postboard.sass | 4 ++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/css/style.css b/css/style.css index 3c39426..8a5b111 100644 --- a/css/style.css +++ b/css/style.css @@ -954,10 +954,11 @@ ol.toptrends-list { transition: background .1s linear; -moz-transition: background .1s linear; } -.post.new -{ - background: #F7F8E0; + +.post.new { + background-color: #FFFFED; } + .post.open { margin: 10px 0; diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index 5cc723b..67791ca 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -1156,6 +1156,11 @@ textarea.splited-post { transition: background .1s linear; -moz-transition: background .1s linear; } + +.post.new { + background-color: #FFFFED; +} + .post.open { margin: 10px 0; diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index 45e5478..6aba4c4 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -771,6 +771,10 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, color: #414244; } +.post.new .post-info-time { + color: #B4C669; +} + /* line 55, ../sass/_postboard.sass */ .post-data { padding: 10px; diff --git a/theme_nin/sass/_postboard.sass b/theme_nin/sass/_postboard.sass index 761c8d8..adf5a7e 100755 --- a/theme_nin/sass/_postboard.sass +++ b/theme_nin/sass/_postboard.sass @@ -78,6 +78,10 @@ .post:hover cursor: pointer +.post.new + .post-info-time + color: $color-green + .open background: none