Browse Source

prompt template to following, follow-unfollow window events and listeners, MAL.showMentions and MAL.showDMchat, notify.js to tmobile

master
Simon Grim 10 years ago
parent
commit
ac59448db0
  1. 14
      following.html
  2. 20
      js/interface_common.js
  3. 11
      js/interface_home.js
  4. 38
      js/mobile_abstract.js
  5. 19
      js/twister_following.js
  6. 16
      js/twister_newmsgs.js
  7. 12
      theme_nin/css/style.css
  8. 17
      theme_nin/js/theme_option.js
  9. 35
      theme_nin/sass/style.sass
  10. 1
      tmobile.html

14
following.html

@ -314,6 +314,20 @@
</div> </div>
<!-- TEMPLATE DO MODAL GENÉRICO END --> <!-- TEMPLATE DO MODAL GENÉRICO END -->
<!-- TEMPLATE GENERAL PROMPT -->
<div class="prompt-wrapper">
<div class="modal-header">
<h3></h3>
<span class="modal-close prompt-close">&times;</span>
</div>
<div class="modal-content"></div>
<div class="modal-buttons">
<button class="modal-cancel prompt-close">Cancel</button>
<button class="modal-propagate">Retransmit</button>
</div>
</div>
<!-- TEMPLATE GENERAL PROMPT END-->
<!-- MODAL DE RETWEET INIT --> <!-- MODAL DE RETWEET INIT -->
<!-- MODAL DE RETWEET END --> <!-- MODAL DE RETWEET END -->

20
js/interface_common.js

@ -574,23 +574,15 @@ function toggleFollowButton(button, followingUser) {
.removeClass("unfollow") .removeClass("unfollow")
.addClass("follow") .addClass("follow")
.unbind("click") .unbind("click")
.bind("click", userClickFollow); .bind("click", userClickFollow)
.text(polyglot.t('Follow'))
if ($.Options.getTheme() === 'nin') { .trigger("toggleFollow");
this.attr('title', polyglot.t('Follow'));
} else {
this.text(polyglot.t('Follow'));
}
}).bind($(e.target)) }).bind($(e.target))
); );
}).bind(followingUser) }).bind(followingUser)
); )
.text(polyglot.t('Unfollow'))
if ($.Options.getTheme() === 'nin') { .trigger("toggleUnfollow");
button.attr('title', polyglot.t('Unfollow'));
} else {
button.text(polyglot.t('Unfollow'));
}
} }
var postExpandFunction = function( e, postLi ) var postExpandFunction = function( e, postLi )

11
js/interface_home.js

@ -132,9 +132,14 @@ var InterfaceFunctions = function()
args.cbFunc(args.cbArg); args.cbFunc(args.cbArg);
}, {cbFunc:cbFunc, cbArg:cbArg}); }, {cbFunc:cbFunc, cbArg:cbArg});
$(window)
.on("eventFollow", function(e, user) {
$(".following-count").text(followingUsers.length-1);
setTimeout('requestTimelineUpdate("latest",postsPerRefresh,["'+user+'"],promotedPostsOnly)', 1000);
})
.on("eventUnfollow", function(e, user) {
$(".following-count").text(followingUsers.length-1);
});
} }
} }
}; };

38
js/mobile_abstract.js

