diff options
Diffstat (limited to 'js/util.js')
| -rw-r--r-- | js/util.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,11 +1,11 @@ -$.fn.int = function(){ return parseInt($(this).val(),10) } -$.fn.float = function(){ return parseFloat($(this).val()) } +if (window.$) { + $.fn.int = function(){ return parseInt($(this).val(),10) } + $.fn.float = function(){ return parseFloat($(this).val()) } +} + function clamp(n,a,b){ return n<a?a:n<b?n:b } function loadImage(imageURL, callback) { - document.getElementById("save").style.display = "none" - document.getElementById("encode").style.display = "none" - status("loading") var imageURL = proxify( imageURL ); window.gif = window.img = null @@ -26,7 +26,7 @@ function loadImage(imageURL, callback) { } function giveImage() { - if (imageURL.substr(-3) === "gif") { + if (window.gif) { return gif.frames[gif.currentFrame()].ctx.canvas; } else { return img; |
