mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-02-05 03:24:17 +00:00
fix updating of minimized modals / add resuming from desktop notifications
This commit is contained in:
parent
44641a5271
commit
6a6b3aba5d
@ -139,10 +139,44 @@ function resumeModal(event) {
|
|||||||
// TODO also need reset modal height here maybe and then compute new scroll
|
// TODO also need reset modal height here maybe and then compute new scroll
|
||||||
if (modal.scroll)
|
if (modal.scroll)
|
||||||
modal.self.find($(modal.scroll.targetSelector).scrollTop(modal.scroll.top));
|
modal.self.find($(modal.scroll.targetSelector).scrollTop(modal.scroll.top));
|
||||||
|
|
||||||
|
if (modal.resume && typeof modal.resume.cbFunc === 'function')
|
||||||
|
modal.resume.cbFunc(modal.resume.cbArg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function focusModalWithElement(elem, cbFunc, cbArg) {
|
||||||
|
if (elem.jquery ? elem.is('html *') : $(elem).is('html *')) {
|
||||||
|
cbFunc(cbArg);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hash = getHashOfMinimizedModalWithElem(elem);
|
||||||
|
if (hash) {
|
||||||
|
_minimizedModals[hash].resume = {cbFunc: cbFunc, cbArg: cbArg};
|
||||||
|
_minimizedModals[hash].btnResume.click();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getHashOfMinimizedModalWithElem(elem) {
|
||||||
|
for (var i in _minimizedModals)
|
||||||
|
if (_minimizedModals[i] && _minimizedModals[i].self.find(elem).length)
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function isModalWithElemExists(elem) {
|
||||||
|
if (elem.jquery ? elem.is('html *') : $(elem).is('html *'))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return getHashOfMinimizedModalWithElem(elem) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
function confirmPopup(event, req) {
|
function confirmPopup(event, req) {
|
||||||
if (event && event.stopPropagation) {
|
if (event && event.stopPropagation) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
@ -331,29 +365,37 @@ function openHashtagModalFromSearchHandler(hashtag) {
|
|||||||
title: '#' + hashtag
|
title: '#' + hashtag
|
||||||
});
|
});
|
||||||
|
|
||||||
clearHashtagProcessed();
|
setupQueryModalUpdating(modal.content.find('.postboard-posts'), hashtag, 'hashtag');
|
||||||
updateHashtagModal(modal.content.find('.postboard-posts'), hashtag, 'hashtag');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateHashtagModal(postboard, hashtag, resource, timeoutArgs) {
|
function setupQueryModalUpdating(postboard, query, resource) {
|
||||||
if (postboard.is('html *')) {
|
var req = {
|
||||||
requestHashtag(postboard, hashtag, resource, timeoutArgs);
|
postboard: postboard,
|
||||||
|
query: query,
|
||||||
|
resource: resource,
|
||||||
|
id: query + '@' + resource
|
||||||
|
};
|
||||||
|
|
||||||
if (_hashtagPendingPostsUpdated) {
|
postboard.attr('data-request-id', req.id);
|
||||||
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.showDesktopNotifPostsModalTimer.val, function() {
|
|
||||||
$('.postboard-news').hide();
|
|
||||||
displayHashtagPending($('.hashtag-modal .postboard-posts'));
|
|
||||||
}, false)
|
|
||||||
}
|
|
||||||
_hashtagPendingPostsUpdated = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// use extended timeout parameters on modal refresh (requires twister_core >= 0.9.14).
|
requestQuery(req);
|
||||||
// our first query above should be faster (with default timeoutArgs of twisterd),
|
|
||||||
// then we may possibly collect more posts on our second try by waiting more.
|
// use extended timeout parameters on modal refresh (requires twister_core >= 0.9.14).
|
||||||
setTimeout(updateHashtagModal, 5000, postboard, hashtag, resource, [10000,2000,3]);
|
// our first query above should be faster (with default timeoutArgs of twisterd),
|
||||||
|
// then we may possibly collect more posts on our second try by waiting more.
|
||||||
|
req.timeoutArgs = [10000, 2000, 3];
|
||||||
|
|
||||||
|
postboard.attr('data-request-interval', setInterval(updateQueryModal, 5000, req)); // FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateQueryModal(req) {
|
||||||
|
if (!isModalWithElemExists(req.postboard)) {
|
||||||
|
clearInterval(req.postboard.attr('data-request-interval'));
|
||||||
|
clearQueryProcessed(req.id);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requestQuery(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openMentionsModal(e) {
|
function openMentionsModal(e) {
|
||||||
@ -382,12 +424,16 @@ function openMentionsModalHandler(username) {
|
|||||||
title: polyglot.t('users_mentions', {username: username})
|
title: polyglot.t('users_mentions', {username: username})
|
||||||
});
|
});
|
||||||
|
|
||||||
clearHashtagProcessed();
|
setupQueryModalUpdating(modal.content.find('.postboard-posts'), username, 'mention');
|
||||||
updateHashtagModal(modal.content.find('.postboard-posts'), username, 'mention');
|
|
||||||
|
|
||||||
if (username === defaultScreenName) {
|
if (username === defaultScreenName) {
|
||||||
// obtain already cached mention posts from twister_newmsgs.js
|
// obtain already cached mention posts from twister_newmsgs.js
|
||||||
processHashtag(modal.content.find('.postboard-posts'), defaultScreenName, getMentionsData());
|
processQuery({
|
||||||
|
postboard: modal.content.find('.postboard-posts'),
|
||||||
|
query: defaultScreenName,
|
||||||
|
resource: 'mention',
|
||||||
|
posts: getMentionsData()
|
||||||
|
});
|
||||||
resetMentionsCount();
|
resetMentionsCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -473,14 +519,9 @@ function newConversationModal(username, resource) {
|
|||||||
var postLi = postboard.children().first()
|
var postLi = postboard.children().first()
|
||||||
.css('display', 'none');
|
.css('display', 'none');
|
||||||
getTopPostOfConversation(postLi, null, postboard);
|
getTopPostOfConversation(postLi, null, postboard);
|
||||||
}, {content:content}
|
}, {content: content}
|
||||||
);
|
);
|
||||||
|
|
||||||
content.find('.postboard-news').on('click', function () {
|
|
||||||
$(this).hide();
|
|
||||||
displayHashtagPending($('.conversation-modal .postboard-posts'));
|
|
||||||
});
|
|
||||||
|
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,7 +535,7 @@ function openConversationClick(e) {
|
|||||||
':post' + postData.attr('data-id');
|
':post' + postData.attr('data-id');
|
||||||
}
|
}
|
||||||
|
|
||||||
function openConversationModal(username,resource) {
|
function openConversationModal(username, resource) {
|
||||||
openModal({
|
openModal({
|
||||||
classAdd: 'conversation-modal',
|
classAdd: 'conversation-modal',
|
||||||
content: newConversationModal(username, resource),
|
content: newConversationModal(username, resource),
|
||||||
@ -1693,7 +1734,7 @@ function initInterfaceCommon() {
|
|||||||
|
|
||||||
$('#hashtag-modal-template .postboard-news').on('click', function () {
|
$('#hashtag-modal-template .postboard-news').on('click', function () {
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
displayHashtagPending($('.hashtag-modal .postboard-posts'));
|
displayQueryPending($('.hashtag-modal .postboard-posts'));
|
||||||
});
|
});
|
||||||
|
|
||||||
replaceDashboards();
|
replaceDashboards();
|
||||||
|
@ -538,22 +538,27 @@ function encode_utf8(s) {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
var hashtag_elem;
|
var tmobileQueryReq = {}; // FIXME need to rework all that searching
|
||||||
var hashtag_tag;
|
|
||||||
var hashtag_res;
|
function setupHashtagOrMention(postboard, tag, res) {
|
||||||
function setupHashtagOrMention( ulElem, tag, res) {
|
|
||||||
hashtag_elem = ulElem;
|
|
||||||
hashtag_tag = tag;
|
|
||||||
hashtag_res = res;
|
|
||||||
hashtag_elem.text("");
|
|
||||||
$.MAL.setPostTemplate( $("#post-template-home") );
|
$.MAL.setPostTemplate( $("#post-template-home") );
|
||||||
$.mobile.showPageLoadingMsg();
|
$.mobile.showPageLoadingMsg();
|
||||||
clearHashtagProcessed();
|
|
||||||
if( tag == defaultScreenName && res == "mention" ) {
|
var reqId = tag + '@' + res;
|
||||||
|
|
||||||
|
clearQueryProcessed(reqId);
|
||||||
|
|
||||||
|
tmobileQueryReq.postboard = postboard.text('').attr('data-request-id', reqId);
|
||||||
|
tmobileQueryReq.query = tag;
|
||||||
|
tmobileQueryReq.resource = res;
|
||||||
|
|
||||||
|
if (tag === defaultScreenName && res === 'mention') {
|
||||||
// obtain already cached mention posts from twister_newmsgs.js
|
// obtain already cached mention posts from twister_newmsgs.js
|
||||||
processHashtag(hashtag_elem, defaultScreenName, getMentionsData() );
|
tmobileQueryReq.posts = getMentionsData();
|
||||||
|
processQuery(tmobileQueryReq);
|
||||||
}
|
}
|
||||||
requestHashtag(hashtag_elem,hashtag_tag,hashtag_res);
|
|
||||||
|
requestQuery(tmobileQueryReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
// every 2 seconds do something page specific.
|
// every 2 seconds do something page specific.
|
||||||
@ -575,10 +580,12 @@ function tmobileTick() {
|
|||||||
}
|
}
|
||||||
}, {} );
|
}, {} );
|
||||||
}
|
}
|
||||||
if( curPage == "mentions" || curPage == "hashtag" ) {
|
|
||||||
autoUpdateHashtag = true;
|
else if (curPage === 'mentions' || curPage === 'hashtag') {
|
||||||
requestHashtag(hashtag_elem,hashtag_tag,hashtag_res);
|
autoUpdateQuery = true;
|
||||||
|
requestQuery(tmobileQueryReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( curPage == "dmchat" ) {
|
if( curPage == "dmchat" ) {
|
||||||
requestDmConversation($("#dmchat ul.direct-messages-list"),dmChatUser);
|
requestDmConversation($("#dmchat ul.direct-messages-list"),dmChatUser);
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,9 @@
|
|||||||
var postsPerRefresh = 10;
|
var postsPerRefresh = 10;
|
||||||
var maxExpandPost = 8;
|
var maxExpandPost = 8;
|
||||||
var maxExpandPostTop = 4;
|
var maxExpandPostTop = 4;
|
||||||
var _hashtagProcessedMap = {};
|
var _queryProcessedMap = {};
|
||||||
var _hashtagPendingPosts = [];
|
var _queryPendingPosts = {};
|
||||||
var _hashtagPendingPostsUpdated = 0;
|
var autoUpdateQuery = false;
|
||||||
var autoUpdateHashtag = false;
|
|
||||||
|
|
||||||
// ----------------
|
// ----------------
|
||||||
|
|
||||||
@ -365,63 +364,98 @@ function updateProfilePosts(postsView, username, useGetposts) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearHashtagProcessed() {
|
function clearQueryProcessed(id) {
|
||||||
_hashtagProcessedMap = {};
|
if (!id) return;
|
||||||
_hashtagPendingPosts = [];
|
|
||||||
|
_queryProcessedMap[id] = {};
|
||||||
|
_queryPendingPosts[id] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
function requestHashtag(postboard, hashtag, resource, timeoutArgs) {
|
function requestQuery(req) {
|
||||||
postboard.closest("div").find(".postboard-loading").show();
|
req.postboard.closest('div').find('.postboard-loading').show();
|
||||||
dhtget(hashtag, resource, "m",
|
dhtget(req.query, req.resource, 'm',
|
||||||
function(args, data) {processHashtag(args.postboard, args.hashtag, data);},
|
function(req, posts) {
|
||||||
{postboard:postboard,hashtag:hashtag},
|
req.posts = posts;
|
||||||
timeoutArgs
|
processQuery(req);
|
||||||
|
},
|
||||||
|
req,
|
||||||
|
req.timeoutArgs
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function processHashtag(postboard, hashtag, data) {
|
function processQuery(req) {
|
||||||
if( data && window.location.hash.indexOf(encodeURIComponent(hashtag)) != -1 ) {
|
if (!isModalWithElemExists(req.postboard) || !req.posts || !req.posts.length)
|
||||||
for( var i = data.length-1; i >= 0; i-- ) {
|
return;
|
||||||
var userpost = data[i]["userpost"];
|
|
||||||
var key = userpost["n"] + ";" + userpost["time"];
|
|
||||||
if( !(key in _hashtagProcessedMap) ) {
|
|
||||||
_hashtagProcessedMap[key] = true;
|
|
||||||
|
|
||||||
if ($.Options.filterLang.val !== 'disable' && $.Options.filterLangForSearching.val) {
|
if (!req.id)
|
||||||
if (typeof(userpost['rt']) !== 'undefined') {
|
req.id = req.query + '@' + req.resource;
|
||||||
var msg = userpost['rt']['msg'];
|
if (typeof _queryProcessedMap[req.id] !== 'object')
|
||||||
} else {
|
_queryProcessedMap[req.id] = {};
|
||||||
var msg = userpost['msg'];
|
if (typeof _queryPendingPosts[req.id] !== 'object')
|
||||||
}
|
_queryPendingPosts[req.id] = [];
|
||||||
langFilterData = filterLang(msg);
|
|
||||||
if ($.Options.filterLangSimulate.val) {
|
for (var i = req.posts.length - 1; i >= 0; i--) {
|
||||||
data[i]['langFilter'] = langFilterData;
|
var userpost = req.posts[i].userpost;
|
||||||
} else {
|
var key = userpost.n + ';' + userpost.time;
|
||||||
if (!langFilterData['pass'])
|
|
||||||
continue;
|
if (!_queryProcessedMap[req.id][key]) {
|
||||||
}
|
_queryProcessedMap[req.id][key] = true;
|
||||||
|
|
||||||
|
if ($.Options.filterLang.val !== 'disable' && $.Options.filterLangForSearching.val) {
|
||||||
|
if (typeof userpost.rt !== 'undefined') {
|
||||||
|
var msg = userpost.rt.msg;
|
||||||
|
} else {
|
||||||
|
var msg = userpost.msg;
|
||||||
|
}
|
||||||
|
langFilterData = filterLang(msg);
|
||||||
|
if ($.Options.filterLangSimulate.val) {
|
||||||
|
req.posts[i].langFilter = langFilterData;
|
||||||
|
} else {
|
||||||
|
if (!langFilterData.pass)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_hashtagPendingPosts.push(data[i]);
|
|
||||||
_hashtagPendingPostsUpdated++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_queryPendingPosts[req.id].push(req.posts[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_queryPendingPosts[req.id].length) {
|
||||||
|
if (!$.hasOwnProperty('mobile') && $.Options.showDesktopNotifPostsModal.val === 'enable'
|
||||||
|
&& (req.resource !== 'mention' || req.query !== defaultScreenName)) {
|
||||||
|
$.MAL.showDesktopNotification({
|
||||||
|
body: polyglot.t('You got') + ' ' + polyglot.t('new_posts', _queryPendingPosts[req.id].length) + ' '
|
||||||
|
+ polyglot.t('in search result') + '.',
|
||||||
|
tag: 'twister_notification_new_posts_modal',
|
||||||
|
timeout: $.Options.showDesktopNotifPostsModalTimer.val,
|
||||||
|
funcClick: (function() {
|
||||||
|
focusModalWithElement(this.postboard,
|
||||||
|
function (req) {
|
||||||
|
req.postboard.closest('.postboard').find('.postboard-news').hide();
|
||||||
|
displayQueryPending(req.postboard);
|
||||||
|
}, {postboard: this.postboard}
|
||||||
|
);
|
||||||
|
}).bind({postboard: req.postboard})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if( _hashtagPendingPosts.length ) {
|
if (!req.postboard.children().length || autoUpdateQuery) {
|
||||||
if( !postboard.children().length || autoUpdateHashtag ) {
|
displayQueryPending(req.postboard);
|
||||||
displayHashtagPending(postboard);
|
} else {
|
||||||
} else {
|
req.postboard.closest('div').find('.postboard-news') // FIXME we'd replace 'div' with '.postboard' but need to dig through tmobile first
|
||||||
var newTweetsBar = postboard.closest("div").find(".postboard-news");
|
.text(polyglot.t('new_posts', _queryPendingPosts[req.id].length))
|
||||||
newTweetsBar.text(polyglot.t("new_posts", _hashtagPendingPosts.length));
|
.fadeIn('slow')
|
||||||
newTweetsBar.fadeIn("slow");
|
;
|
||||||
postboard.closest("div").find(".postboard-loading").hide();
|
req.postboard.closest('div').find('.postboard-loading').hide();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayHashtagPending(postboard) {
|
function displayQueryPending(postboard) {
|
||||||
attachPostsToStream(postboard, _hashtagPendingPosts, false);
|
var reqId = postboard.attr('data-request-id');
|
||||||
|
|
||||||
|
attachPostsToStream(postboard, _queryPendingPosts[reqId], false);
|
||||||
|
_queryPendingPosts[reqId] = [];
|
||||||
|
|
||||||
$.MAL.postboardLoaded();
|
$.MAL.postboardLoaded();
|
||||||
_hashtagPendingPosts = [];
|
|
||||||
}
|
}
|
||||||
|
@ -50,10 +50,11 @@ function processDMsnippet(dmUsers, dmThreadList, forGroup) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function requestDmConversationModal(postboard, dm_screenname) {
|
function requestDmConversationModal(postboard, dm_screenname) {
|
||||||
if (postboard.is('html *')) {
|
if (!isModalWithElemExists(postboard))
|
||||||
requestDmConversation(postboard, dm_screenname);
|
return;
|
||||||
setTimeout(requestDmConversationModal, 1000, postboard, dm_screenname);
|
|
||||||
}
|
requestDmConversation(postboard, dm_screenname);
|
||||||
|
setTimeout(requestDmConversationModal, 1000, postboard, dm_screenname);
|
||||||
}
|
}
|
||||||
|
|
||||||
function requestDmConversation(postboard, dm_screenname) {
|
function requestDmConversation(postboard, dm_screenname) {
|
||||||
|
@ -29,6 +29,11 @@ function processMention(user, mentionTime, data) {
|
|||||||
_newMentionsUpdated = true;
|
_newMentionsUpdated = true;
|
||||||
_lastMentionTime = Math.max(mentionTime, _lastMentionTime);
|
_lastMentionTime = Math.max(mentionTime, _lastMentionTime);
|
||||||
data.isNew = true;
|
data.isNew = true;
|
||||||
|
|
||||||
|
var reqId = defaultScreenName + '@mention';
|
||||||
|
if (typeof _queryPendingPosts[reqId] !== 'object')
|
||||||
|
_queryPendingPosts[reqId] = [];
|
||||||
|
_queryPendingPosts[reqId].push(data);
|
||||||
}
|
}
|
||||||
_knownMentions[key] = {mentionTime: mentionTime, data: data};
|
_knownMentions[key] = {mentionTime: mentionTime, data: data};
|
||||||
purgeOldMentions();
|
purgeOldMentions();
|
||||||
@ -103,8 +108,25 @@ function requestMentionsCount() {
|
|||||||
if (_newMentions) {
|
if (_newMentions) {
|
||||||
$.MAL.soundNotifyMentions();
|
$.MAL.soundNotifyMentions();
|
||||||
|
|
||||||
if ($.Options.showDesktopNotifMentions.val === 'enable')
|
if (!$.hasOwnProperty('mobile') && $.Options.showDesktopNotifMentions.val === 'enable')
|
||||||
$.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_mentions', _newMentions)+'.', false,'twister_notification_new_mentions', $.Options.showDesktopNotifMentionsTimer.val, function(){$.MAL.showMentions(defaultScreenName)}, false)
|
$.MAL.showDesktopNotification({
|
||||||
|
body: polyglot.t('You got') + ' ' + polyglot.t('new_mentions', _newMentions) + '.',
|
||||||
|
tag: 'twister_notification_new_mentions',
|
||||||
|
timeout: $.Options.showDesktopNotifMentionsTimer.val,
|
||||||
|
funcClick: function () {
|
||||||
|
var postboardSelector =
|
||||||
|
'.postboard-posts[data-request-id="' + defaultScreenName + '@mention"]';
|
||||||
|
if (!focusModalWithElement(postboardSelector,
|
||||||
|
function (req) {
|
||||||
|
var postboard = $(req.postboardSelector);
|
||||||
|
postboard.closest('.postboard').find('.postboard-news').hide();
|
||||||
|
displayQueryPending(postboard);
|
||||||
|
resetMentionsCount();
|
||||||
|
}, {postboardSelector: postboardSelector}
|
||||||
|
))
|
||||||
|
$.MAL.showMentions(defaultScreenName);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,24 +139,26 @@ function requestMentionsCount() {
|
|||||||
if (newDMs) {
|
if (newDMs) {
|
||||||
$.MAL.soundNotifyDM();
|
$.MAL.soundNotifyDM();
|
||||||
|
|
||||||
if ($.Options.showDesktopNotifDMs.val === 'enable') {
|
if (!$.hasOwnProperty('mobile') && $.Options.showDesktopNotifDMs.val === 'enable') {
|
||||||
$.MAL.showDesktopNotif(false,
|
$.MAL.showDesktopNotification({
|
||||||
polyglot.t('You got') + ' ' + polyglot.t('new_direct_messages', newDMs) + '.',
|
body: polyglot.t('You got') + ' ' + polyglot.t('new_direct_messages', newDMs) + '.',
|
||||||
false, 'twister_notification_new_DMs', $.Options.showDesktopNotifDMsTimer.val,
|
tag: 'twister_notification_new_DMs',
|
||||||
function () {$.MAL.showDMchat();}, false
|
timeout: $.Options.showDesktopNotifDMsTimer.val,
|
||||||
);
|
funcClick: function () {$.MAL.showDMchat();}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var newDMs = getNewGroupDMsCount();
|
var newDMs = getNewGroupDMsCount();
|
||||||
if (newDMs) {
|
if (newDMs) {
|
||||||
$.MAL.soundNotifyDM();
|
$.MAL.soundNotifyDM();
|
||||||
|
|
||||||
if ($.Options.showDesktopNotifDMs.val === 'enable') {
|
if (!$.hasOwnProperty('mobile') && $.Options.showDesktopNotifDMs.val === 'enable') {
|
||||||
$.MAL.showDesktopNotif(false,
|
$.MAL.showDesktopNotification({
|
||||||
polyglot.t('You got') + ' ' + polyglot.t('new_group_messages', newDMs) + '.',
|
body: polyglot.t('You got') + ' ' + polyglot.t('new_group_messages', newDMs) + '.',
|
||||||
false, 'twister_notification_new_DMs', $.Options.showDesktopNotifDMsTimer.val,
|
tag: 'twister_notification_new_DMs',
|
||||||
function () {$.MAL.showDMchat({group: true});}, false
|
timeout: $.Options.showDesktopNotifDMsTimer.val,
|
||||||
);
|
funcClick: function () {$.MAL.showDMchat({group: true});}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user