Browse Source

Merge branch 'master' of git://github.com/iHedgehog/twister-calm

master
Denis Ryabov 11 years ago
parent
commit
de5b4eb6fb
  1. 16
      css/profile.css
  2. 9
      css/style.css
  3. 1
      following.html
  4. 30
      jquery-emotions/jquery.emotions.js
  5. 36
      js/calm.js
  6. 13
      js/interface_common.js
  7. 20
      js/interface_localization.js
  8. 1
      js/twister_actions.js
  9. 4
      js/twister_user.js

16
css/profile.css

@ -66,7 +66,8 @@
} }
.profile-card .direct-messages, .profile-card .direct-messages,
.profile-card .direct-messages-with-user, .profile-card .direct-messages-with-user,
.profile-card .follow .profile-card .follow,
.profile-card .profileUnfollow
{ {
display: block; display: block;
position: absolute; position: absolute;
@ -81,13 +82,15 @@
border: none; border: none;
transition: all .2s linear; transition: all .2s linear;
} }
.profile-card .follow .profile-card .follow,
.profile-card .profileUnfollow
{ {
right: 128px; right: 128px;
} }
.profile-card .direct-messages:hover, .profile-card .direct-messages:hover,
.profile-card .direct-messages-with-user:hover, .profile-card .direct-messages-with-user:hover,
.profile-card .follow:hover .profile-card .follow:hover,
.profile-card .profileUnfollow:hover
{ {
background: rgba( 0, 0, 0, .3 ); background: rgba( 0, 0, 0, .3 );
} }
@ -251,6 +254,10 @@ button.follow:hover {
background: #b2d67b; background: #b2d67b;
color: #fff; color: #fff;
} }
.profile-card .profileUnfollow:hover {
background: #e18882;
color: #fff;
}
.profile-modal button.direct-messages-with-user:hover { .profile-modal button.direct-messages-with-user:hover {
background: #b2d67b; background: #b2d67b;
color: #fff; color: #fff;
@ -305,7 +312,8 @@ button.follow:hover {
*/ */
.profile-modal .direct-messages, .profile-modal .direct-messages,
.profile-modal .direct-messages-with-user, .profile-modal .direct-messages-with-user,
.profile-modal .follow .profile-modal .follow,
.profile-card .profileUnfollow
{ {
bottom: 10px; bottom: 10px;
} }

9
css/style.css

@ -344,7 +344,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
.userMenu li.userMenu-dhtindicator a { .userMenu li.userMenu-dhtindicator a {
display: inline-block; display: inline-block;
font: 12px/25px "Open Sans", sans-serif; font: 12px/25px "Open Sans", sans-serif;
padding: 0 0 0 45px; padding: 0 5px 0 41px;
width: 60px; width: 60px;
height: 25px; height: 25px;
opacity: .9; opacity: .9;
@ -353,7 +353,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
content: 'DHT:'; content: 'DHT:';
display: inline-block; display: inline-block;
position: absolute; position: absolute;
left: 10px; left: 8px;
width: 70px; width: 70px;
height: 25px; height: 25px;
} }
@ -1038,7 +1038,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
{ {
float: right; float: right;
font-size: 12px; font-size: 12px;
margin: 5px 10px; margin-right: 5px;
opacity: .5; opacity: .5;
text-decoration: none; text-decoration: none;
} }
@ -1150,7 +1150,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
} }
.post-interactions .post-interactions
{ {
margin: 2px 10px 10px 60px; margin: -5px 10px 5px 60px;
text-align: right; text-align: right;
height: 25px; height: 25px;
} }
@ -1984,6 +1984,7 @@ ul.dropdown-menu > li > a {
clear: both; clear: both;
font: 13px/20px "Open Sans", sans-serif; font: 13px/20px "Open Sans", sans-serif;
white-space: nowrap; white-space: nowrap;
cursor: pointer;
-webkit-transition: all 200ms; -webkit-transition: all 200ms;
-moz-transition: all 200ms; -moz-transition: all 200ms;
-ms-transition: all 200ms; -ms-transition: all 200ms;

1
following.html

@ -22,6 +22,7 @@
<script src="js/twister_directmsg.js"></script> <script src="js/twister_directmsg.js"></script>
<script src="js/twister_actions.js"></script> <script src="js/twister_actions.js"></script>
<script src="js/interface_common.js"></script> <script src="js/interface_common.js"></script>
<script src="jquery-emotions/jquery.emotions.js"></script>
<script> <script>
$(document).ready(function() $(document).ready(function()

30
jquery-emotions/jquery.emotions.js

@ -33,28 +33,34 @@
"0:-)": "angel", "0:-)": "angel",
"o.O": "confused", "o.O": "confused",
"o_O": "confused", "o_O": "confused",
":'(": "cry",
"3:)": "devil", "3:)": "devil",
":(": "frown",
"=(": "frown",
":-(": "frown",
"8)": "glasses",
":D": "grin",
":-D": "grin",
">:(": "grumpy",
"<3": "heart", "<3": "heart",
":*": "kiss", ":*": "kiss",
":-)": "smile", ":-)": "smile",
":]": "smile", ":]": "smile",
":)": "smile",
"=)": "smile",
"(:": "smile",
"(-:": "smile",
"[:": "smile",
"(=": "smile",
"8|": "sunglasses", "8|": "sunglasses",
":p": "tongue",
":P": "tongue",
":/": "unsure", ":/": "unsure",
":\\": "unsure", ":\\": "unsure",
";)": "wink", ";)": "wink",
";-)": "wink", ";-)": "wink",
":'(": "cry", "(;": "wink",
">:(": "grumpy", "(-;": "wink"
":(": "frown",
"=(": "frown",
":-(": "frown",
"8)": "glasses",
":p": "tongue",
":P": "tongue",
":)": "smile",
"=)": "smile",
":D": "grin",
":-D": "grin"
} }
}, },
shortcode: function(eId){ shortcode: function(eId){

36
js/calm.js

@ -6,29 +6,29 @@ $(function(){
$('.post-text').on('click', 'a', function(e){ $('.post-text').on('click', 'a', function(e){
e.stopPropagation(); e.stopPropagation();
}); });
$('#showqr').on('click', function(){ $('#showqr').on('click', function(){
if($('#qrcode img')[0]) return; if($('#qrcode img')[0]) return;
var skey = document.getElementById('skey').innerText; var skey = document.getElementById('skey').innerText;
new QRCode(document.getElementById("qrcode"), skey); new QRCode(document.getElementById("qrcode"), skey);
}); });
})
function dhtIndicatorBg(){ function dhtIndicatorBg(){
var bgcolor = ''; var bgcolor = '';
if(twisterDhtNodes <= 10){bgcolor = '#770900' if(twisterDhtNodes <= 20){bgcolor = '#770900'
}else if(twisterDhtNodes <= 20){bgcolor = '#773400' }else if(twisterDhtNodes <= 60){bgcolor = '#773400'
}else if(twisterDhtNodes <= 30){bgcolor = '#774c00' }else if(twisterDhtNodes <= 90){bgcolor = '#774c00'
}else if(twisterDhtNodes <= 40){bgcolor = '#776400' }else if(twisterDhtNodes <= 120){bgcolor = '#776400'
}else if(twisterDhtNodes <= 50){bgcolor = '#707500' }else if(twisterDhtNodes <= 150){bgcolor = '#707500'
}else if(twisterDhtNodes <= 60){bgcolor = '#3f6900' }else if(twisterDhtNodes <= 180){bgcolor = '#3f6900'
}else if(twisterDhtNodes <= 70){bgcolor = '#005f15' }else if(twisterDhtNodes <= 210){bgcolor = '#005f15'
}else if(twisterDhtNodes >= 71){bgcolor = '#009922' }else if(twisterDhtNodes >= 250){bgcolor = '#009922'
} }
$('.userMenu-dhtindicator').animate({'background-color': bgcolor }); $('.userMenu-dhtindicator').animate({'background-color': bgcolor });
}; };
setTimeout(dhtIndicatorBg, 300); setTimeout(dhtIndicatorBg, 300);
setTimeout(function() {setInterval(dhtIndicatorBg, 2000)}, 400); setTimeout(function() {setInterval(dhtIndicatorBg, 2000)}, 400);
})
function modalDMIntr() { function modalDMIntr() {
$(".cancel").on('click', function(event){ $(".cancel").on('click', function(event){
@ -127,11 +127,11 @@ function keysSend() {
} }
function mensAutocomplete() { function mensAutocomplete() {
var storFollArr = JSON.parse(localStorage[localStorage.defaultScreenName]), suggests = []; var suggests = [];
for(var i = 0; i < storFollArr.followingUsers.length; i++){ for(var i = 0; i < followingUsers.length; i++){
if(storFollArr.followingUsers[i] == localStorage.defaultScreenName) continue; if(followingUsers[i] == localStorage.defaultScreenName) continue;
suggests.push(storFollArr.followingUsers[i]); suggests.push(followingUsers[i]);
} }
suggests.reverse(); suggests.reverse();
$('textarea').textcomplete([ $('textarea').textcomplete([

13
js/interface_common.js

@ -93,7 +93,6 @@ function newProfileModal(username) {
var profileModalContent = $( "#profile-modal-template" ).children().clone(true); var profileModalContent = $( "#profile-modal-template" ).children().clone(true);
updateProfileData(profileModalContent, username); updateProfileData(profileModalContent, username);
return profileModalContent; return profileModalContent;
} }
@ -113,6 +112,13 @@ function openProfileModal(e)
//título do modal //título do modal
$( "."+profileModalClass + " h3" ).text( polyglot.t("users_profile", { username: username }) ); $( "."+profileModalClass + " h3" ).text( polyglot.t("users_profile", { username: username }) );
//hed//add dinamic follow button in profile modal window
if(followingUsers.indexOf(username) != -1){
$('.profile-card button').first().removeClass('follow').addClass('profileUnfollow').text(polyglot.t('Unfollow')).on('click', function(){
unfollow(username);
});
};
} }
function newHashtagModal(hashtag) { function newHashtagModal(hashtag) {
@ -402,7 +408,6 @@ function replyTextKeypress(e) {
} }
} }
} }
} }
} }
@ -459,7 +464,7 @@ function initInterfaceCommon() {
$( ".userMenu-config-dropdown" ).bind( "click", dropDownMenu ); $( ".userMenu-config-dropdown" ).bind( "click", dropDownMenu );
$( ".config-menu" ).clickoutside( closeThis ); $( ".config-menu" ).clickoutside( closeThis );
$( ".module.post" ).bind( "click", function(e) { $( ".module.post" ).bind( "click", function(e) {
postExpandFunction(e,$(this)); }); if(window.getSelection() == 0)postExpandFunction(e,$(this)); });
$( ".post-area-new" ).bind( "click", function(e) { $( ".post-area-new" ).bind( "click", function(e) {
composeNewPost(e,$(this));} ); composeNewPost(e,$(this));} );
$( ".post-area-new" ).clickoutside( unfocusThis ); $( ".post-area-new" ).clickoutside( unfocusThis );
@ -467,7 +472,7 @@ function initInterfaceCommon() {
$( ".modal-propagate").click( retweetSubmit ); $( ".modal-propagate").click( retweetSubmit );
var $replyText = $( ".post-area-new textarea" ); var $replyText = $( ".post-area-new textarea" );
$replyText.on("keydown", replyTextKeypress ); $replyText.on("keyup", replyTextKeypress );
$( ".open-profile-modal").bind( "click", openProfileModal ); $( ".open-profile-modal").bind( "click", openProfileModal );
$( ".open-hashtag-modal").bind( "click", openHashtagModal ); $( ".open-hashtag-modal").bind( "click", openHashtagModal );

20
js/interface_localization.js

@ -797,7 +797,7 @@ if(preferredLanguage == "ru"){
"followed_by": "%{username} подписан", "followed_by": "%{username} подписан",
"Followers": "Читателей", "Followers": "Читателей",
"Following": "Читаемых", "Following": "Читаемых",
"Following users": "Подписанные пользователи", "Following users": "Читаемые пользователи",
"Force connection to peer:": "Принудительно подключиться к пиру:", "Force connection to peer:": "Принудительно подключиться к пиру:",
"General information": "Основное", "General information": "Основное",
"Generate blocks (send promoted messages)": "Генерация блоков (отправка рекламных сообщений)", "Generate blocks (send promoted messages)": "Генерация блоков (отправка рекламных сообщений)",
@ -859,7 +859,7 @@ if(preferredLanguage == "ru"){
"time_ago": "%{time} назад", // 5 minutes ago "time_ago": "%{time} назад", // 5 minutes ago
"Time of the last block:": "Время последнего блока: ", "Time of the last block:": "Время последнего блока: ",
"Top Trends": "Тенденции", "Top Trends": "Тенденции",
"Type message here": "Введите ваше сообщение тут", "Type message here": "Введите здесь ваше сообщение",
"Unfollow": "Отписаться", "Unfollow": "Отписаться",
"Update": "Обновить", "Update": "Обновить",
"Updating status...": "Обновление информации...", // status of block chain "Updating status...": "Обновление информации...", // status of block chain
@ -874,20 +874,20 @@ if(preferredLanguage == "ru"){
"twister'a).\n\n" + "twister'a).\n\n" +
"Хозяйке на заметку: Сейчас вы можете выбрать аватар!", "Хозяйке на заметку: Сейчас вы можете выбрать аватар!",
"users_mentions": "Ответ от @%{username}", "users_mentions": "Ответ от @%{username}",
"users_profile": "%{username}'s профиль", "users_profile": "Профиль пользователя %{username}",
"username_undefined": "Имя пользователя не определено, требуется войти.", "username_undefined": "Имя пользователя не определено, требуется войти.",
"View": "Просмотреть", "View": "Просмотреть",
"View All": "Просмотреть Всё", "View All": "Просмотреть всё",
"Who to Follow": "Кого почитать", "Who to Follow": "Кого почитать",
"Your message was sent!": "Ваше сообщение было отправлено!", "Your message was sent!": "Ваше сообщение отправлено!",
"twister login": "Вход в twister", "twister login": "Вход в twister",
"Existing local users": "Уже зарегистрированные", "Existing local users": "Предыдущие аккаунты",
"Or...": "Или...", "Or...": "Или...",
"Create a new user": "Зарегистрировать нового пользователя", "Create a new user": "Создать новый аккаунт",
"Login": "Войти", "Login": "Войти",
"Check availability": "Проверить на доступность", "Check availability": "Проверить, занят ли ник",
"Create this nickname": "Зарегистировать этот ник", "Create this nickname": "Создать аккаунт",
"Type nickname here": "Введите ваш ник тут", "Type nickname here": "Введите ник",
"Import secret key": "Импортировать секретный ключ", "Import secret key": "Импортировать секретный ключ",
"52-characters secret": "52-значный ключ", "52-characters secret": "52-значный ключ",
"With nickname": "С логином", "With nickname": "С логином",

1
js/twister_actions.js

@ -191,6 +191,7 @@ function clearHashtagProcessed() {
} }
function requestHashtag(postboard,hashtag,resource) { function requestHashtag(postboard,hashtag,resource) {
if(/[a-z]/i.test(hashtag))hashtag = hashtag.toLowerCase(); //hed//fix english hashtag case dependency bug
dhtget( hashtag, resource, "m", dhtget( hashtag, resource, "m",
function(args, data) { function(args, data) {
processHashtag(args.postboard, args.hashtag, data); processHashtag(args.postboard, args.hashtag, data);

4
js/twister_user.js

@ -171,7 +171,7 @@ function sendNewUserTransaction(username, cbFunc) {
function importSecretKeypress() { function importSecretKeypress() {
var secretKey = $(".secret-key-import").val(); var secretKey = $(".secret-key-import").val();
var username = $(".username-import").val(); var username = $(".username-import").val().toLowerCase();
var $importButton = $(".import-secret-key"); var $importButton = $(".import-secret-key");
if( secretKey.length == 52 && username.length ) { if( secretKey.length == 52 && username.length ) {
@ -183,7 +183,7 @@ function importSecretKeypress() {
function importSecretKeyClick() { function importSecretKeyClick() {
var secretKey = $(".secret-key-import").val(); var secretKey = $(".secret-key-import").val();
var username = $(".username-import").val(); var username = $(".username-import").val().toLowerCase();
twisterRpc("importprivkey", [secretKey,username], twisterRpc("importprivkey", [secretKey,username],
function(args, ret) { function(args, ret) {

Loading…
Cancel
Save