|
|
@ -208,8 +208,8 @@ function updateHashtagModal(postboard,hashtag,timeoutArgs) { |
|
|
|
requestHashtag(postboard,hashtag,resource,timeoutArgs); |
|
|
|
requestHashtag(postboard,hashtag,resource,timeoutArgs); |
|
|
|
|
|
|
|
|
|
|
|
if( _hashtagPendingPostsUpdated ) { |
|
|
|
if( _hashtagPendingPostsUpdated ) { |
|
|
|
if (resource != 'mention' && $.Options.getShowDesktopNotifPostsModalOpt() === 'enable') { |
|
|
|
if (resource != 'mention' && $.Options.showDesktopNotifPostsModal.val === 'enable') { |
|
|
|
$.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t("new_posts", _hashtagPendingPostsUpdated)+' '+polyglot.t('in search result')+'.', false,'twister_notification_new_posts_modal', $.Options.getShowDesktopNotifPostsModalTimerOpt(), function() { |
|
|
|
$.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t("new_posts", _hashtagPendingPostsUpdated)+' '+polyglot.t('in search result')+'.', false,'twister_notification_new_posts_modal', $.Options.showDesktopNotifPostsModalTimer.val, function() { |
|
|
|
$(".postboard-news").hide(); |
|
|
|
$(".postboard-news").hide(); |
|
|
|
displayHashtagPending($(".hashtag-modal .postboard-posts")); |
|
|
|
displayHashtagPending($(".hashtag-modal .postboard-posts")); |
|
|
|
}, false) |
|
|
|
}, false) |
|
|
@ -231,10 +231,9 @@ function openMentionsModal(e) |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!defaultScreenName) |
|
|
|
if (!defaultScreenName) { |
|
|
|
{ |
|
|
|
alert(polyglot.t("No one can mention you because you are not logged in.")); |
|
|
|
alert(polyglot.t("No one can mention you because you are not logged in.")); |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var username; |
|
|
|
var username; |
|
|
@ -483,7 +482,7 @@ function initHashWatching() |
|
|
|
if (window.navigator && window.navigator.registerProtocolHandler && !already_registered){ |
|
|
|
if (window.navigator && window.navigator.registerProtocolHandler && !already_registered){ |
|
|
|
var local_twister_url = window.location.protocol + '//' + window.location.host + '/home.html#%s'; |
|
|
|
var local_twister_url = window.location.protocol + '//' + window.location.host + '/home.html#%s'; |
|
|
|
window.navigator.registerProtocolHandler('web+twister', local_twister_url, 'Twister'); |
|
|
|
window.navigator.registerProtocolHandler('web+twister', local_twister_url, 'Twister'); |
|
|
|
_putResourceIntoStorage("twister_protocol_registered", true); |
|
|
|
_putResourceIntoStorage("twister_protocol_registered", true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Register hash spy and launch it once
|
|
|
|
// Register hash spy and launch it once
|
|
|
@ -500,9 +499,9 @@ var reTwistPopup = function( e ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(!defaultScreenName) |
|
|
|
if(!defaultScreenName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopPropagation(); |
|
|
|
alert(polyglot.t("You have to log in to retransmit messages.")); |
|
|
|
alert(polyglot.t('You have to log in to retransmit messages.')); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var reTwistClass = "reTwist"; |
|
|
|
var reTwistClass = "reTwist"; |
|
|
@ -628,7 +627,7 @@ var postExpandFunction = function( e, postLi ) |
|
|
|
|
|
|
|
|
|
|
|
$postExpandedContent.slideDown( "fast" ); |
|
|
|
$postExpandedContent.slideDown( "fast" ); |
|
|
|
|
|
|
|
|
|
|
|
if ($.Options.getShowPreviewOpt() == 'enable'){ |
|
|
|
if ($.Options.displayPreview.val === 'enable') { |
|
|
|
var previewContainer=$postExpandedContent.find(".preview-container")[0]; |
|
|
|
var previewContainer=$postExpandedContent.find(".preview-container")[0]; |
|
|
|
/* was the preview added before... */ |
|
|
|
/* was the preview added before... */ |
|
|
|
if ($(previewContainer).children().length == 0) { |
|
|
|
if ($(previewContainer).children().length == 0) { |
|
|
@ -676,9 +675,9 @@ var postReplyClick = function( e ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(!defaultScreenName) |
|
|
|
if(!defaultScreenName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopPropagation(); |
|
|
|
alert(polyglot.t("You have to log in to post replies.")); |
|
|
|
alert(polyglot.t('You have to log in to post replies.')); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var post = $(this).closest(".post"); |
|
|
|
var post = $(this).closest(".post"); |
|
|
|
if( !post.hasClass( "original" ) ) { |
|
|
|
if( !post.hasClass( "original" ) ) { |
|
|
@ -703,14 +702,13 @@ var composeNewPost = function( e, postAreaNew ) |
|
|
|
//se o usuário clicar fora é pra fechar
|
|
|
|
//se o usuário clicar fora é pra fechar
|
|
|
|
postAreaNew.clickoutside( unfocusThis ); |
|
|
|
postAreaNew.clickoutside( unfocusThis ); |
|
|
|
|
|
|
|
|
|
|
|
if ($.Options.getSplitPostsOpt() === "enable") |
|
|
|
if ($.Options.splitPosts.val === 'enable') |
|
|
|
usePostSpliting = true; |
|
|
|
usePostSpliting = true; |
|
|
|
else if ($.Options.getSplitPostsOpt() === "only-new") { |
|
|
|
else if ($.Options.splitPosts.val === 'only-new') { |
|
|
|
var $postOrig = postAreaNew.closest(".post-data"); |
|
|
|
var $postOrig = postAreaNew.closest(".post-data"); |
|
|
|
|
|
|
|
|
|
|
|
if (!$postOrig.length) { |
|
|
|
if (!$postOrig.length) |
|
|
|
$postOrig = postAreaNew.closest(".modal-content").find(".post-data"); |
|
|
|
$postOrig = postAreaNew.closest(".modal-content").find(".post-data"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($postOrig.length) |
|
|
|
if ($postOrig.length) |
|
|
|
usePostSpliting = false; |
|
|
|
usePostSpliting = false; |
|
|
@ -749,7 +747,7 @@ function replyTextInput(e) { |
|
|
|
var $this = $( this ); |
|
|
|
var $this = $( this ); |
|
|
|
var tweetForm = $this.parents("form"); |
|
|
|
var tweetForm = $this.parents("form"); |
|
|
|
if( tweetForm != undefined ) { |
|
|
|
if( tweetForm != undefined ) { |
|
|
|
if ($.Options.getUnicodeConversionOpt() !== "disable") |
|
|
|
if ($.Options.unicodeConversion.val !== 'disable') |
|
|
|
$this.val(convert2Unicodes($this.val(), $this)); |
|
|
|
$this.val(convert2Unicodes($this.val(), $this)); |
|
|
|
|
|
|
|
|
|
|
|
if (usePostSpliting && !$this.parents('.directMessages').length) { |
|
|
|
if (usePostSpliting && !$this.parents('.directMessages').length) { |
|
|
@ -933,14 +931,14 @@ function replyTextKeySend(e) { |
|
|
|
var tweetAction = tweetForm.find(".post-submit"); |
|
|
|
var tweetAction = tweetForm.find(".post-submit"); |
|
|
|
if( !tweetAction.length ) tweetAction = tweetForm.find(".dm-submit"); |
|
|
|
if( !tweetAction.length ) tweetAction = tweetForm.find(".dm-submit"); |
|
|
|
|
|
|
|
|
|
|
|
if( $.Options.keyEnterToSend() && $('.dropdown-menu').css('display') == 'none'){ |
|
|
|
if ($.Options.keysSend.val === 'enter' && $('.dropdown-menu').css('display') == 'none') { |
|
|
|
if (e.keyCode === 13 && (!e.metaKey && !e.ctrlKey)) { |
|
|
|
if (e.keyCode === 13 && (!e.metaKey && !e.ctrlKey)) { |
|
|
|
$this.val($this.val().trim()); |
|
|
|
$this.val($this.val().trim()); |
|
|
|
if( !tweetAction.hasClass("disabled")) { |
|
|
|
if( !tweetAction.hasClass("disabled")) { |
|
|
|
tweetAction.click(); |
|
|
|
tweetAction.click(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if( !$.Options.keyEnterToSend() ){ |
|
|
|
} else if ($.Options.keysSend.val === 'ctrlenter') { |
|
|
|
if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) { |
|
|
|
if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) { |
|
|
|
$this.val($this.val().trim()); |
|
|
|
$this.val($this.val().trim()); |
|
|
|
if( !tweetAction.hasClass("disabled") ) { |
|
|
|
if( !tweetAction.hasClass("disabled") ) { |
|
|
@ -1295,37 +1293,29 @@ function convert2Unicodes(s, ta) |
|
|
|
ta.data("disabledUnicodeRules", []); |
|
|
|
ta.data("disabledUnicodeRules", []); |
|
|
|
var ranges = getRangesForUnicodeConversion(s); |
|
|
|
var ranges = getRangesForUnicodeConversion(s); |
|
|
|
var list; |
|
|
|
var list; |
|
|
|
if ($.Options.getUnicodeConversionOpt() === "enable" || $.Options.getConvertPunctuationsOpt()) |
|
|
|
if ($.Options.unicodeConversion.val === 'enable' || $.Options.convertPunctuations.val) { |
|
|
|
{ |
|
|
|
|
|
|
|
list = unicodeConversionList.punctuation; |
|
|
|
list = unicodeConversionList.punctuation; |
|
|
|
s = getUnicodeReplacement(s, list, ranges, ta); |
|
|
|
s = getUnicodeReplacement(s, list, ranges, ta); |
|
|
|
} |
|
|
|
} |
|
|
|
if ($.Options.getUnicodeConversionOpt() === "enable"|| $.Options.getConvertEmotionsOpt()) |
|
|
|
if ($.Options.unicodeConversion.val === 'enable' || $.Options.convertEmotions.val) { |
|
|
|
{ |
|
|
|
|
|
|
|
list = unicodeConversionList.emotions; |
|
|
|
list = unicodeConversionList.emotions; |
|
|
|
s = getUnicodeReplacement(s, list, ranges, ta); |
|
|
|
s = getUnicodeReplacement(s, list, ranges, ta); |
|
|
|
} |
|
|
|
} |
|
|
|
if ($.Options.getUnicodeConversionOpt() === "enable"|| $.Options.getConvertSignsOpt()) |
|
|
|
if ($.Options.unicodeConversion.val === 'enable' || $.Options.convertSigns.val) { |
|
|
|
{ |
|
|
|
|
|
|
|
list = unicodeConversionList.signs; |
|
|
|
list = unicodeConversionList.signs; |
|
|
|
s = getUnicodeReplacement(s, list, ranges, ta); |
|
|
|
s = getUnicodeReplacement(s, list, ranges, ta); |
|
|
|
} |
|
|
|
} |
|
|
|
if ($.Options.getUnicodeConversionOpt() === "enable"|| $.Options.getConvertFractionsOpt()) |
|
|
|
if ($.Options.unicodeConversion.val === 'enable' || $.Options.convertFractions.val) { |
|
|
|
{ |
|
|
|
|
|
|
|
list = unicodeConversionList.fractions; |
|
|
|
list = unicodeConversionList.fractions; |
|
|
|
s = getUnicodeReplacement(s, list, ranges, ta); |
|
|
|
s = getUnicodeReplacement(s, list, ranges, ta); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ta.data("unicodeConversionStack").length > 0) |
|
|
|
if (ta.data("unicodeConversionStack").length > 0) { |
|
|
|
{ |
|
|
|
|
|
|
|
var ub = ta.closest(".post-area-new").find(".undo-unicode"); |
|
|
|
var ub = ta.closest(".post-area-new").find(".undo-unicode"); |
|
|
|
ub.text(polyglot.t("undo") + ": " + ta.data("unicodeConversionStack")[0].u); |
|
|
|
ub.text(polyglot.t("undo") + ": " + ta.data("unicodeConversionStack")[0].u); |
|
|
|
$.MAL.enableButton(ub); |
|
|
|
$.MAL.enableButton(ub); |
|
|
|
} |
|
|
|
} else |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$.MAL.disableButton(ta.closest(".post-area-new").find(".undo-unicode")); |
|
|
|
$.MAL.disableButton(ta.closest(".post-area-new").find(".undo-unicode")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return s; |
|
|
|
return s; |
|
|
|
} |
|
|
|
} |
|
|
@ -1471,7 +1461,7 @@ var retweetSubmit = function(e) |
|
|
|
|
|
|
|
|
|
|
|
function changeStyle() { |
|
|
|
function changeStyle() { |
|
|
|
var style, profile, menu; |
|
|
|
var style, profile, menu; |
|
|
|
var theme = $.Options.getTheme(); |
|
|
|
var theme = $.Options.theme.val; |
|
|
|
|
|
|
|
|
|
|
|
if(theme == 'nin') |
|
|
|
if(theme == 'nin') |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1582,7 +1572,7 @@ function initInterfaceCommon() { |
|
|
|
$( ".modal-propagate").click( retweetSubmit ); |
|
|
|
$( ".modal-propagate").click( retweetSubmit ); |
|
|
|
$( ".expanded-content .show-more").bind('click', openConversationClick); |
|
|
|
$( ".expanded-content .show-more").bind('click', openConversationClick); |
|
|
|
|
|
|
|
|
|
|
|
if ($.Options.getUnicodeConversionOpt() === "disable") |
|
|
|
if ($.Options.unicodeConversion.val === 'disable') |
|
|
|
$( ".undo-unicode" ).click( undoLastUnicode ).css("display", "none"); |
|
|
|
$( ".undo-unicode" ).click( undoLastUnicode ).css("display", "none"); |
|
|
|
else |
|
|
|
else |
|
|
|
$( ".undo-unicode" ).click( undoLastUnicode ); |
|
|
|
$( ".undo-unicode" ).click( undoLastUnicode ); |
|
|
@ -1601,7 +1591,7 @@ function initInterfaceCommon() { |
|
|
|
replaceDashboards(); |
|
|
|
replaceDashboards(); |
|
|
|
$( window ).resize(replaceDashboards); |
|
|
|
$( window ).resize(replaceDashboards); |
|
|
|
|
|
|
|
|
|
|
|
if ($.Options.getWhoToFollowOpt() === 'enable') |
|
|
|
if ($.Options.WhoToFollow.val === 'enable') |
|
|
|
initWhoToFollow(); |
|
|
|
initWhoToFollow(); |
|
|
|
else |
|
|
|
else |
|
|
|
killInterfaceModule('who-to-follow'); |
|
|
|
killInterfaceModule('who-to-follow'); |
|
|
|