Browse Source

Merge branch 'pr/218'

master
Miguel Freitas 10 years ago
parent
commit
32217ae150
  1. 8
      css/profile.css
  2. 234
      css/style.css
  3. 20
      home.html
  4. 206
      js/interface_common.js
  5. 21
      js/twister_actions.js
  6. 43
      js/twister_directmsg.js
  7. 7
      js/twister_following.js
  8. 1
      js/twister_io.js
  9. 20
      theme_calm/css/style.css
  10. 3147
      theme_nin/css/style.css
  11. 4
      theme_nin/js/theme_option.js
  12. 31
      theme_nin/sass/style.sass

8
css/profile.css

@ -177,7 +177,7 @@
} }
/************************************* /*************************************
****************** PROFILE MODAL ****************** PROFILE MODAL
**************************************/ *************************************
.profile-modal .modal-wrapper .profile-modal .modal-wrapper
{ {
width: 580px; width: 580px;
@ -186,13 +186,13 @@
position: absolute; position: absolute;
top:10%; top:10%;
height: 80%; height: 80%;
margin-left: -300px; margin-left: -290px;
} }*/
.profile-modal .modal-content .profile-modal .modal-content
{ {
padding: 3px; padding: 3px;
height: 90%; height: 100%;
} }
#msngrswr { #msngrswr {
display: none; display: none;

234
css/style.css

