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
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
expands images and webm on hover
|
||||
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
var mouseisOnImage = false;
|
||||
var mouseexitedImage = false;
|
||||
|
||||
var imageHover = (localStorage['imagehover']) ? true:false;
|
||||
|
||||
|
||||
imageHover = !imageHover;
|
||||
|
||||
|
||||
var imageEnter = function(){
|
||||
|
||||
if (!imageHover)
|
||||
return;
|
||||
|
||||
|
||||
|
||||
mouseexitedImage = 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"});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document.body).append($imgH);
|
||||
$("#hover-image").hover(function(){
|
||||
mouseisOnImage = true;
|
||||
|
||||
}, function(){
|
||||
mouseisOnImage = false;
|
||||
|
||||
if (mouseexitedImage){
|
||||
$("#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>');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(".options_tab").append($mrCheckie);
|
||||
$("#toggle-hover").prop("checked", imageHover);
|
||||
$("#toggle-hover").on("click", function(){
|
||||
@ -103,15 +88,10 @@ delete localStorage['imagehover'];
|
||||
imageHover = false;
|
||||
localStorage['imagehover'] = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
$(".options_tab").append();
|
||||
|
||||
|
||||
|
||||
$(document).on("new_post", function(e, post) {
|
||||
$(post).hover(imageEnter(),imageLeave());
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user