forked from GithubBackups/vichan
Attempt to fix undidio's unreadable indentation scheme
This commit is contained in:
parent
a4c67065f1
commit
f253d841f5
@ -13,27 +13,20 @@
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
expands images and webm on hover
|
expands images and webm on hover
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var mouseisOnImage = false;
|
var mouseisOnImage = false;
|
||||||
var mouseexitedImage = false;
|
var mouseexitedImage = false;
|
||||||
|
|
||||||
var imageHover = (localStorage['imagehover']) ? true:false;
|
var imageHover = (localStorage['imagehover']) ? true:false;
|
||||||
|
|
||||||
|
|
||||||
imageHover = !imageHover;
|
imageHover = !imageHover;
|
||||||
|
|
||||||
|
|
||||||
var imageEnter = function(){
|
var imageEnter = function(){
|
||||||
|
|
||||||
if (!imageHover)
|
if (!imageHover)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mouseexitedImage = false;
|
mouseexitedImage = false;
|
||||||
mouseisOnImage = false;
|
mouseisOnImage = false;
|
||||||
|
|
||||||
@ -62,15 +55,11 @@ widStyle = "width:" + ((maxWidth > videoWidth) ? videoWidth:maxWidth) + "px;" +
|
|||||||
$imgH = $("<iframe/>", {"src":$(this).parent().attr("href"), "style":stylez + widStyle, "id":"hover-image"});
|
$imgH = $("<iframe/>", {"src":$(this).parent().attr("href"), "style":stylez + widStyle, "id":"hover-image"});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document.body).append($imgH);
|
$(document.body).append($imgH);
|
||||||
$("#hover-image").hover(function(){
|
$("#hover-image").hover(function(){
|
||||||
mouseisOnImage = true;
|
mouseisOnImage = true;
|
||||||
|
|
||||||
}, function(){
|
}, function(){
|
||||||
mouseisOnImage = false;
|
mouseisOnImage = false;
|
||||||
|
|
||||||
if (mouseexitedImage){
|
if (mouseexitedImage){
|
||||||
$("#hover-image").remove();
|
$("#hover-image").remove();
|
||||||
}
|
}
|
||||||
@ -89,10 +78,6 @@ $("a .post-image").hover(imageEnter,imageLeave);
|
|||||||
|
|
||||||
$mrCheckie = $('<div><label id=\"toggle-image-hover\"><input id="toggle-hover" type=\"checkbox\"> show image on hover</label></div>');
|
$mrCheckie = $('<div><label id=\"toggle-image-hover\"><input id="toggle-hover" type=\"checkbox\"> show image on hover</label></div>');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(".options_tab").append($mrCheckie);
|
$(".options_tab").append($mrCheckie);
|
||||||
$("#toggle-hover").prop("checked", imageHover);
|
$("#toggle-hover").prop("checked", imageHover);
|
||||||
$("#toggle-hover").on("click", function(){
|
$("#toggle-hover").on("click", function(){
|
||||||
@ -103,15 +88,10 @@ delete localStorage['imagehover'];
|
|||||||
imageHover = false;
|
imageHover = false;
|
||||||
localStorage['imagehover'] = true;
|
localStorage['imagehover'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".options_tab").append();
|
$(".options_tab").append();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).on("new_post", function(e, post) {
|
$(document).on("new_post", function(e, post) {
|
||||||
$(post).hover(imageEnter(),imageLeave());
|
$(post).hover(imageEnter(),imageLeave());
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user