diff --git a/img/groupmessages.png b/img/groupmessages.png
new file mode 100644
index 0000000..3b6562f
Binary files /dev/null and b/img/groupmessages.png differ
diff --git a/js/interface_common.js b/js/interface_common.js
index a3d1e93..70f7482 100644
--- a/js/interface_common.js
+++ b/js/interface_common.js
@@ -55,12 +55,56 @@ function closeModal() {
});
}
+function closePrompt() {
+ closeModalHandler('.prompt-wrapper');
+}
+
function closeModalHandler(classBase) {
var modalWindows = $(classBase+':not(#templates *)');
modalWindows.fadeOut('fast', function() {modalWindows.remove();});
}
+function confirmPopup(event, req) {
+ event.stopPropagation();
+
+ var modal = openModal({
+ classBase: '.prompt-wrapper',
+ classAdd: 'confirm-popup',
+ content: $('#confirm-popup-template').children().clone(true),
+ title: req.titleTxt
+ });
+
+ if (req.messageTxt)
+ modal.content.find('.message').text(req.messageTxt);
+
+ var btn = modal.content.find('.confirm');
+ if (req.confirmTxt)
+ btn.text(req.confirmTxt);
+ else
+ btn.text(polyglot.t('Confirm'));
+ if (req.confirmFunc) {
+ btn.on('click', function () {
+ closePrompt();
+ req.confirmFunc(req.confirmFuncArgs);
+ });
+ } else
+ btn.on('click', closePrompt);
+
+ var btn = modal.content.find('.cancel');
+ if (req.cancelTxt)
+ btn.text(req.cancelTxt);
+ else
+ btn.text(polyglot.t('Cancel'));
+ if (req.cancelFunc) {
+ btn.on('click', function () {
+ closePrompt();
+ req.cancelFunc(req.cancelFuncArgs);
+ });
+ } else
+ btn.on('click', closePrompt);
+}
+
function checkNetworkStatusAndAskRedirect(cbFunc, cbArg) {
networkUpdate(function(args) {
if (!twisterdConnectedAndUptodate) {
@@ -98,7 +142,43 @@ function timeSincePost(t) {
return polyglot.t('time_ago', {time: expression});
}
-function openProfileModalWithUsernameHandler(username) {
+function openGroupProfileModalWithNameHandler(groupAlias) {
+ var modal = openModal({
+ classAdd: 'profile-modal',
+ content: $('#group-profile-modal-template').children().clone(true),
+ title: polyglot.t('users_profile', {username: '
' + groupAlias + ''})
+ });
+
+ modal.content.find('.profile-card').attr('data-screen-name', groupAlias);
+
+ groupMsgGetGroupInfo(groupAlias,
+ function(req, ret) {
+ if (ret) {
+ req.modal.content.find('.profile-bio').text(ret.description);
+
+ if (ret.members.indexOf(defaultScreenName) !== -1)
+ req.modal.content.find('.group-messages-control').children('button').attr('disabled', false);
+
+ var membersList = req.modal.content.find('.members');
+ var memberTemplate = $('#group-profile-member-template').children();
+ for (var i = 0; i < ret.members.length; i++) {
+ var item = memberTemplate.clone(true).appendTo(membersList);
+
+ item.find('.twister-user-info').attr('data-screen-name', ret.members[i]);
+ item.find('.twister-user-name').attr('href', $.MAL.userUrl(ret.members[i]));
+
+ getAvatar(ret.members[i], item.find('.twister-user-photo'));
+ getFullname(ret.members[i], item.find('.twister-user-full'));
+ getBio(ret.members[i], item.find('.bio'));
+ }
+ }
+ }, {modal: modal}
+ );
+
+
+}
+
+function openUserProfileModalWithNameHandler(username) {
var content = $('#profile-modal-template').children().clone(true);
updateProfileData(content, username);
@@ -333,18 +413,26 @@ function loadModalFromHash() {
var hashdata = hashstring.split(':');
if (hashdata[0] !== '#web+twister')
- hashdata = hashstring.match(/(hashtag|profile|mentions|directmessages|following|conversation)\?(?:user|hashtag|post)=(.+)/);
+ hashdata = hashstring.match(/(hashtag|profile|mentions|directmessages|following|conversation)\?(?:group|user|hashtag|post)=(.+)/); // need to rework hash scheme to use group|user|hashtag|post or drop it
if (hashdata && hashdata[1] !== undefined && hashdata[2] !== undefined) {
if (hashdata[1] === 'profile')
- openProfileModalWithUsernameHandler(hashdata[2]);
+ if (hashdata[2][0] === '*')
+ openGroupProfileModalWithNameHandler(hashdata[2]);
+ else
+ openUserProfileModalWithNameHandler(hashdata[2]);
+
else if (hashdata[1] === 'hashtag')
openHashtagModalFromSearchHandler(hashdata[2]);
else if (hashdata[1] === 'mentions')
openMentionsModalHandler(hashdata[2]);
- else if (hashdata[1] === 'directmessages')
- openDmWithUserModal(hashdata[2]);
- else if (hashdata[1] === 'following')
+ else if (hashdata[1] === 'directmessages') {
+ if (hashdata[2][0] === '*')
+ openGroupMessagesModal(hashdata[2]);
+ else
+ openDmWithUserModal(hashdata[2]);
+
+ } else if (hashdata[1] === 'following')
openFollowingModal(hashdata[2]);
else if (hashdata[1] === 'conversation') {
splithashdata2 = hashdata[2].split(':');
@@ -352,6 +440,12 @@ function loadModalFromHash() {
}
} else if (hashstring === '#directmessages')
directMessagesPopup();
+ else if (hashstring === '#groupmessages')
+ openGroupMessagesModal();
+ else if (hashstring === '#groupmessages+newgroup')
+ openGroupMessagesNewGroupModal();
+ else if (hashstring === '#groupmessages+joingroup')
+ openGroupMessagesJoinGroupModal();
else if (hashstring === '#whotofollow')
openWhoToFollowModal();
}
@@ -627,7 +721,7 @@ function posPostPreview(event) {
if (textArea[0].value.length)
postPreview.html(htmlFormatMsg(textArea[0].value).html).show();
else
- postPreview.slideUp('fast');
+ postPreview.hide();
textArea.before(postPreview);
}
@@ -706,7 +800,7 @@ function replyTextInput(event) {
$(tas[i]).caret(caretPos);
replyTextUpdateRemaining(tas[i]);
if ($.fn.textcomplete)
- setTextcompleteOnElement(tas[i]);
+ setTextcompleteOnElement(tas[i], getMentionsForAutoComplete());
}
}
} else if (tas.length > 1 && tas[i].value.length === 0) {
@@ -1317,7 +1411,7 @@ function postSubmit(e, oldLastPostId) {
}
if (btnPostSubmit.parents('.prompt-wrapper').length)
- closeModalHandler('.prompt-wrapper');
+ closePrompt();
else {
textArea.val('').attr('placeholder', polyglot.t('Your message was sent!'));
var tweetForm = btnPostSubmit.parents('form');
@@ -1338,7 +1432,7 @@ function retweetSubmit(e) {
newRtMsg($(this).closest('.prompt-wrapper').find('.post-data'));
- closeModalHandler('.prompt-wrapper');
+ closePrompt();
}
function changeStyle() {
@@ -1409,7 +1503,7 @@ function replaceDashboards() {
}
function initInterfaceCommon() {
- $('.cancel').on('click', function() {
+ $('.modal-close, .modal-blackout').not('.prompt-close').on('click', function() {
if ($('.modal-content').attr('style') != undefined)
$('.modal-content').removeAttr('style');
$('.modal-back').css('display', 'none');
@@ -1419,10 +1513,7 @@ function initInterfaceCommon() {
$('.modal-back').on('click', function() {history.back();});
- $('.prompt-close').on('click', function(e) {
- e.stopPropagation();
- closeModalHandler('.prompt-wrapper');
- });
+ $('.prompt-close').on('click', closePrompt);
/*
$('.modal-back').on('click', function() {
@@ -1480,10 +1571,10 @@ function initInterfaceCommon() {
$('.bitmessage-ctc').on('click', promptCopyAttrData);
if ($.fn.textcomplete) {
- $('textarea').on({
- 'focus': setTextcompleteOnEventTarget,
- 'focusout': function () {$(this).textcomplete('destroy');}
- });
+ $('.post-area-new textarea')
+ .on('focus', {req: getMentionsForAutoComplete}, setTextcompleteOnEventTarget)
+ .on('focusout', unsetTextcompleteOnEventTarget)
+ ;
}
}
@@ -1499,19 +1590,30 @@ function killInterfaceModule(module) {
$('.module.'+module).empty().hide();
}
-function setTextcompleteOnEventTarget(event) {
- // cursor has not set yet and we need to wait 100ms to skip global click event
- setTimeout(setTextcompleteOnElement, 100, event.target);
+function inputEnterActivator(event) {
+ var elemEvent = $(event.target);
+ elemEvent.parents(event.data.parentSelector).find(event.data.enterSelector)
+ .attr('disabled', elemEvent.val().trim() === '');
}
-function setTextcompleteOnElement(elem) {
+function setTextcompleteOnEventTarget(event) {
+ // cursor has not set yet and we need to wait 100ms to skip global click event
+ setTimeout(setTextcompleteOnElement, 100, event.target,
+ typeof event.data.req === 'function' ? event.data.req() : event.data.req);
+}
+
+function setTextcompleteOnElement(elem, req) {
elem = $(elem);
- elem.textcomplete(getMentionsForAutoComplete(), {
+ elem.textcomplete(req, {
appendTo: (elem.parents('.dashboard').length) ? elem.parent() : $('body'),
listPosition: setTextcompleteDropdownListPos
});
}
+function unsetTextcompleteOnEventTarget(event) {
+ $(event.target).textcomplete('destroy');
+}
+
// following workaround function is for calls from $.fn.textcomplete only
// we need this because currently implementation of caret position detection is way too imperfect
function setTextcompleteDropdownListPos(position) {
diff --git a/js/interface_localization.js b/js/interface_localization.js
index 9b08e75..7eb855f 100644
--- a/js/interface_localization.js
+++ b/js/interface_localization.js
@@ -44,6 +44,9 @@ if(preferredLanguage == "en"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "Cancel",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Change user",
"Checking...": "Checking...", // checking if username is available
"Collapse": "Collapse", // smaller view of a post
@@ -54,6 +57,9 @@ if(preferredLanguage == "en"){
"Detailed information": "Detailed information",
"DHT network down.": "DHT network down.",
"Direct Messages": "Direct Messages",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Direct messages with %{username}",
"Disable": "Disable",
"Display mentions to @": "Display mentions to @",
@@ -94,6 +100,16 @@ if(preferredLanguage == "en"){
"Network status": "Network status",
"New direct message...": "New direct message...",
"New Post...": "New Post...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "You got",
"in postboard": "in postboard",
"in search result": "in search result",
@@ -101,6 +117,7 @@ if(preferredLanguage == "en"){
"new_posts": "%{smart_count} new post |||| %{smart_count} new posts",
"new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions",
"new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "nobody", // used to promote a post without attaching the user
"Not available": "Not available", // username is not available
"notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.",
@@ -344,6 +361,9 @@ if(preferredLanguage == "es"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "Cancelar",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Cambiar de usuario",
"Checking...": "Comprobando ...", // checking if username is available
"Collapse": "Colapsar", // smaller view of a post
@@ -354,6 +374,9 @@ if(preferredLanguage == "es"){
"Detailed information": "Información detallada",
"DHT network down.": "Red DHT caida.",
"Direct Messages": "Mensajes directos",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Mensajes directos con %{username}",
"Disable": "Inhabilitar",
"Display mentions to @": "Visualización de menciones a @",
@@ -394,6 +417,16 @@ if(preferredLanguage == "es"){
"Network status": "Estado de la red",
"New direct message...": "Nuevo mensaje directo...",
"New Post...": "Nuevo Post...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "You got",
"in postboard": "in postboard",
"in search result": "in search result",
@@ -401,6 +434,7 @@ if(preferredLanguage == "es"){
"new_posts": "%{smart_count} nuevo post |||| %{smart_count} nuevos posts",
"new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions",
"new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "Nadie", // used to promote a post without attaching the user
"Not available": "No disponible", // username is not available
"notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.",
@@ -628,6 +662,9 @@ if(preferredLanguage == "uk"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "Відміна",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Змінити користувача",
"Checking...": "Перевірка...", // checking if username is available
"Collapse": "Згорнути", // smaller view of a post
@@ -638,6 +675,9 @@ if(preferredLanguage == "uk"){
"Detailed information": "Детальна інформація",
"DHT network down.": "Мережа DHT недоступна.",
"Direct Messages": "Особисті повідомлення",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Direct messages with %{username}",
"Disable": "Вимкнено",
"Display mentions to @": "Показати сповіщення @",
@@ -679,6 +719,16 @@ if(preferredLanguage == "uk"){
"Network status": "Статус мережі",
"New direct message...": "Нове повідомлення...",
"New Post...": "Що нового?",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "Ви отримали",
"in postboard": "в стрічці",
"in search result": "в пошуковому запиті",
@@ -686,6 +736,7 @@ if(preferredLanguage == "uk"){
"new_posts": "%{smart_count} новий твіст |||| %{smart_count} нових твістів",
"new_mentions": "%{smart_count} нове сповіщення |||| %{smart_count} нових сповіщень",
"new_direct_messages": "%{smart_count} нове повідомлення |||| %{smart_count} нові повідомлення",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "анонім", // used to promote a post without attaching the user
"Not available": "Не доступне", // username is not available
"notify_desktop_error": "Twister не може створити сповіщення: невідома помилка.",
@@ -911,6 +962,9 @@ if(preferredLanguage == "zh-CN"){
"busted_oh": "噢,阻挡!",
"busted_avowal": "系统检测到此用户试图在这里注入恶意代码",
"Cancel": "取消",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "切换用户",
"Checking...": "检查中...", // checking if username is available
"Collapse": "折叠", // smaller view of a post
@@ -921,6 +975,9 @@ if(preferredLanguage == "zh-CN"){
"Detailed information": "详细信息",
"DHT network down.": "DHT网络中断。",
"Direct Messages": "私信",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Direct messages with %{username}",
"Disable": "关闭",
"Display mentions to @": "显示@",
@@ -961,6 +1018,16 @@ if(preferredLanguage == "zh-CN"){
"Network status": "网络状态",
"New direct message...": "新私信...",
"New Post...": "新推文...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "你收到",
"in postboard": "在时间线里",
"in search result": "在搜索结果里",
@@ -968,6 +1035,7 @@ if(preferredLanguage == "zh-CN"){
"new_posts": "%{smart_count} 篇新推文",
"new_mentions": "%{smart_count} 次新的提及",
"new_direct_messages": "%{smart_count} 封新私信",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "无名", // used to promote a post without attaching the user
"Not available": "用户名不可用", // username is not available
"notify_desktop_error": "Twister 无法发出桌面提醒:发生未知错误。",
@@ -1211,6 +1279,9 @@ if(preferredLanguage == "nl"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "Annuleren",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Gebruiker wijzigen",
"Checking...": "Controleren...", // checking if username is available
"Collapse": "Uitklappen", // smaller view of a post
@@ -1221,6 +1292,9 @@ if(preferredLanguage == "nl"){
"Detailed information": "Gedetailleerde informatie",
"DHT network down.": "DHT netwerk down.",
"Direct Messages": "Privéberichten",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Direct messages with %{username}",
"Disable": "Uitschakelen",
"Display mentions to @": "Toon vermeldingen voor @",
@@ -1261,6 +1335,16 @@ if(preferredLanguage == "nl"){
"Network status": "Netwerkstatus",
"New direct message...": "Nieuw privébericht...",
"New Post...": "Nieuw bericht...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "You got",
"in postboard": "in postboard",
"in search result": "in search result",
@@ -1268,6 +1352,7 @@ if(preferredLanguage == "nl"){
"new_posts": "%{smart_count} nieuw bericht |||| %{smart_count} nieuwe berichten",
"new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions",
"new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "nobody", // used to promote a post without attaching the user
"Not available": "Niet beschikbaar", // username is not available
"notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.",
@@ -1495,6 +1580,9 @@ if(preferredLanguage == "it"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "Cancella",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Cambia utente",
"Checking...": "Controllo in corso...", // checking if username is available
"Collapse": "Chiudi", // smaller view of a post
@@ -1505,6 +1593,9 @@ if(preferredLanguage == "it"){
"Detailed information": "Informazioni dettagliate",
"DHT network down.": "DHT network inaccessibile.",
"Direct Messages": "Messaggi Diretti",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Messaggi Diretti come %{username}",
"Disable": "Disabilitato",
"Display mentions to @": "Mostra le menzioni di @",
@@ -1545,6 +1636,16 @@ if(preferredLanguage == "it"){
"Network status": "Status della rete",
"New direct message...": "Nuovo messaggio diretto...",
"New Post...": "Nuovo messaggio...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "You got",
"in postboard": "in postboard",
"in search result": "in search result",
@@ -1552,6 +1653,7 @@ if(preferredLanguage == "it"){
"new_posts": "%{smart_count} nuovo messaggio |||| %{smart_count} nuovi messaggi",
"new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions",
"new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "nessuno", // used to promote a post without attaching the user
"Not available": "Non disponibile", // username is not available
"notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.",
@@ -1776,6 +1878,9 @@ if(preferredLanguage == "fr"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "Annuler",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Changer d'utilisateur",
"Checking...": "Vérification...", // checking if username is available
"Collapse": "Fermer", // smaller view of a post
@@ -1786,6 +1891,9 @@ if(preferredLanguage == "fr"){
"Detailed information": "Informations détaillées",
"DHT network down.": "Panne du réseau DHT.",
"Direct Messages": "Messages privés",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Messages privés avec %{username}",
"Disable": "Désactiver",
"Display mentions to @": "Afficher les mentions pour @",
@@ -1826,6 +1934,16 @@ if(preferredLanguage == "fr"){
"Network status": "État du réseau",
"New direct message...": "Nouveau message privé...",
"New Post...": "Nouveau billets...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "Tu as",
"in postboard": "sur le postboard",
"in search result": "dans les résultats de recherche",
@@ -1833,6 +1951,7 @@ if(preferredLanguage == "fr"){
"new_posts": "%{smart_count} nouveau billet |||| %{smart_count} nouveaux billets",
"new_mentions": "%{smart_count} nouvelle mention |||| %{smart_count} nouvelles mentions",
"new_direct_messages": "%{smart_count} nouveau message privé |||| %{smart_count} nouveaux messages privés",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "nobody", // used to promote a post without attaching the user
"Not available": "Non disponible", // username is not available
"notify_desktop_error": "Impossible d'afficher les notifications: une erreur inconnue est survenue.",
@@ -2062,6 +2181,9 @@ if(preferredLanguage == "ru"){
"busted_oh": "о нет!",
"busted_avowal": "я пойман на попытке вставить этот подозрительный код здесь",
"Cancel": "Отмена",
+ "Confirm": "Несомненно",
+ "сonfirm_group_leaving_header": "Подтверждение ухода из группы",
+ "сonfirm_group_leaving_body": "Воистину покинуть группу %{alias}?",
"Change user": "Сменить пользователя",
"Checking...": "Проверка...",
"Collapse": "Свернуть",
@@ -2072,6 +2194,9 @@ if(preferredLanguage == "ru"){
"Detailed information": "Подробная информация",
"DHT network down.": "Недоступна DHT сеть.",
"Direct Messages": "Личные сообщения",
+ "Group Messages": "Групповые сообщения",
+ "Group Messages — New Group Creation": "Групповые сообщения — Создать новую группу",
+ "Group Messages — Join Group": "Групповые сообщения — Присоединиться к группе",
"direct_messages_with": "Личная переписка с %{username}",
"Disable": "Отключено",
"Display mentions to @": "Показать ответы для @",
@@ -2112,6 +2237,16 @@ if(preferredLanguage == "ru"){
"Network status": "Состояние сети",
"New direct message...": "Новое личное сообщение...",
"New Post...": "Новый пост...",
+ "New group": "Создать группу",
+ "Group description": "Описание группы",
+ "Peers to invite": "Кого пригласить",
+ "Join group": "Присоединиться",
+ "Select group(s)": "Выберите группу(ы)",
+ "Create": "Создать",
+ "Join": "Присоединиться",
+ "Invite": "Пригласить",
+ "Invite peers": "Пригласить кого",
+ "Leave group": "Покинуть группу",
"You got": "У вас",
"in postboard": "в ленте",
"in search result": "в результатах поиска",
@@ -2119,6 +2254,7 @@ if(preferredLanguage == "ru"){
"new_posts": "%{smart_count} новый пост |||| %{smart_count} новых постов",
"new_mentions": "%{smart_count} новое упоминание |||| %{smart_count} новых упоминаний",
"new_direct_messages": "%{smart_count} новое личное сообщение |||| %{smart_count} новых личных сообщений",
+ "new_group_messages": "%{smart_count} новое сообщение в группе |||| %{smart_count} новых групповых сообщений",
"nobody": "Анонимно", // used to promote a post without attaching the user
"Not available": "Недоступно",
"notify_desktop_error": "Твистер не может выполнить уведомление: произошла неизвестная ошибка.",
@@ -2351,6 +2487,9 @@ if(preferredLanguage == "de"){
"busted_oh": "Oh nein!",
"busted_avowal": "Ich bin ertappt, habe versucht, hier Schadcode einzugeben!",
"Cancel": "Abbrechen",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Benutzer wechseln",
"Checking...": "Überprüfe...", // checking if username is available
"Collapse": "Einklappen", // smaller view of a post
@@ -2361,6 +2500,9 @@ if(preferredLanguage == "de"){
"Detailed information": "Detaillierte Informationen",
"DHT network down.": "DHT-Netzwerk nicht verfügbar.",
"Direct Messages": "Direktnachrichten",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Direktnachrichten mit %{username}",
"Disable": "Deaktivieren",
"Display mentions to @": "Zeige Erwähnungen von @", //Ist das richtig? Ich weiß nicht, in welchem Zusammenhang das benutzt wird.
@@ -2402,6 +2544,16 @@ if(preferredLanguage == "de"){
"Network status": "Netzwerkstatus",
"New direct message...": "Neue Direktnachricht...",
"New Post...": "Neuer Post...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "Du hast",
"in postboard": "in der Timeline",
"in search result": "in den Suchergebnissen",
@@ -2409,6 +2561,7 @@ if(preferredLanguage == "de"){
"new_posts": "%{smart_count} neuer Post |||| %{smart_count} neue Posts",
"new_mentions": "%{smart_count} neue Erwähnung |||| %{smart_count} neue Erwähnungen",
"new_direct_messages": "%{smart_count} neue Direktnachricht |||| %{smart_count} neue Direktnachrichten",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "nobody", // used to promote a post without attaching the user
"Not available": "Nicht verfügbar", // username is not available
"notify_desktop_error": "Twister kann keine Desktop-Meldungen anzeigen: ein unbekannter Fehler trat auf.",
@@ -2637,6 +2790,9 @@ if(preferredLanguage == "ja"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "キャンセル",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "ユーザーを変更",
"Checking...": "チェック...", // checking if username is available
"Collapse": "閉じる", // smaller view of a post
@@ -2647,6 +2803,9 @@ if(preferredLanguage == "ja"){
"Detailed information": "詳細",
"DHT network down.": "DHTネットワークがダウンしています",
"Direct Messages": "ダイレクトメッセージ",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Direct messages with %{username}",
"Disable": "停止",
"Display mentions to @": "メンションを表示する",
@@ -2687,6 +2846,16 @@ if(preferredLanguage == "ja"){
"Network status": "ネットワークステータス",
"New direct message...": "ダイレクトメッセージ...",
"New Post...": "投稿する",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "You got",
"in postboard": "in postboard",
"in search result": "in search result",
@@ -2694,6 +2863,7 @@ if(preferredLanguage == "ja"){
"new_posts": "%{smart_count} 新投稿 |||| %{smart_count} 新投稿",
"new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions",
"new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "ナナシ", // used to promote a post without attaching the user
"Not available": "使用中", // username is not available
"notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.",
@@ -2919,6 +3089,9 @@ if(preferredLanguage == "pt-BR"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "Cancelar",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Trocar usuário",
"Checking...": "Verificando...", // checking if username is available
"Collapse": "Recolher", // smaller view of a post
@@ -2929,6 +3102,9 @@ if(preferredLanguage == "pt-BR"){
"Detailed information": "Informações detalhadas",
"DHT network down.": "Falha na rede DHT",
"Direct Messages": "Mensagens Diretas",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Mensagens Diretas com %{username}",
"Disable": "Desabilitado",
"Display mentions to @": "Exibir menções a @",
@@ -2969,6 +3145,16 @@ if(preferredLanguage == "pt-BR"){
"Network status": "Estado da rede",
"New direct message...": "Nova mensagem direta...",
"New Post...": "Nova Postagem...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "You got",
"in postboard": "in postboard",
"in search result": "in search result",
@@ -2976,6 +3162,7 @@ if(preferredLanguage == "pt-BR"){
"new_posts": "%{smart_count} nova postagem |||| %{smart_count} novas postagens",
"new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions",
"new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "nobody", // used to promote a post without attaching the user
"Not available": "Indisponível", // username is not available
"notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.",
@@ -3205,6 +3392,9 @@ if(preferredLanguage == "tr"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "İptal",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Kullanıcı değiştir",
"Checking...": "Denetleniyor...", // checking if username is available
"Collapse": "Kapat", // smaller view of a post
@@ -3215,6 +3405,9 @@ if(preferredLanguage == "tr"){
"Detailed information": "Detaylı bilgi",
"DHT network down.": "DHT ağı çalışmıyor.",
"Direct Messages": "Direk Mesajlar",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "%{username} ile Direk Mesajlar",
"Disable": "Kullanılmaz",
"Display mentions to @": "@ adının geçtiği gönderiler",
@@ -3255,6 +3448,16 @@ if(preferredLanguage == "tr"){
"Network status": "Ağ durumu",
"New direct message...": "Yeni direk mesaj...",
"New Post...": "Yeni gönderi...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "You got",
"in postboard": "in postboard",
"in search result": "in search result",
@@ -3262,6 +3465,7 @@ if(preferredLanguage == "tr"){
"new_posts": "%{smart_count} yeni gönederi |||| %{smart_count} yeni gönderi",
"new_mentions": "%{smart_count} new mention |||| %{smart_count} new mentions",
"new_direct_messages": "%{smart_count} new direct message |||| %{smart_count} new direct messages",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "hiçkimse", // used to promote a post without attaching the user
"Not available": "Kullanılamaz", // username is not available
"notify_desktop_error": "Twister cannot perform desktop notification: unknown error occured.",
@@ -3488,6 +3692,9 @@ if(preferredLanguage == "cs"){
"busted_oh": "oh noes!",
"busted_avowal": "I\'m busted trying inject this suspicious stuff here",
"Cancel": "Zrušit",
+ "Confirm": "Confirm",
+ "сonfirm_group_leaving_header": "Confirm group leaving",
+ "сonfirm_group_leaving_body": "Are you sure want to leave %{alias} group?",
"Change user": "Změnit uživatele",
"Checking...": "Ověřuji...", // checking if username is available
"Collapse": "Složit", // smaller view of a post
@@ -3498,6 +3705,9 @@ if(preferredLanguage == "cs"){
"Detailed information": "Podrobné informace",
"DHT network down.": "Síť DHT je nedostupná.",
"Direct Messages": "Přímé zprávy",
+ "Group Messages": "Group Messages",
+ "Group Messages — New Group Creation": "Group Messages — New Group Creation",
+ "Group Messages — Join Group": "Group Messages — Join Group",
"direct_messages_with": "Direct messages with %{username}",
"Disable": "Vypnuto",
"Display mentions to @": "Zobrazit zmínky o @",
@@ -3538,6 +3748,16 @@ if(preferredLanguage == "cs"){
"Network status": "Stav sítě",
"New direct message...": "Nová přímá zpráva...",
"New Post...": "Nový příspěvek...",
+ "New group": "New group",
+ "Group description": "Group description",
+ "Peers to invite": "Peers to invite",
+ "Join group": "Join group",
+ "Select group(s)": "Select group(s)",
+ "Create": "Create",
+ "Join": "Join",
+ "Invite": "Invite",
+ "Invite peers": "Invite peers",
+ "Leave group": "Leave group",
"You got": "Máte",
"in postboard": "na nástěnce",
"in search result": "ve výsledcích hledání",
@@ -3545,6 +3765,7 @@ if(preferredLanguage == "cs"){
"new_posts": "%{smart_count} nový příspěvek |||| %{smart_count} nové příspěvky |||| %{smart_count} nových příspěvků",
"new_mentions": "%{smart_count} novou zmínku |||| %{smart_count} nové zmínky |||| %{smart_count} nových zmínek",
"new_direct_messages": "%{smart_count} novou přímou zprávu |||| %{smart_count} nové přímé zprávy |||| %{smart_count} nových přímých zpráv",
+ "new_group_messages": "%{smart_count} new group message |||| %{smart_count} new group messages",
"nobody": "nikdo", // used to promote a post without attaching the user
"Not available": "Tuto přezdívku již někdo používá", // username is not available
"notify_desktop_error": "Twisteru se nepodařilo zobrazit upozornění na ploše: došlo k neznámé chybě.",
diff --git a/js/mobile_abstract.js b/js/mobile_abstract.js
index 00b7bb7..8fe3e14 100644
--- a/js/mobile_abstract.js
+++ b/js/mobile_abstract.js
@@ -142,12 +142,15 @@ var MAL = function()
// how do we map usernames into urls
this.userUrl = function(username) {
- if( $.hasOwnProperty("mobile") ) {
- return "#profile?user=" + username;
- } else {
- return "#profile?user=" + username;
- }
- }
+ //if( $.hasOwnProperty("mobile") ) {
+ // return "#profile?user=" + username;
+ //} else {
+ if (username[0] === '*')
+ return "#profile?group=" + username;
+ else
+ return "#profile?user=" + username;
+ //}
+ };
// recover username from url (only for hash)
this.urlToUser = function(url) {
@@ -184,13 +187,13 @@ var MAL = function()
}
}
- this.dmchatUrl = function(username) {
- if( $.hasOwnProperty("mobile") ) {
- return "#dmchat?user=" + username;
+ this.dmchatUrl = function (alias) {
+ if ($.hasOwnProperty('mobile')) {
+ return '#dmchat?user=' + alias;
} else {
- return "#directmessages?user=" + username;
+ return '#directmessages?' + (alias[0] === '*' ? 'group' : 'user') + '=' + alias;
}
- }
+ };
this.followingUrl = function(username) {
if( $.hasOwnProperty("mobile") ) {
@@ -275,6 +278,18 @@ var MAL = function()
}
}
+ this.updateNewGroupDMsUI = function(newDMs) {
+ if( $.hasOwnProperty('mobile') ) {
+ } else {
+ var DMsCounter = $('.userMenu-groupmessages .messages-qtd');
+ if (newDMs) {
+ DMsCounter.text(newDMs).fadeIn();
+ } else {
+ DMsCounter.hide();
+ }
+ }
+ }
+
this.updateMyOwnPostCount = function(numPosts) {
if( $.hasOwnProperty("mobile") ) {
console.log("FIXME: implement MAL_updateMyOwnPostCount");
@@ -327,29 +342,29 @@ var MAL = function()
}
}
- this.showDMchat = function(username) {
- if (username) {
- if( $.hasOwnProperty("mobile") ) {
- $.mobile.navigate( this.dmchatUrl(username) );
+ this.showDMchat = function(req) {
+ if (req.alias) {
+ if ($.hasOwnProperty('mobile')) {
+ $.mobile.navigate(this.dmchatUrl(req.alias));
} else {
- if ($(".postboard").length) {
- window.location.hash = this.dmchatUrl(username);
+ if ($('.postboard').length) {
+ window.location.hash = this.dmchatUrl(req.alias);
} else {
- window.location.href = 'home.html'+this.dmchatUrl(username);
+ window.location.href = 'home.html'+this.dmchatUrl(req.alias);
}
}
} else {
- if( $.hasOwnProperty("mobile") ) {
- $.mobile.navigate( '#directmsg' );
+ if ($.hasOwnProperty('mobile')) {
+ $.mobile.navigate('#' + (req.group ? '' : 'directmsg')); // FIXME add group messages to tmobile
} else {
- if ($(".postboard").length) {
- window.location.hash = '#directmessages';
+ if ($('.postboard').length) {
+ window.location.hash = '#' + (req.group ? 'groupmessages' : 'directmessages');
} else {
- window.location.href = 'home.html#directmessages';
+ window.location.href = 'home.html#' + (req.group ? 'groupmessages' : 'directmessages');
}
}
}
- }
+ };
this.setNetworkStatusMsg = function(msg, statusGood) {
if( $.hasOwnProperty("mobile") ) {
diff --git a/js/tmobile.js b/js/tmobile.js
index 24a0b00..20143ac 100644
--- a/js/tmobile.js
+++ b/js/tmobile.js
@@ -432,9 +432,13 @@ function installCreateUserClick() {
}
function installUserSearchHandler() {
- var $userSearchField = $( ".userMenu-search-field" );
- $userSearchField.unbind('keyup').keyup( userSearchKeypress );
- $userSearchField.unbind('click').bind( "click", userSearchKeypress );
+ $('.userMenu-search-field')
+ .off('click input')
+ .on('keyup', userSearchEnter)
+ .on('click keyup',
+ {hashtags: true, handleRet: processDropdownUserResults,
+ handleRetZero: closeSearchDialog}, userSearchKeypress)
+ ;
}
function installProfileEditHandlers() {
diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js
index 8748bf5..20587ec 100644
--- a/js/twister_directmsg.js
+++ b/js/twister_directmsg.js
@@ -3,7 +3,9 @@
//
// Handle direct messages modal
-function requestDMsnippetList(dmThreadList) {
+var _groupMsgInviteToGroupQueue = [];
+
+function requestDMsnippetList(dmThreadList, forGroup) {
var followList = [];
for (var i = 0; i < followingUsers.length; i++)
followList.push({username:followingUsers[i]});
@@ -11,15 +13,19 @@ function requestDMsnippetList(dmThreadList) {
followList.push({username:groupChatAliases[i]});
twisterRpc('getdirectmsgs', [defaultScreenName, 1, followList],
- function(req, ret) {processDMsnippet(ret, dmThreadList);}, dmThreadList,
+ function(req, ret) {processDMsnippet(ret, req.dmThreadList, req.forGroup);},
+ {dmThreadList: dmThreadList, forGroup: forGroup},
function(req, ret) {console.log('ajax error:' + ret);}, null
);
}
-function processDMsnippet(dmUsers, dmThreadList) {
+function processDMsnippet(dmUsers, dmThreadList, forGroup) {
dmThreadList.empty();
for (var u in dmUsers) {
+ if ((forGroup && u[0] !== '*') || (!forGroup && u[0] === '*'))
+ continue;
+
// convert snipped to html and add it to date-sorted list
var dmItem = dmDataToSnippetItem(dmUsers[u][0], u);
var timeDmItem = parseInt(dmItem.attr('data-time'));
@@ -75,7 +81,7 @@ function processDmConversation(postboard, dm_screenname, dmData) {
var dmList = dmData[dm_screenname];
if (dmList.length) {
for (var i = 0; i < dmList.length; i++) {
- var dmItem = dmDataToConversationItem(dmList[i], defaultScreenName, dm_screenname)
+ var dmItem = postToElemDM(dmList[i], defaultScreenName, dm_screenname)
.attr('data-id', dmList[i].id)
.appendTo(postboard)
;
@@ -96,7 +102,7 @@ function directMsgSubmit(e) {
replyText.siblings('#post-preview').hide();
- newDirectMsg(replyText.val(), $('.directMessages').attr('data-dm-screen-name'));
+ newDirectMsg(replyText.val(), $('.directMessages').attr('data-screen-name'));
replyText.val('');
}
@@ -137,7 +143,7 @@ function directMessagesPopup() {
return;
}
- modal = openModal({
+ var modal = openModal({
classAdd: 'directMessages',
content: $('.direct-messages-template').children().clone(true),
title: polyglot.t('Direct Messages')
@@ -150,7 +156,8 @@ function directMessagesPopup() {
.attr('title', polyglot.t('Mark all as read'))
.on('click', function() {
for (var user in _newDMsPerUser) {
- _newDMsPerUser[user] = 0;
+ if (user[0] !== '*')
+ _newDMsPerUser[user] = 0;
}
saveDMsToStorage();
$.MAL.updateNewDMsUI(getNewDMsCount());
@@ -164,13 +171,13 @@ function openDmWithUserModal(dm_screenname) {
return;
}
- modal = openModal({
+ var modal = openModal({
classAdd: 'directMessages',
content: $('.messages-thread-template').children().clone(true),
title: polyglot.t('direct_messages_with', {username: '
' + dm_screenname + ''})
});
- modal.self.attr('data-dm-screen-name', dm_screenname);
+ modal.self.attr('data-screen-name', dm_screenname);
if (dm_screenname.length && dm_screenname[0] === '*')
getGroupChatName(dm_screenname, modal.self.find('.modal-header h3 span'));
@@ -183,12 +190,260 @@ function openDmWithUserModal(dm_screenname) {
.addClass('open').appendTo(modal.content).fadeIn('fast');
}
+function openGroupMessagesModal(groupAlias) {
+ if (!defaultScreenName) {
+ alert(polyglot.t('You have to log in to use group messages.'));
+ return;
+ }
+
+ if (typeof groupAlias === 'undefined') {
+ var modal = openModal({
+ classAdd: 'directMessages groupMessages',
+ content: $('.direct-messages-template').children().clone(true),
+ title: polyglot.t('Group Messages')
+ });
+
+ modal.content.prepend($('#group-messages-profile-modal-control-template').children().clone(true));
+
+ requestDMsnippetList(modal.content.find('.direct-messages-list'), true);
+
+ modal.self.find('.mark-all-as-read')
+ .css('display', 'inline')
+ .attr('title', polyglot.t('Mark all as read'))
+ .on('click', function() {
+ for (var user in _newDMsPerUser) {
+ if (user[0] === '*')
+ _newDMsPerUser[user] = 0;
+ }
+ saveDMsToStorage();
+ $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount());
+ })
+ ;
+ } else {
+ var modal = openModal({
+ classAdd: 'directMessages groupMessages',
+ title: polyglot.t('direct_messages_with', {username: '
' + groupAlias + ''})
+ });
+
+ modal.self.attr('data-screen-name', groupAlias);
+
+ getGroupChatName(groupAlias, modal.self.find('.modal-header h3 span'));
+
+ groupMsgGetGroupInfo(groupAlias,
+ function(req, ret) {
+ if (ret && ret.members.indexOf(defaultScreenName) !== -1) {
+ req.modal.content.append($('.messages-thread-template').children().clone(true));
+ requestDmConversationModal(req.modal.content.find('.direct-messages-thread'), req.groupAlias);
+
+ var control = $('#group-messages-messages-modal-control-template').children().clone(true)
+ .appendTo(req.modal.content);
+ control.find('.profile').on('click', {groupAlias: req.groupAlias},
+ function (event) {window.location.href = $.MAL.userUrl(event.data.groupAlias);}
+ );
+
+ $('.dm-form-template').children().clone(true)
+ .addClass('open').appendTo(req.modal.content).fadeIn('fast');
+ }
+ }, {groupAlias: groupAlias, modal: modal}
+ );
+ }
+}
+
+function openGroupMessagesNewGroupModal() {
+ if (!defaultScreenName) {
+ alert(polyglot.t('You have to log in to use group messages.'));
+ return;
+ }
+
+ var modal = openModal({
+ classAdd: 'group-messages-new-group',
+ content: $('#group-messages-new-group-template').children().clone(true),
+ title: polyglot.t('Group Messages — New Group Creation')
+ });
+
+ modal.content.find('.description').on('input',
+ {parentSelector: '.module', enterSelector: '.create'}, inputEnterActivator);
+ modal.content.find('.invite')
+ .on('input', {handleRet: groupMsgInviteFormInputHandleUserSearchRet}, userSearchKeypress)
+ .on('focus', {req: groupMsgInviteFormInputSetTextcompleteReq}, setTextcompleteOnEventTarget)
+ .on('focusout', unsetTextcompleteOnEventTarget)
+ ;
+ modal.content.find('.create').on('click', function (event) {
+ var elemEvent = $(event.target);
+ var elemForm = elemEvent.parents('.module')
+
+ var peersToInvite = elemForm.find('.invite').val().toLowerCase().match(/@\w+/g);
+ if (peersToInvite)
+ peersToInvite = peersToInvite.join('').slice(1).split('@');
+
+ groupMsgCreateGroup(elemForm.find('.description').val(), peersToInvite);
+
+ closeModal();
+ });
+}
+
+function openGroupMessagesJoinGroupModal() {
+ if (!defaultScreenName) {
+ alert(polyglot.t('You have to log in to use group messages.'));
+ return;
+ }
+
+ var modal = openModal({
+ classAdd: 'group-messages-join-group',
+ content: $('#group-messages-join-group-template').children().clone(true),
+ title: polyglot.t('Group Messages — Join Group')
+ });
+
+ var elemGroupsList = modal.content.find('.groups-list');
+ var elemGroupTemplate = $('#groups-list-item-template').children();
+ groupMsgGetGroupsForPeer(defaultScreenName,
+ function(req, ret) {
+ if (ret) {
+ for (var i = 0; i < groupChatAliases.length; i++) {
+ if (ret.indexOf(groupChatAliases[i]) === -1) {
+ var item = req.elemGroupTemplate.clone(true).appendTo(req.elemGroupsList);
+
+ item.find('input')
+ .attr('data-screen-name', groupChatAliases[i])
+ .on('click', function (event) {
+ var elemEvent = $(event.target);
+ elemEvent.parents('.module').find('.join')
+ .attr('disabled',
+ !elemEvent.parents('.groups-list').find('input:checked').length);
+ })
+ ;
+ item.find('.twister-user-name')
+ .text(groupChatAliases[i])
+ .attr('href', $.MAL.userUrl(groupChatAliases[i]))
+ ;
+ getGroupChatName(groupChatAliases[i], item.find('.description')); // FIXME
+ }
+ }
+ }
+ }, {elemGroupsList: elemGroupsList, elemGroupTemplate: elemGroupTemplate}
+ );
+
+ modal.content.find('.join').on('click', function (event) {
+ var elemEvent = $(event.target);
+ var groups = elemEvent.parents('.module').find('.groups-list input:checked');
+ for (var i = 0; i < groups.length; i++)
+ groupMsgInviteToGroup(groups[i].getAttribute('data-screen-name'), [defaultScreenName]);
+
+ closeModal();
+ });
+
+ modal.content.find('.secret-key-import, .username-import').on('input', importSecretKeypress);
+
+ modal.content.find('.import-secret-key').on('click', function (event) {
+ var elemModule = $(event.target).parents('.module');
+ var groupAlias = elemModule.find('.username-import').val().toLowerCase();
+ var secretKey = elemModule.find('.secret-key-import').val();
+
+ twisterRpc('importprivkey', [secretKey, groupAlias],
+ function(req, ret) {
+ groupMsgInviteToGroup(req.groupAlias, [defaultScreenName]);
+ closeModal();
+ }, {groupAlias: groupAlias},
+ function(req, ret) {
+ alert(polyglot.t('Error in \'importprivkey\'', {rpc: ret.message}));
+ }, null
+ );
+ });
+}
+
+function groupMsgCreateGroup(description, peersToInvite) {
+ if (!peersToInvite)
+ peersToInvite = [];
+
+ twisterRpc('creategroup', [description],
+ function(peersToInvite, ret) {
+ groupMsgInviteToGroup(ret, peersToInvite.push(defaultScreenName));
+ }, peersToInvite,
+ function(req, ret) {
+ alert(polyglot.t('error', {error: 'can\'t create group — ' + ret.message}));
+ }, null
+ );
+}
+
+function groupMsgInviteToGroup(groupAlias, peersToInvite) {
+ _groupMsgInviteToGroupQueue.push({groupAlias: groupAlias, peersToInvite: peersToInvite});
+
+ if (_groupMsgInviteToGroupQueue.length === 1)
+ doGroupMsgInviteToGroup();
+}
+
+function doGroupMsgInviteToGroup() {
+ twisterRpc('newgroupinvite',
+ [defaultScreenName, lastPostId + 1,
+ _groupMsgInviteToGroupQueue[0].groupAlias, _groupMsgInviteToGroupQueue[0].peersToInvite],
+ function(req, ret) {
+ incLastPostId();
+ _groupMsgInviteToGroupQueue.shift();
+ if (_groupMsgInviteToGroupQueue.length)
+ setTimeout(doGroupMsgInviteToGroup, 200);
+ }, null,
+ function(req, ret) {
+ alert(polyglot.t('error',
+ {error: 'can\'t invite ' + req[1] + ' to ' + req[0] + ' group — ' + ret.message}));
+ _groupMsgInviteToGroupQueue.shift();
+ if (_groupMsgInviteToGroupQueue.length)
+ setTimeout(doGroupMsgInviteToGroup, 200);
+ }, [_groupMsgInviteToGroupQueue[0].groupAlias, _groupMsgInviteToGroupQueue[0].peersToInvite]
+ );
+}
+
+function groupMsgLeaveGroup(groupAlias, cbFunc, cbArgs) {
+ twisterRpc('leavegroup', [defaultScreenName, groupAlias],
+ cbFunc, cbArgs,
+ function(req, ret) {alert(polyglot.t('error', {error: 'can\'t leave group — ' + ret.message}));}, null
+ );
+}
+
+function groupMsgGetGroupsForPeer(peer, cbFunc, cbArgs) {
+ twisterRpc('listgroups', [peer],
+ cbFunc, cbArgs,
+ function(req, ret) {alert(polyglot.t('error', {error: 'can\'t list groups — ' + ret.message}));}, null
+ );
+}
+
+function groupMsgGetGroupInfo(groupAlias, cbFunc, cbArgs) {
+ twisterRpc('getgroupinfo', [groupAlias],
+ cbFunc, cbArgs,
+ function(req, ret) {alert(polyglot.t('error', {error: 'can\'t get group info — ' + ret.message}));}, null
+ );
+}
+
+function groupMsgInviteFormInputHandleUserSearchRet() {
+ // working with global results because of search function in textcomplete strategy, see groupMsgInviteFormInputSetTextcompleteReq
+ var i = _lastSearchUsersResults.indexOf(defaultScreenName);
+ if (i !== -1)
+ _lastSearchUsersResults.splice(i, 1);
+}
+
+function groupMsgInviteFormInputSetTextcompleteReq() {
+ return [{
+ match: /\B@(\w*)$/,
+ search: function (term, callback) {
+ callback($.map(_lastSearchUsersResults, function (mention) {
+ return mention.indexOf(term) === 0 ? mention : null;
+ }));
+ },
+ index: 1,
+ replace: function (mention) {
+ return '@'+mention+' ';
+ }
+ }]
+}
+
function initInterfaceDirectMsg() {
- $('.direct-messages').attr('href','#directmessages');
- $('.userMenu-messages a').attr('href','#directmessages');
+ $('.direct-messages').attr('href', '#directmessages');
+ $('.userMenu-messages a').attr('href', '#directmessages');
+ $('.groupmessages').attr('href', '#groupmessages');
+ $('.userMenu-groupmessages a').attr('href', '#groupmessages');
$('#dm-snippet-template').on('click', function() {
- window.location.hash = '#directmessages?user=' + $(this).attr('data-dm-screen-name');
+ var alias = $(this).attr('data-screen-name');
+ window.location.hash = '#directmessages?' + (alias[0] === '*' ? 'group' : 'user') + '=' + alias;
});
$('.dm-submit').on('click', directMsgSubmit);
@@ -196,5 +451,72 @@ function initInterfaceDirectMsg() {
window.location.hash = '#directmessages?user=' +
$(this).closest('[data-screen-name]').attr('data-screen-name');
});
-}
+ $('.group-messages-control .invite').on('click', function (event) {
+ $(event.target).siblings('.invite-form').toggle();
+ });
+
+ $('.group-messages-control .invite-form textarea')
+ .on('input', {parentSelector: '.invite-form', enterSelector: 'button',
+ handleRet: groupMsgInviteFormInputHandleUserSearchRet},
+ function (event) {
+ inputEnterActivator(event);
+ userSearchKeypress(event);
+ }
+ )
+ .on('focus', {req: groupMsgInviteFormInputSetTextcompleteReq}, setTextcompleteOnEventTarget)
+ .on('focusout', unsetTextcompleteOnEventTarget)
+ ;
+
+ $('.group-messages-control .invite-form button').on('click', function (event) {
+ var elemEvent = $(event.target);
+ var elemInput = elemEvent.siblings('textarea');
+ var peersToInvite = elemInput.val().toLowerCase().match(/@\w+/g);
+ if (peersToInvite)
+ peersToInvite = peersToInvite.join('').slice(1).split('@');
+
+ groupMsgInviteToGroup(elemEvent.closest('[data-screen-name]').attr('data-screen-name'),
+ peersToInvite);
+
+ elemInput.val('');
+ elemEvent.parents('.invite-form').toggle();
+
+ // TODO reload group members list
+ });
+
+ $('.group-messages-control .join').on('click', function () {
+ window.location.hash = '#groupmessages+joingroup';
+ });
+
+ $('.group-messages-control .leave').on('click', function (event) {
+ var elemEvent = $(event.target);
+ var groupAlias = elemEvent.closest('[data-screen-name]').attr('data-screen-name');
+ confirmPopup(event, {
+ titleTxt: polyglot.t('сonfirm_group_leaving_header'),
+ messageTxt: polyglot.t('сonfirm_group_leaving_body', {alias: groupAlias}),
+ confirmFunc: function (groupAlias) {
+ groupMsgLeaveGroup(groupAlias, function () {history.back();});
+ },
+ confirmFuncArgs: groupAlias
+ });
+ });
+
+ $('.group-messages-control .new').on('click', function () {
+ window.location.hash = '#groupmessages+newgroup';
+ });
+
+ $('.group-messages-control .secret-key').on('click', promptCopyAttrData);
+
+ $('.group-messages-control .show-secret-key').on('click', function (event) {
+ var elemEvent = $(event.target);
+ var elemSecretKey = elemEvent.siblings('.secret-key')
+ .toggle();
+ if (elemSecretKey.css('display') !== 'none') {
+ dumpPrivkey(elemEvent.closest('[data-screen-name]').attr('data-screen-name'),
+ function(req, ret) {req.text(ret).attr('data', ret);},
+ elemSecretKey
+ );
+ } else
+ elemSecretKey.text('').attr('data', '');
+ });
+}
diff --git a/js/twister_following.js b/js/twister_following.js
index 46c5b90..d3387ee 100644
--- a/js/twister_following.js
+++ b/js/twister_following.js
@@ -10,9 +10,10 @@ var _followsPerPage = 200;
var _maxFollowingPages = 50;
var _followingSeqNum = 0;
var _followSuggestions = [];
-var _searchingPartialUsers = "";
+var _searchingPartialName = '';
var _searchKeypressTimer = undefined;
var _lastSearchUsersResults = [];
+var _lastSearchUsersResultsRemovedFromDHTgetQueue = true;
var _lastLoadFromDhtTime = 0;
var twisterFollowingO = undefined;
@@ -578,101 +579,96 @@ function processWhoToFollowSuggestion(suggestion, followedBy) {
console.warn('nothing to proceed: no twisters to follow was suggested');
}
-function closeSearchDialog()
-{
- $(".userMenu-search-field").siblings().slideUp( "fast" );
- removeUsersFromDhtgetQueue( _lastSearchUsersResults );
- _lastSearchUsersResults = [];
+function closeSearchDialog(event) {
+ var elemEvent = event ? $(event.target) : this;
+ elemEvent.siblings('.search-results').slideUp('fast');
+ if (!_lastSearchUsersResultsRemovedFromDHTgetQueue) {
+ removeUsersFromDhtgetQueue(_lastSearchUsersResults);
+ _lastSearchUsersResultsRemovedFromDHTgetQueue = true;
+ }
}
function userSearchKeypress(event) {
- var partialName = $(".userMenu-search-field").val().toLowerCase();
- var searchResults = $(".search-results");
+ var elemEvent = $(event.target);
+ var partialName = elemEvent.val().toLowerCase();
- if ( partialName.substr( 0, 1 ) == '#' ) {
-
- if(searchResults.is(":visible"))
- searchResults.slideUp( "fast" );
-
- if ( event.which == 13 )
- window.location.hash = '#hashtag?hashtag=' + encodeURIComponent(partialName.substr(1));
+ if (event.data.hashtags && partialName[0] === '#') {
+ var searchResults = elemEvent.siblings('.search-results');
+ if (searchResults.is(':visible'))
+ searchResults.slideUp('fast');
return;
}
- if ( partialName.substr( 0, 1 ) == '@' ) {
- partialName = partialName.substr( 1 );
- }
+ var words = partialName.match(/\b\w+/g);
+ if (words && words.length) {
+ partialName = words.pop();
- //var partialName = item.val();
-
- if( !partialName.length ) {
- closeSearchDialog();
- } else {
- if( _searchKeypressTimer !== undefined )
+ if (typeof _searchKeypressTimer !== 'undefined')
clearTimeout(_searchKeypressTimer);
- if( _searchingPartialUsers.length ) {
- _searchingPartialUsers = partialName;
+ if (_searchingPartialName.length) {
+ _searchingPartialName = partialName;
} else {
- _searchKeypressTimer = setTimeout( function() {
+ _searchKeypressTimer = setTimeout(function () {
_searchKeypressTimer = undefined;
- searchPartialUsername(partialName);
+ event.data.partialName = partialName;
+ searchPartialUsername(event);
}, 600);
}
- }
+ } else
+ closeSearchDialog(event);
}
-function searchPartialUsername(partialName) {
- _searchingPartialUsers = partialName;
- twisterRpc("listusernamespartial", [partialName,10],
- function(partialName, ret) {
- processDropdownUserResults(partialName, ret)
- }, partialName,
- function(cbArg, ret) {
- console.log("ajax error:" + ret);
- }, {});
+function searchPartialUsername(event) {
+ _searchingPartialName = event.data.partialName;
+ twisterRpc('listusernamespartial', [event.data.partialName, 10],
+ function(event, ret) {
+ if (event.data.partialName !== _searchingPartialName)
+ setTimeout(searchPartialUsername, 100, event);
+ else {
+ if (!_lastSearchUsersResultsRemovedFromDHTgetQueue)
+ removeUsersFromDhtgetQueue(_lastSearchUsersResults);
+ else
+ _lastSearchUsersResultsRemovedFromDHTgetQueue = false;
+ _lastSearchUsersResults = ret;
+
+ if (ret && ret.length) {
+ if (event.data.handleRet)
+ event.data.handleRet(event, ret);
+ } else {
+ if (event.data.handleRetZero)
+ event.data.handleRetZero(event);
+ }
+
+ _searchingPartialName = '';
+ }
+ }, event,
+ function(req, ret) {console.warn('ajax error:' + ret.message);}, null
+ );
}
-function processDropdownUserResults(partialName, results){
+function processDropdownUserResults(event, results) {
+ var container = $('.userMenu-search-profiles').empty();
+ var template = $('#search-profile-template').children();
- if( partialName != _searchingPartialUsers ) {
- searchPartialUsername( _searchingPartialUsers );
- return;
+ for (var i = 0; i < results.length; i++) {
+ if (results[i] === defaultScreenName)
+ continue;
+
+ var item = template.clone(true);
+ item.find('.mini-profile-info').attr('data-screen-name', results[i]);
+ item.find('.mini-screen-name b').text(results[i]);
+ item.find('a.open-profile-modal').attr('href', $.MAL.userUrl(results[i]));
+ getAvatar(results[i], item.find('.mini-profile-photo'));
+ getFullname(results[i], item.find('.mini-profile-name'));
+ item.appendTo(container);
+
+ if (followingUsers.indexOf(results[i]) !== -1)
+ toggleFollowButton(results[i], true);
}
- removeUsersFromDhtgetQueue( _lastSearchUsersResults );
- _lastSearchUsersResults = results;
-
- var typeaheadAccounts = $(".userMenu-search-profiles");
- var template = $("#search-profile-template").detach();
-
- typeaheadAccounts.empty();
- typeaheadAccounts.append(template);
-
- if( results.length ) {
- for( var i = 0; i < results.length; i++ ) {
- if( results[i] == defaultScreenName )
- continue;
-
- var resItem = template.clone(true);
- resItem.removeAttr('id');
- resItem.show();
- resItem.find(".mini-profile-info").attr("data-screen-name", results[i]);
- resItem.find(".mini-screen-name b").text(results[i]);
- resItem.find("a.open-profile-modal").attr("href",$.MAL.userUrl(results[i]));
- getAvatar(results[i],resItem.find(".mini-profile-photo"));
- getFullname(results[i],resItem.find(".mini-profile-name"));
- resItem.appendTo(typeaheadAccounts);
- if (followingUsers.indexOf(results[i]) >= 0)
- toggleFollowButton(results[i], true);
- }
-
- $.MAL.searchUserListLoaded();
- } else {
- closeSearchDialog();
- }
- _searchingPartialUsers = "";
+ $.MAL.searchUserListLoaded();
}
function userClickFollow(e) {
@@ -700,22 +696,33 @@ function userClickFollow(e) {
}
function initUserSearch() {
- var $userSearchField = $( ".userMenu-search-field" );
- $userSearchField.keyup( userSearchKeypress );
- $userSearchField.bind( "click", userSearchKeypress );
- $(".userMenu-search").clickoutside( closeSearchDialog );
+ var elem = $('.userMenu-search-field')
+ .on('click input',
+ {hashtags: true, handleRet: processDropdownUserResults,
+ handleRetZero: closeSearchDialog}, userSearchKeypress)
+ .on('keyup', userSearchEnter)
+ ;
+ $('.userMenu-search').clickoutside(closeSearchDialog.bind(elem));
// following stuff should be moved to special function
$('button.follow').on('click', userClickFollow);
$('.following-config-method-buttons .public-following')
.on('click', function(e) {
setFollowingMethod(e);
- closeModalHandler('.prompt-wrapper');
+ closePrompt();
window.setTimeout(loadModalFromHash, 500); // delay reload so dhtput may do it's job
})
;
}
+function userSearchEnter(event) {
+ if (event.which === 13) {
+ var str = $(event.target).val().toLowerCase().trim();
+ if (str[0] === '#')
+ window.location.hash = '#hashtag?hashtag=' + encodeURIComponent(str.slice(1));
+ }
+}
+
function followingListPublicCheckbox(e) {
e.stopPropagation();
diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js
index 3aa20a9..4489050 100644
--- a/js/twister_formatpost.js
+++ b/js/twister_formatpost.js
@@ -35,22 +35,6 @@ $(document).ready(function() {
// format "userpost" to html element
// kind = "original"/"ancestor"/"descendant"
function postToElem(post, kind, promoted) {
-
- function setPostCommon(elem, username, time) {
- var postInfoName = elem.find('.post-info-name')
- .text(username).attr('href', $.MAL.userUrl(username));
-
- getFullname(username, postInfoName);
- //elem.find('.post-info-tag').text("@" + username); // FIXME
- getAvatar(username, elem.find('.avatar'));
-
- elem.find('.post-info-time')
- .attr('title', timeSincePost(time))
- .find('span:last')
- .text(timeGmtToText(time))
- ;
- }
-
/*
"userpost" :
{
@@ -170,19 +154,22 @@ function postToElem(post, kind, promoted) {
if (typeof retweeted_by !== 'undefined') {
var postContext = elem.find('.post-context');
if (userpost.msg) {
- postContext.append(_templatePostRtReference.clone(true))
- .find('.post-rt-reference')
- .attr('data-screen-name', rt.n)
- .attr('data-id', rt.k)
- .attr('data-userpost', $.toJSON({userpost: rt, sig_userpost: userpost.sig_rt}))
- .find('.post-text').html(htmlFormatMsg(rt.msg).html)
- ;
- setPostCommon(postContext, rt.n, rt.time);
+ setPostReference(postContext, rt, userpost.sig_rt);
} else {
postContext.append(_templatePostRtBy.clone(true))
.find('.post-retransmited-by')
.attr('href', $.MAL.userUrl(retweeted_by)).text('@' + retweeted_by)
;
+ // let's check original post and grab some possible RT
+ dhtget(username, 'post' + k, 's',
+ function(args, post) {
+ if (post && post.userpost.msg && post.userpost.rt) {
+ var postContext = $('
');
+ setPostReference(postContext, post.userpost.rt, post.userpost.sig_rt);
+ args.elem.find('.post-text').after(postContext);
+ }
+ }, {elem: elem}
+ );
}
postContext.show();
}
@@ -226,6 +213,32 @@ function postToElem(post, kind, promoted) {
return elem;
}
+function setPostCommon(elem, username, time) {
+ var postInfoName = elem.find('.post-info-name')
+ .text(username).attr('href', $.MAL.userUrl(username));
+
+ getFullname(username, postInfoName);
+ //elem.find('.post-info-tag').text("@" + username); // FIXME
+ getAvatar(username, elem.find('.avatar'));
+
+ elem.find('.post-info-time')
+ .attr('title', timeSincePost(time))
+ .find('span:last')
+ .text(timeGmtToText(time))
+ ;
+}
+
+function setPostReference(elem, rt, sig_rt) {
+ elem.append(_templatePostRtReference.clone(true))
+ .find('.post-rt-reference')
+ .attr('data-screen-name', rt.n)
+ .attr('data-id', rt.k)
+ .attr('data-userpost', $.toJSON({userpost: rt, sig_userpost: sig_rt}))
+ .find('.post-text').html(htmlFormatMsg(rt.msg).html)
+ ;
+ setPostCommon(elem, rt.n, rt.time);
+}
+
function setPostInfoSent(n, k, item) {
if( n === defaultScreenName && k >= 0 ) {
getPostMaxAvailability(n,k,
@@ -244,7 +257,7 @@ function setPostInfoSent(n, k, item) {
function dmDataToSnippetItem(dmData, remoteUser) {
var dmItem = $("#dm-snippet-template").clone(true);
dmItem.removeAttr('id');
- dmItem.attr("data-dm-screen-name",remoteUser);
+ dmItem.attr('data-screen-name', remoteUser);
dmItem.attr("data-last_id", dmData.id);
dmItem.attr("data-time", dmData.time);
@@ -267,24 +280,31 @@ function dmDataToSnippetItem(dmData, remoteUser) {
}
// format dmdata (returned by getdirectmsgs) to display in conversation thread
-function dmDataToConversationItem(dmData, localUser, remoteUser) {
- var from = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0))
- ? dmData.from
- : (dmData.fromMe ? localUser : remoteUser);
- var classDm = dmData.fromMe ? "sent" : "received";
- var dmItem = $("#dm-chat-template").clone(true);
- dmItem.removeAttr('id');
- dmItem.addClass(classDm);
- getAvatar(from, dmItem.find(".post-photo").find("img") );
- dmItem.find('.post-info-time')
+function postToElemDM(dmData, localUser, remoteUser) {
+ var senderAlias = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0))
+ ? dmData.from : (dmData.fromMe ? localUser : remoteUser);
+ var elem = $('#dm-chat-template').clone(true)
+ .removeAttr('id')
+ .addClass(dmData.fromMe ? 'sent' : 'received')
+ ;
+
+ var elemName = elem.find('.post-info-name')
+ .attr('href', $.MAL.userUrl(senderAlias));
+ if (senderAlias[0] === '*' )
+ getGroupChatName(senderAlias, elemName);
+ else
+ getFullname(senderAlias, elemName);
+
+ getAvatar(senderAlias, elem.find('.post-photo').find('img'));
+ elem.find('.post-info-time')
.attr('title', timeSincePost(dmData.time))
.find('span:last')
.text(timeGmtToText(dmData.time))
;
- setPostInfoSent(from,dmData.k,dmItem.find('.post-info-sent'));
- dmItem.find('.post-text').html(htmlFormatMsg(dmData.text).html);
+ setPostInfoSent(senderAlias, dmData.k, elem.find('.post-info-sent'));
+ elem.find('.post-text').html(htmlFormatMsg(dmData.text).html);
- return dmItem;
+ return elem;
}
// convert message text to html, featuring @users and links formating.
diff --git a/js/twister_newmsgs.js b/js/twister_newmsgs.js
index 27b3cf6..df1b738 100644
--- a/js/twister_newmsgs.js
+++ b/js/twister_newmsgs.js
@@ -117,8 +117,25 @@ function requestMentionsCount() {
if (newDMs) {
$.MAL.soundNotifyDM();
- if ($.Options.showDesktopNotifDMs.val === 'enable')
- $.MAL.showDesktopNotif(false, polyglot.t('You got')+' '+polyglot.t('new_direct_messages', newDMs)+'.', false, 'twister_notification_new_DMs', $.Options.showDesktopNotifDMsTimer.val, function(){$.MAL.showDMchat()}, false)
+ if ($.Options.showDesktopNotifDMs.val === 'enable') {
+ $.MAL.showDesktopNotif(false,
+ polyglot.t('You got') + ' ' + polyglot.t('new_direct_messages', newDMs) + '.',
+ false, 'twister_notification_new_DMs', $.Options.showDesktopNotifDMsTimer.val,
+ function () {$.MAL.showDMchat();}, false
+ );
+ }
+ }
+ var newDMs = getNewGroupDMsCount();
+ if (newDMs) {
+ $.MAL.soundNotifyDM();
+
+ if ($.Options.showDesktopNotifDMs.val === 'enable') {
+ $.MAL.showDesktopNotif(false,
+ polyglot.t('You got') + ' ' + polyglot.t('new_group_messages', newDMs) + '.',
+ false, 'twister_notification_new_DMs', $.Options.showDesktopNotifDMsTimer.val,
+ function () {$.MAL.showDMchat({group: true});}, false
+ );
+ }
}
}
}
@@ -197,6 +214,7 @@ function requestDMsCount() {
if (_newDMsUpdated) {
saveDMsToStorage();
$.MAL.updateNewDMsUI(getNewDMsCount());
+ $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount());
}
}, null,
function(req, ret) {console.warn('ajax error:' + ret);}, null
@@ -207,7 +225,18 @@ function getNewDMsCount() {
var newDMs = 0;
for (var user in _newDMsPerUser) {
- if (_newDMsPerUser[user])
+ if (user[0] !== '*' && _newDMsPerUser[user])
+ newDMs += _newDMsPerUser[user];
+ }
+
+ return newDMs;
+}
+
+function getNewGroupDMsCount() {
+ var newDMs = 0;
+
+ for (var user in _newDMsPerUser) {
+ if (user[0] === '*' && _newDMsPerUser[user])
newDMs += _newDMsPerUser[user];
}
@@ -220,6 +249,7 @@ function resetNewDMsCountForUser(user, lastId) {
saveDMsToStorage();
$.MAL.updateNewDMsUI(getNewDMsCount());
+ $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount());
}
function updateGroupList() {
@@ -232,6 +262,7 @@ function updateGroupList() {
function initDMsCount() {
loadDMsFromStorage();
$.MAL.updateNewDMsUI(getNewDMsCount());
+ $.MAL.updateNewGroupDMsUI(getNewGroupDMsCount());
//quick hack to obtain list of group chat aliases
updateGroupList();
setInterval(updateGroupList, 60000);
diff --git a/licenses/groupmessages.png.license b/licenses/groupmessages.png.license
new file mode 100644
index 0000000..f469f0f
--- /dev/null
+++ b/licenses/groupmessages.png.license
@@ -0,0 +1,7 @@
+*group messages icon* is derivative work
+
+ based on https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Group_half_security.svg/120px-Group_half_security.svg.png from https://commons.wikimedia.org/wiki/File:Group_half_security.svg
+
+ formerly was icon from PICOL, PIctorial COmmunication Language, http://picol.org
+
+ licensed under Creative Commons Attribution 3.0 Unported license
diff --git a/theme_calm/css/profile.css b/theme_calm/css/profile.css
index adf7f4a..81e0e0b 100644
--- a/theme_calm/css/profile.css
+++ b/theme_calm/css/profile.css
@@ -62,36 +62,16 @@
color: #f8f8f8;
}
-.profile-card-buttons
-{
+.profile-card-buttons {
+ padding: 4px 0;
+}
+
+.twister-user-info .profile-card-buttons {
position: absolute;
- bottom: 30px;
+ top: 0;
right: 0;
}
-.profile-card-buttons .direct-messages-with-user,
-.profile-card-buttons .mentions-from-user,
-.profile-card-buttons .follow,
-.profile-card-buttons .unfollow
-{
- display: inline;
- padding: 4px 12px;
- font-size: 12px;
- width: auto;
- text-align: center;
- color: rgba( 0, 0, 0, .7 );
- background: rgba( 0, 0, 0, .1 );
- border: none;
- transition: all .2s linear;
-}
-
-.profile-card-buttons .direct-messages-with-user:hover,
-.profile-card-buttons .mentions-from-user:hover
-{
- color: #fff;
- background: #b2d67b;
-}
-
.profile-card.forEdition
{
margin: 0 auto;
@@ -385,10 +365,6 @@ h2.profile-screen-name {
color: #8f95a4;
}
-.profile-modal .modal-buttons {
- display: none;
-}
-
.profile-modal h1.profile-name,
.profile-modal h2.profile-screen-name,
.profile-modal span.profile-location,
@@ -401,3 +377,36 @@ h2.profile-screen-name {
.profile-modal a.profile-bio:empty {
display: none;
}
+
+.group-messages-control .invite-form, .group-messages-control .secret-key {
+ display: none;
+ font-size: 12px;
+ text-align: center;
+ padding: 4px 0;
+}
+
+.group-messages-control .invite-form textarea {
+ border: solid 1px rgba(0, 0, 0, .3);
+ border-radius: 3px;
+ vertical-align: middle;
+ width: 73%;
+ height: 20px;
+ resize: none;
+ margin: 0 4px;
+ padding: 1px 4px;
+}
+
+.group-messages-control .invite-form textarea:focus {
+ border: solid 1px rgba(118, 145, 206, .8);
+}
+
+.group-messages-control .invite-form button {
+ color: #DDD;
+ background-color: #45474D;
+ border: medium none;
+ vertical-align: middle;
+}
+
+.group-messages-control .invite-form button:hover {
+ color: #FFF;
+}
diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css
index 5cc723b..af6745c 100644
--- a/theme_calm/css/style.css
+++ b/theme_calm/css/style.css
@@ -107,28 +107,24 @@ h3
************** BUTTONS ***************
**************************************/
-button
-{
+button {
+ color: rgba(255, 255, 255, .8);
background: #45474d;
- color: rgba( 255, 255, 255, .8 );
border: none;
padding: 5px 10px;
cursor: pointer;
}
-button:hover
-{
+button:hover {
color: #fff;
}
-button.disabled
-{
+button:disabled, button.disabled {
opacity: .4;
}
-button.disabled:hover
-{
- color: rgba( 255, 255, 255, .8 );
+button:disabled:hover, button.disabled:hover {
+ color: rgba(255, 255, 255, .8);
}
button.follow, button.unfollow, .following-list button.private {
@@ -172,11 +168,32 @@ button.unfollow:hover {
margin-right: 10px;
}
+.b-buttons {
+ text-align: right;
+ padding: 4px;
+}
+
+.b-buttons button {
+ color: rgba(0, 0, 0, .7);
+ background-color: rgba(0, 0, 0, .08);
+ border: none;
+ font-size: 12px;
+ text-align: center;
+ width: auto;
+ padding: 4px 12px;
+ transition: all .1s linear;
+}
+
+.b-buttons button:hover {
+ color: #FFF;
+ background: #B2D67B;
+}
+
/*************************************
-**************************** MENU *****
+**************** MENU ****************
**************************************/
-.userMenu
-{
+
+.userMenu {
width: 900px;
position: fixed;
left: 50%;
@@ -185,11 +202,13 @@ button.unfollow:hover {
background: #43464d;
z-index: 2;
}
+
.userMenu.w1200 {
width: 1200px;
margin-left: -600px;
}
-.userMenu:after{
+
+.userMenu:after {
position: absolute;
content: '';
width: 9999px;
@@ -197,7 +216,8 @@ button.unfollow:hover {
background: #43464d;
z-index: -999;
}
-.userMenu:before{
+
+.userMenu:before {
position: absolute;
content: '';
width: 9999px;
@@ -206,16 +226,14 @@ button.unfollow:hover {
background: #43464d;
z-index: -999;
}
-.userMenu > ul
-{
-}
-.userMenu > ul > li
-{
+
+.userMenu > ul > li {
float: left;
+ height: 40px;
margin: 0;
}
-.userMenu > ul > li > a
-{
+
+.userMenu > ul > li > a {
line-height: 40px;
height: 40px;
padding: 0 20px 0 45px;
@@ -227,119 +245,87 @@ button.unfollow:hover {
transition: all .2s linear;
position: relative;
}
-.userMenu li > a:hover
-{
+
+.userMenu li:hover, .userMenu li:active {
+ background-color: rgba(0, 0, 0 , .4);
+}
+
+.userMenu li:hover > a, .userMenu li:active > a {
text-decoration: none;
opacity: 1;
}
-.userMenu li.current > a
-{
+
+.userMenu li.current {
+ background-color: #768FCE;
+}
+
+.userMenu li.current > a {
color: #fff;
opacity: 1;
}
-.userMenu li.userMenu-home > a
-{
+
+.userMenu li.userMenu-home > a {
background: url(../img/home.png) no-repeat center center;
padding-left: 40px;
}
-.userMenu li.userMenu-home:hover > a
-{
- background: url(../img/home.png) no-repeat center center rgba( 0, 0, 0 , .4 );
-}
-.userMenu li.userMenu-home.current > a
-{
- background: url(../img/home.png) no-repeat center center #768fce;
-}
-.userMenu li.userMenu-connections > a
-{
+
+.userMenu li.userMenu-connections > a {
background: url(../img/connections.png) no-repeat center center;
opacity: 1;
}
-.userMenu li.userMenu-connections:hover > a
-{
- background: url(../img/connections.png) no-repeat center center rgba( 0, 0, 0 , .4 );
-}
-.userMenu li.userMenu-connections.current > a
-{
- background: url(../img/connections.png) no-repeat 5px center #b43e34;
-}
-.userMenu li.userMenu-network > a
-{
+
+.userMenu li.userMenu-network > a {
background: url(../img/network.png) no-repeat 5px center;
padding-left: 60px;
}
-.userMenu li.userMenu-network:hover > a
-{
- background: url(../img/network.png) no-repeat 5px center rgba( 0, 0, 0 , .4 );
-}
-.userMenu li.userMenu-network.current > a
-{
- background: url(../img/network.png) no-repeat 5px center #768fce;
-}
-.userMenu li.userMenu-following > a
-{
+.userMenu li.userMenu-following > a {
background: url(../img/following.png) no-repeat 5px center;
padding-left: 50px;
}
-.userMenu li.userMenu-following:hover > a
-{
- background: url(../img/following.png) no-repeat 5px center rgba( 0, 0, 0 , .4 );
-}
-.userMenu li.userMenu-following.current > a
-{
- background: url(../img/following.png) no-repeat 5px center #768fce;
-}
-.userMenu li.userMenu-options > a
-{
+
+.userMenu li.userMenu-options > a {
background: url(../img/switch.png) no-repeat 5px center;
padding-left: 50px;
}
-.userMenu li.userMenu-options:hover > a
-{
- background: url(../img/switch.png) no-repeat 5px center rgba( 0, 0, 0 , .4 );
-}
-.userMenu li.userMenu-options.current > a
-{
- background: url(../img/switch.png) no-repeat 5px center #768fce;
-}
-.userMenu li.userMenu-messages > a
-{
+
+.userMenu li.userMenu-messages > a {
background: url(../img/messages.png) no-repeat center center;
padding: 0 25px 0 35px;
opacity: 1;
}
-.userMenu li.userMenu-messages:hover > a
-{
- background: url(../img/messages.png) no-repeat center center rgba( 0, 0, 0 , .4 );
+
+.userMenu li.userMenu-messages > a:empty {
+ padding: 0 20px 0 30px;
+ opacity: .7;
}
-.userMenu li.userMenu-messages.current > a
-{
- background: url(../img/messages.png) no-repeat center center #b43e34;
+
+.userMenu li.userMenu-groupmessages > a {
+ background: url(../img/groupmessages.png) no-repeat center center;
+ background-size: 22px 22px;
+ padding: 0 24px;
+ opacity: 0.9;
}
-.userMenu li.userMenu-profile > a
-{
+
+.userMenu li.userMenu-profile > a {
background: url(../img/profile.png) no-repeat 5px center;
padding-left: 35px;
}
-.userMenu li.userMenu-profile:hover > a
-{
- background: url(../img/profile.png) no-repeat 5px center rgba( 0, 0, 0 , .4 );
-}
-.userMenu li.userMenu-profile.current > a
-{
- background: url(../img/profile.png) no-repeat 5px center #768fce;
-}
-.userMenu li.userMenu-config
-{
+
+.userMenu li.userMenu-config {
float: right;
position: relative;
}
-.userMenu li.userMenu-search
-{
+
+.userMenu li.userMenu-search {
float: right;
position: relative;
}
+
+.userMenu li.userMenu-search:hover {
+ background-color: transparent;
+}
+
input.userMenu-search-field::-webkit-input-placeholder {
color: #4d4d4d;
font-style: italic;
@@ -368,24 +354,20 @@ input.userMenu-search-field:focus::-moz-placeholder {
input.userMenu-search-field:focus::-ms-input-placeholder {
color: #fff;
}
-.userMenu li.userMenu-config > a
-{
+
+.userMenu li.userMenu-config > a {
background: url(../img/config.png) no-repeat 5px center;
padding: 0 30px 0 45px;
}
-.userMenu li.userMenu-config > a:after
-{
+
+.userMenu li.userMenu-config > a:after {
content: "▼";
position: absolute;
font-size: 10px;
transition: all .2 linear;
margin-left: 8px;
}
-.userMenu li.userMenu-config:hover > a,
-.userMenu li.userMenu-config:active > a
-{
- background: url(../img/config.png) no-repeat 5px center rgba( 0, 0, 0 , .4 );
-}
+
.userMenu li.userMenu-dhtindicator {
background: #000;
width: 70px;
@@ -402,6 +384,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
transition: all 200ms;
border-radius: 10px;
}
+
.userMenu li.userMenu-dhtindicator a {
display: inline-block;
font: 12px/25px "Open Sans", sans-serif;
@@ -410,6 +393,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
height: 25px;
opacity: .9;
}
+
.userMenu li.userMenu-dhtindicator a:before {
content: 'DHT:';
display: inline-block;
@@ -418,19 +402,15 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
width: 70px;
height: 25px;
}
+
.userMenu li.userMenu-dhtindicator:hover {
opacity: 1;
-webkit-box-shadow: inset 0 0 15px #000;
-moz-box-shadow: inset 0 0 15px #000;
box-shadow: inset 0 0 15px #000;
}
-.userMenu li.userMenu-messages > a:empty
-{
- padding: 0 20px 0 30px;
- opacity: .7;
-}
-.wrapper
-{
+
+.wrapper {
width: 900px;
margin: 0 auto;
background: #e0e6f5;
@@ -439,15 +419,18 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
z-index: 1;
min-height: 100%;
}
+
.wrapper.w1200 {
width: 1200px;
padding: 55px 7px 15px 7px;
}
+
.dashboard.left {
width: 320px;
position: fixed;
top: 55px;
}
+
.dashboard.right {
width: 320px;
position: fixed;
@@ -455,18 +438,18 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
margin-left: 864px;
}
-.module
-{
+.module {
border: solid 1px rgba( 69, 71, 77, .1 );
background: #f3f5fb;
}
+
.dashboard .module {
margin: 0 0 3%;
border-radius: 6px;
}
-.messages-qtd
-{
+
+.messages-qtd {
position: absolute;
background: #ef0807;
color: #fff;
@@ -475,10 +458,11 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
font-size: 8px;
margin-top: 4px;
}
-.userMenu-connections .messages-qtd
-{
+
+.userMenu-connections .messages-qtd {
margin: 4px 0 0 -5px;
}
+
/*******************************************************
****************** CONFIG SUBMENU & SEARCH RESULTS *****
*******************************************************/
@@ -1156,6 +1140,11 @@ textarea.splited-post {
transition: background .1s linear;
-moz-transition: background .1s linear;
}
+
+.post.new {
+ background-color: #FFFFED;
+}
+
.post.open
{
margin: 10px 0;
@@ -1197,10 +1186,8 @@ textarea.splited-post {
{
background: #fff;
}
-.post-photo,
-.mini-profile-photo
-{
- margin: 5px;
+
+.post-photo, .mini-profile-photo {
display: inline-block;
float: left;
vertical-align: middle;
@@ -1209,13 +1196,14 @@ textarea.splited-post {
overflow: hidden;
border-radius: 20%;
/*transform: rotate( 45deg );*/
+ margin: 6px;
}
-.post-photo img,
-.mini-profile-photo img
-{
+
+.post-photo img, .mini-profile-photo img {
width: 48px;
- height: 48px;
+ height: auto;
}
+
.post-info span
{
vertical-align: top;
@@ -1238,14 +1226,15 @@ textarea.splited-post {
display: inline-block;
letter-spacing: 0px;
}
-.post-info-time
-{
+
+.post-info-time {
float: right;
font-size: 12px;
- margin-right: 5px;
+ margin: 4px 8px 0;
opacity: .5;
text-decoration: none;
}
+
.post-info-time:hover {
text-decoration: none;
color: #43464d;
@@ -1253,7 +1242,7 @@ textarea.splited-post {
.post-text {
font-size: 13px;
- margin: 2px 10px 4px 60px;
+ margin: 2px 16px 4px 60px;
word-wrap: break-word;
}
@@ -1263,11 +1252,11 @@ textarea.splited-post {
padding-right: 2px;
}
-.post-context
-{
+.post-context {
font-size: 11px;
- margin: 2px 10px 4px 60px;
+ margin: 2px 16px 4px 60px;
}
+
.post-text a,
.post-context a,
.mini-screen-name
@@ -1908,7 +1897,7 @@ textarea.splited-post {
}
.direct-messages-thread .post-text {
- margin: 2px 10px 4px 4px;
+ margin: 2px 16px 4px 4px;
word-wrap: break-word;
}
@@ -1931,8 +1920,26 @@ textarea.splited-post {
left: auto;
}
+.direct-messages-thread .post.sent .post-info {
+ text-align: right;
+}
+
+.direct-messages-thread .post.sent .post-info-name {
+ margin-right: 2px;
+}
+
+.direct-messages-thread .post.sent .post-info-time {
+ float: left;
+}
+
+.direct-messages-thread .post.sent .post-info-time .post-info-sent {
+ float: right;
+ margin-left: 2px;
+}
+
.direct-messages-thread .post.sent .post-text {
- margin: 2px 10px 4px 4px;
+ margin: 2px 4px 4px 16px;
+ text-align: right;
}
.direct-messages-thread .post.sent .post-photo {
@@ -1957,6 +1964,100 @@ textarea.splited-post {
content: '\2714';
}
+/*************************************
+****** GM NEW GROUP SETUP MODAL ******
+**************************************/
+
+.group-messages-new-group.modal-wrapper {
+ height: auto; /*about 320px*/
+ margin-top: -160px;
+}
+
+.group-messages-new-group .modal-content .module {
+ margin: 4px;
+}
+
+.group-messages-new-group .modal-content div div {
+ width: 100%;
+ margin: 4px 0;
+ padding: 4px 12px;
+}
+
+.group-messages-new-group .modal-content div div:last-child {
+ text-align: right;
+}
+
+.group-messages-new-group .modal-content div div:last-child button {
+ margin: 8px 4px;
+}
+
+.group-messages-new-group .modal-content textarea {
+ border: solid 1px rgba(0, 0, 0, .3);
+ border-radius: 3px;
+ width: 500px;
+ height: 56px;
+ resize: none;
+ margin: 12px 16px;
+ padding: 2px 4px;
+}
+
+.group-messages-new-group .modal-content textarea:focus {
+ border: solid 1px rgba(118, 145, 206, .8);
+ box-shadow: 0 0 10px rgba(0, 0, 0, .3);
+}
+
+/*************************************
+****** GM JOIN GROUP SETUP MODAL *****
+**************************************/
+
+.group-messages-join-group.modal-wrapper {
+ height: auto; /*about 360px*/
+ margin-top: -240px;
+}
+
+.group-messages-join-group .modal-content .module {
+ margin: 4px;
+}
+
+.group-messages-join-group .modal-content div div {
+ width: 100%;
+ margin: 4px 0;
+ padding: 4px 12px;
+}
+
+.group-messages-join-group .modal-content div div:last-child {
+ text-align: right;
+}
+
+.group-messages-join-group .modal-content div div:last-child button {
+ margin: 8px 4px;
+}
+
+.group-messages-join-group .modal-content input {
+ border: solid 1px rgba(0, 0, 0, .3);
+ border-radius: 3px;
+ width: 500px;
+ margin: 12px 16px;
+ padding: 2px 4px;
+}
+
+.group-messages-join-group .modal-content input:focus {
+ border: solid 1px rgba(118, 145, 206, .8);
+ box-shadow: 0 0 10px rgba(0, 0, 0, .3);
+}
+
+.group-messages-join-group .modal-content input[type='checkbox'] {
+ display: inline;
+ width: auto;
+ margin: 2px;
+}
+
+.group-messages-join-group .modal-content .groups-list {
+ height: 120px;
+ overflow-y: auto;
+ margin: 8px 8px 0;
+}
+
/*************************************
*********** NEW USER MODAL ***********
**************************************/
@@ -2082,6 +2183,7 @@ textarea.splited-post {
.prompt-wrapper {
background: rgba(255,255,255, 1.0);
+ font-size: 13px;
z-index: 5;
position: fixed;
top: 50%;
@@ -2102,6 +2204,20 @@ textarea.splited-post {
margin: 4px;
}
+/*************************************
+*********** CONFIRM POPUP ************
+**************************************/
+
+.confirm-popup .message {
+ text-align: center;
+ margin: 12px;
+}
+
+.confirm-popup .modal-buttons {
+ text-align: center;
+ padding: 4px;
+}
+
/*************************************
****** FOLLOWING-CONFIG PROMPT *******
**************************************/
@@ -2523,6 +2639,7 @@ p.post-text img {
.post-rt-reference .post-photo {
width: 24px;
height: 24px;
+ margin: 4px;
}
.post-rt-reference .post-photo img {
@@ -2532,11 +2649,12 @@ p.post-text img {
.post-rt-reference .post-info-name {
font-size: 11px;
+ padding: 0;
}
.post-rt-reference .post-text {
font-size: 11px;
- margin: 2px 10px 4px 10px;
+ margin: 2px 8px 4px 34px;
}
.post-rt-reference .post-text a {
@@ -2546,4 +2664,5 @@ p.post-text img {
.post-rt-reference .post-info-time {
font-size: 9px;
color: #000;
+ margin: 2px 4px 0;
}
diff --git a/theme_calm/img/groupmessages.png b/theme_calm/img/groupmessages.png
new file mode 100644
index 0000000..3b6562f
Binary files /dev/null and b/theme_calm/img/groupmessages.png differ
diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css
index 45e5478..58e10f3 100644
--- a/theme_nin/css/style.css
+++ b/theme_nin/css/style.css
@@ -56,7 +56,7 @@
font-style: normal;
}
/* line 64, ../sass/_fonts.sass */
-[class^="icon-"]:before, [class*=" icon-"]:before, .extend-icon:before, .userMenu li.userMenu-config > a:before, .post-retransmited-icon:before, .post-reply:before, .post-propagate:before, .post-favorite:before, .post .show-more:before, .mini-profile-actions span:before, ul.userMenu-search-profiles button:before, .mini-profile-indicators .userMenu-connections a:before, .mini-profile-indicators .userMenu-messages a:before, .mini-profile-indicators .userMenu-user a:before, .twister-user-remove:before, .refresh-toptrends:before, .twistday-reminder .refresh:before, .refresh-users:before, .modal-close:before, .mark-all-as-read:before, .modal-back:before, .icon-down-after:after {
+[class^="icon-"]:before, [class*=" icon-"]:before, .extend-icon:before, .userMenu li.userMenu-config > a:before, .post-retransmited-icon:before, .post-reply:before, .post-propagate:before, .post-favorite:before, .post .show-more:before, .mini-profile-actions span:before, ul.userMenu-search-profiles button:before, .mini-profile-indicators .userMenu-connections a:before, .mini-profile-indicators .userMenu-messages a:before, .twister-user-remove:before, .refresh-toptrends:before, .twistday-reminder .refresh:before, .refresh-users:before, .modal-close:before, .mark-all-as-read:before, .modal-back:before, .icon-down-after:after {
font-family: "fontello";
font-style: normal;
font-weight: normal;
@@ -95,12 +95,6 @@
content: "";
}
-/* '' */
-/* line 100, ../sass/_fonts.sass */
-.icon-user:before, .mini-profile-indicators .userMenu-user a:before {
- content: "";
-}
-
/* '' */
/* line 105, ../sass/_fonts.sass */
.icon-camera:before {
@@ -365,7 +359,8 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu,
display: block;
}
/* line 65, ../sass/_menu.sass */
-.userMenu li.userMenu-dhtindicator, .userMenu li.userMenu-connections, .userMenu li.userMenu-messages {
+.userMenu li.userMenu-dhtindicator, .userMenu li.userMenu-connections,
+.userMenu li.userMenu-messages, .userMenu li.userMenu-groupmessages {
display: none !important;
}
/* line 68, ../sass/_menu.sass */
@@ -438,7 +433,7 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu,
padding: 0;
}
/* line 54, ../sass/_profile.sass */
-.profile-modal .modal-content .postboard {
+.profile-modal .modal-content .postboard, .profile-modal .modal-content .members {
margin-left: 0;
height: 100%;
bottom: 0;
@@ -771,6 +766,10 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu,
color: #414244;
}
+.post.new .post-info-time {
+ color: #B4C669;
+}
+
/* line 55, ../sass/_postboard.sass */
.post-data {
padding: 10px;
@@ -888,9 +887,10 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu,
.post-context {
font-size: 11px;
line-height: 11px;
- margin: 2px 10px 4px 60px;
color: #b3b5b7;
+ margin: 2px 8px 4px 62px;
}
+
/* line 146, ../sass/_postboard.sass */
.post-retransmited-icon:before {
display: block;
@@ -1699,12 +1699,12 @@ button:hover, .mini-profile-actions span:hover, a.button:hover {
text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}
/* line 85, ../sass/_commons.sass */
-button.disabled, .mini-profile-actions span.disabled, a.button.disabled {
+button:disabled, button.disabled, .mini-profile-actions span.disabled, a.button.disabled {
opacity: 0.5;
background-color: #999;
}
/* line 88, ../sass/_commons.sass */
-button.disabled:hover, .mini-profile-actions span.disabled:hover, a.button.disabled:hover {
+button:disabled:hover, button.disabled:hover, .mini-profile-actions span.disabled:hover, a.button.disabled:hover {
color: white;
}
@@ -1977,6 +1977,7 @@ ul.userMenu-search-profiles button:after, ul.userMenu-search-profiles .mini-prof
position: relative;
text-align: center;
background: white;
+ padding: 1em;
}
/* line 152, ../sass/style.sass */
.mini-profile a.button {
@@ -2003,8 +2004,8 @@ ul.userMenu-search-profiles button:after, ul.userMenu-search-profiles .mini-prof
/* line 169, ../sass/style.sass */
.mini-profile-indicators {
- margin: 0 0 1em 0;
background-color: #f3f2f1;
+ text-align: center;
}
/* line 173, ../sass/style.sass */
.mini-profile-indicators li {
@@ -2012,7 +2013,6 @@ ul.userMenu-search-profiles button:after, ul.userMenu-search-profiles .mini-prof
-webkit-box-sizing: border-box;
box-sizing: border-box;
display: block;
- width: 100px;
float: left;
font-size: 0.8em;
position: relative;
@@ -2046,6 +2046,21 @@ ul.userMenu-search-profiles button:after, ul.userMenu-search-profiles .mini-prof
padding-top: 0.2em;
}
+.mini-profile-indicators .userMenu-connections, .mini-profile-indicators .userMenu-messages {
+ width: 30%;
+}
+
+.mini-profile-indicators .userMenu-groupmessages {
+ width: 40%;
+}
+
+.mini-profile-indicators .userMenu-groupmessages a:before {
+ content: "";
+ background: transparent url("../img/groupmessages.png") no-repeat scroll center center;
+ background-size: 24px 24px;
+ height: 1em;
+}
+
/* line 208, ../sass/style.sass */
.messages-qtd {
position: absolute;
@@ -2853,17 +2868,19 @@ ol.toptrends-list a:hover {
margin-left: 58px;
font-size: 0.9em;
}
+
/* line 758, ../sass/style.sass */
.directMessages .post-info-name {
float: none;
}
+
/* line 760, ../sass/style.sass */
.directMessages .post-info-tag {
line-height: 1em;
padding: 0;
display: inline;
font-size: 80%;
- margin: 0 0 0 1em;
+ margin-left: 0.1em;
}
/* line 767, ../sass/style.sass */
@@ -2896,6 +2913,13 @@ ol.toptrends-list a:hover {
margin: 0px 10px 20px 10px;
cursor: default;
}
+
+.direct-messages-thread .post .post-info-name {
+ display: block;
+ margin-left: 128px;
+ padding: 0;
+}
+
/* line 793, ../sass/style.sass */
.direct-messages-thread .post .post-info-time {
float: none;
@@ -2947,6 +2971,15 @@ ol.toptrends-list a:hover {
left: 0;
top: 10px;
}
+
+.direct-messages-thread .post.sent .post-info {
+ text-align: right;
+}
+
+.direct-messages-thread .post.sent .post-info-name {
+ margin-right: 128px;
+}
+
/* line 842, ../sass/style.sass */
.direct-messages-thread .post.sent .post-text:after {
border-top: solid 7px transparent;
@@ -2967,6 +3000,144 @@ ol.toptrends-list a:hover {
left: auto;
}
+
+.group-messages-control .invite-form, .group-messages-control .secret-key {
+ display: none;
+ font-size: 12px;
+ text-align: center;
+ padding: 4px 0;
+}
+
+.group-messages-control .invite-form textarea {
+ font-size: 1.1em;
+ border: 1px solid rgba(0, 0, 0, .1);
+ vertical-align: middle;
+ width: 73%;
+ height: 20px;
+ resize: none;
+ margin: 0 4px;
+ padding: 1px 4px;
+}
+
+.group-messages-control .invite-form textarea:focus {
+ border-bottom: solid 1px #B4C669;
+}
+
+.group-messages-control .invite-form button {
+ vertical-align: middle;
+}
+
+.group-messages-control.b-buttons {
+ padding: 4px;
+}
+
+.profile-card-buttons.group-messages-control.b-buttons {
+ text-align: center;
+}
+
+.profile-card-buttons.group-messages-control.b-buttons button {
+ margin: 2px 0;
+}
+
+/*************************************
+****** GM NEW GROUP SETUP MODAL ******
+**************************************/
+
+.group-messages-new-group.modal-wrapper {
+ width: 580px;
+ height: auto; /*about 320px*/
+ margin: -180px 0 0 -290px;
+}
+
+.group-messages-new-group .modal-content {
+ padding: 0;
+}
+
+.group-messages-new-group .modal-content .module {
+ margin: 4px;
+}
+
+.group-messages-new-group .modal-content div div {
+ margin: 4px 0;
+ padding: 4px 12px;
+}
+
+.group-messages-new-group .modal-content div div:last-child {
+ text-align: right;
+}
+
+.group-messages-new-group .modal-content div div:last-child button {
+ margin: 8px 4px;
+}
+
+.group-messages-new-group .modal-content textarea {
+ border: 1px solid rgba(0, 0, 0, .1);
+ width: 500px;
+ height: 56px;
+ resize: none;
+ margin: 12px 16px;
+ padding: 2px 4px;
+}
+
+.group-messages-new-group .modal-content textarea:focus {
+ border-bottom: solid 1px #B4C669;
+}
+
+/*************************************
+****** GM JOIN GROUP SETUP MODAL *****
+**************************************/
+
+.group-messages-join-group.modal-wrapper {
+ width: 580px;
+ height: auto; /*about 360px*/
+ margin: -250px 0 0 -290px;
+}
+
+.group-messages-join-group .modal-content {
+ padding: 0;
+}
+
+.group-messages-join-group .modal-content .module {
+ margin: 4px;
+}
+
+.group-messages-join-group .modal-content div div {
+ margin: 4px 0;
+ padding: 4px 12px;
+}
+
+.group-messages-join-group .modal-content div div:last-child {
+ text-align: right;
+}
+
+.group-messages-join-group .modal-content div div:last-child button {
+ margin: 8px 4px;
+}
+
+.group-messages-join-group .modal-content input {
+ border: 1px solid rgba(0, 0, 0, .1);
+ width: 500px;
+ margin: 12px 16px;
+ padding: 2px 4px;
+}
+
+.group-messages-join-group .modal-content input:focus {
+ border-bottom: solid 1px #B4C669;
+}
+
+.group-messages-join-group .modal-content input[type='checkbox'] {
+ display: inline;
+ width: auto;
+ margin: 2px;
+}
+
+.group-messages-join-group .modal-content .groups-list {
+ background-color: #FFF;
+ height: 120px;
+ overflow-y: auto;
+ margin: 8px 8px 0;
+}
+
/********* NEW USER MODAL************* */
.new-user.modal-wrapper {
@@ -3352,4 +3523,5 @@ ul.dropdown-menu .active, ul.dropdown-menu .active a {
.post-rt-reference .post-info-time {
font-size: 9px;
color: #B3B5B7;
+ margin: 0 2px 0;
}
diff --git a/theme_nin/img/groupmessages.png b/theme_nin/img/groupmessages.png
new file mode 100644
index 0000000..a084c1d
Binary files /dev/null and b/theme_nin/img/groupmessages.png differ
diff --git a/theme_nin/js/theme_option.js b/theme_nin/js/theme_option.js
index b0678ee..b936b26 100644
--- a/theme_nin/js/theme_option.js
+++ b/theme_nin/js/theme_option.js
@@ -5,7 +5,6 @@ $(function(){
$('.twister-user-remove').html('');
$('.profile-card-main').attr('style', '');
$('img[src$="img/tornado_avatar.png"]').attr("src","theme_nin/img/tornado_avatar.png");
- $('.userMenu-search-profiles button').html('').attr('title',polyglot.t('Follow'));
$('.mini-profile-actions span').html('');
$.globalEval(postToElem.toString().replace(/postContext.append\(_templatePostRtBy/,
@@ -37,13 +36,17 @@ $(function(){
this.slideUp(150);
}).bind($('.left .post-area-new')));
- $(".userMenu-search-profiles .follow")
- .on("eventToggleFollow", function() {
+
+ $('#search-profile-template .follow')
+ .html('')
+ .attr('title', polyglot.t('Follow'))
+ .on('eventToggleFollow', function() {
$(this).text('').attr('title', polyglot.t('Follow'));
})
- .on("eventToggleUnfollow", function() {
+ .on('eventToggleUnfollow', function() {
$(this).text('').attr('title', polyglot.t('Unfollow'));
- });
+ })
+ ;
if (/\/options.html$/i.test(document.location))
$(document).ready(localizeLabels);
diff --git a/theme_nin/sass/_postboard.sass b/theme_nin/sass/_postboard.sass
index 761c8d8..adf5a7e 100755
--- a/theme_nin/sass/_postboard.sass
+++ b/theme_nin/sass/_postboard.sass
@@ -78,6 +78,10 @@
.post:hover
cursor: pointer
+.post.new
+ .post-info-time
+ color: $color-green
+
.open
background: none
diff --git a/tmobile.html b/tmobile.html
index 24e3058..8a0acd6 100644
--- a/tmobile.html
+++ b/tmobile.html
@@ -658,16 +658,7 @@