@ -188,7 +188,7 @@ var MAL = function()
if( $.hasOwnProperty("mobile") ) { if( $.hasOwnProperty("mobile") ) {
return "#dmchat?user=" + username; return "#dmchat?user=" + username;
} else { } else {
return "#dmchat?user=" + username; return "#directmessages?user=" + username;
} }
} }
@ -315,6 +315,42 @@ var MAL = function()
} }
} }
this.showMentions = function(username) {
if( $.hasOwnProperty("mobile") ) {
$.mobile.navigate( this.mentionsUrl(username) );
} else {
if ($(".postboard").length) {
openMentionsModal();
} else {
window.location.href = 'home.html'+this.mentionsUrl(username);
}
}
}
this.showDMchat = function(username) {
if (username) {
if( $.hasOwnProperty("mobile") ) {
$.mobile.navigate( this.dmchatUrl(username) );
} else {
if ($(".postboard").length) {
window.location.hash = this.dmchatUrl(username);
} else {
window.location.href = 'home.html'+this.dmchatUrl(username);
}
}
} else {
if( $.hasOwnProperty("mobile") ) {
$.mobile.navigate( '#directmsg' );
} else {
if ($(".postboard").length) {
window.location.hash = '#directmessages';
} else {
window.location.href = 'home.html#directmessages';
}
}
}
}
this.setNetworkStatusMsg = function(msg, statusGood) { this.setNetworkStatusMsg = function(msg, statusGood) {
if( $.hasOwnProperty("mobile") ) { if( $.hasOwnProperty("mobile") ) {
$(".network-status").text(msg); $(".network-status").text(msg);

19
js/twister_following.js

@ -354,8 +354,7 @@ function follow(user, publicFollow, cbFunc, cbArg) {
if( followingUsers.indexOf(user) < 0 ) { if( followingUsers.indexOf(user) < 0 ) {
followingUsers.push(user); followingUsers.push(user);
twisterFollowingO.update(user); twisterFollowingO.update(user);
$(".following-count").text(followingUsers.length-1); $(window).trigger("eventFollow", user)
setTimeout('requestTimelineUpdate("latest",postsPerRefresh,["'+user+'"],promotedPostsOnly)', 1000);
} }
if( publicFollow == undefined || publicFollow ) if( publicFollow == undefined || publicFollow )
_isFollowPublic[user] = true; _isFollowPublic[user] = true;
@ -370,7 +369,7 @@ function unfollow(user, cbFunc, cbArg) {
if( i >= 0 ) { if( i >= 0 ) {
followingUsers.splice(i,1); followingUsers.splice(i,1);
twisterFollowingO.update(user); twisterFollowingO.update(user);
$(".following-count").text(followingUsers.length-1); $(window).trigger("eventUnfollow", user)
} }
delete _isFollowPublic[user]; delete _isFollowPublic[user];
saveFollowing(); saveFollowing();
@ -731,9 +730,7 @@ function followingListUnfollow(e) {
var $this = $(this); var $this = $(this);
var username = $this.closest(".mini-profile-info").attr("data-screen-name"); var username = $this.closest(".mini-profile-info").attr("data-screen-name");
unfollow(username, function() { unfollow(username);
showFollowingUsers();
});
} }
function followingListPublicCheckbox(e) { function followingListPublicCheckbox(e) {
@ -844,6 +841,16 @@ function initInterfaceFollowing() {
initMentionsCount(); initMentionsCount();
initDMsCount(); initDMsCount();
}); });
$(window)
.on("eventFollow", function(e, user) {
$(".following-count").text(followingUsers.length-1);
showFollowingUsers();
})
.on("eventUnfollow", function(e, user) {
$(".following-count").text(followingUsers.length-1);
showFollowingUsers();
});
} }

16
js/twister_newmsgs.js

@ -101,13 +101,7 @@ function requestMentionsCount() {
$.MAL.soundNotifyMentions(); $.MAL.soundNotifyMentions();
if ($.Options.getShowDesktopNotifMentionsOpt() === 'enable') { if ($.Options.getShowDesktopNotifMentionsOpt() === 'enable') {
$.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_mentions', _newMentions)+'.', false,'twister_notification_new_mentions', $.Options.getShowDesktopNotifMentionsTimerOpt(), function() { $.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_mentions', _newMentions)+'.', false,'twister_notification_new_mentions', $.Options.getShowDesktopNotifMentionsTimerOpt(), function(){$.MAL.showMentions(defaultScreenName)}, false)
if (window.location.pathname === '/home.html' || window.location.pathname === '/following.html' ) {
openMentionsModal();
} else {
window.location.href = '/home.html#mentions?user='+defaultScreenName;
}
}, false)
} }
} }
@ -121,13 +115,7 @@ function requestMentionsCount() {
$.MAL.soundNotifyDM(); $.MAL.soundNotifyDM();
if ($.Options.getShowDesktopNotifDMsOpt() === 'enable') { if ($.Options.getShowDesktopNotifDMsOpt() === 'enable') {
$.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_direct_messages', newDMs)+'.', false, 'twister_notification_new_DMs', $.Options.getShowDesktopNotifDMsTimerOpt(), function() { $.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_direct_messages', newDMs)+'.', false, 'twister_notification_new_DMs', $.Options.getShowDesktopNotifDMsTimerOpt(), function(){$.MAL.showDMchat()}, false)
if (window.location.pathname === '/home.html' || window.location.pathname === '/following.html' ) {
window.location.hash = '#directmessages';
} else {
window.location.href = '/home.html#directmessages';
}
}, false)
} }
} }
} }

12
theme_nin/css/style.css

