Browse Source

added ability to enable/disable GIF image preview and jpe image format

added ability to enable/disable GIF image preview and jpe image format
master
Hedgehog 11 years ago
parent
commit
8d0001a29c
  1. 14
      css/profile.css
  2. 11
      css/style.css
  3. BIN
      img/bm.png
  4. BIN
      img/tox.png
  5. 1
      js/calm.js
  6. 4
      js/interface_common.js
  7. 15
      js/options.js
  8. 5
      js/twister_formatpost.js
  9. 5
      options.html

14
css/profile.css

@ -254,19 +254,18 @@
} }
#msngrswr { #msngrswr {
display: none; display: none;
margin-left: 10px; margin-top: 20px;
margin-top: 10px; height: 30px;
height: 40px;
} }
#toxbtnwr, #bmbtnwr { #toxbtnwr, #bmbtnwr {
float: left; float: left;
display: none; display: none;
} }
.bitmessage-ctc, .tox-ctc { .bitmessage-ctc, .tox-ctc {
height: 35px; height: 30px;
width: 30px; width: 30px;
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 5px;
border: 1px solid #d6d8dc; border: 1px solid #d6d8dc;
background: #e3e5ea url(img/clipboard.png) center no-repeat; background: #e3e5ea url(img/clipboard.png) center no-repeat;
opacity: .8; opacity: .8;
@ -289,8 +288,8 @@
} }
.profile-modal .profile-tox, .profile-modal .profile-bitmessage { .profile-modal .profile-tox, .profile-modal .profile-bitmessage {
display: inline-block; display: inline-block;
width: 80px; width: 70px;
height: 35px; height: 30px;
border: 1px solid #c0c2c6; border: 1px solid #c0c2c6;
opacity: .8; opacity: .8;
-webkit-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px;
@ -360,6 +359,7 @@ button.follow:hover {
position: absolute; position: absolute;
top: 0; top: 0;
height: 100%; height: 100%;
width: 99%;
box-sizing: border-box; box-sizing: border-box;
border-top: 292px solid transparent; border-top: 292px solid transparent;
overflow: auto; overflow: auto;

11
css/style.css

@ -1259,7 +1259,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
.image-preview .image-preview
{ {
max-height: 500px; max-height: 500px;
width: 100%; max-width: 100%;
} }
.preview-container .preview-container
{ {
@ -1973,6 +1973,15 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
.following ol.following-list .mini-profile-info button { .following ol.following-list .mini-profile-info button {
margin-top: 5px; margin-top: 5px;
} }
.gifCheckBox {
float: right;
vertical-align: middle;
}
.optionsPage .module label {
font: 14px "Open Sans", sans-serif;
display: block;
float: right;
}
/* Autocomplite*/ /* Autocomplite*/
.textcomplete-wrapper textarea { .textcomplete-wrapper textarea {

BIN
img/bm.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
img/tox.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

After

Width:  |  Height:  |  Size: 3.0 KiB

1
js/calm.js

@ -1,6 +1,5 @@
$(function(){ $(function(){
$('.dropdown-menu').on('keydown', function(e){ $('.dropdown-menu').on('keydown', function(e){
e = event || window.event;
e.stopPropagation(); e.stopPropagation();
}) })
$('.post-text').on('click', 'a', function(e){ $('.post-text').on('click', 'a', function(e){

4
js/interface_common.js

@ -448,11 +448,11 @@ var postSubmit = function(e)
var remainingCount = tweetForm.find(".post-area-remaining"); var remainingCount = tweetForm.find(".post-area-remaining");
remainingCount.text(140); remainingCount.text(140);
$replyText.attr("placeholder", "Your message was sent!"); $replyText.attr("placeholder", "Your message was sent!");
closeModal($this);
if($this.closest('.post-area,.post-reply-content')){ if($this.closest('.post-area,.post-reply-content')){
$('.post-area-new').removeClass('open').find('textarea').blur(); $('.post-area-new').removeClass('open').find('textarea').blur();
}; };
setTimeout('requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly)', 1000); setTimeout('requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly)', 2000);
} }

15
js/options.js

@ -103,9 +103,24 @@ function setTheme() {
function setShowPreviewOpt(){ function setShowPreviewOpt(){
$('#displayPreview').val(localStorage['showPreviewOpt'] || "enable"); $('#displayPreview').val(localStorage['showPreviewOpt'] || "enable");
$('input[type="checkbox"]').prop('checked', localStorage['showPreviewOptGif'] == 'true')
if(localStorage['showPreviewOpt'] == 'disable'){
$('input[type="checkbox"]').prop('disabled', true)
}
if(!localStorage['showPreviewOpt']) localStorage['showPreviewOpt'] = "enable"; if(!localStorage['showPreviewOpt']) localStorage['showPreviewOpt'] = "enable";
$('#displayPreview').on('change', function(){ $('#displayPreview').on('change', function(){
localStorage['showPreviewOpt'] = $(this).val(); localStorage['showPreviewOpt'] = $(this).val();
switch($(this).val()){
case 'enable': $('.gifCheckBox').prop('disabled', false); break;
case 'disable': $('.gifCheckBox').prop('disabled', true); break;
}
})
$('input[type="checkbox"]').on('click', function(){
localStorage[$(this).attr('name')] = $(this).prop('checked')
}) })
} }

5
js/twister_formatpost.js

@ -296,9 +296,10 @@ function imagePreview(post) {
if (localStorage['showPreviewOpt'] == 'enable') { if (localStorage['showPreviewOpt'] == 'enable') {
var link = post.find("a[rel='nofollow']"); var link = post.find("a[rel='nofollow']");
var linkAnon = 'https://ssl-proxy.my-addr.org/myaddrproxy.php/http/'; var linkAnon = 'https://ssl-proxy.my-addr.org/myaddrproxy.php/http/';
if (link.html() && /(\.jpg)|(\.gif)|(\.png)|(\.jpeg)/.test(link.html().toLowerCase())) if (link.html() && /(\.jpg)|(\.gif)|(\.png)|(\.jpeg)|(\.jpe)/.test(link.html().toLowerCase()))
{ {
var cleanLink = link.html().replace(/^http[s]?:\/\//i, '') var cleanLink = link.html().replace(/^http[s]?:\/\//i, '');
if(/\.gif\b/i.test(cleanLink) && localStorage['showPreviewOptGif'] == 'false') return;
return "<img src='"+linkAnon+cleanLink+"' class='image-preview' />"; return "<img src='"+linkAnon+cleanLink+"' class='image-preview' />";
} }
} }

5
options.html

@ -140,9 +140,10 @@
<div class="module"> <div class="module">
<h1>Inline image preview</h1> <h1>Inline image preview</h1>
<select name="" id="displayPreview"> <select name="" id="displayPreview">
<option value="disable">Ignore</option> <option value="disable">Disable</option>
<option value="enable">Display</option> <option value="enable">Enable</option>
</select> </select>
<label>Display GIF images<input class="gifCheckBox" type="checkbox" name="showPreviewOptGif"></label>
</div> </div>
</div> </div>

Loading…
Cancel
Save