Skip to content

Commit

Permalink
fix for showing of promoted posts, zh localizaion of notifications, r…
Browse files Browse the repository at this point in the history
…eplacement of couldnt_find_any_posts string by common slider
  • Loading branch information
Simon Grim committed Mar 28, 2015
1 parent 0ca69db commit 91a2fde
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ ol.toptrends-list {

.postboard-loading
{
text-align: right;
text-align: center;
}
.postboard-loading div
{
Expand Down
4 changes: 3 additions & 1 deletion home.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,12 @@ <h2>
<button class="postboard-news" style="display:none;"></button>
</h2>

<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>

<div class="postboard-loading" style="display: none;">
<div></div>
</div>
</div>
<!-- ÁREA DE POSTS END -->
</div>
Expand Down
14 changes: 7 additions & 7 deletions js/interface_localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -896,19 +896,19 @@ if(preferredLanguage == "zh"){
"Network status": "网络状态",
"New direct message...": "新的即时信息...",
"New Post...": "新推文...",
"You got": "You got",
"You got": "你收到",
"in postboard": "在时间线里",
"in search result": "在搜索结果里",
"in top trends": "在热词趋势里",
"new_posts": "%{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_mentions": "%{smart_count} 新的提及 |||| %{smart_count} 新的提及",
"new_direct_messages": "%{smart_count} 新私信 |||| %{smart_count} 新私信",
"nobody": "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.",
"notify_desktop_perm_denied": "Twister cannot perform desktop notification: permission denied.\n\nIf you want to get notifications, allow them for %{this_domain} in settings of your browser.",
"notify_desktop_test": "All the twisters gonna twist.\nNow you are welcome too.",
"notify_desktop_title": "Watch out, it's twister over here!",
"notify_desktop_error": "Twister 无法发出桌面提醒: 发生未知错误.",
"notify_desktop_perm_denied": "Twister 无法发出桌面提醒: 权限被拒绝.\n\n如果你想收到提醒, 在你的浏览器设置中允许 %{this_domain} 发出提醒.",
"notify_desktop_test": "我们都用 Twister.\n欢迎你加入.",
"notify_desktop_title": "注意, twister 在这!",
"Number of blocks in block chain:": "块链中的块数:",
"Number of CPUs to use": "使用CPU数目 ",
"Only alphanumeric and underscore allowed.": "只允许字母和下划线",
Expand Down
8 changes: 3 additions & 5 deletions js/twister_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function updateProfileData(profileModalContent, username) {
profileModalContent.find(".following-count").parent().attr("href", $.MAL.followingUrl(username));

var postsView = profileModalContent.find(".postboard-posts");

// try using getposts first. fallback to dht.
twisterRpc("getposts", [1,[{username: username}]],
function(args, posts) {
Expand Down Expand Up @@ -326,6 +326,7 @@ function clearHashtagProcessed() {
}

function requestHashtag(postboard,hashtag,resource, timeoutArgs) {
postboard.closest("div").find(".postboard-loading").show();
dhtget( hashtag, resource, "m",
function(args, data) {
processHashtag(args.postboard, args.hashtag, data);
Expand Down Expand Up @@ -360,9 +361,6 @@ function processHashtag(postboard, hashtag, data) {
_hashtagPendingPostsUpdated++;
}
}

if(!postboard.children().length && !_hashtagPendingPosts.length && hashtag != defaultScreenName)
postboard.closest("div").find(".no-posts-found-message").show();

if( _hashtagPendingPosts.length ) {
if( !postboard.children().length || autoUpdateHashtag ) {
Expand All @@ -371,8 +369,8 @@ function processHashtag(postboard, hashtag, data) {
var newTweetsBar = postboard.closest("div").find(".postboard-news");
newTweetsBar.text(polyglot.t("new_posts", _hashtagPendingPosts.length));
newTweetsBar.fadeIn("slow");
postboard.closest("div").find(".postboard-loading").hide();
}
postboard.closest("div").find(".no-posts-found-message").hide();
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion js/twister_timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function showPosts(req, posts)
var streamItemsParent = $.MAL.getStreamPostsParent();

for( var i = 0; i < posts.length; i++ ) {
if ( req.users.indexOf(posts[i]['userpost']['n']) > -1 ) {
if (req.users.indexOf(posts[i]['userpost']['n']) > -1 || req.getspam) { // FIXME maybe it's unecessary check but currently we got unwanted adverting posts which are coming with requested ones from 'getposts' sometimes
var post = posts[i];
//console.log(post);
var streamPost = postToElem(post, "original", req.getspam);
Expand Down Expand Up @@ -349,6 +349,10 @@ function willBeHidden(post){
if (post['userpost']['n'] === defaultScreenName)
return false;

// currently we don't need to filter promoted posts anyhow
if (typeof(post['userpost']['lastk']) === 'undefined' )
return false;

if (typeof(post['userpost']['rt']) !== 'undefined') {
// hope it is not too egocentric to overcome HideCloseRTsOpt this way
if (post['userpost']['rt']['n'] === defaultScreenName)
Expand Down
2 changes: 1 addition & 1 deletion theme_calm/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,7 @@ textarea.splited-post {

.postboard-loading
{
text-align: right;
text-align: center;
}
.postboard-loading div
{
Expand Down

0 comments on commit 91a2fde

Please sign in to comment.