From bfa925347a133fea3ddcf4a594a9b5a0dbfd68e3 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 21 Aug 2015 10:10:46 +0500 Subject: [PATCH 1/9] 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/9] 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/9] 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 From 3595a9d2c570c9b9bbf446e3e01b98b1195d5f8f Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 4 Sep 2015 03:21:33 +0500 Subject: [PATCH 4/9] introduce #groupchat #UI --- css/profile.css | 56 +++--- css/style.css | 302 ++++++++++++++++++++----------- following.html | 166 ++++++++++++++--- home.html | 174 ++++++++++++++---- js/interface_common.js | 123 +++++++++++-- js/interface_localization.js | 221 +++++++++++++++++++++++ js/mobile_abstract.js | 61 ++++--- js/twister_directmsg.js | 310 ++++++++++++++++++++++++++++++-- js/twister_following.js | 2 +- js/twister_formatpost.js | 2 +- js/twister_newmsgs.js | 37 +++- theme_calm/css/profile.css | 61 ++++--- theme_calm/css/style.css | 333 ++++++++++++++++++++++------------- theme_nin/css/style.css | 170 ++++++++++++++++-- 14 files changed, 1622 insertions(+), 396 deletions(-) diff --git a/css/profile.css b/css/profile.css index f0c2b39..16906a4 100644 --- a/css/profile.css +++ b/css/profile.css @@ -58,36 +58,16 @@ color: #fff; } -.profile-card-buttons -{ +.profile-card-buttons { + padding: 4px 0; +} + +.twister-user-info .profile-card-buttons { position: absolute; - bottom: 30px; + top: 0; right: 0; } -.profile-card-buttons .direct-messages-with-user, -.profile-card-buttons .mentions-from-user, -.profile-card-buttons .follow, -.profile-card-buttons .unfollow -{ - display: inline; - padding: 4px 12px; - font-size: 12px; - width: auto; - text-align: center; - color: rgba( 0, 0, 0, .7 ); - background: rgba( 0, 0, 0, .1 ); - border: none; - transition: all .2s linear; -} - -.profile-card-buttons .direct-messages-with-user:hover, -.profile-card-buttons .mentions-from-user:hover -{ - color: #fff; - background: #45474d; -} - .profile-card.forEdition { margin: 0 auto; @@ -308,3 +288,27 @@ h1.profile-name { h2.profile-screen-name { display: block; } + +.group-messages-control .invite-form, .group-messages-control .secret-key { + display: none; + font-size: 12px; + text-align: center; + padding: 4px 0; +} + +.group-messages-control .invite-form input { + vertical-align: middle; + width: 73%; + margin: 0 4px; +} + +.group-messages-control .invite-form button { + color: #DDD; + background-color: #45474D; + border: medium none; + vertical-align: middle; +} + +.group-messages-control .invite-form button:hover { + color: #FFF; +} diff --git a/css/style.css b/css/style.css index 8a5b111..f9de08b 100644 --- a/css/style.css +++ b/css/style.css @@ -96,28 +96,24 @@ h3 ************** BUTTONS *************** **************************************/ -button -{ +button { + color: rgba(255, 255, 255, .8); background: #45474d; - color: rgba( 255, 255, 255, .8 ); border: none; padding: 5px 10px; cursor: pointer; } -button:hover -{ +button:hover { color: #fff; } -button.disabled -{ +button:disabled, button.disabled { opacity: .4; } -button.disabled:hover -{ - color: rgba( 255, 255, 255, .8 ); +button:disabled:hover, button.disabled:hover { + color: rgba(255, 255, 255, .8); } button.follow, button.unfollow, .following-list button.private { @@ -151,11 +147,32 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover margin-right: 10px; } +.b-buttons { + text-align: right; + padding: 4px; +} + +.b-buttons button { + color: rgba(0, 0, 0, .7); + background-color: rgba(0, 0, 0, .08); + border: none; + font-size: 12px; + text-align: center; + width: auto; + padding: 4px 12px; + transition: all .1s linear; +} + +.b-buttons button:hover { + color: #FFF; + background: #45474D; +} + /************************************* -**************************** MENU ***** +**************** MENU **************** **************************************/ -.userMenu -{ + +.userMenu { width: 900px; position: fixed; left: 50%; @@ -164,12 +181,13 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover background: #45474d; z-index: 2; } + .userMenu.w1200 { width: 1200px; margin-left: -600px; } -.userMenu:after -{ + +.userMenu:after { content: ""; position: absolute; right: 0; @@ -177,16 +195,14 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover height: 54px; background: url(../img/twister_mini.png) no-repeat right 5px; } -.userMenu > ul -{ -} -.userMenu > ul > li -{ + +.userMenu > ul > li { float: left; + height: 40px; margin: 0; } -.userMenu > ul > li > a -{ + +.userMenu > ul > li > a { line-height: 40px; height: 40px; padding: 0 20px 0 45px; @@ -198,115 +214,89 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover transition: all .2s linear; position: relative; } -.userMenu li > a:hover -{ + +.userMenu li:hover, .userMenu li:active { + background-color: rgba(0, 0, 0 , .4); +} + +.userMenu li:hover > a, .userMenu li:active > a { text-decoration: none; opacity: 1; } -.userMenu li.current > a -{ + +.userMenu li.current { + background-color: #B43E34; +} + +.userMenu li.current > a { color: #fff; opacity: 1; } -.userMenu li.userMenu-home > a -{ + +.userMenu li.userMenu-home > a { background: url(../img/home.png) no-repeat 5px center; } -.userMenu li.userMenu-home:hover > a -{ - background: url(../img/home.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-home.current > a -{ - background: url(../img/home.png) no-repeat 5px center #b43e34; -} -.userMenu li.userMenu-connections > a -{ + +.userMenu li.userMenu-connections > a { background: url(../img/connections.png) no-repeat 5px center; - padding: 0 30px 0 20px; + padding: 0 24px; opacity: 1; } -.userMenu li.userMenu-connections:hover > a -{ - background: url(../img/connections.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-connections.current > a -{ - background: url(../img/connections.png) no-repeat 5px center #b43e34; -} -.userMenu li.userMenu-network > a -{ + +.userMenu li.userMenu-network > a { background: url(../img/network.png) no-repeat 5px center; } -.userMenu li.userMenu-network:hover > a -{ - background: url(../img/network.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-network.current > a -{ - background: url(../img/network.png) no-repeat 5px center #b43e34; -} -.userMenu li.userMenu-messages > a -{ + +.userMenu li.userMenu-messages > a { background: url(../img/messages.png) no-repeat center center; - padding: 0 25px 0 35px; + padding: 0 24px; opacity: 1; } -.userMenu li.userMenu-messages:hover > a -{ - background: url(../img/messages.png) no-repeat center center rgba( 0, 0, 0 , .4 ); + +.userMenu li.userMenu-messages > a:empty { + padding: 0 20px 0 30px; + opacity: .7; } -.userMenu li.userMenu-messages.current > a -{ - background: url(../img/messages.png) no-repeat center center #b43e34; + +.userMenu li.userMenu-groupmessages > a { + background: url(../img/groupmessages.png) no-repeat center center; + background-size: 22px 22px; + padding: 0 24px; + opacity: 0.9; } -.userMenu li.userMenu-profile > a -{ + +.userMenu li.userMenu-profile > a { background: url(../img/profile.png) no-repeat 5px center; } -.userMenu li.userMenu-profile:hover > a -{ - background: url(../img/profile.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-profile.current > a -{ - background: url(../img/profile.png) no-repeat 5px center #b43e34; -} -.userMenu li.userMenu-config -{ + +.userMenu li.userMenu-config { float: right; position: relative; margin-right: 40px; } -.userMenu li.userMenu-search -{ + +.userMenu li.userMenu-search { float: right; position: relative; } -.userMenu li.userMenu-config > a -{ + +.userMenu li.userMenu-search:hover { + background-color: transparent; +} + +.userMenu li.userMenu-config > a { background: url(../img/config.png) no-repeat 5px center; padding: 0 30px 0 45px; } -.userMenu li.userMenu-config > a:after -{ + +.userMenu li.userMenu-config > a:after { content: "▼"; position: absolute; font-size: 10px; transition: all .2 linear; } -.userMenu li.userMenu-config:hover > a, -.userMenu li.userMenu-config:active > a -{ - background: url(../img/config.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-messages > a:empty -{ - padding: 0 20px 0 30px; - opacity: .7; -} -.wrapper -{ + +.wrapper { width: 900px; margin: 0 auto; background: #f8f5ee; @@ -315,10 +305,12 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover z-index: 1; min-height: 100%; } + .wrapper.w1200 { width: 1200px; padding: 55px 7px 15px 7px; } + .dashboard.left { width: 320px; position: fixed; @@ -332,8 +324,7 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover margin-left: 864px; } -.module -{ +.module { border: solid 1px rgba( 69, 71, 77, .1 ); background: #fff; } @@ -342,8 +333,7 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover margin: 0 0 3%; } -.messages-qtd -{ +.messages-qtd { position: absolute; background: #b43e34; color: #fff; @@ -352,10 +342,11 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover font-size: 8px; margin-top: 4px; } -.userMenu-connections .messages-qtd -{ + +.userMenu-connections .messages-qtd { margin: 4px 0 0 10px; } + /******************************************************* ****************** CONFIG SUBMENU & SEARCH RESULTS ***** *******************************************************/ @@ -1581,6 +1572,98 @@ ol.toptrends-list { content: '\2714'; } +/************************************* +****** GM NEW GROUP SETUP MODAL ****** +**************************************/ + +.group-messages-new-group.modal-wrapper { + height: auto; /*about 320px*/ + margin-top: -160px; +} + +.group-messages-new-group .modal-content .module { + margin: 4px; +} + +.group-messages-new-group .modal-content div div { + width: 100%; + margin: 4px 0; + padding: 4px 12px; +} + +.group-messages-new-group .modal-content div div:last-child { + text-align: right; +} + +.group-messages-new-group .modal-content div div:last-child button { + margin: 8px 4px; +} + +.group-messages-new-group .modal-content textarea { + border: solid 1px rgba(0, 0, 0, .3); + border-radius: 3px; + width: 500px; + height: 56px; + resize: none; + margin: 12px 16px; + padding: 2px 4px; +} + +.group-messages-new-group .modal-content textarea:focus { + border: solid 1px rgba(227, 79, 66, .5); +} + +/************************************* +****** GM JOIN GROUP SETUP MODAL ***** +**************************************/ + +.group-messages-join-group.modal-wrapper { + height: auto; /*about 360px*/ + margin-top: -240px; +} + +.group-messages-join-group .modal-content .module { + margin: 4px; +} + +.group-messages-join-group .modal-content div div { + width: 100%; + margin: 4px 0; + padding: 4px 12px; +} + +.group-messages-join-group .modal-content div div:last-child { + text-align: right; +} + +.group-messages-join-group .modal-content div div:last-child button { + margin: 8px 4px; +} + +.group-messages-join-group .modal-content input { + border: solid 1px rgba(0, 0, 0, .3); + border-radius: 3px; + width: 500px; + margin: 12px 16px; + padding: 2px 4px; +} + +.group-messages-join-group .modal-content input:focus { + border: solid 1px rgba(227, 79, 66, .5); +} + +.group-messages-join-group .modal-content input[type='checkbox'] { + display: inline; + width: auto; + margin: 2px; +} + +.group-messages-join-group .modal-content .groups-list { + height: 120px; + overflow-y: auto; + margin: 8px 8px 0; +} + /************************************* *********** NEW USER MODAL *********** **************************************/ @@ -1693,6 +1776,7 @@ ol.toptrends-list { .prompt-wrapper { background: #fff; + font-size: 13px; z-index: 5; position: fixed; top: 50%; @@ -1713,6 +1797,20 @@ ol.toptrends-list { margin: 4px; } +/************************************* +*********** CONFIRM POPUP ************ +**************************************/ + +.confirm-popup .message { + text-align: center; + margin: 12px; +} + +.confirm-popup .modal-buttons { + text-align: center; + padding: 4px; +} + /************************************* ****** FOLLOWING-CONFIG PROMPT ******* **************************************/ diff --git a/following.html b/following.html index 30ee04a..0ca6122 100644 --- a/following.html +++ b/following.html @@ -36,7 +36,7 @@
  • Home
  • Network
  • Profile
  • -
  • +
  • @@ -63,6 +64,11 @@ +
  • + + + +
  • @@ -95,21 +101,21 @@
    + +
    - -
    user-photo
    View @@ -211,7 +217,6 @@
    -
  • @@ -247,8 +252,8 @@
    140 - - + +
    @@ -293,12 +298,12 @@
    @@ -309,14 +314,22 @@
    +
    +
    + +
    +
    140 - - + +
    @@ -378,13 +391,114 @@
    140 - - + +
    +
    +
    + + +
    +
    + +
    +
    + + + +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    + + user-photo + +
    + +
    +
    + +
    +
    +
    +

    Group description

    + +
    +
    +

    Peers to invite

    + +
    +
    + +
    +
    +
    + +
    +
    +
    +

    Select group(s)

    +
      +
      +
      + +
      +
      +
      +
      +

      Import secret key

      + +
      +
      +

      With group alias

      + +
      +
      + +
      +
      +
      + +
      +
    • + // +
    • +
      +
      @@ -418,7 +532,7 @@
    •  Followers
    • -
      +
      diff --git a/home.html b/home.html index bf094a5..b94eb16 100644 --- a/home.html +++ b/home.html @@ -54,8 +54,9 @@ Setup account Following users Change user - - Direct Messages + + Direct Messages + Group Messages
      @@ -69,6 +70,11 @@ +
    • + + + +
    • @@ -101,22 +107,21 @@
      + +
      - - -
      user-photo
      View @@ -132,8 +137,8 @@
      140 - - + +
      @@ -169,8 +174,8 @@
      140 - - + +
      @@ -338,8 +343,8 @@
      140 - - + +
      @@ -385,12 +390,12 @@
      @@ -401,14 +406,22 @@
      +
      +
      + +
      +
      140 - - + +
      @@ -470,13 +483,114 @@
      140 - - + +
      +
      +
      + + +
      +
      + +
      +
      + + + +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +
      + + + + +
      + +
      +
      +
      +
      +
      +
      + +
      +
      +
      + + user-photo + +
      + +
      +
      + +
      +
      +
      +

      Group description

      + +
      +
      +

      Peers to invite

      + +
      +
      + +
      +
      +
      + +
      +
      +
      +

      Select group(s)

      +
        +
        +
        + +
        +
        +
        +
        +

        Import secret key

        + +
        +
        +

        With group alias

        + +
        +
        + +
        +
        +
        + +
        +
      • + // +
      • +
        +
        @@ -510,7 +624,7 @@
      •  Followers
      • -
        +
        diff --git a/js/interface_common.js b/js/interface_common.js index e7a4065..c08197c 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -55,12 +55,56 @@ function closeModal() { }); } +function closePrompt() { + closeModalHandler('.prompt-wrapper'); +} + function closeModalHandler(classBase) { var modalWindows = $(classBase+':not(#templates *)'); modalWindows.fadeOut('fast', function() {modalWindows.remove();}); } +function confirmPopup(event, req) { + event.stopPropagation(); + + var modal = openModal({ + classBase: '.prompt-wrapper', + classAdd: 'confirm-popup', + content: $('#confirm-popup-template').children().clone(true), + title: req.titleTxt + }); + + if (req.messageTxt) + modal.content.find('.message').text(req.messageTxt); + + var btn = modal.content.find('.confirm'); + if (req.confirmTxt) + btn.text(req.confirmTxt); + else + btn.text(polyglot.t('Confirm')); + if (req.confirmFunc) { + btn.on('click', function () { + closePrompt(); + req.confirmFunc(req.confirmFuncArgs); + }); + } else + btn.on('click', closePrompt); + + var btn = modal.content.find('.cancel'); + if (req.cancelTxt) + btn.text(req.cancelTxt); + else + btn.text(polyglot.t('Cancel')); + if (req.cancelFunc) { + btn.on('click', function () { + closePrompt(); + req.cancelFunc(req.cancelFuncArgs); + }); + } else + btn.on('click', closePrompt); +} + function checkNetworkStatusAndAskRedirect(cbFunc, cbArg) { networkUpdate(function(args) { if (!twisterdConnectedAndUptodate) { @@ -98,7 +142,43 @@ function timeSincePost(t) { return polyglot.t('time_ago', {time: expression}); } -function openProfileModalWithUsernameHandler(username) { +function openGroupProfileModalWithNameHandler(groupAlias) { + var modal = openModal({ + classAdd: 'profile-modal', + content: $('#group-profile-modal-template').children().clone(true), + title: polyglot.t('users_profile', {username: '' + groupAlias + ''}) + }); + + modal.content.find('.profile-card').attr('data-screen-name', groupAlias); + + groupMsgGetGroupInfo(groupAlias, + function(req, ret) { + if (ret) { + req.modal.content.find('.profile-bio').text(ret.description); + + if (ret.members.indexOf(defaultScreenName) !== -1) + req.modal.content.find('.group-messages-control').children('button').attr('disabled', false); + + var membersList = req.modal.content.find('.members'); + var memberTemplate = $('#group-profile-member-template').children(); + for (var i = 0; i < ret.members.length; i++) { + var item = memberTemplate.clone(true).appendTo(membersList); + + item.find('.twister-user-info').attr('data-screen-name', ret.members[i]); + item.find('.twister-user-name').attr('href', $.MAL.userUrl(ret.members[i])); + + getAvatar(ret.members[i], item.find('.twister-user-photo')); + getFullname(ret.members[i], item.find('.twister-user-full')); + getBio(ret.members[i], item.find('.bio')); + } + } + }, {modal: modal} + ); + + +} + +function openUserProfileModalWithNameHandler(username) { var content = $('#profile-modal-template').children().clone(true); updateProfileData(content, username); @@ -333,18 +413,26 @@ function loadModalFromHash() { var hashdata = hashstring.split(':'); if (hashdata[0] !== '#web+twister') - hashdata = hashstring.match(/(hashtag|profile|mentions|directmessages|following|conversation)\?(?:user|hashtag|post)=(.+)/); + hashdata = hashstring.match(/(hashtag|profile|mentions|directmessages|following|conversation)\?(?:group|user|hashtag|post)=(.+)/); // need to rework hash scheme to use group|user|hashtag|post or drop it if (hashdata && hashdata[1] !== undefined && hashdata[2] !== undefined) { if (hashdata[1] === 'profile') - openProfileModalWithUsernameHandler(hashdata[2]); + if (hashdata[2][0] === '*') + openGroupProfileModalWithNameHandler(hashdata[2]); + else + openUserProfileModalWithNameHandler(hashdata[2]); + else if (hashdata[1] === 'hashtag') openHashtagModalFromSearchHandler(hashdata[2]); else if (hashdata[1] === 'mentions') openMentionsModalHandler(hashdata[2]); - else if (hashdata[1] === 'directmessages') - openDmWithUserModal(hashdata[2]); - else if (hashdata[1] === 'following') + else if (hashdata[1] === 'directmessages') { + if (hashdata[2][0] === '*') + openGroupMessagesModal(hashdata[2]); + else + openDmWithUserModal(hashdata[2]); + + } else if (hashdata[1] === 'following') openFollowingModal(hashdata[2]); else if (hashdata[1] === 'conversation') { splithashdata2 = hashdata[2].split(':'); @@ -352,6 +440,12 @@ function loadModalFromHash() { } } else if (hashstring === '#directmessages') directMessagesPopup(); + else if (hashstring === '#groupmessages') + openGroupMessagesModal(); + else if (hashstring === '#groupmessages+newgroup') + openGroupMessagesNewGroupModal(); + else if (hashstring === '#groupmessages+joingroup') + openGroupMessagesJoinGroupModal(); else if (hashstring === '#whotofollow') openWhoToFollowModal(); } @@ -1317,7 +1411,7 @@ function postSubmit(e, oldLastPostId) { } if (btnPostSubmit.parents('.prompt-wrapper').length) - closeModalHandler('.prompt-wrapper'); + closePrompt(); else { textArea.val('').attr('placeholder', polyglot.t('Your message was sent!')); var tweetForm = btnPostSubmit.parents('form'); @@ -1338,7 +1432,7 @@ function retweetSubmit(e) { newRtMsg($(this).closest('.prompt-wrapper').find('.post-data')); - closeModalHandler('.prompt-wrapper'); + closePrompt(); } function changeStyle() { @@ -1409,7 +1503,7 @@ function replaceDashboards() { } function initInterfaceCommon() { - $('.cancel').on('click', function() { + $('.modal-close, .modal-blackout').not('.prompt-close').on('click', function() { if ($('.modal-content').attr('style') != undefined) $('.modal-content').removeAttr('style'); $('.modal-back').css('display', 'none'); @@ -1419,10 +1513,7 @@ function initInterfaceCommon() { $('.modal-back').on('click', function() {history.back();}); - $('.prompt-close').on('click', function(e) { - e.stopPropagation(); - closeModalHandler('.prompt-wrapper'); - }); + $('.prompt-close').on('click', closePrompt); /* $('.modal-back').on('click', function() { @@ -1499,6 +1590,12 @@ function killInterfaceModule(module) { $('.module.'+module).empty().hide(); } +function inputEnterActivator(event) { + var elemEvent = $(event.target); + elemEvent.parents(event.data.parentSelector).find(event.data.enterSelector) + .attr('disabled', elemEvent.val().trim() === ''); +} + function setTextcompleteOnEventTarget(event) { // cursor has not set yet and we need to wait 100ms to skip global click event setTimeout(setTextcompleteOnElement, 100, event.target); diff --git a/js/interface_localization.js b/js/interface_localization.js index 9b08e75..7eb855f 100644 --- a/js/interface_localization.js +++ b/js/interface_localization.js @@ -44,6 +44,9 @@ if(preferredLanguage == "en"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "Cancel", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Change user", "Checking...": "Checking...", // checking if username is available "Collapse": "Collapse", // smaller view of a post @@ -54,6 +57,9 @@ if(preferredLanguage == "en"){ "Detailed information": "Detailed information", "DHT network down.": "DHT network down.", "Direct Messages": "Direct Messages", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Direct messages with %{username}", "Disable": "Disable", "Display mentions to @": "Display mentions to @", @@ -94,6 +100,16 @@ if(preferredLanguage == "en"){ "Network status": "Network status", "New direct message...": "New direct message...", "New Post...": "New Post...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "You got", "in postboard": "in postboard", "in search result": "in search result", @@ -101,6 +117,7 @@ if(preferredLanguage == "en"){ "new_posts": "%{smart_count} new post |||| %{smart_count} new posts", "new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions", "new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "nobody", // used to promote a post without attaching the user "Not available": "Not available", // username is not available "notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.", @@ -344,6 +361,9 @@ if(preferredLanguage == "es"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "Cancelar", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Cambiar de usuario", "Checking...": "Comprobando ...", // checking if username is available "Collapse": "Colapsar", // smaller view of a post @@ -354,6 +374,9 @@ if(preferredLanguage == "es"){ "Detailed information": "Información detallada", "DHT network down.": "Red DHT caida.", "Direct Messages": "Mensajes directos", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Mensajes directos con %{username}", "Disable": "Inhabilitar", "Display mentions to @": "Visualización de menciones a @", @@ -394,6 +417,16 @@ if(preferredLanguage == "es"){ "Network status": "Estado de la red", "New direct message...": "Nuevo mensaje directo...", "New Post...": "Nuevo Post...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "You got", "in postboard": "in postboard", "in search result": "in search result", @@ -401,6 +434,7 @@ if(preferredLanguage == "es"){ "new_posts": "%{smart_count} nuevo post |||| %{smart_count} nuevos posts", "new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions", "new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "Nadie", // used to promote a post without attaching the user "Not available": "No disponible", // username is not available "notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.", @@ -628,6 +662,9 @@ if(preferredLanguage == "uk"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "Відміна", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Змінити користувача", "Checking...": "Перевірка...", // checking if username is available "Collapse": "Згорнути", // smaller view of a post @@ -638,6 +675,9 @@ if(preferredLanguage == "uk"){ "Detailed information": "Детальна інформація", "DHT network down.": "Мережа DHT недоступна.", "Direct Messages": "Особисті повідомлення", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Direct messages with %{username}", "Disable": "Вимкнено", "Display mentions to @": "Показати сповіщення @", @@ -679,6 +719,16 @@ if(preferredLanguage == "uk"){ "Network status": "Статус мережі", "New direct message...": "Нове повідомлення...", "New Post...": "Що нового?", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "Ви отримали", "in postboard": "в стрічці", "in search result": "в пошуковому запиті", @@ -686,6 +736,7 @@ if(preferredLanguage == "uk"){ "new_posts": "%{smart_count} новий твіст |||| %{smart_count} нових твістів", "new_mentions": "%{smart_count} нове сповіщення |||| %{smart_count} нових сповіщень", "new_direct_messages": "%{smart_count} нове повідомлення |||| %{smart_count} нові повідомлення", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "анонім", // used to promote a post without attaching the user "Not available": "Не доступне", // username is not available "notify_desktop_error": "Twister не може створити сповіщення: невідома помилка.", @@ -911,6 +962,9 @@ if(preferredLanguage == "zh-CN"){ "busted_oh": "噢,阻挡!", "busted_avowal": "系统检测到此用户试图在这里注入恶意代码", "Cancel": "取消", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "切换用户", "Checking...": "检查中...", // checking if username is available "Collapse": "折叠", // smaller view of a post @@ -921,6 +975,9 @@ if(preferredLanguage == "zh-CN"){ "Detailed information": "详细信息", "DHT network down.": "DHT网络中断。", "Direct Messages": "私信", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Direct messages with %{username}", "Disable": "关闭", "Display mentions to @": "显示@", @@ -961,6 +1018,16 @@ if(preferredLanguage == "zh-CN"){ "Network status": "网络状态", "New direct message...": "新私信...", "New Post...": "新推文...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "你收到", "in postboard": "在时间线里", "in search result": "在搜索结果里", @@ -968,6 +1035,7 @@ if(preferredLanguage == "zh-CN"){ "new_posts": "%{smart_count} 篇新推文", "new_mentions": "%{smart_count} 次新的提及", "new_direct_messages": "%{smart_count} 封新私信", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "无名", // used to promote a post without attaching the user "Not available": "用户名不可用", // username is not available "notify_desktop_error": "Twister 无法发出桌面提醒:发生未知错误。", @@ -1211,6 +1279,9 @@ if(preferredLanguage == "nl"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "Annuleren", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Gebruiker wijzigen", "Checking...": "Controleren...", // checking if username is available "Collapse": "Uitklappen", // smaller view of a post @@ -1221,6 +1292,9 @@ if(preferredLanguage == "nl"){ "Detailed information": "Gedetailleerde informatie", "DHT network down.": "DHT netwerk down.", "Direct Messages": "Privéberichten", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Direct messages with %{username}", "Disable": "Uitschakelen", "Display mentions to @": "Toon vermeldingen voor @", @@ -1261,6 +1335,16 @@ if(preferredLanguage == "nl"){ "Network status": "Netwerkstatus", "New direct message...": "Nieuw privébericht...", "New Post...": "Nieuw bericht...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "You got", "in postboard": "in postboard", "in search result": "in search result", @@ -1268,6 +1352,7 @@ if(preferredLanguage == "nl"){ "new_posts": "%{smart_count} nieuw bericht |||| %{smart_count} nieuwe berichten", "new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions", "new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "nobody", // used to promote a post without attaching the user "Not available": "Niet beschikbaar", // username is not available "notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.", @@ -1495,6 +1580,9 @@ if(preferredLanguage == "it"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "Cancella", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Cambia utente", "Checking...": "Controllo in corso...", // checking if username is available "Collapse": "Chiudi", // smaller view of a post @@ -1505,6 +1593,9 @@ if(preferredLanguage == "it"){ "Detailed information": "Informazioni dettagliate", "DHT network down.": "DHT network inaccessibile.", "Direct Messages": "Messaggi Diretti", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Messaggi Diretti come %{username}", "Disable": "Disabilitato", "Display mentions to @": "Mostra le menzioni di @", @@ -1545,6 +1636,16 @@ if(preferredLanguage == "it"){ "Network status": "Status della rete", "New direct message...": "Nuovo messaggio diretto...", "New Post...": "Nuovo messaggio...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "You got", "in postboard": "in postboard", "in search result": "in search result", @@ -1552,6 +1653,7 @@ if(preferredLanguage == "it"){ "new_posts": "%{smart_count} nuovo messaggio |||| %{smart_count} nuovi messaggi", "new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions", "new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "nessuno", // used to promote a post without attaching the user "Not available": "Non disponibile", // username is not available "notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.", @@ -1776,6 +1878,9 @@ if(preferredLanguage == "fr"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "Annuler", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Changer d'utilisateur", "Checking...": "Vérification...", // checking if username is available "Collapse": "Fermer", // smaller view of a post @@ -1786,6 +1891,9 @@ if(preferredLanguage == "fr"){ "Detailed information": "Informations détaillées", "DHT network down.": "Panne du réseau DHT.", "Direct Messages": "Messages privés", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Messages privés avec %{username}", "Disable": "Désactiver", "Display mentions to @": "Afficher les mentions pour @", @@ -1826,6 +1934,16 @@ if(preferredLanguage == "fr"){ "Network status": "État du réseau", "New direct message...": "Nouveau message privé...", "New Post...": "Nouveau billets...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "Tu as", "in postboard": "sur le postboard", "in search result": "dans les résultats de recherche", @@ -1833,6 +1951,7 @@ if(preferredLanguage == "fr"){ "new_posts": "%{smart_count} nouveau billet |||| %{smart_count} nouveaux billets", "new_mentions": "%{smart_count} nouvelle mention |||| %{smart_count} nouvelles mentions", "new_direct_messages": "%{smart_count} nouveau message privé |||| %{smart_count} nouveaux messages privés", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "nobody", // used to promote a post without attaching the user "Not available": "Non disponible", // username is not available "notify_desktop_error": "Impossible d'afficher les notifications: une erreur inconnue est survenue.", @@ -2062,6 +2181,9 @@ if(preferredLanguage == "ru"){ "busted_oh": "о нет!", "busted_avowal": "я пойман на попытке вставить этот подозрительный код здесь", "Cancel": "Отмена", + "Confirm": "Несомненно", + "сonfirm_group_leaving_header": "Подтверждение ухода из группы", + "сonfirm_group_leaving_body": "Воистину покинуть группу %{alias}?", "Change user": "Сменить пользователя", "Checking...": "Проверка...", "Collapse": "Свернуть", @@ -2072,6 +2194,9 @@ if(preferredLanguage == "ru"){ "Detailed information": "Подробная информация", "DHT network down.": "Недоступна DHT сеть.", "Direct Messages": "Личные сообщения", + "Group Messages": "Групповые сообщения", + "Group Messages — New Group Creation": "Групповые сообщения — Создать новую группу", + "Group Messages — Join Group": "Групповые сообщения — Присоединиться к группе", "direct_messages_with": "Личная переписка с %{username}", "Disable": "Отключено", "Display mentions to @": "Показать ответы для @", @@ -2112,6 +2237,16 @@ if(preferredLanguage == "ru"){ "Network status": "Состояние сети", "New direct message...": "Новое личное сообщение...", "New Post...": "Новый пост...", + "New group": "Создать группу", + "Group description": "Описание группы", + "Peers to invite": "Кого пригласить", + "Join group": "Присоединиться", + "Select group(s)": "Выберите группу(ы)", + "Create": "Создать", + "Join": "Присоединиться", + "Invite": "Пригласить", + "Invite peers": "Пригласить кого", + "Leave group": "Покинуть группу", "You got": "У вас", "in postboard": "в ленте", "in search result": "в результатах поиска", @@ -2119,6 +2254,7 @@ if(preferredLanguage == "ru"){ "new_posts": "%{smart_count} новый пост |||| %{smart_count} новых постов", "new_mentions": "%{smart_count} новое упоминание |||| %{smart_count} новых упоминаний", "new_direct_messages": "%{smart_count} новое личное сообщение |||| %{smart_count} новых личных сообщений", + "new_group_messages": "%{smart_count} новое сообщение в группе |||| %{smart_count} новых групповых сообщений", "nobody": "Анонимно", // used to promote a post without attaching the user "Not available": "Недоступно", "notify_desktop_error": "Твистер не может выполнить уведомление: произошла неизвестная ошибка.", @@ -2351,6 +2487,9 @@ if(preferredLanguage == "de"){ "busted_oh": "Oh nein!", "busted_avowal": "Ich bin ertappt, habe versucht, hier Schadcode einzugeben!", "Cancel": "Abbrechen", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Benutzer wechseln", "Checking...": "Überprüfe...", // checking if username is available "Collapse": "Einklappen", // smaller view of a post @@ -2361,6 +2500,9 @@ if(preferredLanguage == "de"){ "Detailed information": "Detaillierte Informationen", "DHT network down.": "DHT-Netzwerk nicht verfügbar.", "Direct Messages": "Direktnachrichten", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Direktnachrichten mit %{username}", "Disable": "Deaktivieren", "Display mentions to @": "Zeige Erwähnungen von @", //Ist das richtig? Ich weiß nicht, in welchem Zusammenhang das benutzt wird. @@ -2402,6 +2544,16 @@ if(preferredLanguage == "de"){ "Network status": "Netzwerkstatus", "New direct message...": "Neue Direktnachricht...", "New Post...": "Neuer Post...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "Du hast", "in postboard": "in der Timeline", "in search result": "in den Suchergebnissen", @@ -2409,6 +2561,7 @@ if(preferredLanguage == "de"){ "new_posts": "%{smart_count} neuer Post |||| %{smart_count} neue Posts", "new_mentions": "%{smart_count} neue Erwähnung |||| %{smart_count} neue Erwähnungen", "new_direct_messages": "%{smart_count} neue Direktnachricht |||| %{smart_count} neue Direktnachrichten", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "nobody", // used to promote a post without attaching the user "Not available": "Nicht verfügbar", // username is not available "notify_desktop_error": "Twister kann keine Desktop-Meldungen anzeigen: ein unbekannter Fehler trat auf.", @@ -2637,6 +2790,9 @@ if(preferredLanguage == "ja"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "キャンセル", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "ユーザーを変更", "Checking...": "チェック...", // checking if username is available "Collapse": "閉じる", // smaller view of a post @@ -2647,6 +2803,9 @@ if(preferredLanguage == "ja"){ "Detailed information": "詳細", "DHT network down.": "DHTネットワークがダウンしています", "Direct Messages": "ダイレクトメッセージ", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Direct messages with %{username}", "Disable": "停止", "Display mentions to @": "メンションを表示する", @@ -2687,6 +2846,16 @@ if(preferredLanguage == "ja"){ "Network status": "ネットワークステータス", "New direct message...": "ダイレクトメッセージ...", "New Post...": "投稿する", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "You got", "in postboard": "in postboard", "in search result": "in search result", @@ -2694,6 +2863,7 @@ if(preferredLanguage == "ja"){ "new_posts": "%{smart_count} 新投稿 |||| %{smart_count} 新投稿", "new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions", "new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "ナナシ", // used to promote a post without attaching the user "Not available": "使用中", // username is not available "notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.", @@ -2919,6 +3089,9 @@ if(preferredLanguage == "pt-BR"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "Cancelar", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Trocar usuário", "Checking...": "Verificando...", // checking if username is available "Collapse": "Recolher", // smaller view of a post @@ -2929,6 +3102,9 @@ if(preferredLanguage == "pt-BR"){ "Detailed information": "Informações detalhadas", "DHT network down.": "Falha na rede DHT", "Direct Messages": "Mensagens Diretas", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Mensagens Diretas com %{username}", "Disable": "Desabilitado", "Display mentions to @": "Exibir menções a @", @@ -2969,6 +3145,16 @@ if(preferredLanguage == "pt-BR"){ "Network status": "Estado da rede", "New direct message...": "Nova mensagem direta...", "New Post...": "Nova Postagem...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "You got", "in postboard": "in postboard", "in search result": "in search result", @@ -2976,6 +3162,7 @@ if(preferredLanguage == "pt-BR"){ "new_posts": "%{smart_count} nova postagem |||| %{smart_count} novas postagens", "new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions", "new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "nobody", // used to promote a post without attaching the user "Not available": "Indisponível", // username is not available "notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.", @@ -3205,6 +3392,9 @@ if(preferredLanguage == "tr"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "İptal", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Kullanıcı değiştir", "Checking...": "Denetleniyor...", // checking if username is available "Collapse": "Kapat", // smaller view of a post @@ -3215,6 +3405,9 @@ if(preferredLanguage == "tr"){ "Detailed information": "Detaylı bilgi", "DHT network down.": "DHT ağı çalışmıyor.", "Direct Messages": "Direk Mesajlar", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "%{username} ile Direk Mesajlar", "Disable": "Kullanılmaz", "Display mentions to @": "@ adının geçtiği gönderiler", @@ -3255,6 +3448,16 @@ if(preferredLanguage == "tr"){ "Network status": "Ağ durumu", "New direct message...": "Yeni direk mesaj...", "New Post...": "Yeni gönderi...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "You got", "in postboard": "in postboard", "in search result": "in search result", @@ -3262,6 +3465,7 @@ if(preferredLanguage == "tr"){ "new_posts": "%{smart_count} yeni gönederi |||| %{smart_count} yeni gönderi", "new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions", "new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "hiçkimse", // used to promote a post without attaching the user "Not available": "Kullanılamaz", // username is not available "notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.", @@ -3488,6 +3692,9 @@ if(preferredLanguage == "cs"){ "busted_oh": "oh noes!", "busted_avowal": "I\'m busted trying inject this suspicious stuff here", "Cancel": "Zrušit", + "Confirm": "Confirm", + "сonfirm_group_leaving_header": "Confirm group leaving", + "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?", "Change user": "Změnit uživatele", "Checking...": "Ověřuji...", // checking if username is available "Collapse": "Složit", // smaller view of a post @@ -3498,6 +3705,9 @@ if(preferredLanguage == "cs"){ "Detailed information": "Podrobné informace", "DHT network down.": "Síť DHT je nedostupná.", "Direct Messages": "Přímé zprávy", + "Group Messages": "Group Messages", + "Group Messages — New Group Creation": "Group Messages — New Group Creation", + "Group Messages — Join Group": "Group Messages — Join Group", "direct_messages_with": "Direct messages with %{username}", "Disable": "Vypnuto", "Display mentions to @": "Zobrazit zmínky o @", @@ -3538,6 +3748,16 @@ if(preferredLanguage == "cs"){ "Network status": "Stav sítě", "New direct message...": "Nová přímá zpráva...", "New Post...": "Nový příspěvek...", + "New group": "New group", + "Group description": "Group description", + "Peers to invite": "Peers to invite", + "Join group": "Join group", + "Select group(s)": "Select group(s)", + "Create": "Create", + "Join": "Join", + "Invite": "Invite", + "Invite peers": "Invite peers", + "Leave group": "Leave group", "You got": "Máte", "in postboard": "na nástěnce", "in search result": "ve výsledcích hledání", @@ -3545,6 +3765,7 @@ if(preferredLanguage == "cs"){ "new_posts": "%{smart_count} nový příspěvek |||| %{smart_count} nové příspěvky |||| %{smart_count} nových příspěvků", "new_mentions": "%{smart_count} novou zmínku |||| %{smart_count} nové zmínky |||| %{smart_count} nových zmínek", "new_direct_messages": "%{smart_count} novou přímou zprávu |||| %{smart_count} nové přímé zprávy |||| %{smart_count} nových přímých zpráv", + "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages", "nobody": "nikdo", // used to promote a post without attaching the user "Not available": "Tuto přezdívku již někdo používá", // username is not available "notify_desktop_error": "Twisteru se nepodařilo zobrazit upozornění na ploše: došlo k neznámé chybě.", diff --git a/js/mobile_abstract.js b/js/mobile_abstract.js index 00b7bb7..2d0673d 100644 --- a/js/mobile_abstract.js +++ b/js/mobile_abstract.js @@ -142,11 +142,14 @@ var MAL = function() // how do we map usernames into urls this.userUrl = function(username) { - if( $.hasOwnProperty("mobile") ) { - return "#profile?user=" + username; - } else { - return "#profile?user=" + username; - } + //if( $.hasOwnProperty("mobile") ) { + // return "#profile?user=" + username; + //} else { + if (username[0] === '*') + return "#profile?group=" + username; + else + return "#profile?user=" + username; + //} } // recover username from url (only for hash) @@ -184,13 +187,13 @@ var MAL = function() } } - this.dmchatUrl = function(username) { - if( $.hasOwnProperty("mobile") ) { - return "#dmchat?user=" + username; + this.dmchatUrl = function (alias) { + if ($.hasOwnProperty('mobile')) { + return '#dmchat?user=' + alias; } else { - return "#directmessages?user=" + username; + return '#directmessages?' + (alias[0] === '*' ? 'group' : 'user') + '=' + alias; } - } + }; this.followingUrl = function(username) { if( $.hasOwnProperty("mobile") ) { @@ -275,6 +278,18 @@ var MAL = function() } } + this.updateNewGroupDMsUI = function(newDMs) { + if( $.hasOwnProperty('mobile') ) { + } else { + var DMsCounter = $('.userMenu-groupmessages .messages-qtd'); + if (newDMs) { + DMsCounter.text(newDMs).fadeIn(); + } else { + DMsCounter.hide(); + } + } + } + this.updateMyOwnPostCount = function(numPosts) { if( $.hasOwnProperty("mobile") ) { console.log("FIXME: implement MAL_updateMyOwnPostCount"); @@ -327,29 +342,29 @@ var MAL = function() } } - this.showDMchat = function(username) { - if (username) { - if( $.hasOwnProperty("mobile") ) { - $.mobile.navigate( this.dmchatUrl(username) ); + this.showDMchat = function(req) { + if (req.alias) { + if ($.hasOwnProperty('mobile')) { + $.mobile.navigate(this.dmchatUrl(req.alias)); } else { - if ($(".postboard").length) { - window.location.hash = this.dmchatUrl(username); + if ($('.postboard').length) { + window.location.hash = this.dmchatUrl(req.alias); } else { - window.location.href = 'home.html'+this.dmchatUrl(username); + window.location.href = 'home.html'+this.dmchatUrl(req.alias); } } } else { - if( $.hasOwnProperty("mobile") ) { - $.mobile.navigate( '#directmsg' ); + if ($.hasOwnProperty('mobile')) { + $.mobile.navigate('#' + (req.group ? '' : 'directmsg')); // FIXME add group messages to tmobile } else { - if ($(".postboard").length) { - window.location.hash = '#directmessages'; + if ($('.postboard').length) { + window.location.hash = '#' + (req.group ? 'groupmessages' : 'directmessages'); } else { - window.location.href = 'home.html#directmessages'; + window.location.href = 'home.html#' + (req.group ? 'groupmessages' : 'directmessages'); } } } - } + }; this.setNetworkStatusMsg = function(msg, statusGood) { if( $.hasOwnProperty("mobile") ) { diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js index 8748bf5..abe346e 100644 --- a/js/twister_directmsg.js +++ b/js/twister_directmsg.js @@ -3,7 +3,9 @@ // // Handle direct messages modal -function requestDMsnippetList(dmThreadList) { +var _groupMsgInviteToGroupQueue = []; + +function requestDMsnippetList(dmThreadList, forGroup) { var followList = []; for (var i = 0; i < followingUsers.length; i++) followList.push({username:followingUsers[i]}); @@ -11,15 +13,19 @@ function requestDMsnippetList(dmThreadList) { followList.push({username:groupChatAliases[i]}); twisterRpc('getdirectmsgs', [defaultScreenName, 1, followList], - function(req, ret) {processDMsnippet(ret, dmThreadList);}, dmThreadList, + function(req, ret) {processDMsnippet(ret, req.dmThreadList, req.forGroup);}, + {dmThreadList: dmThreadList, forGroup: forGroup}, function(req, ret) {console.log('ajax error:' + ret);}, null ); } -function processDMsnippet(dmUsers, dmThreadList) { +function processDMsnippet(dmUsers, dmThreadList, forGroup) { dmThreadList.empty(); for (var u in dmUsers) { + if ((forGroup && u[0] !== '*') || (!forGroup && u[0] === '*')) + continue; + // convert snipped to html and add it to date-sorted list var dmItem = dmDataToSnippetItem(dmUsers[u][0], u); var timeDmItem = parseInt(dmItem.attr('data-time')); @@ -96,7 +102,7 @@ function directMsgSubmit(e) { replyText.siblings('#post-preview').hide(); - newDirectMsg(replyText.val(), $('.directMessages').attr('data-dm-screen-name')); + newDirectMsg(replyText.val(), $('.directMessages').attr('data-screen-name')); replyText.val(''); } @@ -137,7 +143,7 @@ function directMessagesPopup() { return; } - modal = openModal({ + var modal = openModal({ classAdd: 'directMessages', content: $('.direct-messages-template').children().clone(true), title: polyglot.t('Direct Messages') @@ -150,7 +156,8 @@ function directMessagesPopup() { .attr('title', polyglot.t('Mark all as read')) .on('click', function() { for (var user in _newDMsPerUser) { - _newDMsPerUser[user] = 0; + if (!user[0] === '*') + _newDMsPerUser[user] = 0; } saveDMsToStorage(); $.MAL.updateNewDMsUI(getNewDMsCount()); @@ -164,13 +171,13 @@ function openDmWithUserModal(dm_screenname) { return; } - modal = openModal({ + var modal = openModal({ classAdd: 'directMessages', content: $('.messages-thread-template').children().clone(true), title: polyglot.t('direct_messages_with', {username: '' + dm_screenname + ''}) }); - modal.self.attr('data-dm-screen-name', dm_screenname); + modal.self.attr('data-screen-name', dm_screenname); if (dm_screenname.length && dm_screenname[0] === '*') getGroupChatName(dm_screenname, modal.self.find('.modal-header h3 span')); @@ -183,12 +190,233 @@ function openDmWithUserModal(dm_screenname) { .addClass('open').appendTo(modal.content).fadeIn('fast'); } +function openGroupMessagesModal(groupAlias) { + if (!defaultScreenName) { + alert(polyglot.t('You have to log in to use group messages.')); + return; + } + + if (typeof groupAlias === 'undefined') { + var modal = openModal({ + classAdd: 'directMessages groupMessages', + content: $('.direct-messages-template').children().clone(true), + title: polyglot.t('Group Messages') + }); + + modal.content.prepend($('#group-messages-profile-modal-control-template').children().clone(true)); + + requestDMsnippetList(modal.content.find('.direct-messages-list'), true); + + modal.self.find('.mark-all-as-read') + .css('display', 'inline') + .attr('title', polyglot.t('Mark all as read')) + .on('click', function() { + for (var user in _newDMsPerUser) { + if (user[0] === '*') + _newDMsPerUser[user] = 0; + } + saveDMsToStorage(); + $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount()); + }) + ; + } else { + var modal = openModal({ + classAdd: 'directMessages groupMessages', + title: polyglot.t('direct_messages_with', {username: '' + groupAlias + ''}) + }); + + modal.self.attr('data-screen-name', groupAlias); + + getGroupChatName(groupAlias, modal.self.find('.modal-header h3 span')); + + groupMsgGetGroupInfo(groupAlias, + function(req, ret) { + if (ret && ret.members.indexOf(defaultScreenName) !== -1) { + req.modal.content.append($('.messages-thread-template').children().clone(true)); + requestDmConversationModal(req.modal.content.find('.direct-messages-thread'), req.groupAlias); + + var control = $('#group-messages-messages-modal-control-template').children().clone(true) + .appendTo(req.modal.content); + control.find('.profile').on('click', {groupAlias: req.groupAlias}, + function (event) {window.location.href = $.MAL.userUrl(event.data.groupAlias);} + ); + + $('.dm-form-template').children().clone(true) + .addClass('open').appendTo(req.modal.content).fadeIn('fast'); + } + }, {groupAlias: groupAlias, modal: modal} + ); + } +} + +function openGroupMessagesNewGroupModal() { + if (!defaultScreenName) { + alert(polyglot.t('You have to log in to use group messages.')); + return; + } + + var modal = openModal({ + classAdd: 'group-messages-new-group', + content: $('#group-messages-new-group-template').children().clone(true), + title: polyglot.t('Group Messages — New Group Creation') + }); + + modal.content.find('.description').on('input', + {parentSelector: '.module', enterSelector: '.create'}, inputEnterActivator); + modal.content.find('.create').on('click', function (event) { + var elemEvent = $(event.target); + var elemForm = elemEvent.parents('.module') + + var peersToInvite = elemForm.find('.invite').val().toLowerCase().match(/@\w+/g); + if (peersToInvite) + peersToInvite = peersToInvite.join('').slice(1).split('@'); + + groupMsgCreateGroup(elemForm.find('.description').val(), peersToInvite); + + closeModal(); + }); +} + +function openGroupMessagesJoinGroupModal() { + if (!defaultScreenName) { + alert(polyglot.t('You have to log in to use group messages.')); + return; + } + + var modal = openModal({ + classAdd: 'group-messages-join-group', + content: $('#group-messages-join-group-template').children().clone(true), + title: polyglot.t('Group Messages — Join Group') + }); + + var elemGroupsList = modal.content.find('.groups-list'); + var elemGroupTemplate = $('#groups-list-item-template').children(); + groupMsgGetGroupsForPeer(defaultScreenName, + function(req, ret) { + if (ret) { + for (var i = 0; i < groupChatAliases.length; i++) { + if (ret.indexOf(groupChatAliases[i]) === -1) { + var item = req.elemGroupTemplate.clone(true).appendTo(req.elemGroupsList); + + item.find('input') + .attr('data-screen-name', groupChatAliases[i]) + .on('click', function (event) { + var elemEvent = $(event.target); + elemEvent.parents('.module').find('.join') + .attr('disabled', + !elemEvent.parents('.groups-list').find('input:checked').length); + }) + ; + item.find('.twister-user-name') + .text(groupChatAliases[i]) + .attr('href', $.MAL.userUrl(groupChatAliases[i])) + ; + getGroupChatName(groupChatAliases[i], item.find('.description')); // FIXME + } + } + } + }, {elemGroupsList: elemGroupsList, elemGroupTemplate: elemGroupTemplate} + ); + + modal.content.find('.join').on('click', function (event) { + var elemEvent = $(event.target); + var groups = elemEvent.parents('.module').find('.groups-list input:checked'); + for (var i = 0; i < groups.length; i++) + groupMsgInviteToGroup(groups[i].getAttribute('data-screen-name'), [defaultScreenName]); + + closeModal(); + }); + + modal.content.find('.secret-key-import, .username-import').on('input', importSecretKeypress); + + modal.content.find('.import-secret-key').on('click', function (event) { + var elemModule = $(event.target).parents('.module'); + var groupAlias = elemModule.find('.username-import').val().toLowerCase(); + var secretKey = elemModule.find('.secret-key-import').val(); + + twisterRpc('importprivkey', [secretKey, groupAlias], + function(req, ret) { + groupMsgInviteToGroup(req.groupAlias, [defaultScreenName]); + closeModal(); + }, {groupAlias: groupAlias}, + function(req, ret) { + alert(polyglot.t('Error in \'importprivkey\'', {rpc: ret.message})); + }, null + ); + }); +} + +function groupMsgCreateGroup(description, peersToInvite) { + if (!peersToInvite) + peersToInvite = []; + + twisterRpc('creategroup', [description], + function(peersToInvite, ret) { + groupMsgInviteToGroup(ret, peersToInvite.push(defaultScreenName)); + }, peersToInvite, + function(req, ret) { + alert(polyglot.t('error', {error: 'can\'t create group — ' + ret.message})); + }, null + ); +} + +function groupMsgInviteToGroup(groupAlias, peersToInvite) { + _groupMsgInviteToGroupQueue.push({groupAlias: groupAlias, peersToInvite: peersToInvite}); + + if (_groupMsgInviteToGroupQueue.length === 1) + doGroupMsgInviteToGroup(); +} + +function doGroupMsgInviteToGroup() { + twisterRpc('newgroupinvite', + [defaultScreenName, lastPostId + 1, + _groupMsgInviteToGroupQueue[0].groupAlias, _groupMsgInviteToGroupQueue[0].peersToInvite], + function(req, ret) { + incLastPostId(); + _groupMsgInviteToGroupQueue.shift(); + if (_groupMsgInviteToGroupQueue.length) + setTimeout(doGroupMsgInviteToGroup, 200); + }, null, + function(req, ret) { + alert(polyglot.t('error', + {error: 'can\'t invite ' + req[1] + ' to ' + req[0] + ' group — ' + ret.message})); + _groupMsgInviteToGroupQueue.shift(); + if (_groupMsgInviteToGroupQueue.length) + setTimeout(doGroupMsgInviteToGroup, 200); + }, [_groupMsgInviteToGroupQueue[0].groupAlias, _groupMsgInviteToGroupQueue[0].peersToInvite] + ); +} + +function groupMsgLeaveGroup(groupAlias, cbFunc, cbArgs) { + twisterRpc('leavegroup', [defaultScreenName, groupAlias], + cbFunc, cbArgs, + function(req, ret) {alert(polyglot.t('error', {error: 'can\'t leave group — ' + ret.message}));}, null + ); +} + +function groupMsgGetGroupsForPeer(peer, cbFunc, cbArgs) { + twisterRpc('listgroups', [peer], + cbFunc, cbArgs, + function(req, ret) {alert(polyglot.t('error', {error: 'can\'t list groups — ' + ret.message}));}, null + ); +} + +function groupMsgGetGroupInfo(groupAlias, cbFunc, cbArgs) { + twisterRpc('getgroupinfo', [groupAlias], + cbFunc, cbArgs, + function(req, ret) {alert(polyglot.t('error', {error: 'can\'t get group info — ' + ret.message}));}, null + ); +} + function initInterfaceDirectMsg() { - $('.direct-messages').attr('href','#directmessages'); - $('.userMenu-messages a').attr('href','#directmessages'); + $('.direct-messages').attr('href', '#directmessages'); + $('.userMenu-messages a').attr('href', '#directmessages'); + $('.groupmessages').attr('href', '#groupmessages'); + $('.userMenu-groupmessages a').attr('href', '#groupmessages'); $('#dm-snippet-template').on('click', function() { - window.location.hash = '#directmessages?user=' + $(this).attr('data-dm-screen-name'); + var alias = $(this).attr('data-screen-name'); + window.location.hash = '#directmessages?' + (alias[0] === '*' ? 'group' : 'user') + '=' + alias; }); $('.dm-submit').on('click', directMsgSubmit); @@ -196,5 +424,63 @@ function initInterfaceDirectMsg() { window.location.hash = '#directmessages?user=' + $(this).closest('[data-screen-name]').attr('data-screen-name'); }); -} + $('.group-messages-control .invite').on('click', function (event) { + $(event.target).siblings('.invite-form').toggle(); + }); + + $('.group-messages-control .invite-form input').on('input', + {parentSelector: '.invite-form', enterSelector: 'button'}, inputEnterActivator); + + $('.group-messages-control .invite-form button').on('click', function (event) { + var elemEvent = $(event.target); + var elemInput = elemEvent.siblings('input'); + var peersToInvite = elemInput.val().toLowerCase().match(/@\w+/g); + if (peersToInvite) + peersToInvite = peersToInvite.join('').slice(1).split('@'); + + groupMsgInviteToGroup(elemEvent.closest('[data-screen-name]').attr('data-screen-name'), + peersToInvite); + + elemInput.val(''); + elemEvent.parents('.invite-form').toggle(); + + // TODO reload group members list + }); + + $('.group-messages-control .join').on('click', function () { + window.location.hash = '#groupmessages+joingroup'; + }); + + $('.group-messages-control .leave').on('click', function (event) { + var elemEvent = $(event.target); + var groupAlias = elemEvent.closest('[data-screen-name]').attr('data-screen-name'); + confirmPopup(event, { + titleTxt: polyglot.t('сonfirm_group_leaving_header'), + messageTxt: polyglot.t('сonfirm_group_leaving_body', {alias: groupAlias}), + confirmFunc: function (groupAlias) { + groupMsgLeaveGroup(groupAlias, function () {history.back();}); + }, + confirmFuncArgs: groupAlias + }); + }); + + $('.group-messages-control .new').on('click', function () { + window.location.hash = '#groupmessages+newgroup'; + }); + + $('.group-messages-control .secret-key').on('click', promptCopyAttrData); + + $('.group-messages-control .show-secret-key').on('click', function (event) { + var elemEvent = $(event.target); + var elemSecretKey = elemEvent.siblings('.secret-key') + .toggle(); + if (elemSecretKey.css('display') !== 'none') { + dumpPrivkey(elemEvent.closest('[data-screen-name]').attr('data-screen-name'), + function(req, ret) {req.text(ret).attr('data', ret);}, + elemSecretKey + ); + } else + elemSecretKey.text('').attr('data', ''); + }); +} diff --git a/js/twister_following.js b/js/twister_following.js index 46c5b90..6df7f0f 100644 --- a/js/twister_following.js +++ b/js/twister_following.js @@ -710,7 +710,7 @@ function initUserSearch() { $('.following-config-method-buttons .public-following') .on('click', function(e) { setFollowingMethod(e); - closeModalHandler('.prompt-wrapper'); + closePrompt(); window.setTimeout(loadModalFromHash, 500); // delay reload so dhtput may do it's job }) ; diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index c7f65c4..d113266 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -257,7 +257,7 @@ function setPostInfoSent(n, k, item) { function dmDataToSnippetItem(dmData, remoteUser) { var dmItem = $("#dm-snippet-template").clone(true); dmItem.removeAttr('id'); - dmItem.attr("data-dm-screen-name",remoteUser); + dmItem.attr('data-screen-name', remoteUser); dmItem.attr("data-last_id", dmData.id); dmItem.attr("data-time", dmData.time); diff --git a/js/twister_newmsgs.js b/js/twister_newmsgs.js index 27b3cf6..38214c9 100644 --- a/js/twister_newmsgs.js +++ b/js/twister_newmsgs.js @@ -117,8 +117,25 @@ function requestMentionsCount() { if (newDMs) { $.MAL.soundNotifyDM(); - if ($.Options.showDesktopNotifDMs.val === 'enable') - $.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_direct_messages', newDMs)+'.', false, 'twister_notification_new_DMs', $.Options.showDesktopNotifDMsTimer.val, function(){$.MAL.showDMchat()}, false) + if ($.Options.showDesktopNotifDMs.val === 'enable') { + $.MAL.showDesktopNotif(false, + polyglot.t('You got') + ' ' + polyglot.t('new_direct_messages', newDMs) + '.', + false, 'twister_notification_new_DMs', $.Options.showDesktopNotifDMsTimer.val, + function () {$.MAL.showDMchat();}, false + ); + } + } + var newDMs = getNewGroupDMsCount(); + if (newDMs) { + $.MAL.soundNotifyDM(); + + if ($.Options.showDesktopNotifDMs.val === 'enable') { + $.MAL.showDesktopNotif(false, + polyglot.t('You got') + ' ' + polyglot.t('new_group_messages', newDMs) + '.', + false, 'twister_notification_new_DMs', $.Options.showDesktopNotifDMsTimer.val, + function () {$.MAL.showDMchat({group: true});}, false + ); + } } } } @@ -197,6 +214,7 @@ function requestDMsCount() { if (_newDMsUpdated) { saveDMsToStorage(); $.MAL.updateNewDMsUI(getNewDMsCount()); + $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount()); } }, null, function(req, ret) {console.warn('ajax error:' + ret);}, null @@ -207,7 +225,18 @@ function getNewDMsCount() { var newDMs = 0; for (var user in _newDMsPerUser) { - if (_newDMsPerUser[user]) + if (!user[0] === '*' && _newDMsPerUser[user]) + newDMs += _newDMsPerUser[user]; + } + + return newDMs; +} + +function getNewGroupDMsCount() { + var newDMs = 0; + + for (var user in _newDMsPerUser) { + if (user[0] === '*' && _newDMsPerUser[user]) newDMs += _newDMsPerUser[user]; } @@ -220,6 +249,7 @@ function resetNewDMsCountForUser(user, lastId) { saveDMsToStorage(); $.MAL.updateNewDMsUI(getNewDMsCount()); + $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount()); } function updateGroupList() { @@ -232,6 +262,7 @@ function updateGroupList() { function initDMsCount() { loadDMsFromStorage(); $.MAL.updateNewDMsUI(getNewDMsCount()); + $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount()); //quick hack to obtain list of group chat aliases updateGroupList(); setInterval(updateGroupList, 60000); diff --git a/theme_calm/css/profile.css b/theme_calm/css/profile.css index 929edc9..96aed93 100644 --- a/theme_calm/css/profile.css +++ b/theme_calm/css/profile.css @@ -62,36 +62,16 @@ color: #f8f8f8; } -.profile-card-buttons -{ +.profile-card-buttons { + padding: 4px 0; +} + +.twister-user-info .profile-card-buttons { position: absolute; - bottom: 30px; + top: 0; right: 0; } -.profile-card-buttons .direct-messages-with-user, -.profile-card-buttons .mentions-from-user, -.profile-card-buttons .follow, -.profile-card-buttons .unfollow -{ - display: inline; - padding: 4px 12px; - font-size: 12px; - width: auto; - text-align: center; - color: rgba( 0, 0, 0, .7 ); - background: rgba( 0, 0, 0, .1 ); - border: none; - transition: all .2s linear; -} - -.profile-card-buttons .direct-messages-with-user:hover, -.profile-card-buttons .mentions-from-user:hover -{ - color: #fff; - background: #b2d67b; -} - .profile-card.forEdition { margin: 0 auto; @@ -397,3 +377,32 @@ h2.profile-screen-name { .profile-modal a.profile-bio:empty { display: none; } + +.group-messages-control .invite-form, .group-messages-control .secret-key { + display: none; + font-size: 12px; + text-align: center; + padding: 4px 0; +} + +.group-messages-control .invite-form input { + border: solid 1px rgba(0, 0, 0, .3); + vertical-align: middle; + width: 73%; + margin: 0 4px; +} + +.group-messages-control .invite-form input:focus { + border: solid 1px rgba(118, 145, 206, .8); +} + +.group-messages-control .invite-form button { + color: #DDD; + background-color: #45474D; + border: medium none; + vertical-align: middle; +} + +.group-messages-control .invite-form button:hover { + color: #FFF; +} diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index 67791ca..fe7191e 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -107,28 +107,24 @@ h3 ************** BUTTONS *************** **************************************/ -button -{ +button { + color: rgba(255, 255, 255, .8); background: #45474d; - color: rgba( 255, 255, 255, .8 ); border: none; padding: 5px 10px; cursor: pointer; } -button:hover -{ +button:hover { color: #fff; } -button.disabled -{ +button:disabled, button.disabled { opacity: .4; } -button.disabled:hover -{ - color: rgba( 255, 255, 255, .8 ); +button:disabled:hover, button.disabled:hover { + color: rgba(255, 255, 255, .8); } button.follow, button.unfollow, .following-list button.private { @@ -172,11 +168,32 @@ button.unfollow:hover { margin-right: 10px; } +.b-buttons { + text-align: right; + padding: 4px; +} + +.b-buttons button { + color: rgba(0, 0, 0, .7); + background-color: rgba(0, 0, 0, .08); + border: none; + font-size: 12px; + text-align: center; + width: auto; + padding: 4px 12px; + transition: all .1s linear; +} + +.b-buttons button:hover { + color: #FFF; + background: #B2D67B; +} + /************************************* -**************************** MENU ***** +**************** MENU **************** **************************************/ -.userMenu -{ + +.userMenu { width: 900px; position: fixed; left: 50%; @@ -185,11 +202,13 @@ button.unfollow:hover { background: #43464d; z-index: 2; } + .userMenu.w1200 { width: 1200px; margin-left: -600px; } -.userMenu:after{ + +.userMenu:after { position: absolute; content: ''; width: 9999px; @@ -197,7 +216,8 @@ button.unfollow:hover { background: #43464d; z-index: -999; } -.userMenu:before{ + +.userMenu:before { position: absolute; content: ''; width: 9999px; @@ -206,16 +226,14 @@ button.unfollow:hover { background: #43464d; z-index: -999; } -.userMenu > ul -{ -} -.userMenu > ul > li -{ + +.userMenu > ul > li { float: left; + height: 40px; margin: 0; } -.userMenu > ul > li > a -{ + +.userMenu > ul > li > a { line-height: 40px; height: 40px; padding: 0 20px 0 45px; @@ -227,119 +245,87 @@ button.unfollow:hover { transition: all .2s linear; position: relative; } -.userMenu li > a:hover -{ + +.userMenu li:hover, .userMenu li:active { + background-color: rgba(0, 0, 0 , .4); +} + +.userMenu li:hover > a, .userMenu li:active > a { text-decoration: none; opacity: 1; } -.userMenu li.current > a -{ + +.userMenu li.current { + background-color: #768FCE; +} + +.userMenu li.current > a { color: #fff; opacity: 1; } -.userMenu li.userMenu-home > a -{ + +.userMenu li.userMenu-home > a { background: url(../img/home.png) no-repeat center center; padding-left: 40px; } -.userMenu li.userMenu-home:hover > a -{ - background: url(../img/home.png) no-repeat center center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-home.current > a -{ - background: url(../img/home.png) no-repeat center center #768fce; -} -.userMenu li.userMenu-connections > a -{ + +.userMenu li.userMenu-connections > a { background: url(../img/connections.png) no-repeat center center; opacity: 1; } -.userMenu li.userMenu-connections:hover > a -{ - background: url(../img/connections.png) no-repeat center center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-connections.current > a -{ - background: url(../img/connections.png) no-repeat 5px center #b43e34; -} -.userMenu li.userMenu-network > a -{ + +.userMenu li.userMenu-network > a { background: url(../img/network.png) no-repeat 5px center; padding-left: 60px; } -.userMenu li.userMenu-network:hover > a -{ - background: url(../img/network.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-network.current > a -{ - background: url(../img/network.png) no-repeat 5px center #768fce; -} -.userMenu li.userMenu-following > a -{ +.userMenu li.userMenu-following > a { background: url(../img/following.png) no-repeat 5px center; padding-left: 50px; } -.userMenu li.userMenu-following:hover > a -{ - background: url(../img/following.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-following.current > a -{ - background: url(../img/following.png) no-repeat 5px center #768fce; -} -.userMenu li.userMenu-options > a -{ + +.userMenu li.userMenu-options > a { background: url(../img/switch.png) no-repeat 5px center; padding-left: 50px; } -.userMenu li.userMenu-options:hover > a -{ - background: url(../img/switch.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-options.current > a -{ - background: url(../img/switch.png) no-repeat 5px center #768fce; -} -.userMenu li.userMenu-messages > a -{ + +.userMenu li.userMenu-messages > a { background: url(../img/messages.png) no-repeat center center; padding: 0 25px 0 35px; opacity: 1; } -.userMenu li.userMenu-messages:hover > a -{ - background: url(../img/messages.png) no-repeat center center rgba( 0, 0, 0 , .4 ); + +.userMenu li.userMenu-messages > a:empty { + padding: 0 20px 0 30px; + opacity: .7; } -.userMenu li.userMenu-messages.current > a -{ - background: url(../img/messages.png) no-repeat center center #b43e34; + +.userMenu li.userMenu-groupmessages > a { + background: url(../img/groupmessages.png) no-repeat center center; + background-size: 22px 22px; + padding: 0 24px; + opacity: 0.9; } -.userMenu li.userMenu-profile > a -{ + +.userMenu li.userMenu-profile > a { background: url(../img/profile.png) no-repeat 5px center; padding-left: 35px; } -.userMenu li.userMenu-profile:hover > a -{ - background: url(../img/profile.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} -.userMenu li.userMenu-profile.current > a -{ - background: url(../img/profile.png) no-repeat 5px center #768fce; -} -.userMenu li.userMenu-config -{ + +.userMenu li.userMenu-config { float: right; position: relative; } -.userMenu li.userMenu-search -{ + +.userMenu li.userMenu-search { float: right; position: relative; } + +.userMenu li.userMenu-search:hover { + background-color: transparent; +} + input.userMenu-search-field::-webkit-input-placeholder { color: #4d4d4d; font-style: italic; @@ -368,24 +354,20 @@ input.userMenu-search-field:focus::-moz-placeholder { input.userMenu-search-field:focus::-ms-input-placeholder { color: #fff; } -.userMenu li.userMenu-config > a -{ + +.userMenu li.userMenu-config > a { background: url(../img/config.png) no-repeat 5px center; padding: 0 30px 0 45px; } -.userMenu li.userMenu-config > a:after -{ + +.userMenu li.userMenu-config > a:after { content: "▼"; position: absolute; font-size: 10px; transition: all .2 linear; margin-left: 8px; } -.userMenu li.userMenu-config:hover > a, -.userMenu li.userMenu-config:active > a -{ - background: url(../img/config.png) no-repeat 5px center rgba( 0, 0, 0 , .4 ); -} + .userMenu li.userMenu-dhtindicator { background: #000; width: 70px; @@ -402,6 +384,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder { transition: all 200ms; border-radius: 10px; } + .userMenu li.userMenu-dhtindicator a { display: inline-block; font: 12px/25px "Open Sans", sans-serif; @@ -410,6 +393,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder { height: 25px; opacity: .9; } + .userMenu li.userMenu-dhtindicator a:before { content: 'DHT:'; display: inline-block; @@ -418,19 +402,15 @@ input.userMenu-search-field:focus::-ms-input-placeholder { width: 70px; height: 25px; } + .userMenu li.userMenu-dhtindicator:hover { opacity: 1; -webkit-box-shadow: inset 0 0 15px #000; -moz-box-shadow: inset 0 0 15px #000; box-shadow: inset 0 0 15px #000; } -.userMenu li.userMenu-messages > a:empty -{ - padding: 0 20px 0 30px; - opacity: .7; -} -.wrapper -{ + +.wrapper { width: 900px; margin: 0 auto; background: #e0e6f5; @@ -439,15 +419,18 @@ input.userMenu-search-field:focus::-ms-input-placeholder { z-index: 1; min-height: 100%; } + .wrapper.w1200 { width: 1200px; padding: 55px 7px 15px 7px; } + .dashboard.left { width: 320px; position: fixed; top: 55px; } + .dashboard.right { width: 320px; position: fixed; @@ -455,18 +438,18 @@ input.userMenu-search-field:focus::-ms-input-placeholder { margin-left: 864px; } -.module -{ +.module { border: solid 1px rgba( 69, 71, 77, .1 ); background: #f3f5fb; } + .dashboard .module { margin: 0 0 3%; border-radius: 6px; } -.messages-qtd -{ + +.messages-qtd { position: absolute; background: #ef0807; color: #fff; @@ -475,10 +458,11 @@ input.userMenu-search-field:focus::-ms-input-placeholder { font-size: 8px; margin-top: 4px; } -.userMenu-connections .messages-qtd -{ + +.userMenu-connections .messages-qtd { margin: 4px 0 0 -5px; } + /******************************************************* ****************** CONFIG SUBMENU & SEARCH RESULTS ***** *******************************************************/ @@ -1962,6 +1946,100 @@ textarea.splited-post { content: '\2714'; } +/************************************* +****** GM NEW GROUP SETUP MODAL ****** +**************************************/ + +.group-messages-new-group.modal-wrapper { + height: auto; /*about 320px*/ + margin-top: -160px; +} + +.group-messages-new-group .modal-content .module { + margin: 4px; +} + +.group-messages-new-group .modal-content div div { + width: 100%; + margin: 4px 0; + padding: 4px 12px; +} + +.group-messages-new-group .modal-content div div:last-child { + text-align: right; +} + +.group-messages-new-group .modal-content div div:last-child button { + margin: 8px 4px; +} + +.group-messages-new-group .modal-content textarea { + border: solid 1px rgba(0, 0, 0, .3); + border-radius: 3px; + width: 500px; + height: 56px; + resize: none; + margin: 12px 16px; + padding: 2px 4px; +} + +.group-messages-new-group .modal-content textarea:focus { + border: solid 1px rgba(118, 145, 206, .8); + box-shadow: 0 0 10px rgba(0, 0, 0, .3); +} + +/************************************* +****** GM JOIN GROUP SETUP MODAL ***** +**************************************/ + +.group-messages-join-group.modal-wrapper { + height: auto; /*about 360px*/ + margin-top: -240px; +} + +.group-messages-join-group .modal-content .module { + margin: 4px; +} + +.group-messages-join-group .modal-content div div { + width: 100%; + margin: 4px 0; + padding: 4px 12px; +} + +.group-messages-join-group .modal-content div div:last-child { + text-align: right; +} + +.group-messages-join-group .modal-content div div:last-child button { + margin: 8px 4px; +} + +.group-messages-join-group .modal-content input { + border: solid 1px rgba(0, 0, 0, .3); + border-radius: 3px; + width: 500px; + margin: 12px 16px; + padding: 2px 4px; +} + +.group-messages-join-group .modal-content input:focus { + border: solid 1px rgba(118, 145, 206, .8); + box-shadow: 0 0 10px rgba(0, 0, 0, .3); +} + +.group-messages-join-group .modal-content input[type='checkbox'] { + display: inline; + width: auto; + margin: 2px; +} + +.group-messages-join-group .modal-content .groups-list { + height: 120px; + overflow-y: auto; + margin: 8px 8px 0; +} + /************************************* *********** NEW USER MODAL *********** **************************************/ @@ -2087,6 +2165,7 @@ textarea.splited-post { .prompt-wrapper { background: rgba(255,255,255, 1.0); + font-size: 13px; z-index: 5; position: fixed; top: 50%; @@ -2107,6 +2186,20 @@ textarea.splited-post { margin: 4px; } +/************************************* +*********** CONFIRM POPUP ************ +**************************************/ + +.confirm-popup .message { + text-align: center; + margin: 12px; +} + +.confirm-popup .modal-buttons { + text-align: center; + padding: 4px; +} + /************************************* ****** FOLLOWING-CONFIG PROMPT ******* **************************************/ diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index 6aba4c4..447a746 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -56,7 +56,7 @@ font-style: normal; } /* line 64, ../sass/_fonts.sass */ -[class^="icon-"]:before, [class*=" icon-"]:before, .extend-icon:before, .userMenu li.userMenu-config > a:before, .post-retransmited-icon:before, .post-reply:before, .post-propagate:before, .post-favorite:before, .post .show-more:before, .mini-profile-actions span:before, ul.userMenu-search-profiles button:before, .mini-profile-indicators .userMenu-connections a:before, .mini-profile-indicators .userMenu-messages a:before, .mini-profile-indicators .userMenu-user a:before, .twister-user-remove:before, .refresh-toptrends:before, .twistday-reminder .refresh:before, .refresh-users:before, .modal-close:before, .mark-all-as-read:before, .modal-back:before, .icon-down-after:after { +[class^="icon-"]:before, [class*=" icon-"]:before, .extend-icon:before, .userMenu li.userMenu-config > a:before, .post-retransmited-icon:before, .post-reply:before, .post-propagate:before, .post-favorite:before, .post .show-more:before, .mini-profile-actions span:before, ul.userMenu-search-profiles button:before, .mini-profile-indicators .userMenu-connections a:before, .mini-profile-indicators .userMenu-messages a:before, .twister-user-remove:before, .refresh-toptrends:before, .twistday-reminder .refresh:before, .refresh-users:before, .modal-close:before, .mark-all-as-read:before, .modal-back:before, .icon-down-after:after { font-family: "fontello"; font-style: normal; font-weight: normal; @@ -95,12 +95,6 @@ content: ""; } -/* '' */ -/* line 100, ../sass/_fonts.sass */ -.icon-user:before, .mini-profile-indicators .userMenu-user a:before { - content: ""; -} - /* '' */ /* line 105, ../sass/_fonts.sass */ .icon-camera:before { @@ -365,7 +359,8 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, display: block; } /* line 65, ../sass/_menu.sass */ -.userMenu li.userMenu-dhtindicator, .userMenu li.userMenu-connections, .userMenu li.userMenu-messages { +.userMenu li.userMenu-dhtindicator, .userMenu li.userMenu-connections, +.userMenu li.userMenu-messages, .userMenu li.userMenu-groupmessages { display: none !important; } /* line 68, ../sass/_menu.sass */ @@ -438,7 +433,7 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, padding: 0; } /* line 54, ../sass/_profile.sass */ -.profile-modal .modal-content .postboard { +.profile-modal .modal-content .postboard, .profile-modal .modal-content .members { margin-left: 0; height: 100%; bottom: 0; @@ -1703,12 +1698,12 @@ button:hover, .mini-profile-actions span:hover, a.button:hover { text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1); } /* line 85, ../sass/_commons.sass */ -button.disabled, .mini-profile-actions span.disabled, a.button.disabled { +button:disabled, button.disabled, .mini-profile-actions span.disabled, a.button.disabled { opacity: 0.5; background-color: #999; } /* line 88, ../sass/_commons.sass */ -button.disabled:hover, .mini-profile-actions span.disabled:hover, a.button.disabled:hover { +button:disabled:hover, button.disabled:hover, .mini-profile-actions span.disabled:hover, a.button.disabled:hover { color: white; } @@ -1981,6 +1976,7 @@ ul.userMenu-search-profiles button:after, ul.userMenu-search-profiles .mini-prof position: relative; text-align: center; background: white; + padding: 1em; } /* line 152, ../sass/style.sass */ .mini-profile a.button { @@ -2007,8 +2003,8 @@ ul.userMenu-search-profiles button:after, ul.userMenu-search-profiles .mini-prof /* line 169, ../sass/style.sass */ .mini-profile-indicators { - margin: 0 0 1em 0; background-color: #f3f2f1; + text-align: center; } /* line 173, ../sass/style.sass */ .mini-profile-indicators li { @@ -2016,7 +2012,6 @@ ul.userMenu-search-profiles button:after, ul.userMenu-search-profiles .mini-prof -webkit-box-sizing: border-box; box-sizing: border-box; display: block; - width: 100px; float: left; font-size: 0.8em; position: relative; @@ -2050,6 +2045,21 @@ ul.userMenu-search-profiles button:after, ul.userMenu-search-profiles .mini-prof padding-top: 0.2em; } +.mini-profile-indicators .userMenu-connections, .mini-profile-indicators .userMenu-messages { + width: 30%; +} + +.mini-profile-indicators .userMenu-groupmessages { + width: 40%; +} + +.mini-profile-indicators .userMenu-groupmessages a:before { + content: ""; + background: transparent url("../img/groupmessages.png") no-repeat scroll center center; + background-size: 24px 24px; + height: 1em; +} + /* line 208, ../sass/style.sass */ .messages-qtd { position: absolute; @@ -2971,6 +2981,140 @@ ol.toptrends-list a:hover { left: auto; } + +.group-messages-control .invite-form, .group-messages-control .secret-key { + display: none; + font-size: 12px; + text-align: center; + padding: 4px 0; +} + +.group-messages-control .invite-form input { + border: 1px solid rgba(0, 0, 0, .1); + vertical-align: middle; + width: 73%; + margin: 0 4px; +} + +.group-messages-control .invite-form input:focus { + border-bottom: solid 1px #B4C669; +} + +.group-messages-control .invite-form button { + vertical-align: middle; +} + +.group-messages-control.b-buttons { + padding: 4px; +} + +.profile-card-buttons.group-messages-control.b-buttons { + text-align: center; +} + +.profile-card-buttons.group-messages-control.b-buttons button { + margin: 2px 0; +} + +/************************************* +****** GM NEW GROUP SETUP MODAL ****** +**************************************/ + +.group-messages-new-group.modal-wrapper { + width: 580px; + height: auto; /*about 320px*/ + margin: -180px 0 0 -290px; +} + +.group-messages-new-group .modal-content { + padding: 0; +} + +.group-messages-new-group .modal-content .module { + margin: 4px; +} + +.group-messages-new-group .modal-content div div { + margin: 4px 0; + padding: 4px 12px; +} + +.group-messages-new-group .modal-content div div:last-child { + text-align: right; +} + +.group-messages-new-group .modal-content div div:last-child button { + margin: 8px 4px; +} + +.group-messages-new-group .modal-content textarea { + border: 1px solid rgba(0, 0, 0, .1); + width: 500px; + height: 56px; + resize: none; + margin: 12px 16px; + padding: 2px 4px; +} + +.group-messages-new-group .modal-content textarea:focus { + border-bottom: solid 1px #B4C669; +} + +/************************************* +****** GM JOIN GROUP SETUP MODAL ***** +**************************************/ + +.group-messages-join-group.modal-wrapper { + width: 580px; + height: auto; /*about 360px*/ + margin: -250px 0 0 -290px; +} + +.group-messages-join-group .modal-content { + padding: 0; +} + +.group-messages-join-group .modal-content .module { + margin: 4px; +} + +.group-messages-join-group .modal-content div div { + margin: 4px 0; + padding: 4px 12px; +} + +.group-messages-join-group .modal-content div div:last-child { + text-align: right; +} + +.group-messages-join-group .modal-content div div:last-child button { + margin: 8px 4px; +} + +.group-messages-join-group .modal-content input { + border: 1px solid rgba(0, 0, 0, .1); + width: 500px; + margin: 12px 16px; + padding: 2px 4px; +} + +.group-messages-join-group .modal-content input:focus { + border-bottom: solid 1px #B4C669; +} + +.group-messages-join-group .modal-content input[type='checkbox'] { + display: inline; + width: auto; + margin: 2px; +} + +.group-messages-join-group .modal-content .groups-list { + background-color: #FFF; + height: 120px; + overflow-y: auto; + margin: 8px 8px 0; +} + /********* NEW USER MODAL************* */ .new-user.modal-wrapper { From e6f077b8e2bc2c844fc1c41d6a464d687ca59684 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 4 Sep 2015 14:57:41 +0500 Subject: [PATCH 5/9] add group messages icon --- img/groupmessages.png | Bin 0 -> 3951 bytes licenses/groupmessages.png.license | 7 +++++++ theme_calm/img/groupmessages.png | Bin 0 -> 3951 bytes theme_nin/img/groupmessages.png | Bin 0 -> 5451 bytes 4 files changed, 7 insertions(+) create mode 100644 img/groupmessages.png create mode 100644 licenses/groupmessages.png.license create mode 100644 theme_calm/img/groupmessages.png create mode 100644 theme_nin/img/groupmessages.png diff --git a/img/groupmessages.png b/img/groupmessages.png new file mode 100644 index 0000000000000000000000000000000000000000..3b6562f4903c685a0a9d0e17c5914c14d31f58b6 GIT binary patch literal 3951 zcmV-#50LPQP)tL0avA)@ny>`9rHy1*gM9Dg~iM8XnGw@{;ff5kyp8ilB($VJt|>D*_1=l91%r zKi0W7H#hg5v-Un`?|sfa`OVzPK?!mz<$7MftkQ+;3;4+ za5HdaL_AQX9Q}&AIdBkgIIt721F$vlEbut+E8r?%K}0NXO3uQl2dFZ_ZUy)EiY^_l`Vej+!i+cn*eDp5~TUnto>&#K2X-G)g~cT*R2 zaq~xc)b#3@R;U}R=k}m~)~KhbBTcty4E1fMVX9XwQ+H{)UA;uTxQG3tdRo(M0zlnb zUD)HssXm~-s_FLi0`*fB^pEQCO}7p8w2B(1`qie}*DdOs)a4cR&vWWFO*Zb$>dJ~5 zr@G1ke-)^gSJ*$Q=Qi26b1H6}>IIE8uuDvHqcs)x&r0=mWo0ZqlT>E_N0mLl0Eep^ z)lg3r90f$hb!<#pNGe4)pAxf4t9w=R8ep#)>ZyW5`@NoS6yT4#IJYS8sIjhIQkUGN z>*+=Tw(sKHqU=y(T|L3{3AiOH>Pp{>ZWLevC5N4Yya>#%p`I$Zs-}9bE_-5W1&D|hz)fY(FTl+a@lp--RKdKO z>ba(-de%jqUBgo6-i+cP~cECog z>#BBjMAW+XV6u4HmbC5tD&QH?{>PIMv8GO0rX}i5>Rj`zb62Z3s_$u9?hSN_$s6ZP z%YUMN*Cx%bH&7mv1LluQ-uUr6rtaBvdp1x2bqn>L9^CvAZ0bh|c?fjUFIzK1t| zltpfM9rQoyi51-ZQNGc1`+7|+pMiCuZbh=fsp?4;cxOc1UD5SxXFZP_braw)QdpO_ zk{mPog)1WBOKpySlAN#Hjfjt@$(%Nc`m^GA7Gn`3tXPu3(yCr_N6YmuS{44MM$Hr0Wa<;)E= z$Z&r|baMLq!y4r134^8pf7;>r*XTT1?3Vv%cTn9Fcz4Az^o&7MfCFq}5*-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BGH+y>CDF`aCz$>UkUL8rl&mSeWF{m9n9i=+x#r$=g=Om} zwt%DnPd6+`m26Oeso4^e0^CdQf-3hLFJ+eN6as!avJzmV6})hM!@^X>7MbOW+S*MA zo`n6W-5*YLub#5<>@EZR{(%k z==CeeG;!*4c2Q?!27dSv!=(T}fa$*yxEaX~E{B_|6r|7iO+>6a2bjj>X7Rk0={E_U ziZNv$1_j6pNgolv18%BVmVRN(M1B|)VE+PTFRo0A{^1G6E&L6G0=&zV&@qRrnEtDR z-x@zD9tH)N0lYt_V9RJDH%;6ivXT@oc8p5$p!76tEIklBodmV;F0RT=^vzE16owzF6>v8xh~uDgazw26?jL2CUICCMgV_oY5zBxhDer^VG?xKiX;)y_6aZ4J zoE-mq03zZSz=1$+fQf$L2GY>q*6Mp06<`+0`YD@;xD%Me;F!(b34E}XFQ_fUHU}7G z39xf(11KByeWb`7b>uE8%Qd8%pEY6);|KuB6X?HkKMO~Rh+9ZWph{;3ub6)ajw}!l zseiHBV9}%eV@cUIRliz;e7QVfe}0yh$9fcCxhXJISsCY8O@^={TxAMtJH4S*Yg592z{VPXSc#wF@O^$-9mEFY1ztWxY||yI1|(x2TU)+>sNx z#WrEp3&_2tdYpQLx~fOAJz<)2%47?;eoVbbeYs{OcuIYD(|u4i{|}^BOT=RxYKQ;;002ov JPDHLkV1oBUZ+8Fy literal 0 HcmV?d00001 diff --git a/licenses/groupmessages.png.license b/licenses/groupmessages.png.license new file mode 100644 index 0000000..f469f0f --- /dev/null +++ b/licenses/groupmessages.png.license @@ -0,0 +1,7 @@ +*group messages icon* is derivative work + + based on https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Group_half_security.svg/120px-Group_half_security.svg.png from https://commons.wikimedia.org/wiki/File:Group_half_security.svg + + formerly was icon from PICOL, PIctorial COmmunication Language, http://picol.org + + licensed under Creative Commons Attribution 3.0 Unported license diff --git a/theme_calm/img/groupmessages.png b/theme_calm/img/groupmessages.png new file mode 100644 index 0000000000000000000000000000000000000000..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nPd6+`m26Oeso4^e0^CdQf-3hLFJ+eN6as!avJzmV6})hM!@^X>7MbOW+S*MA zo`n6W-5*YLub#5<>@EZR{(%k z==CeeG;!*4c2Q?!27dSv!=(T}fa$*yxEaX~E{B_|6r|7iO+>6a2bjj>X7Rk0={E_U ziZNv$1_j6pNgolv18%BVmVRN(M1B|)VE+PTFRo0A{^1G6E&L6G0=&zV&@qRrnEtDR z-x@zD9tH)N0lYt_V9RJDH%;6ivXT@oc8p5$p!76tEIklBodmV;F0RT=^vzE16owzF6>v8xh~uDgazw26?jL2CUICCMgV_oY5zBxhDer^VG?xKiX;)y_6aZ4J zoE-mq03zZSz=1$+fQf$L2GY>q*6Mp06<`+0`YD@;xD%Me;F!(b34E}XFQ_fUHU}7G z39xf(11KByeWb`7b>uE8%Qd8%pEY6);|KuB6X?HkKMO~Rh+9ZWph{;3ub6)ajw}!l zseiHBV9}%eV@cUIRliz;e7QVfe}0yh$9fcCxhXJISsCY8O@^={TxAMtJH4S*Yg592z{VPXSc#wF@O^$-9mEFY1ztWxY||yI1|(x2TU)+>sNx z#WrEp3&_2tdYpQLx~fOAJz<)2%47?;eoVbbeYs{OcuIYD(|u4i{|}^BOT=RxYKQ;;002ov JPDHLkV1oBUZ+8Fy literal 0 HcmV?d00001 diff --git a/theme_nin/img/groupmessages.png b/theme_nin/img/groupmessages.png new file mode 100644 index 0000000000000000000000000000000000000000..a084c1dee066e8ba90064c280f93b231c2a7de02 GIT binary patch literal 5451 zcmV-R6}0M!P)SlKlk^#IvauP8v_m^1_T8L42T;Tc60&< z+T%c?kaWMQuIe@f(LtSqg)_38FovPKmaa}9f~XMI90Hih2nY@WVH6c)X9PmX3PM7b zuKL~iqdS=Lbg zK-LSo2H`=2y*rc1JRfEp)ykYXmyQ}a^8M4SF|$PVW56_EKj3YJwE}-uxTkCT)>TWF zF5MnR3=)RXXf$z(3ReUF;IYeU6}h}K(|&&#@l+d)jq@ivbzR?8#05rp=<*)W=7_yE zlgYdtWGsOSAdy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8LZ?3dog@ Date: Fri, 4 Sep 2015 14:58:31 +0500 Subject: [PATCH 6/9] tune posts view --- css/style.css | 44 +++++++++++++++++++++--------------- theme_calm/css/style.css | 48 +++++++++++++++++++++++++--------------- theme_nin/css/style.css | 4 +++- 3 files changed, 59 insertions(+), 37 deletions(-) diff --git a/css/style.css b/css/style.css index f9de08b..3f4c6e1 100644 --- a/css/style.css +++ b/css/style.css @@ -989,10 +989,7 @@ ol.toptrends-list { background: #fefedf; } -.post-photo, -.mini-profile-photo -{ - margin: 5px; +.post-photo, .mini-profile-photo { display: inline-block; float: left; vertical-align: middle; @@ -1000,14 +997,15 @@ ol.toptrends-list { height: 48px; overflow: hidden; border-radius: 20%; + margin: 6px; /*transform: rotate( 45deg );*/ } -.post-photo img, -.mini-profile-photo img -{ + +.post-photo img, .mini-profile-photo img { width: 48px; - height: 48px; + height: auto; } + .post-info span { vertical-align: top; @@ -1030,18 +1028,18 @@ ol.toptrends-list { display: inline-block; letter-spacing: 0px; } -.post-info-time -{ + +.post-info-time { float: right; font-size: 12px; - margin: 5px; + margin: 4px 8px 0; opacity: .5; text-decoration: none; } .post-text { font-size: 13px; - margin: 2px 10px 4px 60px; + margin: 2px 16px 4px 60px; word-wrap: break-word; } @@ -1051,11 +1049,11 @@ ol.toptrends-list { padding-right: 2px; } -.post-context -{ +.post-context { font-size: 11px; - margin: 2px 10px 4px 60px; + margin: 2px 16px 4px 60px; } + .post-text a, .post-context a, .mini-screen-name @@ -1531,7 +1529,7 @@ ol.toptrends-list { } .direct-messages-thread .post-text { - margin: 2px 10px 4px 4px; + margin: 2px 16px 4px 4px; word-wrap: break-word; } @@ -1554,8 +1552,18 @@ ol.toptrends-list { left: auto; } +.direct-messages-thread .post.sent .post-info-time { + float: left; +} + +.direct-messages-thread .post.sent .post-info-time .post-info-sent { + float: right; + margin: 0 2px; +} + .direct-messages-thread .post.sent .post-text { - margin: 2px 10px 4px 4px; + margin: 2px 4px 4px 16px; + text-align: right; } .direct-messages-thread .post.sent .post-photo { @@ -2210,7 +2218,7 @@ ul.dropdown-menu .active, ul.dropdown-menu .active a { .post-rt-reference .post-text { font-size: 11px; - margin: 2px 10px 4px 10px; + margin: 2px 8px 4px 34px; } .post-rt-reference .post-info-time { diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index fe7191e..683c907 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -1186,10 +1186,8 @@ textarea.splited-post { { background: #fff; } -.post-photo, -.mini-profile-photo -{ - margin: 5px; + +.post-photo, .mini-profile-photo { display: inline-block; float: left; vertical-align: middle; @@ -1198,13 +1196,14 @@ textarea.splited-post { overflow: hidden; border-radius: 20%; /*transform: rotate( 45deg );*/ + margin: 6px; } -.post-photo img, -.mini-profile-photo img -{ + +.post-photo img, .mini-profile-photo img { width: 48px; - height: 48px; + height: auto; } + .post-info span { vertical-align: top; @@ -1227,14 +1226,15 @@ textarea.splited-post { display: inline-block; letter-spacing: 0px; } -.post-info-time -{ + +.post-info-time { float: right; font-size: 12px; - margin-right: 5px; + margin: 4px 8px 0; opacity: .5; text-decoration: none; } + .post-info-time:hover { text-decoration: none; color: #43464d; @@ -1242,7 +1242,7 @@ textarea.splited-post { .post-text { font-size: 13px; - margin: 2px 10px 4px 60px; + margin: 2px 16px 4px 60px; word-wrap: break-word; } @@ -1252,11 +1252,11 @@ textarea.splited-post { padding-right: 2px; } -.post-context -{ +.post-context { font-size: 11px; - margin: 2px 10px 4px 60px; + margin: 2px 16px 4px 60px; } + .post-text a, .post-context a, .mini-screen-name @@ -1897,7 +1897,7 @@ textarea.splited-post { } .direct-messages-thread .post-text { - margin: 2px 10px 4px 4px; + margin: 2px 16px 4px 4px; word-wrap: break-word; } @@ -1920,8 +1920,18 @@ textarea.splited-post { left: auto; } +.direct-messages-thread .post.sent .post-info-time { + float: left; +} + +.direct-messages-thread .post.sent .post-info-time .post-info-sent { + float: right; + margin: 0 2px; +} + .direct-messages-thread .post.sent .post-text { - margin: 2px 10px 4px 4px; + margin: 2px 4px 4px 16px; + text-align: right; } .direct-messages-thread .post.sent .post-photo { @@ -2630,11 +2640,12 @@ p.post-text img { .post-rt-reference .post-info-name { font-size: 11px; + padding: 0; } .post-rt-reference .post-text { font-size: 11px; - margin: 2px 10px 4px 10px; + margin: 2px 8px 4px 34px; } .post-rt-reference .post-text a { @@ -2644,4 +2655,5 @@ p.post-text img { .post-rt-reference .post-info-time { font-size: 9px; color: #000; + margin: 2px 4px 0; } diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index 447a746..2a8aae1 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -887,9 +887,10 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, .post-context { font-size: 11px; line-height: 11px; - margin: 2px 10px 4px 60px; color: #b3b5b7; + margin: 2px 8px 4px 62px; } + /* line 146, ../sass/_postboard.sass */ .post-retransmited-icon:before { display: block; @@ -3500,4 +3501,5 @@ ul.dropdown-menu .active, ul.dropdown-menu .active a { .post-rt-reference .post-info-time { font-size: 9px; color: #B3B5B7; + margin: 0 2px 0; } From 89e4d5ed07c18d9642853c322dd59be5be0d3e25 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 4 Sep 2015 17:18:49 +0500 Subject: [PATCH 7/9] show usernames in #groupchat messages --- css/style.css | 11 ++++++++++- following.html | 5 ++++- home.html | 5 ++++- js/mobile_abstract.js | 2 +- js/twister_directmsg.js | 2 +- js/twister_formatpost.js | 33 ++++++++++++++++++++------------- theme_calm/css/style.css | 11 ++++++++++- theme_nin/css/style.css | 20 +++++++++++++++++++- 8 files changed, 69 insertions(+), 20 deletions(-) diff --git a/css/style.css b/css/style.css index 3f4c6e1..01a8e17 100644 --- a/css/style.css +++ b/css/style.css @@ -1552,13 +1552,21 @@ ol.toptrends-list { left: auto; } +.direct-messages-thread .post.sent .post-info { + text-align: right; +} + +.direct-messages-thread .post.sent .post-info-name { + margin-right: 2px; +} + .direct-messages-thread .post.sent .post-info-time { float: left; } .direct-messages-thread .post.sent .post-info-time .post-info-sent { float: right; - margin: 0 2px; + margin-left: 2px; } .direct-messages-thread .post.sent .post-text { @@ -2205,6 +2213,7 @@ ul.dropdown-menu .active, ul.dropdown-menu .active a { .post-rt-reference .post-photo { width: 24px; height: 24px; + margin: 4px; } .post-rt-reference .post-photo img { diff --git a/following.html b/following.html index 0ca6122..5941fbd 100644 --- a/following.html +++ b/following.html @@ -382,7 +382,10 @@
      • user-photo
        - +

      • diff --git a/home.html b/home.html index b94eb16..179dac6 100644 --- a/home.html +++ b/home.html @@ -474,7 +474,10 @@
      • user-photo
        - +

      • diff --git a/js/mobile_abstract.js b/js/mobile_abstract.js index 2d0673d..8fe3e14 100644 --- a/js/mobile_abstract.js +++ b/js/mobile_abstract.js @@ -150,7 +150,7 @@ var MAL = function() else return "#profile?user=" + username; //} - } + }; // recover username from url (only for hash) this.urlToUser = function(url) { diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js index abe346e..4c8291d 100644 --- a/js/twister_directmsg.js +++ b/js/twister_directmsg.js @@ -81,7 +81,7 @@ function processDmConversation(postboard, dm_screenname, dmData) { var dmList = dmData[dm_screenname]; if (dmList.length) { for (var i = 0; i < dmList.length; i++) { - var dmItem = dmDataToConversationItem(dmList[i], defaultScreenName, dm_screenname) + var dmItem = postToElemDM(dmList[i], defaultScreenName, dm_screenname) .attr('data-id', dmList[i].id) .appendTo(postboard) ; diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index d113266..4489050 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -280,24 +280,31 @@ function dmDataToSnippetItem(dmData, remoteUser) { } // format dmdata (returned by getdirectmsgs) to display in conversation thread -function dmDataToConversationItem(dmData, localUser, remoteUser) { - var from = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0)) - ? dmData.from - : (dmData.fromMe ? localUser : remoteUser); - var classDm = dmData.fromMe ? "sent" : "received"; - var dmItem = $("#dm-chat-template").clone(true); - dmItem.removeAttr('id'); - dmItem.addClass(classDm); - getAvatar(from, dmItem.find(".post-photo").find("img") ); - dmItem.find('.post-info-time') +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) + .removeAttr('id') + .addClass(dmData.fromMe ? 'sent' : 'received') + ; + + var elemName = elem.find('.post-info-name') + .attr('href', $.MAL.userUrl(senderAlias)); + if (senderAlias[0] === '*' ) + getGroupChatName(senderAlias, elemName); + else + getFullname(senderAlias, elemName); + + getAvatar(senderAlias, elem.find('.post-photo').find('img')); + elem.find('.post-info-time') .attr('title', timeSincePost(dmData.time)) .find('span:last') .text(timeGmtToText(dmData.time)) ; - setPostInfoSent(from,dmData.k,dmItem.find('.post-info-sent')); - dmItem.find('.post-text').html(htmlFormatMsg(dmData.text).html); + setPostInfoSent(senderAlias, dmData.k, elem.find('.post-info-sent')); + elem.find('.post-text').html(htmlFormatMsg(dmData.text).html); - return dmItem; + return elem; } // convert message text to html, featuring @users and links formating. diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index 683c907..af6745c 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -1920,13 +1920,21 @@ textarea.splited-post { left: auto; } +.direct-messages-thread .post.sent .post-info { + text-align: right; +} + +.direct-messages-thread .post.sent .post-info-name { + margin-right: 2px; +} + .direct-messages-thread .post.sent .post-info-time { float: left; } .direct-messages-thread .post.sent .post-info-time .post-info-sent { float: right; - margin: 0 2px; + margin-left: 2px; } .direct-messages-thread .post.sent .post-text { @@ -2631,6 +2639,7 @@ p.post-text img { .post-rt-reference .post-photo { width: 24px; height: 24px; + margin: 4px; } .post-rt-reference .post-photo img { diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index 2a8aae1..c27f003 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -2868,17 +2868,19 @@ ol.toptrends-list a:hover { margin-left: 58px; font-size: 0.9em; } + /* line 758, ../sass/style.sass */ .directMessages .post-info-name { float: none; } + /* line 760, ../sass/style.sass */ .directMessages .post-info-tag { line-height: 1em; padding: 0; display: inline; font-size: 80%; - margin: 0 0 0 1em; + margin-left: 0.1em; } /* line 767, ../sass/style.sass */ @@ -2911,6 +2913,13 @@ ol.toptrends-list a:hover { margin: 0px 10px 20px 10px; cursor: default; } + +.direct-messages-thread .post .post-info-name { + display: block; + margin-left: 128px; + padding: 0; +} + /* line 793, ../sass/style.sass */ .direct-messages-thread .post .post-info-time { float: none; @@ -2962,6 +2971,15 @@ ol.toptrends-list a:hover { left: 0; top: 10px; } + +.direct-messages-thread .post.sent .post-info { + text-align: right; +} + +.direct-messages-thread .post.sent .post-info-name { + margin-right: 128px; +} + /* line 842, ../sass/style.sass */ .direct-messages-thread .post.sent .post-text:after { border-top: solid 7px transparent; From 7ef1f0129eae6dc8d7892af49fd55f89c3404fc8 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Sat, 5 Sep 2015 04:14:16 +0500 Subject: [PATCH 8/9] add alias textcompletion for peers invitation form; textcompletion refactoring --- css/profile.css | 11 ++- following.html | 30 ++++--- home.html | 30 ++++--- js/interface_common.js | 21 +++-- js/tmobile.js | 10 ++- js/twister_directmsg.js | 42 ++++++++- js/twister_following.js | 163 ++++++++++++++++++----------------- theme_calm/css/profile.css | 8 +- theme_nin/css/style.css | 8 +- theme_nin/js/theme_option.js | 13 +-- tmobile.html | 22 ++--- 11 files changed, 218 insertions(+), 140 deletions(-) diff --git a/css/profile.css b/css/profile.css index 16906a4..6ef058d 100644 --- a/css/profile.css +++ b/css/profile.css @@ -296,10 +296,19 @@ h2.profile-screen-name { padding: 4px 0; } -.group-messages-control .invite-form input { +.group-messages-control .invite-form textarea { + border: solid 1px rgba(0, 0, 0, .3); + border-radius: 3px; vertical-align: middle; width: 73%; + height: 20px; + resize: none; margin: 0 4px; + padding: 1px 4px; +} + +.group-messages-control .invite-form textarea:focus { + border: solid 1px rgba(227, 79, 66, .5); } .group-messages-control .invite-form button { diff --git a/following.html b/following.html index 5941fbd..3cd5175 100644 --- a/following.html +++ b/following.html @@ -80,18 +80,7 @@
      • Outro Fulano
      • Mais outro
      • - +
          @@ -183,6 +172,19 @@ @@ -430,7 +432,7 @@
          - +
          diff --git a/home.html b/home.html index 179dac6..b9640a7 100644 --- a/home.html +++ b/home.html @@ -86,18 +86,7 @@
        • Outro Fulano
        • Mais outro
        • - +
            @@ -198,6 +187,19 @@ diff --git a/js/interface_common.js b/js/interface_common.js index c08197c..70f7482 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -800,7 +800,7 @@ function replyTextInput(event) { $(tas[i]).caret(caretPos); replyTextUpdateRemaining(tas[i]); if ($.fn.textcomplete) - setTextcompleteOnElement(tas[i]); + setTextcompleteOnElement(tas[i], getMentionsForAutoComplete()); } } } else if (tas.length > 1 && tas[i].value.length === 0) { @@ -1571,10 +1571,10 @@ function initInterfaceCommon() { $('.bitmessage-ctc').on('click', promptCopyAttrData); if ($.fn.textcomplete) { - $('textarea').on({ - 'focus': setTextcompleteOnEventTarget, - 'focusout': function () {$(this).textcomplete('destroy');} - }); + $('.post-area-new textarea') + .on('focus', {req: getMentionsForAutoComplete}, setTextcompleteOnEventTarget) + .on('focusout', unsetTextcompleteOnEventTarget) + ; } } @@ -1598,17 +1598,22 @@ function inputEnterActivator(event) { function setTextcompleteOnEventTarget(event) { // cursor has not set yet and we need to wait 100ms to skip global click event - setTimeout(setTextcompleteOnElement, 100, event.target); + setTimeout(setTextcompleteOnElement, 100, event.target, + typeof event.data.req === 'function' ? event.data.req() : event.data.req); } -function setTextcompleteOnElement(elem) { +function setTextcompleteOnElement(elem, req) { elem = $(elem); - elem.textcomplete(getMentionsForAutoComplete(), { + elem.textcomplete(req, { appendTo: (elem.parents('.dashboard').length) ? elem.parent() : $('body'), listPosition: setTextcompleteDropdownListPos }); } +function unsetTextcompleteOnEventTarget(event) { + $(event.target).textcomplete('destroy'); +} + // following workaround function is for calls from $.fn.textcomplete only // we need this because currently implementation of caret position detection is way too imperfect function setTextcompleteDropdownListPos(position) { diff --git a/js/tmobile.js b/js/tmobile.js index 24a0b00..20143ac 100644 --- a/js/tmobile.js +++ b/js/tmobile.js @@ -432,9 +432,13 @@ function installCreateUserClick() { } function installUserSearchHandler() { - var $userSearchField = $( ".userMenu-search-field" ); - $userSearchField.unbind('keyup').keyup( userSearchKeypress ); - $userSearchField.unbind('click').bind( "click", userSearchKeypress ); + $('.userMenu-search-field') + .off('click input') + .on('keyup', userSearchEnter) + .on('click keyup', + {hashtags: true, handleRet: processDropdownUserResults, + handleRetZero: closeSearchDialog}, userSearchKeypress) + ; } function installProfileEditHandlers() { diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js index 4c8291d..7aeb5ec 100644 --- a/js/twister_directmsg.js +++ b/js/twister_directmsg.js @@ -263,6 +263,11 @@ function openGroupMessagesNewGroupModal() { modal.content.find('.description').on('input', {parentSelector: '.module', enterSelector: '.create'}, inputEnterActivator); + modal.content.find('.invite') + .on('input', {handleRet: groupMsgInviteFormInputHandleUserSearchRet}, userSearchKeypress) + .on('focus', {req: groupMsgInviteFormInputSetTextcompleteReq}, setTextcompleteOnEventTarget) + .on('focusout', unsetTextcompleteOnEventTarget) + ; modal.content.find('.create').on('click', function (event) { var elemEvent = $(event.target); var elemForm = elemEvent.parents('.module') @@ -408,6 +413,28 @@ function groupMsgGetGroupInfo(groupAlias, cbFunc, cbArgs) { ); } +function groupMsgInviteFormInputHandleUserSearchRet() { + // working with global results because of search function in textcomplete strategy, see groupMsgInviteFormInputSetTextcompleteReq + var i = _lastSearchUsersResults.indexOf(defaultScreenName); + if (i !== -1) + _lastSearchUsersResults.splice(i, 1); +} + +function groupMsgInviteFormInputSetTextcompleteReq() { + return [{ + match: /\B@(\w*)$/, + search: function (term, callback) { + callback($.map(_lastSearchUsersResults, function (mention) { + return mention.indexOf(term) === 0 ? mention : null; + })); + }, + index: 1, + replace: function (mention) { + return '@'+mention+' '; + } + }] +} + function initInterfaceDirectMsg() { $('.direct-messages').attr('href', '#directmessages'); $('.userMenu-messages a').attr('href', '#directmessages'); @@ -429,12 +456,21 @@ function initInterfaceDirectMsg() { $(event.target).siblings('.invite-form').toggle(); }); - $('.group-messages-control .invite-form input').on('input', - {parentSelector: '.invite-form', enterSelector: 'button'}, inputEnterActivator); + $('.group-messages-control .invite-form textarea') + .on('input', {parentSelector: '.invite-form', enterSelector: 'button', + handleRet: groupMsgInviteFormInputHandleUserSearchRet}, + function (event) { + inputEnterActivator(event); + userSearchKeypress(event); + } + ) + .on('focus', {req: groupMsgInviteFormInputSetTextcompleteReq}, setTextcompleteOnEventTarget) + .on('focusout', unsetTextcompleteOnEventTarget) + ; $('.group-messages-control .invite-form button').on('click', function (event) { var elemEvent = $(event.target); - var elemInput = elemEvent.siblings('input'); + var elemInput = elemEvent.siblings('textarea'); var peersToInvite = elemInput.val().toLowerCase().match(/@\w+/g); if (peersToInvite) peersToInvite = peersToInvite.join('').slice(1).split('@'); diff --git a/js/twister_following.js b/js/twister_following.js index 6df7f0f..d3387ee 100644 --- a/js/twister_following.js +++ b/js/twister_following.js @@ -10,9 +10,10 @@ var _followsPerPage = 200; var _maxFollowingPages = 50; var _followingSeqNum = 0; var _followSuggestions = []; -var _searchingPartialUsers = ""; +var _searchingPartialName = ''; var _searchKeypressTimer = undefined; var _lastSearchUsersResults = []; +var _lastSearchUsersResultsRemovedFromDHTgetQueue = true; var _lastLoadFromDhtTime = 0; var twisterFollowingO = undefined; @@ -578,101 +579,96 @@ function processWhoToFollowSuggestion(suggestion, followedBy) { console.warn('nothing to proceed: no twisters to follow was suggested'); } -function closeSearchDialog() -{ - $(".userMenu-search-field").siblings().slideUp( "fast" ); - removeUsersFromDhtgetQueue( _lastSearchUsersResults ); - _lastSearchUsersResults = []; +function closeSearchDialog(event) { + var elemEvent = event ? $(event.target) : this; + elemEvent.siblings('.search-results').slideUp('fast'); + if (!_lastSearchUsersResultsRemovedFromDHTgetQueue) { + removeUsersFromDhtgetQueue(_lastSearchUsersResults); + _lastSearchUsersResultsRemovedFromDHTgetQueue = true; + } } function userSearchKeypress(event) { - var partialName = $(".userMenu-search-field").val().toLowerCase(); - var searchResults = $(".search-results"); + var elemEvent = $(event.target); + var partialName = elemEvent.val().toLowerCase(); - if ( partialName.substr( 0, 1 ) == '#' ) { - - if(searchResults.is(":visible")) - searchResults.slideUp( "fast" ); - - if ( event.which == 13 ) - window.location.hash = '#hashtag?hashtag=' + encodeURIComponent(partialName.substr(1)); + if (event.data.hashtags && partialName[0] === '#') { + var searchResults = elemEvent.siblings('.search-results'); + if (searchResults.is(':visible')) + searchResults.slideUp('fast'); return; } - if ( partialName.substr( 0, 1 ) == '@' ) { - partialName = partialName.substr( 1 ); - } + var words = partialName.match(/\b\w+/g); + if (words && words.length) { + partialName = words.pop(); - //var partialName = item.val(); - - if( !partialName.length ) { - closeSearchDialog(); - } else { - if( _searchKeypressTimer !== undefined ) + if (typeof _searchKeypressTimer !== 'undefined') clearTimeout(_searchKeypressTimer); - if( _searchingPartialUsers.length ) { - _searchingPartialUsers = partialName; + if (_searchingPartialName.length) { + _searchingPartialName = partialName; } else { - _searchKeypressTimer = setTimeout( function() { + _searchKeypressTimer = setTimeout(function () { _searchKeypressTimer = undefined; - searchPartialUsername(partialName); + event.data.partialName = partialName; + searchPartialUsername(event); }, 600); } - } + } else + closeSearchDialog(event); } -function searchPartialUsername(partialName) { - _searchingPartialUsers = partialName; - twisterRpc("listusernamespartial", [partialName,10], - function(partialName, ret) { - processDropdownUserResults(partialName, ret) - }, partialName, - function(cbArg, ret) { - console.log("ajax error:" + ret); - }, {}); +function searchPartialUsername(event) { + _searchingPartialName = event.data.partialName; + twisterRpc('listusernamespartial', [event.data.partialName, 10], + function(event, ret) { + if (event.data.partialName !== _searchingPartialName) + setTimeout(searchPartialUsername, 100, event); + else { + if (!_lastSearchUsersResultsRemovedFromDHTgetQueue) + removeUsersFromDhtgetQueue(_lastSearchUsersResults); + else + _lastSearchUsersResultsRemovedFromDHTgetQueue = false; + _lastSearchUsersResults = ret; + + if (ret && ret.length) { + if (event.data.handleRet) + event.data.handleRet(event, ret); + } else { + if (event.data.handleRetZero) + event.data.handleRetZero(event); + } + + _searchingPartialName = ''; + } + }, event, + function(req, ret) {console.warn('ajax error:' + ret.message);}, null + ); } -function processDropdownUserResults(partialName, results){ +function processDropdownUserResults(event, results) { + var container = $('.userMenu-search-profiles').empty(); + var template = $('#search-profile-template').children(); - if( partialName != _searchingPartialUsers ) { - searchPartialUsername( _searchingPartialUsers ); - return; + for (var i = 0; i < results.length; i++) { + if (results[i] === defaultScreenName) + continue; + + var item = template.clone(true); + item.find('.mini-profile-info').attr('data-screen-name', results[i]); + item.find('.mini-screen-name b').text(results[i]); + item.find('a.open-profile-modal').attr('href', $.MAL.userUrl(results[i])); + getAvatar(results[i], item.find('.mini-profile-photo')); + getFullname(results[i], item.find('.mini-profile-name')); + item.appendTo(container); + + if (followingUsers.indexOf(results[i]) !== -1) + toggleFollowButton(results[i], true); } - removeUsersFromDhtgetQueue( _lastSearchUsersResults ); - _lastSearchUsersResults = results; - - var typeaheadAccounts = $(".userMenu-search-profiles"); - var template = $("#search-profile-template").detach(); - - typeaheadAccounts.empty(); - typeaheadAccounts.append(template); - - if( results.length ) { - for( var i = 0; i < results.length; i++ ) { - if( results[i] == defaultScreenName ) - continue; - - var resItem = template.clone(true); - resItem.removeAttr('id'); - resItem.show(); - resItem.find(".mini-profile-info").attr("data-screen-name", results[i]); - resItem.find(".mini-screen-name b").text(results[i]); - resItem.find("a.open-profile-modal").attr("href",$.MAL.userUrl(results[i])); - getAvatar(results[i],resItem.find(".mini-profile-photo")); - getFullname(results[i],resItem.find(".mini-profile-name")); - resItem.appendTo(typeaheadAccounts); - if (followingUsers.indexOf(results[i]) >= 0) - toggleFollowButton(results[i], true); - } - - $.MAL.searchUserListLoaded(); - } else { - closeSearchDialog(); - } - _searchingPartialUsers = ""; + $.MAL.searchUserListLoaded(); } function userClickFollow(e) { @@ -700,10 +696,13 @@ function userClickFollow(e) { } function initUserSearch() { - var $userSearchField = $( ".userMenu-search-field" ); - $userSearchField.keyup( userSearchKeypress ); - $userSearchField.bind( "click", userSearchKeypress ); - $(".userMenu-search").clickoutside( closeSearchDialog ); + var elem = $('.userMenu-search-field') + .on('click input', + {hashtags: true, handleRet: processDropdownUserResults, + handleRetZero: closeSearchDialog}, userSearchKeypress) + .on('keyup', userSearchEnter) + ; + $('.userMenu-search').clickoutside(closeSearchDialog.bind(elem)); // following stuff should be moved to special function $('button.follow').on('click', userClickFollow); @@ -716,6 +715,14 @@ function initUserSearch() { ; } +function userSearchEnter(event) { + if (event.which === 13) { + var str = $(event.target).val().toLowerCase().trim(); + if (str[0] === '#') + window.location.hash = '#hashtag?hashtag=' + encodeURIComponent(str.slice(1)); + } +} + function followingListPublicCheckbox(e) { e.stopPropagation(); diff --git a/theme_calm/css/profile.css b/theme_calm/css/profile.css index 96aed93..81e0e0b 100644 --- a/theme_calm/css/profile.css +++ b/theme_calm/css/profile.css @@ -385,14 +385,18 @@ h2.profile-screen-name { padding: 4px 0; } -.group-messages-control .invite-form input { +.group-messages-control .invite-form textarea { border: solid 1px rgba(0, 0, 0, .3); + border-radius: 3px; vertical-align: middle; width: 73%; + height: 20px; + resize: none; margin: 0 4px; + padding: 1px 4px; } -.group-messages-control .invite-form input:focus { +.group-messages-control .invite-form textarea:focus { border: solid 1px rgba(118, 145, 206, .8); } diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index c27f003..58e10f3 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -3008,14 +3008,18 @@ ol.toptrends-list a:hover { padding: 4px 0; } -.group-messages-control .invite-form input { +.group-messages-control .invite-form textarea { + font-size: 1.1em; border: 1px solid rgba(0, 0, 0, .1); vertical-align: middle; width: 73%; + height: 20px; + resize: none; margin: 0 4px; + padding: 1px 4px; } -.group-messages-control .invite-form input:focus { +.group-messages-control .invite-form textarea:focus { border-bottom: solid 1px #B4C669; } diff --git a/theme_nin/js/theme_option.js b/theme_nin/js/theme_option.js index b0678ee..b936b26 100644 --- a/theme_nin/js/theme_option.js +++ b/theme_nin/js/theme_option.js @@ -5,7 +5,6 @@ $(function(){ $('.twister-user-remove').html(''); $('.profile-card-main').attr('style', ''); $('img[src$="img/tornado_avatar.png"]').attr("src","theme_nin/img/tornado_avatar.png"); - $('.userMenu-search-profiles button').html('').attr('title',polyglot.t('Follow')); $('.mini-profile-actions span').html(''); $.globalEval(postToElem.toString().replace(/postContext.append\(_templatePostRtBy/, @@ -37,13 +36,17 @@ $(function(){ this.slideUp(150); }).bind($('.left .post-area-new'))); - $(".userMenu-search-profiles .follow") - .on("eventToggleFollow", function() { + + $('#search-profile-template .follow') + .html('') + .attr('title', polyglot.t('Follow')) + .on('eventToggleFollow', function() { $(this).text('').attr('title', polyglot.t('Follow')); }) - .on("eventToggleUnfollow", function() { + .on('eventToggleUnfollow', function() { $(this).text('').attr('title', polyglot.t('Unfollow')); - }); + }) + ; if (/\/options.html$/i.test(document.location)) $(document).ready(localizeLabels); diff --git a/tmobile.html b/tmobile.html index 24e3058..8a0acd6 100644 --- a/tmobile.html +++ b/tmobile.html @@ -658,16 +658,7 @@
             
            - +
              @@ -741,6 +732,17 @@