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 @@ @@ -314,6 +314,20 @@
</div>
<!-- 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 END -->

20
js/interface_common.js

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

11
js/interface_home.js

@ -132,9 +132,14 @@ var InterfaceFunctions = function() @@ -132,9 +132,14 @@ var InterfaceFunctions = function()
args.cbFunc(args.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() @@ -188,7 +188,7 @@ var MAL = function()
if( $.hasOwnProperty("mobile") ) {
return "#dmchat?user=" + username;
} else {
return "#dmchat?user=" + username;
return "#directmessages?user=" + username;
}
}
@ -315,6 +315,42 @@ var MAL = function() @@ -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) {
if( $.hasOwnProperty("mobile") ) {
$(".network-status").text(msg);

19
js/twister_following.js

@ -354,8 +354,7 @@ function follow(user, publicFollow, cbFunc, cbArg) { @@ -354,8 +354,7 @@ function follow(user, publicFollow, cbFunc, cbArg) {
if( followingUsers.indexOf(user) < 0 ) {
followingUsers.push(user);
twisterFollowingO.update(user);
$(".following-count").text(followingUsers.length-1);
setTimeout('requestTimelineUpdate("latest",postsPerRefresh,["'+user+'"],promotedPostsOnly)', 1000);
$(window).trigger("eventFollow", user)
}
if( publicFollow == undefined || publicFollow )
_isFollowPublic[user] = true;
@ -370,7 +369,7 @@ function unfollow(user, cbFunc, cbArg) { @@ -370,7 +369,7 @@ function unfollow(user, cbFunc, cbArg) {
if( i >= 0 ) {
followingUsers.splice(i,1);
twisterFollowingO.update(user);
$(".following-count").text(followingUsers.length-1);
$(window).trigger("eventUnfollow", user)
}
delete _isFollowPublic[user];
saveFollowing();
@ -731,9 +730,7 @@ function followingListUnfollow(e) { @@ -731,9 +730,7 @@ function followingListUnfollow(e) {
var $this = $(this);
var username = $this.closest(".mini-profile-info").attr("data-screen-name");
unfollow(username, function() {
showFollowingUsers();
});
unfollow(username);
}
function followingListPublicCheckbox(e) {
@ -844,6 +841,16 @@ function initInterfaceFollowing() { @@ -844,6 +841,16 @@ function initInterfaceFollowing() {
initMentionsCount();
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() { @@ -101,13 +101,7 @@ function requestMentionsCount() {
$.MAL.soundNotifyMentions();
if ($.Options.getShowDesktopNotifMentionsOpt() === 'enable') {
$.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_mentions', _newMentions)+'.', false,'twister_notification_new_mentions', $.Options.getShowDesktopNotifMentionsTimerOpt(), function() {
if (window.location.pathname === '/home.html' || window.location.pathname === '/following.html' ) {
openMentionsModal();
} else {
window.location.href = '/home.html#mentions?user='+defaultScreenName;
}
}, false)
$.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_mentions', _newMentions)+'.', false,'twister_notification_new_mentions', $.Options.getShowDesktopNotifMentionsTimerOpt(), function(){$.MAL.showMentions(defaultScreenName)}, false)
}
}
@ -121,13 +115,7 @@ function requestMentionsCount() { @@ -121,13 +115,7 @@ function requestMentionsCount() {
$.MAL.soundNotifyDM();
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() {
if (window.location.pathname === '/home.html' || window.location.pathname === '/following.html' ) {
window.location.hash = '#directmessages';
} else {
window.location.href = '/home.html#directmessages';
}
}, false)
$.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_direct_messages', newDMs)+'.', false, 'twister_notification_new_DMs', $.Options.getShowDesktopNotifDMsTimerOpt(), function(){$.MAL.showDMchat()}, false)
}
}
}

12
theme_nin/css/style.css

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

17
theme_nin/js/theme_option.js

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
$(function(){
$(function(){
$('.modal-close').html('');
$('.modal-back').html('');
$('.twister-user-remove').html('');
@ -13,7 +13,7 @@ $(function(){ @@ -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);
return false
});
@ -34,10 +34,17 @@ $(function(){ @@ -34,10 +34,17 @@ $(function(){
posScroll = $(document).scrollTop();
if(posScroll >= 250)
$('.left .post-area-new').slideDown(300);
else
else
$('.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 @@ -117,13 +117,23 @@ ul.userMenu-search-profiles
float: none
button
background-color: $main-color-dark
padding: 3px
@extend .extend-icon
@extend .icon-plus
&:after
content: ''
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"]
@ -141,6 +151,19 @@ ul.userMenu-search-profiles @@ -141,6 +151,19 @@ ul.userMenu-search-profiles
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 *******************************/
@ -488,14 +511,6 @@ textarea.splited-post @@ -488,14 +511,6 @@ textarea.splited-post
.twister-user-remove:hover
opacity: 1
button.follow
position: absolute
bottom: 10px
right: 10px
background: $main-color-color
&:hover
background: $main-color-light
.refresh-users
@extend .icon-arrows
@extend .extend-icon

1
tmobile.html

@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
<script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.storageapi.js"></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/twister_io.js?vr=10"></script>
<script src="js/polyglot.min.js?vr=10"></script>

Loading…
Cancel
Save