Added proxy change/disable ability.

This commit is contained in:
Hedgehog 2014-06-11 14:11:07 +04:00
parent 08aae0a4db
commit a8f2209bb2
3 changed files with 19 additions and 4 deletions

View File

@ -90,7 +90,7 @@ var TwisterOptions = function()
this.keysSend = function() {
$('#keysSend')[0].value = $.Options.getOption('keysSend', 2)
$('#keysSend').val($.Options.getOption('keysSend', 2));
$('#keysSend').on('change', function(){
$.Options.setOption(this.id, this.value);
@ -132,13 +132,19 @@ var TwisterOptions = function()
$.Options.setOption(this.name, this.checked)
})
}
this.imgPreviwProxy = function () {
$('#imgPreviewProxy').val($.Options.getOption('imgPreviewProxy', 'disable'));
$('#imgPreviewProxy').on('change', function () {
$.Options.setOption(this.id, this.value);
})
}
this.initOptions = function() {
this.soundNotifOptions();
this.volumeControl();
this.keysSend();
this.locLang();
this.showPreviewOpt();
this.imgPreviwProxy();
}
}

View File

@ -308,7 +308,8 @@ function escapeHtmlEntities(str) {
}
function imagePreview(link) {
var linkAnon = 'https://ssl-proxy.my-addr.org/myaddrproxy.php/http/';
var proxyOpt = $.Options.getOption('imgPreviewProxy', 'disable');
var linkAnon = proxyOpt !== 'disable' ? proxyOpt : '';
if (link && /https:\/\/img.bi/i.test(link)){
return '<img data-imgbi="'+link+'" class="image-preview" />';
@ -316,7 +317,7 @@ function imagePreview(link) {
}else{
var cleanLink;
if(/\.gif\b/i.test(cleanLink) && $.Options.getOption('imagesPreviewGif', 'true') === 'false') return;
cleanLink = link.replace(/^http[s]?:\/\//i, '');
cleanLink = link.replace(/^http[s]?:\/\//i, 'http://');
return '<img src="'+linkAnon+cleanLink+'" class="image-preview" />';
}
}

View File

@ -125,6 +125,14 @@
<option value="disable">Disable</option>
</select>
</div>
<div class="module">
<h1>Output proxy</h1>
<h2>Images preview</h2>
<select name="" id="imgPreviewProxy" class="previewOpt">
<option value="disable">Disable</option>
<option value="http://www.headproxy.com/browse.php?u=">headproxy.com</option>
<option value="http://www.proxypronto.com/browse.php?u=">proxypronto.com</option>
</select>
</div>
</body>