@ -809,9 +809,9 @@ ol.toptrends-list {
font-variant: small-caps; font-variant: small-caps;
border-bottom: solid 1px rgba( 69, 71, 77, .1 ); border-bottom: solid 1px rgba( 69, 71, 77, .1 );
margin: 0 0 5px 0; margin: 0 0 5px 0;
padding-left: 5px; padding-left: 10px;
background: #e34f42; background: #e34f42;
width: 513px; width: 100%;
} }
.postboard h2.fixed .postboard h2.fixed
{ {
@ -1253,19 +1253,31 @@ ol.toptrends-list {
} }
.modal-wrapper .modal-wrapper
{ {
width: 580px;
border-radius: 5px;
overflow: hidden;
position: absolute; position: absolute;
top: 50%; top:10%;
left: 50%; left: 50%;
background: rgba( 255, 255, 255, 1.0 ); height: 80%;
margin-left: -290px;
box-shadow: 0 0 30px rgba( 0, 0, 0, .6 ); box-shadow: 0 0 30px rgba( 0, 0, 0, .6 );
background: rgba( 255, 255,255, 1.0 );
z-index: 3;
} }
.modal-content{
height: 100%;
overflow-y: auto;
}
.modal-header .modal-header
{ {
position: relative; position: relative;
} }
.modal-header h3 .modal-header h3
{ {
padding: 5px; padding: 5px 10px;
font-weight: bold; font-weight: bold;
background: #e34f42; background: #e34f42;
color: #fff; color: #fff;
@ -1314,73 +1326,10 @@ ol.toptrends-list {
{ {
padding: 5px 20px; padding: 5px 20px;
} }
/*************************************
*************** FOLLOWING-CONFIG MODAL
**************************************/
.following-config-modal .modal-wrapper
{
top: 43%;
left: 25%;
width: 50%;
}
.following-config-modal .modal-content
{
padding: 10px;
text-align: center;
}
.following-config-modal .modal-buttons
{
display: none;
}
.following-config-method-buttons
{
padding: 10px;
}
/*************************************
****************** RETWIST POSTS MODAL
**************************************/
.reTwist .modal-wrapper
{
width: 520px;
margin: -100px 0 0 -260px;
}
.reTwist .post-expand,
.reTwist .post-interactions
{
display: none;
}
/*************************************
****************** REPLY POSTS MODAL
**************************************/
.reply .modal-wrapper
{
width: 520px;
margin: -100px 0 0 -260px;
}
.reply .modal-buttons
{
display: none;
}
.reply .post-expand,
.reply .post-interactions
{
display: none;
}
/************************************* /*************************************
****************** DIRECT MESSAGES MODAL ****************** DIRECT MESSAGES MODAL
**************************************/ **************************************/
.directMessages .modal-wrapper
{
width: 540px;
height: 470px;
margin: -200px 0 0 -280px;
overflow-x: hidden;
}
.directMessages .modal-content
{
overflow-y: auto;
height: 300px;
}
.directMessages .modal-buttons .directMessages .modal-buttons
{ {
display: none; display: none;
@ -1500,19 +1449,8 @@ ol.toptrends-list {
} }
/************************************* /*************************************
****************** HASHTAG MODAL ****************** HASHTAG MODAL
**************************************/ *************************************/
.hashtag-modal .modal-wrapper
{
width: 560px;
height: 470px;
margin: -200px 0 0 -280px;
overflow: hidden;
}
.hashtag-modal .modal-content
{
overflow-y: auto;
height: 440px;
}
.hashtag-modal .modal-buttons .hashtag-modal .modal-buttons
{ {
display: none; display: none;
@ -1523,21 +1461,8 @@ ol.toptrends-list {
} }
/************************************* /*************************************
****************** CONVERSATION MODAL ****************** CONVERSATION MODAL
**************************************/ *************************************/
.conversation-modal .modal-wrapper
{
position: absolute;
width: 560px;
height: 80%;
top: 10%;
margin: 0 0 0 -330px;
overflow: hidden;
}
.conversation-modal .modal-content
{
overflow-y: auto;
height: 90%;
}
.conversation-modal .modal-buttons .conversation-modal .modal-buttons
{ {
display: none; display: none;
@ -1548,20 +1473,8 @@ ol.toptrends-list {
} }
/************************************* /*************************************
****************** FOLLOWING MODAL ****************** FOLLOWING MODAL
**************************************/ ************************************/
.following-modal .modal-wrapper
{
width: 560px;
height: 470px;
margin: -200px 0 0 -280px;
overflow-x: hidden;
}
.following-modal .modal-content
{
padding: 15px;
height: 400px;
overflow-y: auto;
}
.following-modal .modal-buttons .following-modal .modal-buttons
{ {
display: none; display: none;
@ -1588,20 +1501,7 @@ ol.toptrends-list {
} }
/************************************* /*************************************
******************* WHO TO FOLLOW MODAL ******************* WHO TO FOLLOW MODAL
**************************************/ *************************************/
.who-to-follow-modal .modal-wrapper
{
width: 560px;
height: 470px;
margin: -200px 0 0 -280px;
overflow-x: hidden;
}
.who-to-follow-modal .modal-content
{
padding: 15px;
height: 400px;
overflow-y: auto;
}
.who-to-follow-modal .modal-buttons .who-to-follow-modal .modal-buttons
{ {
display: none; display: none;
@ -1636,6 +1536,90 @@ ol.toptrends-list {
font-size: 12px; font-size: 12px;
color: rgba( 0, 0, 0, .6 ); color: rgba( 0, 0, 0, .6 );
} }
/*************************************
****************** POPUP PROMPT ******
**************************************/
.prompt-wrapper
{
position: fixed;
top: 50%;
left: 50%;
background: rgba( 255, 255,255, 1.0 );
box-shadow: 0 0 30px rgba( 0, 0, 0, .6 );
z-index: 5;
width: 600px;
margin-left:-300px;
}
.prompt-wrapper .modal-header h3{
background: #45474D;
}
/*************************************
*************** FOLLOWING-CONFIG PROMPT
**************************************/
.following-config-modal .modal-content
{
padding: 10px;
text-align: center;
}
.following-config-modal .modal-buttons
{
display: none;
}
.following-config-method-buttons
{
padding: 10px;
}
/*************************************
****************** RETWIST POSTS PROMPT
**************************************/
.reTwist .post-expand,
.reTwist .post-interactions
{
display: none;
}
.reTwist .post {
margin: 10px;
padding: 5px;
min-height: 68px;
}
/*************************************
****************** REPLY POSTS PROMPT
**************************************/
.reply .modal-buttons
{
display: none;
}
.reply .post-expand,
.reply .post-interactions
{
display: none;
}
.reply .textcomplete-wrapper{
padding-top: 10px;
}
.reply .textcomplete-wrapper textarea{
margin: 10px;
width: 580px;
}
.reply .post {
margin: 10px;
padding: 5px;
min-height: 68px;
}
/************************************* /*************************************
****************** LOADER ************ ****************** LOADER ************
**************************************/ **************************************/

20
home.html

@ -157,7 +157,7 @@
<small>.</small> <small>.</small>
<a class="refresh-users">Refresh</a> <a class="refresh-users">Refresh</a>
<small>.</small> <small>.</small>
<a class="view-all-users">View All</a> <a class="view-all-users" href="#whotofollow">View All</a>
<ol class="follow-suggestions"> <ol class="follow-suggestions">
<!-- use "follow-suggestion-template" here --> <!-- use "follow-suggestion-template" here -->
</ol> </ol>
@ -330,7 +330,7 @@
<div class="modal-header"> <div class="modal-header">
<h3></h3> <h3></h3>
<span id="closeModal" class="modal-close cancel">&times;</span> <span id="closeModal" class="modal-close cancel">&times;</span>
<span class="modal-back">&lt;</span> <span class="modal-back" onClick="history.back();">&lt;</span>
<span class="mark-all-as-read"></span> <span class="mark-all-as-read"></span>
</div> </div>
<div class="modal-content"></div> <div class="modal-content"></div>
@ -342,6 +342,20 @@
</div> </div>
<!-- TEMPLATE DO MODAL GENÉRICO END --> <!-- TEMPLATE DO MODAL GENÉRICO END -->
<!-- TEMPLATE GENERAL PROMPT -->
<div class="prompt-wrapper">
<div class="modal-header">
<h3></h3>
<span class="modal-close prompt-close">&times;</span>
</div>
<div class="modal-content"></div>
<div class="modal-buttons">
<button class="modal-cancel prompt-close">Cancel</button>
<button class="modal-propagate">Retransmit</button>
</div>
</div>
<!-- TEMPLATE GENERAL PROMPT END-->
<!-- MODAL DE RETWEET INIT --> <!-- MODAL DE RETWEET INIT -->
<!-- MODAL DE RETWEET END --> <!-- MODAL DE RETWEET END -->
@ -477,7 +491,7 @@
<button class="postboard-news" style="display:none;"></button> <button class="postboard-news" style="display:none;"></button>
</h2> </h2>
<span class="no-posts-found-message" style="display:none;">There aren't any posts with this hashtag.</span> <span class="no-posts-found-message" style="display:none;">Couldn't find any posts with this hashtag. Still searching.</span>
<ol id="profile-posts" class="postboard-posts"> <ol id="profile-posts" class="postboard-posts">
</ol> </ol>

206
js/interface_common.js

@ -32,7 +32,7 @@ function openModal( modalClass )
function closeModal($this) function closeModal($this)
{ {
closeModalHandler($this); closeModalHandler($this);
window.location.hash = ''; window.location.hash = '#';
} }
function closeModalHandler($this) function closeModalHandler($this)
@ -50,6 +50,45 @@ function closeModalHandler($this)
}); });
} }
function openPrompt( modalClass )
{
var $oldModal = $("body").children(".prompt-wrapper");
var $template = $( "#templates" );
var $templateModal = $template.find( ".prompt-wrapper" ).clone(true);
$templateModal.addClass( modalClass );
if( $oldModal.length ) {
$templateModal.show();
$oldModal.replaceWith($templateModal);
} else {
$templateModal.prependTo( "body" ).fadeIn( "fast" );
}
//escondo o overflow da tela
var $body = $( "body" );
$body.css({
"overflow": "hidden"
});
}
function closePrompt()
{
var $body = $( "body" );
var $modalWindows = $( "body" ).children( ".prompt-wrapper" );
$modalWindows.fadeOut( "fast", function()
{
$modalWindows.detach();
});
$body.css({
"overflow": "auto",
"margin-right": "0"
});
}
function checkNetworkStatusAndAskRedirect(cbFunc, cbArg) { function checkNetworkStatusAndAskRedirect(cbFunc, cbArg) {
networkUpdate(function(args) { networkUpdate(function(args) {
if( !twisterdConnectedAndUptodate ) { if( !twisterdConnectedAndUptodate ) {
@ -102,26 +141,6 @@ function newProfileModal(username) {
return profileModalContent; return profileModalContent;
} }
function openProfileModal(e)
{
e.stopPropagation();
e.preventDefault();
var $this = $( this );
var username = $.MAL.urlToUser( $this.attr("href") );
openProfileModalWithUsername(username);
}
function openProfileModalWithUsername(username)
{
if(!username)
{
alert(polyglot.t("You don't have any profile because you are not logged in."));
return;
}
window.location.hash = '#profile?user=' + username;
}
function openProfileModalWithUsernameHandler(username) function openProfileModalWithUsernameHandler(username)
{ {
var profileModalClass = "profile-modal"; var profileModalClass = "profile-modal";
@ -137,9 +156,7 @@ function openProfileModalWithUsernameHandler(username)
if(followingUsers.indexOf(username) != -1){ if(followingUsers.indexOf(username) != -1){
$('.profile-card button.dinamicFollowButton').first().addClass('profileUnfollow').text(polyglot.t('Unfollow')).on('click', function(){ $('.profile-card button.dinamicFollowButton').first().addClass('profileUnfollow').text(polyglot.t('Unfollow')).on('click', function(){
unfollow(username); unfollow(username);
closeModal($(this)); window.setTimeout("loadModalFromHash();",500);
// delay reload so dhtput may do it's job
window.setTimeout("location.reload();",500);
}); });
} else { } else {
$('.profile-card button.dinamicFollowButton').first().addClass('follow').text(polyglot.t('Follow')).on('click', userClickFollow ); $('.profile-card button.dinamicFollowButton').first().addClass('follow').text(polyglot.t('Follow')).on('click', userClickFollow );
@ -162,21 +179,6 @@ function newHashtagModal(hashtag) {
return hashtagModalContent; return hashtagModalContent;
} }
function openHashtagModal(e)
{
e.stopPropagation();
e.preventDefault();
var $this = $( this );
var hashtag = $this.text().substring(1).toLowerCase();
openHashtagModalFromSearch(hashtag);
}
function openHashtagModalFromSearch(hashtag)
{
window.location.hash = '#hashtag?hashtag=' + encodeURIComponent(hashtag);
}
function openHashtagModalFromSearchHandler(hashtag) function openHashtagModalFromSearchHandler(hashtag)
{ {
var hashtagModalClass = "hashtag-modal"; var hashtagModalClass = "hashtag-modal";
@ -253,13 +255,8 @@ function newFollowingModal(username) {
return followingModalContent; return followingModalContent;
} }
function openFollowingModal(e) function openFollowingModal(username)
{ {
e.stopPropagation();
e.preventDefault();
var $this = $( this );
var username = $.MAL.followingUrlToUser( $this.attr("href") );
var followingModalClass = "following-modal"; var followingModalClass = "following-modal";
openModal( followingModalClass ); openModal( followingModalClass );
@ -325,9 +322,7 @@ function fillWhoToFollowModal(list, hlist, start) {
return true; return true;
} }
function openWhoToFollowModal(e) { function openWhoToFollowModal() {
e.stopPropagation();
e.preventDefault();
var whoToFollowModalClass = "who-to-follow-modal"; var whoToFollowModalClass = "who-to-follow-modal";
openModal( whoToFollowModalClass ); openModal( whoToFollowModalClass );
@ -349,62 +344,113 @@ function openWhoToFollowModal(e) {
$( "." + whoToFollowModalClass + " h3" ).text( polyglot.t("Who to Follow") ); $( "." + whoToFollowModalClass + " h3" ).text( polyglot.t("Who to Follow") );
} }
function newConversationModal(postLi) { function newConversationModal(username,resource) {
var hashtagModalContent = $( "#hashtag-modal-template" ).children().clone(true); var hashtagModalContent = $( "#hashtag-modal-template" ).children().clone(true);
requestPost(hashtagModalContent.find(".postboard-posts"),username,resource,
function(args){
postLi=args.hashtagModalContent.find(".postboard-posts").children().first();
postLi.css('display','none');
getTopPostOfConversation(postLi,null,args.hashtagModalContent.find(".postboard-posts"));
},{ hashtagModalContent:hashtagModalContent }
);
hashtagModalContent.find( ".postboard-news").click(function (){ hashtagModalContent.find( ".postboard-news").click(function (){
$(this).hide(); $(this).hide();
displayHashtagPending($(".conversation-modal .postboard-posts")); displayHashtagPending($(".conversation-modal .postboard-posts"));
}); });
getTopPostOfConversation(postLi, null, hashtagModalContent.find(".postboard-posts"));
return hashtagModalContent; return hashtagModalContent;
} }
function openConversationModal(e) function openConversationClick(e){
{
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
var $this = $( this ); var $this = $( this );
var postLi = $this.parents(".module.post.original.open").find('.module.post.original'); var postLi = $this.parents(".module.post.original.open").find('.module.post.original');
var username=postLi.find('.post-data').attr('data-screen-name');
var resource='post'+postLi.find('.post-data').attr('data-id');
window.location.hash="#conversation?post="+username+':'+resource;
}
function openConversationModal(username,resource)
{
var conversationModalClass = "conversation-modal"; var conversationModalClass = "conversation-modal";
openModal( conversationModalClass ); openModal( conversationModalClass );
//$( "." + threadingModalClass ).attr("data-resource","hashtag");
var hashtagModalContent = newConversationModal( postLi ); var conversationModalContent = newConversationModal(username,resource);
hashtagModalContent.appendTo("." + conversationModalClass + " .modal-content"); conversationModalContent.appendTo("." + conversationModalClass + " .modal-content");
//título do modal //título do modal
$( "." + conversationModalClass + " h3" ).text( polyglot.t('conversation_title', {'username': postLi.find('.post-data').attr('data-screen-name')}) ); $( "." + conversationModalClass + " h3" ).text( polyglot.t('conversation_title', {'username': username} ) );
} }
function watchHashChange(e) function watchHashChange(e)
{ {
if(e!=null){
var prevurlsplit = e.oldURL.split('#');
var prevhashstring=prevurlsplit[1];
var notFirstModalView=(prevhashstring!=undefined && prevhashstring.length>0 );
var notNavigatedBackToFirstModalView=(window.history.state==null || ( window.history.state!=null && window.history.state.showCloseButton!=false ) )
if(notFirstModalView && notNavigatedBackToFirstModalView ) ){
$('.modal-back').css('display','inline');
} else {
window.history.pushState({showCloseButton:false},null,null);
$('.modal-back').css('display','none');
}
}
loadModalFromHash();
}
function loadModalFromHash(){
var hashstring = window.location.hash var hashstring = window.location.hash
hashstring = decodeURIComponent(hashstring); hashstring = decodeURIComponent(hashstring);
var hashdata = hashstring.split(':'); var hashdata = hashstring.split(':');
if (hashdata[0] != '#web+twister') { if (hashdata[0] != '#web+twister') {
hashdata = hashstring.match(/(hashtag|profile|mentions)\?(?:user|hashtag)=(.+)/); hashdata = hashstring.match(/(hashtag|profile|mentions|directmessages|following|conversation)\?(?:user|hashtag|post)=(.+)/);
} }
if (hashdata && hashdata[1] != undefined && hashdata[2] != undefined) if (hashdata && hashdata[1] != undefined && hashdata[2] != undefined) {
{
if(hashdata[1] == 'profile') { if(hashdata[1] == 'profile') {
openProfileModalWithUsernameHandler(hashdata[2]); openProfileModalWithUsernameHandler(hashdata[2]);
}else if (hashdata[1] == 'hashtag') { }else if (hashdata[1] == 'hashtag') {
openHashtagModalFromSearchHandler(hashdata[2]); openHashtagModalFromSearchHandler(hashdata[2]);
}else if (hashdata[1] == 'mentions') { }else if (hashdata[1] == 'mentions') {
openMentionsModalHandler(hashdata[2]); openMentionsModalHandler(hashdata[2]);
} }else if (hashdata[1] == 'directmessages') {
openDmWithUserModal(hashdata[2]);
}else if (hashdata[1] == 'following') {
openFollowingModal(hashdata[2]);
}else if (hashdata[1] == 'conversation') {
splithashdata2=hashdata[2].split(':')
//console.log('username='+splithashdata2[0]+' resource='+splithashdata2[1]);
openConversationModal(splithashdata2[0],splithashdata2[1]);
}
} else if (hashstring == '#directmessages') {
directMessagesPopup();
} else if (hashstring == '#whotofollow'){
openWhoToFollowModal();
} else{ } else{
closeModalHandler(); closeModalHandler();
} }
}
}
function initHashWatching() function initHashWatching()
{ {
@ -419,7 +465,8 @@ function initHashWatching()
// Register hash spy and launch it once // Register hash spy and launch it once
window.addEventListener('hashchange', watchHashChange, false); window.addEventListener('hashchange', watchHashChange, false);
watchHashChange(null); //watchHashChange(null);
window.location.hash="#";
} }
@ -437,7 +484,7 @@ var reTwistPopup = function( e )
} }
var reTwistClass = "reTwist"; var reTwistClass = "reTwist";
openModal( reTwistClass ); openPrompt( reTwistClass );
//título do modal //título do modal
$( ".reTwist h3" ).text( polyglot.t("retransmit_this") ); $( ".reTwist h3" ).text( polyglot.t("retransmit_this") );
@ -453,7 +500,7 @@ var reTwistPopup = function( e )
var replyInitPopup = function(e, post) var replyInitPopup = function(e, post)
{ {
var replyClass = "reply"; var replyClass = "reply";
openModal( replyClass ); openPrompt( replyClass );
//título do modal //título do modal
var fullname = post.find(".post-info-name").text(); var fullname = post.find(".post-info-name").text();
@ -1253,7 +1300,13 @@ var postSubmit = function(e, oldLastPostId)
var remainingCount = tweetForm.find(".post-area-remaining"); var remainingCount = tweetForm.find(".post-area-remaining");
remainingCount.text(140); remainingCount.text(140);
$replyText.attr("placeholder", "Your message was sent!"); $replyText.attr("placeholder", "Your message was sent!");
if ($this.parents('.modal-wrapper').length) {
closeModal($this); closeModal($this);
} else if ($this.parents('.prompt-wrapper').length) {
closePrompt();
}
if($this.closest('.post-area,.post-reply-content')){ if($this.closest('.post-area,.post-reply-content')){
$('.post-area-new').removeClass('open').find('textarea').blur(); $('.post-area-new').removeClass('open').find('textarea').blur();
}; };
@ -1269,11 +1322,11 @@ var retweetSubmit = function(e)
e.preventDefault(); e.preventDefault();
var $this = $( this ); var $this = $( this );
var $postOrig = $this.closest(".modal-wrapper").find(".post-data"); var $postOrig = $this.closest(".prompt-wrapper").find(".post-data");
newRtMsg($postOrig); newRtMsg($postOrig);
closeModal($this); closePrompt();
} }
function changeStyle() { function changeStyle() {
@ -1349,24 +1402,33 @@ function replaceDashboards() {
} }
$( ".who-to-follow .refresh-users" ).bind( "click", refreshWhoToFollow ); $( ".who-to-follow .refresh-users" ).bind( "click", refreshWhoToFollow );
$( ".who-to-follow .view-all-users" ).bind( "click", openWhoToFollowModal ); //$( ".who-to-follow .view-all-users" ).bind( "click", function(){window.location.hash = "#whotofollow"} );
} }
function initInterfaceCommon() { function initInterfaceCommon() {
$( "body" ).on( "click", function(event) { $( "body" ).on( "click", function(event) {
if($(event.target).hasClass('cancel')) closeModal($(this)); if($(event.target).hasClass('cancel')) closeModal($(this));
}); });
$(".cancel").on('click', function(event){ $(".cancel").on('click', function(event){
if(!$(event.target).hasClass("cancel")) return; if(!$(event.target).hasClass("cancel")) return;
if($(".modal-content").attr("style") != undefined){$(".modal-content").removeAttr("style")}; if($(".modal-content").attr("style") != undefined){$(".modal-content").removeAttr("style")};
$('.modal-back').css('display', 'none'); $('.modal-back').css('display', 'none');
$('.mark-all-as-read').css('display', 'none'); $('.mark-all-as-read').css('display', 'none');
}); });
$(".prompt-close").on('click', function(event){
closePrompt();
});
/*
$('.modal-back').on('click', function(){ $('.modal-back').on('click', function(){
if($('.modal-content .direct-messages-list')[0]) return; if($('.modal-content .direct-messages-list')[0]) return;
directMessagesPopup(); directMessagesPopup();
$(".modal-content").removeAttr("style"); $(".modal-content").removeAttr("style");
}); });
*/
$('.dropdown-menu').on('keydown', function(e){ $('.dropdown-menu').on('keydown', function(e){
e = event || window.event; e = event || window.event;
e.stopPropagation(); e.stopPropagation();
@ -1385,7 +1447,7 @@ function initInterfaceCommon() {
$( ".post-area-new" ).clickoutside( unfocusThis ); $( ".post-area-new" ).clickoutside( unfocusThis );
$( ".post-submit").click( postSubmit ); $( ".post-submit").click( postSubmit );
$( ".modal-propagate").click( retweetSubmit ); $( ".modal-propagate").click( retweetSubmit );
$( ".expanded-content .show-more").bind('click', openConversationModal); $( ".expanded-content .show-more").bind('click', openConversationClick);
if ($.Options.getUnicodeConversionOpt() === "disable") if ($.Options.getUnicodeConversionOpt() === "disable")
$( ".undo-unicode" ).click( undoLastUnicode ).css("display", "none"); $( ".undo-unicode" ).click( undoLastUnicode ).css("display", "none");
@ -1395,9 +1457,9 @@ function initInterfaceCommon() {
var $replyText = $( ".post-area-new textarea" ); var $replyText = $( ".post-area-new textarea" );
$replyText.on("keyup", replyTextKeypress ); $replyText.on("keyup", replyTextKeypress );
$( ".open-profile-modal").bind( "click", openProfileModal ); $( ".open-profile-modal").bind( "click", function(e){ e.stopPropagation(); } );
$( ".open-hashtag-modal").bind( "click", openHashtagModal ); //$( ".open-hashtag-modal").bind( "click", openHashtagModal );
$( ".open-following-modal").bind( "click", openFollowingModal ); //$( ".open-following-modal").bind( "click", openFollowingModal );
$( ".userMenu-connections a").bind( "click", openMentionsModal ); $( ".userMenu-connections a").bind( "click", openMentionsModal );
$( ".mentions-from-user").bind( "click", openMentionsModal ); $( ".mentions-from-user").bind( "click", openMentionsModal );

21
js/twister_actions.js

@ -147,6 +147,27 @@ function appendPostToContainer(postFromJson, containerToAppend)
var profilePostsLoading = false; var profilePostsLoading = false;
function requestPost(containerToAppend,username,resource,cbFunc,cbArgs){
console.log('dhtget '+username+' '+resource);
dhtget( username, resource, "s",
function(args, postFromJson) {
if( postFromJson ) {
console.log(postFromJson);
appendPostToContainer(postFromJson,args.containerToAppend);
if(args.cbFunc!=undefined) args.cbFunc(args.cbArgs);
}
},
{containerToAppend:containerToAppend,cbFunc:cbFunc,cbArgs:cbArgs}
);
}
function requestPostRecursively(containerToAppend,username,resource,count,useGetposts) function requestPostRecursively(containerToAppend,username,resource,count,useGetposts)
{ {
var max_id = -1; var max_id = -1;

43
js/twister_directmsg.js

@ -158,7 +158,6 @@ function directMessagesPopup()
$( ".directMessages h3" ).text( polyglot.t("Direct Messages") ); $( ".directMessages h3" ).text( polyglot.t("Direct Messages") );
requestDMsnippetList($(".directMessages").find(".direct-messages-list")); requestDMsnippetList($(".directMessages").find(".direct-messages-list"));
$('.modal-back').css('display','inline');
$('.mark-all-as-read').css('display', 'inline'); $('.mark-all-as-read').css('display', 'inline');
$('.mark-all-as-read').attr('title', polyglot.t("Mark all as read")); $('.mark-all-as-read').attr('title', polyglot.t("Mark all as read"));
@ -171,35 +170,13 @@ function directMessagesPopup()
}); });
} }
function openDmWithUserModal(dm_screenname)
//exibe a thread de mensagens individual
function hideDmSnippetShowDmThread()
{
var $this = $( this );
//escondo a listagem de mensagens diretas...
var containerToAnimate = $this.parents( ".direct-messages-list" );
containerToAnimate.hide();
var dm_screenname = $this.attr("data-dm-screen-name");
openDmWithUserModal(dm_screenname);
}
function directMessagesWithUserPopup()
{
if(!defaultScreenName)
{ {
if(!defaultScreenName){
alert(polyglot.t("You have to log in to use direct messages.")); alert(polyglot.t("You have to log in to use direct messages."));
return; return;
} }
var $userInfo = $(this).closest("[data-screen-name]");
var dm_screenname = $userInfo.attr("data-screen-name");
openDmWithUserModal( dm_screenname );
}
function openDmWithUserModal(dm_screenname)
{
var directMessagesClass = "directMessages"; var directMessagesClass = "directMessages";
openModal( directMessagesClass ); openModal( directMessagesClass );
@ -220,10 +197,18 @@ function openDmWithUserModal(dm_screenname)
function initInterfaceDirectMsg() { function initInterfaceDirectMsg() {
$( ".direct-messages" ).bind( "click", directMessagesPopup );
$( "#dm-snippet-template" ).bind( "click", hideDmSnippetShowDmThread ); $( ".direct-messages" ).attr("href","#directmessages");
$( ".userMenu-messages a" ).attr("href","#directmessages");
$( "#dm-snippet-template" ).bind( "click", function(){
window.location.hash='#directmessages?user='+$(this).attr("data-dm-screen-name");
} );
$( ".dm-submit").click( directMsgSubmit ); $( ".dm-submit").click( directMsgSubmit );
$( ".userMenu-messages a" ).bind( "click", directMessagesPopup ); $( ".direct-messages-with-user" ).bind( "click", function() {
$( ".direct-messages-with-user" ).bind( "click", directMessagesWithUserPopup ); window.location.hash='#directmessages?user='+$(this).closest("[data-screen-name]").attr("data-screen-name");
} );
} }

7
js/twister_following.js

@ -464,7 +464,6 @@ function fillWhoFollows(list, item, offset, size) {
follower_link.attr("data-screen-name", list[i]); follower_link.attr("data-screen-name", list[i]);
follower_link.attr("href", $.MAL.userUrl(list[i])); follower_link.attr("href", $.MAL.userUrl(list[i]));
follower_link.text(list[i]); follower_link.text(list[i]);
follower_link.on("click", openProfileModal);
getFullname( list[i], follower_link ); getFullname( list[i], follower_link );
item.append( follower_link ); item.append( follower_link );
@ -690,7 +689,7 @@ function userClickFollow(e) {
} }
var FollowingConfigClass = "following-config-modal"; var FollowingConfigClass = "following-config-modal";
openModal( FollowingConfigClass ); openPrompt( FollowingConfigClass );
var FollowingConfigContent = newFollowingConfigModal(username); var FollowingConfigContent = newFollowingConfigModal(username);
FollowingConfigContent.appendTo("." +FollowingConfigClass +" .modal-content"); FollowingConfigContent.appendTo("." +FollowingConfigClass +" .modal-content");
@ -709,9 +708,9 @@ function initUserSearch() {
$(".following-config-method-buttons .public-following").bind( "click", setFollowingMethod ); $(".following-config-method-buttons .public-following").bind( "click", setFollowingMethod );
$(".following-config-method-buttons .public-following").click( function() { $(".following-config-method-buttons .public-following").click( function() {
closeModal($(this)); closePrompt();
// delay reload so dhtput may do it's job // delay reload so dhtput may do it's job
window.setTimeout("location.reload();",500); window.setTimeout("loadModalFromHash();",500);
}); });
} }

1
js/twister_io.js

@ -93,6 +93,7 @@ function _dhtgetAbortPending(locator)
// the value ["v"] is extracted from response and returned to callback // the value ["v"] is extracted from response and returned to callback
// null is passed to callback in case of an error // null is passed to callback in case of an error
function dhtget( username, resource, multi, cbFunc, cbArg, timeoutArgs ) { function dhtget( username, resource, multi, cbFunc, cbArg, timeoutArgs ) {
//console.log('dhtget '+username+' '+resource+' '+multi);
var locator = _dhtgetLocator(username, resource, multi); var locator = _dhtgetLocator(username, resource, multi);
if( locator in _dhtgetPendingMap) { if( locator in _dhtgetPendingMap) {
_dhtgetAddPending(locator, cbFunc, cbArg); _dhtgetAddPending(locator, cbFunc, cbArg);

20
theme_calm/css/style.css

@ -1645,6 +1645,26 @@ textarea.splited-post {
.login .module input::-ms-input-placeholder { .login .module input::-ms-input-placeholder {
color: #fff; color: #fff;
} }
/*************************************
****************** POPUP PROMPT ******
**************************************/
.prompt-wrapper
{
position: absolute;
top: 50%;
left: 50%;
background: rgba( 255, 255,255, 1.0 );
box-shadow: 0 0 30px rgba( 0, 0, 0, .6 );
z-index: 5;
width: 600px;
margin-left:-300px;
}
/************************************* /*************************************
**************************** POPUP MODAL **************************** POPUP MODAL
**************************************/ **************************************/

3147
theme_nin/css/style.css

File diff suppressed because one or more lines are too long

4
theme_nin/js/theme_option.js

@ -1,6 +1,8 @@
$(function(){ $(function(){
$('#closeModal').html(''); $('.modal-close').html('');
$('.modal-back').html('');
$('.twister-user-remove').html('');
$('.profile-card-main').attr('style', ''); $('.profile-card-main').attr('style', '');
$('img[src$="img/tornado_avatar.png"]').attr("src","theme_nin/img/tornado_avatar.png"); $('img[src$="img/tornado_avatar.png"]').attr("src","theme_nin/img/tornado_avatar.png");
$('.userMenu-search-profiles button').html('').attr('title',polyglot.t('Follow')); $('.userMenu-search-profiles button').html('').attr('title',polyglot.t('Follow'));

31
theme_nin/sass/style.sass

@ -554,9 +554,18 @@ ol.toptrends-list
/*********** POPUP PROMPT *************/
.prompt-wrapper
position: fixed
top: 50%
left: 50%
background: rgba( 255, 255,255, 1.0 )
box-shadow: 0 0 30px rgba( 0, 0, 0, .6 )
z-index: 5
width: 600px
margin-left: -300px
/*********** POPUP MODAL **************/
/*********** POPUP MODAL*************/
.modal-blackout .modal-blackout
position: fixed position: fixed
@ -653,11 +662,17 @@ ol.toptrends-list
.modal-back .modal-back
@extend .extend-icon @extend .extend-icon
@extend .icon-left @extend .icon-left
@extend button position: absolute
margin: 0 right: 35px
background: $main-color-color top: 0
display: none!important font-size: 14px
float: left line-height: 40px
cursor: pointer
color: rgba(white, 0.7)
&:hover
color: white
b
display: none
.modal-buttons .modal-buttons
padding: 10px padding: 10px
@ -703,6 +718,8 @@ ol.toptrends-list
margin: 0 0 0 0-($postboard-modal-width/2) margin: 0 0 0 0-($postboard-modal-width/2)
.modal-buttons, .post-expand, .post-interactions .modal-buttons, .post-expand, .post-interactions
display: none display: none
.post-area
padding-bottom: 6px
/****** DIRECT MESSAGES MODAL**********/ /****** DIRECT MESSAGES MODAL**********/

Loading…
Cancel
Save