From e513d4b84bc2115b2e7347299264e7147fbf19f1 Mon Sep 17 00:00:00 2001 From: erqan Date: Fri, 16 May 2014 01:36:44 +0300 Subject: [PATCH] grabed copy to clipboard functions from Calm client for Tox and Bitmessage address --- css/profile.css | 9 ++++++++- js/interface_common.js | 7 +++++++ js/interface_localization.js | 6 ++++-- theme_calm/css/profile.css | 7 +++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/css/profile.css b/css/profile.css index 8433936..0d8f27e 100644 --- a/css/profile.css +++ b/css/profile.css @@ -198,12 +198,13 @@ display: none; } .bitmessage-ctc, .tox-ctc { + position: absolute; height: 30px; width: 30px; display: inline-block; margin-right: 5px; border: 1px solid #d6d8dc; - background: #e3e5ea url(img/clipboard.png) center no-repeat; + background: #e3e5ea; opacity: .8; -webkit-border-radius: 0 5px 5px 0; -moz-border-radius: 0 5px 5px 0; @@ -213,15 +214,21 @@ -ms-transition: all 20ms; -o-transition: all 20ms; transition: all 20ms; + font-size: 18px; } .bitmessage-ctc:hover, .tox-ctc:hover { background-color: #f0f2f8; opacity: 1; cursor: pointer; + text-decoration: none; } .bitmessage-ctc:active, .tox-ctc:active { background-color: #edfced; } +.bitmessage-ctc:after, +.tox-ctc:after { + content: '📋'; +} .profile-modal .profile-tox, .profile-modal .profile-bitmessage { display: inline-block; width: 70px; diff --git a/js/interface_common.js b/js/interface_common.js index 637eee2..56ad0d9 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -1327,4 +1327,11 @@ function initInterfaceCommon() { $( ".who-to-follow .refresh-users" ).bind( "click", refreshWhoToFollow ); $( ".who-to-follow .view-all-users" ).bind( "click", openWhoToFollowModal ); + + $('.tox-ctc').on('click', function(){ + window.prompt(polyglot.t('copy_to_clipboard'), $(this).attr('data')) + }); + $('.bitmessage-ctc').on('click', function(){ + window.prompt(polyglot.t('copy_to_clipboard'), $(this).attr('data')) + }); } diff --git a/js/interface_localization.js b/js/interface_localization.js index 78299df..294ffcc 100644 --- a/js/interface_localization.js +++ b/js/interface_localization.js @@ -229,7 +229,8 @@ if(preferredLanguage == "en"){ "show_more_count": "%{count} more...", "hide": "hide", "Show more in this conversation...": "Show more in this conversation...", - "conversation_title": "Conversation of @%{username}" + "conversation_title": "Conversation of @%{username}", + "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close" }; } if(preferredLanguage == "es"){ @@ -1877,7 +1878,8 @@ if(preferredLanguage == "tr"){ "show_more_count": "%{count} tane daha...", "hide": "gizle", "Show more in this conversation...": "Sohbetin tamamını göster...", - "conversation_title": "@%{username} kullanıcısının bir sohbeti" + "conversation_title": "@%{username} kullanıcısının bir sohbeti", + "copy_to_clipboard": "Kopyalamak için Ctrl/Cmd+C tuşlarına, kapatmak için Enter tuşuna basınız" }; } diff --git a/theme_calm/css/profile.css b/theme_calm/css/profile.css index 82eb816..e4db016 100644 --- a/theme_calm/css/profile.css +++ b/theme_calm/css/profile.css @@ -262,6 +262,7 @@ display: none; } .bitmessage-ctc, .tox-ctc { + position: absolute; height: 30px; width: 30px; display: inline-block; @@ -277,15 +278,21 @@ -ms-transition: all 20ms; -o-transition: all 20ms; transition: all 20ms; + font-size: 18px; } .bitmessage-ctc:hover, .tox-ctc:hover { background-color: #f0f2f8; opacity: 1; cursor: pointer; + text-decoration: none; } .bitmessage-ctc:active, .tox-ctc:active { background-color: #edfced; } +.bitmessage-ctc:after, +.tox-ctc:after { + content: '📋'; +} .profile-modal .profile-tox, .profile-modal .profile-bitmessage { display: inline-block; width: 70px;