|
|
@ -5,6 +5,8 @@ |
|
|
|
// Profile, mentions and hashtag modal
|
|
|
|
// Profile, mentions and hashtag modal
|
|
|
|
// Post actions: submit, count characters
|
|
|
|
// Post actions: submit, count characters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var preventSlide = false; |
|
|
|
|
|
|
|
|
|
|
|
//dispara o modal genérico
|
|
|
|
//dispara o modal genérico
|
|
|
|
//o modalClass me permite fazer tratamentos específicos de CSS para cada modal
|
|
|
|
//o modalClass me permite fazer tratamentos específicos de CSS para cada modal
|
|
|
|
function openModal( modalClass ) |
|
|
|
function openModal( modalClass ) |
|
|
@ -104,6 +106,12 @@ function openProfileModal(e) |
|
|
|
var $this = $( this ); |
|
|
|
var $this = $( this ); |
|
|
|
var username = $.MAL.urlToUser( $this.attr("href") ); |
|
|
|
var username = $.MAL.urlToUser( $this.attr("href") ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!username) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
alert(polyglot.t("You don't have any profile because you are not logged in.")); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var profileModalClass = "profile-modal"; |
|
|
|
var profileModalClass = "profile-modal"; |
|
|
|
openModal( profileModalClass ); |
|
|
|
openModal( profileModalClass ); |
|
|
|
|
|
|
|
|
|
|
@ -169,6 +177,11 @@ function openMentionsModal(e) |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopPropagation(); |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!defaultScreenName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
alert(polyglot.t("No one can mention you because you are not logged in.")); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
// reuse the same hashtag modal to show mentions
|
|
|
|
// reuse the same hashtag modal to show mentions
|
|
|
|
var hashtagModalClass = "hashtag-modal"; |
|
|
|
var hashtagModalClass = "hashtag-modal"; |
|
|
|
openModal( hashtagModalClass ); |
|
|
|
openModal( hashtagModalClass ); |
|
|
@ -224,6 +237,13 @@ function openFollowingModal(e) |
|
|
|
//dispara o modal de retweet
|
|
|
|
//dispara o modal de retweet
|
|
|
|
var reTwistPopup = function( e ) |
|
|
|
var reTwistPopup = function( e ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if(!defaultScreenName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
preventSlide=true; |
|
|
|
|
|
|
|
alert(polyglot.t("You have to log in to retransmit messages.")); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var reTwistClass = "reTwist"; |
|
|
|
var reTwistClass = "reTwist"; |
|
|
|
openModal( reTwistClass ); |
|
|
|
openModal( reTwistClass ); |
|
|
|
|
|
|
|
|
|
|
@ -296,7 +316,15 @@ var postExpandFunction = function( e, postLi ) |
|
|
|
var $postsRelated = postLi.find(".related"); |
|
|
|
var $postsRelated = postLi.find(".related"); |
|
|
|
|
|
|
|
|
|
|
|
var openClass = "open"; |
|
|
|
var openClass = "open"; |
|
|
|
if( !postLi.hasClass( openClass ) ) { |
|
|
|
|
|
|
|
|
|
|
|
//This is used in "guest mode", when user gets an alert that he can't reply or retransmit
|
|
|
|
|
|
|
|
//when not logged in. Otherwise, this click would also be understood as a command to open/close
|
|
|
|
|
|
|
|
//the post, which would look weird.
|
|
|
|
|
|
|
|
if(preventSlide) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
preventSlide=false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if( !postLi.hasClass( openClass ) ) { |
|
|
|
originalPost.detach(); |
|
|
|
originalPost.detach(); |
|
|
|
postLi.empty(); |
|
|
|
postLi.empty(); |
|
|
|
postLi.addClass( openClass ); |
|
|
|
postLi.addClass( openClass ); |
|
|
@ -347,6 +375,12 @@ var postExpandFunction = function( e, postLi ) |
|
|
|
|
|
|
|
|
|
|
|
var postReplyClick = function( e ) |
|
|
|
var postReplyClick = function( e ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if(!defaultScreenName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
preventSlide=true; |
|
|
|
|
|
|
|
alert(polyglot.t("You have to log in to post replies.")); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
var post = $(this).closest(".post"); |
|
|
|
var post = $(this).closest(".post"); |
|
|
|
if( !post.hasClass( "original" ) ) { |
|
|
|
if( !post.hasClass( "original" ) ) { |
|
|
|
replyInitPopup(e, post); |
|
|
|
replyInitPopup(e, post); |
|
|
|