summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/util.js b/js/util.js
index fc27166..d31af47 100644
--- a/js/util.js
+++ b/js/util.js
@@ -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;