@ -2318,13 +2318,21 @@ textarea.splited-post {
opacity: 1; opacity: 1;
} }
/* line 491, ../sass/style.sass */ /* line 127, ../sass/style.sass */
button.follow, .mini-profile-actions span.follow, button.unfollow, .mini-profile-actions span.unfollow { ul.userMenu-search-profiles .follow, ul.userMenu-search-profiles .unfollow, .follow-suggestions .follow, .follow-suggestions .unfollow {
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
right: 10px; right: 10px;
}
ul.userMenu-search-profiles .follow, .follow-suggestions .follow {
background: #B4C669; background: #B4C669;
} }
ul.userMenu-search-profiles .unfollow, .follow-suggestions .unfollow {
background-color: #66686B;
}
/* line 496, ../sass/style.sass */ /* line 496, ../sass/style.sass */
button.follow:hover, .mini-profile-actions span.follow:hover, button.unfollow, .mini-profile-actions span.unfollow { button.follow:hover, .mini-profile-actions span.follow:hover, button.unfollow, .mini-profile-actions span.unfollow {
background: #aaa; background: #aaa;

17
theme_nin/js/theme_option.js

@ -1,5 +1,5 @@
$(function(){ $(function(){
$('.modal-close').html(''); $('.modal-close').html('');
$('.modal-back').html(''); $('.modal-back').html('');
$('.twister-user-remove').html(''); $('.twister-user-remove').html('');
@ -13,7 +13,7 @@ $(function(){
}); });
$( '.userMenu-home.current a' ).on( 'click', function() { $( '.userMenu-home.current a' ).on( 'click', function() {
$('html, body').animate({scrollTop:0},300); $('html, body').animate({scrollTop:0},300);
return false return false
}); });
@ -34,10 +34,17 @@ $(function(){
posScroll = $(document).scrollTop(); posScroll = $(document).scrollTop();
if(posScroll >= 250) if(posScroll >= 250)
$('.left .post-area-new').slideDown(300); $('.left .post-area-new').slideDown(300);
else else
$('.left .post-area-new').slideUp(150); $('.left .post-area-new').slideUp(150);
}); });
$(".userMenu-search-profiles .follow")
.on("toggleFollow", function() {
$(this).text('').attr('title', polyglot.t('Follow'));
})
.on("toggleUnfollow", function() {
$(this).text('').attr('title', polyglot.t('Unfollow'));
});
}); });

35
theme_nin/sass/style.sass

@ -117,13 +117,23 @@ ul.userMenu-search-profiles
float: none float: none
button button
background-color: $main-color-dark
padding: 3px padding: 3px
@extend .extend-icon @extend .extend-icon
@extend .icon-plus
&:after &:after
content: '' content: ''
font-family: $symbol-font-family font-family: $symbol-font-family
.follow .unfollow
position: absolute
bottom: 10px
right: 10px
&:hover
background-color: $main-color-light
.follow
background-color: $main-color-color
@extend .icon-plus
.unfollow
background-color: $main-color-dark
@extend .icon-minus
.userMenu-search input[type="text"] .userMenu-search input[type="text"]
@ -141,6 +151,19 @@ ul.userMenu-search-profiles
clear: both clear: both
.follow-suggestions
button
.follow .unfollow
position: absolute
bottom: 10px
right: 10px
&:hover
background-color: $main-color-light
.follow
background-color: $main-color-color
.unfollow
background-color: $main-color-dark
/***************** MINI PROFILE *******************************/ /***************** MINI PROFILE *******************************/
@ -488,14 +511,6 @@ textarea.splited-post
.twister-user-remove:hover .twister-user-remove:hover
opacity: 1 opacity: 1
button.follow
position: absolute
bottom: 10px
right: 10px
background: $main-color-color
&:hover
background: $main-color-light
.refresh-users .refresh-users
@extend .icon-arrows @extend .icon-arrows
@extend .extend-icon @extend .extend-icon

1
tmobile.html

@ -28,6 +28,7 @@
<script src="js/jquery.jsonrpcclient.js"></script> <script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.storageapi.js"></script> <script src="js/jquery.storageapi.js"></script>
<script src="js/options.js?vr=10"></script> <script src="js/options.js?vr=10"></script>
<script src="js/notify.js"></script>
<script src="js/mobile_abstract.js?vr=10"></script> <script src="js/mobile_abstract.js?vr=10"></script>
<script src="js/twister_io.js?vr=10"></script> <script src="js/twister_io.js?vr=10"></script>
<script src="js/polyglot.min.js?vr=10"></script> <script src="js/polyglot.min.js?vr=10"></script>

Loading…
Cancel
Save