From 0d2cfc5d83b09efc9d87002302a2fe2c9ab7629b Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Tue, 18 Aug 2015 22:21:03 +0500 Subject: [PATCH] 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 @@ - - + +