Browse Source

Added proxy change/disable ability.

master
Hedgehog 10 years ago
parent
commit
a8f2209bb2
  1. 10
      js/options.js
  2. 5
      js/twister_formatpost.js
  3. 8
      options.html

10
js/options.js

@ -90,7 +90,7 @@ var TwisterOptions = function() @@ -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() @@ -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();
}
}

5
js/twister_formatpost.js

@ -308,7 +308,8 @@ function escapeHtmlEntities(str) { @@ -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) { @@ -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" />';
}
}

8
options.html

@ -125,6 +125,14 @@ @@ -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>

Loading…
Cancel
Save