mirror of
https://github.com/twisterarmy/twister-calm.git
synced 2025-01-13 16:37:52 +00:00
added ability to enable/disable GIF image preview and jpe image format
added ability to enable/disable GIF image preview and jpe image format
This commit is contained in:
parent
cf01e3955e
commit
8d0001a29c
@ -254,19 +254,18 @@
|
||||
}
|
||||
#msngrswr {
|
||||
display: none;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
height: 40px;
|
||||
margin-top: 20px;
|
||||
height: 30px;
|
||||
}
|
||||
#toxbtnwr, #bmbtnwr {
|
||||
float: left;
|
||||
display: none;
|
||||
}
|
||||
.bitmessage-ctc, .tox-ctc {
|
||||
height: 35px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
margin-right: 5px;
|
||||
border: 1px solid #d6d8dc;
|
||||
background: #e3e5ea url(img/clipboard.png) center no-repeat;
|
||||
opacity: .8;
|
||||
@ -289,8 +288,8 @@
|
||||
}
|
||||
.profile-modal .profile-tox, .profile-modal .profile-bitmessage {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 35px;
|
||||
width: 70px;
|
||||
height: 30px;
|
||||
border: 1px solid #c0c2c6;
|
||||
opacity: .8;
|
||||
-webkit-border-radius: 5px 0 0 5px;
|
||||
@ -360,6 +359,7 @@ button.follow:hover {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 99%;
|
||||
box-sizing: border-box;
|
||||
border-top: 292px solid transparent;
|
||||
overflow: auto;
|
||||
|
@ -1259,7 +1259,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
|
||||
.image-preview
|
||||
{
|
||||
max-height: 500px;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.preview-container
|
||||
{
|
||||
@ -1973,6 +1973,15 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
|
||||
.following ol.following-list .mini-profile-info button {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.gifCheckBox {
|
||||
float: right;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.optionsPage .module label {
|
||||
font: 14px "Open Sans", sans-serif;
|
||||
display: block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Autocomplite*/
|
||||
.textcomplete-wrapper textarea {
|
||||
|
BIN
img/bm.png
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
BIN
img/tox.png
Binary file not shown.
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 3.0 KiB |
@ -1,6 +1,5 @@
|
||||
$(function(){
|
||||
$('.dropdown-menu').on('keydown', function(e){
|
||||
e = event || window.event;
|
||||
e.stopPropagation();
|
||||
})
|
||||
$('.post-text').on('click', 'a', function(e){
|
||||
|
@ -448,11 +448,11 @@ var postSubmit = function(e)
|
||||
var remainingCount = tweetForm.find(".post-area-remaining");
|
||||
remainingCount.text(140);
|
||||
$replyText.attr("placeholder", "Your message was sent!");
|
||||
closeModal($this);
|
||||
|
||||
if($this.closest('.post-area,.post-reply-content')){
|
||||
$('.post-area-new').removeClass('open').find('textarea').blur();
|
||||
};
|
||||
setTimeout('requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly)', 1000);
|
||||
setTimeout('requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly)', 2000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,9 +103,24 @@ function setTheme() {
|
||||
|
||||
function setShowPreviewOpt(){
|
||||
$('#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";
|
||||
|
||||
$('#displayPreview').on('change', function(){
|
||||
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')
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -296,9 +296,10 @@ function imagePreview(post) {
|
||||
if (localStorage['showPreviewOpt'] == 'enable') {
|
||||
var link = post.find("a[rel='nofollow']");
|
||||
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' />";
|
||||
}
|
||||
}
|
||||
|
@ -140,9 +140,10 @@
|
||||
<div class="module">
|
||||
<h1>Inline image preview</h1>
|
||||
<select name="" id="displayPreview">
|
||||
<option value="disable">Ignore</option>
|
||||
<option value="enable">Display</option>
|
||||
<option value="disable">Disable</option>
|
||||
<option value="enable">Enable</option>
|
||||
</select>
|
||||
<label>Display GIF images<input class="gifCheckBox" type="checkbox" name="showPreviewOptGif"></label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user