mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-09-03 01:32:03 +00:00
hiding options for RTs those are sent originally by following users
This commit is contained in:
parent
3c6b307ede
commit
4024c5fce4
@ -216,7 +216,11 @@ if(preferredLanguage == "en"){
|
|||||||
"Show all": "Show all",
|
"Show all": "Show all",
|
||||||
"Show only if I am in": "Show only if I am in",
|
"Show only if I am in": "Show only if I am in",
|
||||||
"Show if it's between users I follow": "Show if it's between users I follow",
|
"Show if it's between users I follow": "Show if it's between users I follow",
|
||||||
"Postboard displays": "Postboard displays"
|
"Postboard displays": "Postboard displays",
|
||||||
|
"RTs those are close to original twist": "RTs those are close to original twist",
|
||||||
|
"Show if the original is older than": "Show if the original is older than",
|
||||||
|
"hour(s)": "hour(s)",
|
||||||
|
"only numbers are allowed!": "only numbers are allowed!"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if(preferredLanguage == "es"){
|
if(preferredLanguage == "es"){
|
||||||
@ -1832,7 +1836,11 @@ if(preferredLanguage == "tr"){
|
|||||||
"Show all": "Hepsini göster",
|
"Show all": "Hepsini göster",
|
||||||
"Show only if I am in": "Sadece ben içindeysem göster",
|
"Show only if I am in": "Sadece ben içindeysem göster",
|
||||||
"Show if it's between users I follow": "Takip ettiğim kullanıcılar arasında ise göster",
|
"Show if it's between users I follow": "Takip ettiğim kullanıcılar arasında ise göster",
|
||||||
"Postboard displays": "Zaman çizelgesinde"
|
"Postboard displays": "Zaman çizelgesinde",
|
||||||
|
"RTs those are close to original twist": "Orjinal twist'e yakın olan RTler",
|
||||||
|
"Show if the original is older than": "Orjinali yandaki süreden daha eskiyse göster",
|
||||||
|
"hour(s)": "saat",
|
||||||
|
"only numbers are allowed!": "sadece rakam girilebilir!"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,6 +277,49 @@ var TwisterOptions = function()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.getHideCloseRTsOpt = function () {
|
||||||
|
return $.Options.getOption('hideCloseRTs', 'disable');
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setHideCloseRTsOpt = function () {
|
||||||
|
$('#hideCloseRTs')[0].value = this.getHideCloseRTsOpt();
|
||||||
|
|
||||||
|
if (this.getHideCloseRTsOpt() === 'disable') {
|
||||||
|
$('#hideCloseRTsDesc')[0].style.display = 'none';
|
||||||
|
} else {
|
||||||
|
$('#hideCloseRTsDesc')[0].style.display = 'inline';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#hideCloseRTs').on('change', function () {
|
||||||
|
$.Options.setOption(this.id, this.value);
|
||||||
|
|
||||||
|
if (this.value === 'disable') {
|
||||||
|
$('#hideCloseRTsDesc')[0].style.display = 'none';
|
||||||
|
} else {
|
||||||
|
$('#hideCloseRTsDesc')[0].style.display = 'inline';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getHideCloseRTsHourOpt = function () {
|
||||||
|
return parseInt($.Options.getOption('hideCloseRtsHour', '1'));
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setHideCloseRTsHourOpt = function () {
|
||||||
|
$('#hideCloseRtsHour')[0].value = this.getHideCloseRTsHourOpt().toString();
|
||||||
|
|
||||||
|
$('#hideCloseRtsHour').on('keyup', function () {
|
||||||
|
if (/^\d+$/.test(this.value)) {
|
||||||
|
this.style.backgroundColor = '';
|
||||||
|
$.Options.setOption(this.id, this.value);
|
||||||
|
$(this).next('span').text(polyglot.t('hour(s)'));
|
||||||
|
} else {
|
||||||
|
this.style.backgroundColor = '#f00';
|
||||||
|
$(this).next('span').text(polyglot.t('only numbers are allowed!'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
this.InitOptions = function() {
|
this.InitOptions = function() {
|
||||||
this.soundNotifOptions();
|
this.soundNotifOptions();
|
||||||
this.volumeControl();
|
this.volumeControl();
|
||||||
@ -294,6 +337,8 @@ var TwisterOptions = function()
|
|||||||
this.setUseProxyForImgOnlyOpt();
|
this.setUseProxyForImgOnlyOpt();
|
||||||
this.setSplitPostsOpt();
|
this.setSplitPostsOpt();
|
||||||
this.setHideRepliesOpt();
|
this.setHideRepliesOpt();
|
||||||
|
this.setHideCloseRTsHourOpt();
|
||||||
|
this.setHideCloseRTsOpt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,8 +319,17 @@ function willBeHiden(post){
|
|||||||
($.Options.getHideRepliesOpt() === 'following' &&
|
($.Options.getHideRepliesOpt() === 'following' &&
|
||||||
followingUsers.indexOf(msg.substring(1, msg.search(/ |,|;|\.|:|\/|\?|\!|\\|'|"|\n/))) === -1 ))
|
followingUsers.indexOf(msg.substring(1, msg.search(/ |,|;|\.|:|\/|\?|\!|\\|'|"|\n/))) === -1 ))
|
||||||
{
|
{
|
||||||
return true
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof(post['userpost']['rt']) !== 'undefined' &&
|
||||||
|
$.Options.getHideCloseRTsOpt() != 'disable' &&
|
||||||
|
followingUsers.indexOf(post['userpost']['rt']['n']) > -1 &&
|
||||||
|
parseInt(post['userpost']['time']) - parseInt(post['userpost']['rt']['time']) < $.Options.getHideCloseRTsHourOpt() * 3600)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
13
options.html
13
options.html
@ -150,6 +150,19 @@
|
|||||||
</select>
|
</select>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<br/>
|
||||||
|
<div>
|
||||||
|
<form action="" id="hideCloseRTsOpt">
|
||||||
|
<p class="label">RTs those are close to original twist</p>
|
||||||
|
<select name="" id="hideCloseRTs">
|
||||||
|
<option value="disable">Show all</option>
|
||||||
|
<option value="show-if">Show if the original is older than</option>
|
||||||
|
</select>
|
||||||
|
<div id="hideCloseRTsDesc">
|
||||||
|
<input name="" id="hideCloseRtsHour" maxlength="2" size="3"/> <span class="label">hour(s)</span>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user