Browse Source

update hashtag search

master
Hedgehog 11 years ago
parent
commit
be8bfd6d42
  1. 19
      css/style.css
  2. 2
      home.html
  3. 13
      js/interface_common.js
  4. 2
      js/interface_localization.js
  5. 4
      js/twister_actions.js
  6. 15
      js/twister_following.js

19
css/style.css

@ -1836,6 +1836,25 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
width: 100%; width: 100%;
padding-left: 10px; padding-left: 10px;
} }
.no-posts-found-message {
display: block;
position: absolute;
top: 30%;
left: 30%;
font-size: 12px;
}
.no-posts-found-message:after {
content: ' : (';
display: block;
width: 42px;
margin-top: 20px;
height: 40px;
font-size: 30px;
line-height: 40px;
position: relative;
left: 40%;
-webkit-transform: rotate(90deg);
}
/************************************* /*************************************
****************** FOLLOWING MODAL ****************** FOLLOWING MODAL
**************************************/ **************************************/

2
home.html

@ -480,7 +480,6 @@
<!--o botão de novas postagens deve ser ocultado quando o usuário clicá-lo via javascript--> <!--o botão de novas postagens deve ser ocultado quando o usuário clicá-lo via javascript-->
<button class="postboard-news" style="display:none;"></button> <button class="postboard-news" style="display:none;"></button>
</h2> </h2>
<div id="separator"></div>
<div class="postboard-posts-wrapper"> <div class="postboard-posts-wrapper">
<ol id="profile-posts" class="postboard-posts"> <ol id="profile-posts" class="postboard-posts">
@ -504,6 +503,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>
<ol id="profile-posts" class="postboard-posts"> <ol id="profile-posts" class="postboard-posts">
</ol> </ol>

13
js/interface_common.js

@ -163,6 +163,19 @@ function openHashtagModal(e)
$( "."+hashtagModalClass + " h3" ).text( "#" + hashtag ); $( "."+hashtagModalClass + " h3" ).text( "#" + hashtag );
} }
function openHashtagModalFromSearch(hashtag)
{
var hashtagModalClass = "hashtag-modal";
openModal( hashtagModalClass );
$( "."+hashtagModalClass ).attr("data-resource","hashtag");
var hashtagModalContent = newHashtagModal( hashtag );
hashtagModalContent.appendTo("." +hashtagModalClass + " .modal-content");
//título do modal
$( "."+hashtagModalClass + " h3" ).text( "#" + hashtag );
}
function updateHashtagModal(postboard,hashtag) { function updateHashtagModal(postboard,hashtag) {
var $hashtagModalClass = $(".hashtag-modal"); var $hashtagModalClass = $(".hashtag-modal");
if( !$hashtagModalClass.length || $hashtagModalClass.css("display") == 'none' ) if( !$hashtagModalClass.length || $hashtagModalClass.css("display") == 'none' )

2
js/interface_localization.js

@ -133,6 +133,7 @@ if(preferredLanguage == "en"){
"Do you want to check Network Status page instead?", "Do you want to check Network Status page instead?",
"The File APIs are not fully supported in this browser.": "The File APIs are not fully supported in this browser.", "The File APIs are not fully supported in this browser.": "The File APIs are not fully supported in this browser.",
"Theme": "Theme", "Theme": "Theme",
"There aren't any posts with this hashtag.": "There aren't any posts with this hashtag.",
"time_ago": "%{time} ago", // 5 minutes ago "time_ago": "%{time} ago", // 5 minutes ago
"Time of the last block:": "Time of the last block: ", "Time of the last block:": "Time of the last block: ",
"twisted again by": "twisted again by ", "twisted again by": "twisted again by ",
@ -1144,6 +1145,7 @@ if(preferredLanguage == "ru"){
"Не хотите перейти на страницу настройки сети?", "Не хотите перейти на страницу настройки сети?",
"The File APIs are not fully supported in this browser.": "File APIs не полностью поддерживается этим браузером.", "The File APIs are not fully supported in this browser.": "File APIs не полностью поддерживается этим браузером.",
"Theme": "Тема оформления", "Theme": "Тема оформления",
"There aren't any posts with this hashtag.": "Посты по данному тегу отсутствуют.",
"time_ago": "%{time} назад", // 5 minutes ago "time_ago": "%{time} назад", // 5 minutes ago
"Time of the last block:": "Время последнего блока: ", "Time of the last block:": "Время последнего блока: ",
"Top Trends": "Тенденции", "Top Trends": "Тенденции",

4
js/twister_actions.js

@ -228,6 +228,9 @@ function processHashtag(postboard, hashtag, data) {
} }
} }
if(!postboard.children().length&&!_hashtagPendingPosts.length)
postboard.closest("div").find(".no-posts-found-message").show();
if( _hashtagPendingPosts.length ) { if( _hashtagPendingPosts.length ) {
if( !postboard.children().length || autoUpdateHashtag ) { if( !postboard.children().length || autoUpdateHashtag ) {
displayHashtagPending(postboard); displayHashtagPending(postboard);
@ -236,6 +239,7 @@ function processHashtag(postboard, hashtag, data) {
newTweetsBar.text(polyglot.t("new_posts", _hashtagPendingPosts.length)); newTweetsBar.text(polyglot.t("new_posts", _hashtagPendingPosts.length));
newTweetsBar.fadeIn("slow"); newTweetsBar.fadeIn("slow");
} }
postboard.closest("div").find(".no-posts-found-message").hide();
} }
} }
} }

15
js/twister_following.js

@ -354,9 +354,22 @@ function closeSearchDialog()
_lastSearchUsersResults = []; _lastSearchUsersResults = [];
} }
function userSearchKeypress(item) { function userSearchKeypress(event) {
var partialName = $(".userMenu-search-field").val().toLowerCase(); var partialName = $(".userMenu-search-field").val().toLowerCase();
var searchResults = $(".search-results");
if ( partialName.substr( 0, 1 ) == '#' ) {
if(searchResults.is(":visible"))
searchResults.slideUp( "fast" );
if ( event.which == 13 )
openHashtagModalFromSearch(partialName.substr(1));
return;
}
if ( partialName.substr( 0, 1 ) == '@' ) { if ( partialName.substr( 0, 1 ) == '@' ) {
partialName = partialName.substr( 1 ); partialName = partialName.substr( 1 );
} }

Loading…
Cancel
Save