Browse Source

hiding options for RTs those are sent originally by following users

master
erqan 11 years ago
parent
commit
4024c5fce4
  1. 12
      js/interface_localization.js
  2. 45
      js/options.js
  3. 11
      js/twister_timeline.js
  4. 13
      options.html

12
js/interface_localization.js

@ -216,7 +216,11 @@ if(preferredLanguage == "en"){ @@ -216,7 +216,11 @@ if(preferredLanguage == "en"){
"Show all": "Show all",
"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",
"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"){
@ -1832,7 +1836,11 @@ if(preferredLanguage == "tr"){ @@ -1832,7 +1836,11 @@ if(preferredLanguage == "tr"){
"Show all": "Hepsini 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",
"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!"
};
}

45
js/options.js

@ -277,6 +277,49 @@ var TwisterOptions = function() @@ -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.soundNotifOptions();
this.volumeControl();
@ -294,6 +337,8 @@ var TwisterOptions = function() @@ -294,6 +337,8 @@ var TwisterOptions = function()
this.setUseProxyForImgOnlyOpt();
this.setSplitPostsOpt();
this.setHideRepliesOpt();
this.setHideCloseRTsHourOpt();
this.setHideCloseRTsOpt();
}
}

11
js/twister_timeline.js

@ -319,8 +319,17 @@ function willBeHiden(post){ @@ -319,8 +319,17 @@ function willBeHiden(post){
($.Options.getHideRepliesOpt() === 'following' &&
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;
}

13
options.html

@ -150,6 +150,19 @@ @@ -150,6 +150,19 @@
</select>
</form>
</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>

Loading…
Cancel
Save