summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/frames.js11
-rw-r--r--js/image.js1
-rw-r--r--js/render.js8
3 files changed, 13 insertions, 7 deletions
diff --git a/js/frames.js b/js/frames.js
index 1d08807..887b497 100644
--- a/js/frames.js
+++ b/js/frames.js
@@ -54,7 +54,6 @@ function add_single_frame(){
frame.canvas.style.display = "none"
var thumb = cc.clone().resize(frame_thumb_size,frame_thumb_size).appendTo($el.find(".frame")[0])
$("#frames").append($el)
- $("#render").enable()
}
function add_frames(frame_count){
rendering = true
@@ -71,9 +70,6 @@ function add_frames(frame_count){
}
function remove_frame(){
$(this).closest("div").remove()
- if ($("#frames div").length == 0) {
- $("#render").disable()
- }
}
function remove_all_frames(){
$("#frames").empty()
@@ -102,6 +98,11 @@ function sort_frames(){
function render (){
if (rendering) return
rendering = true
+
+ if ($("#frames canvas.fullsize").length == 0) {
+ add_frame()
+ }
+
encoder.reset()
var delay = $("#framedelay").float() * 1000 || 100
$("#frames canvas.fullsize").each(function(){
@@ -149,7 +150,7 @@ encoder.on("rendered-url", function(url){
$("#uploaded-url").hide().val("")
$("#save,#upload,#rendered").show()
$("#pause,#render,#add-frame,#save,#upload").enable()
- $("#render").html("render")
+ $("#render").html("render gif")
rendering = false
pause(true)
})
diff --git a/js/image.js b/js/image.js
index 4de7fd9..aabab89 100644
--- a/js/image.js
+++ b/js/image.js
@@ -2,6 +2,7 @@ var gif, img
function loadImage(imageURL, callback) {
var imageURL = proxify( imageURL );
+ window.imageURL = imageURL
window.gif = window.img = null
diff --git a/js/render.js b/js/render.js
index 6ad7560..cfc2d81 100644
--- a/js/render.js
+++ b/js/render.js
@@ -12,13 +12,17 @@ function choose (){
}
function load(){
- var imageURL = $("#url").val()
+ var newImageURL = $("#url").val()
loading = true
- loadImage(imageURL, ready)
+ if (newImageURL != imageURL) {
+ loadImage(newImageURL, ready)
+ status("loading")
+ }
}
function ready(){
loading = false
+ status("")
if (window.gif) {
frame = gif.frames[0]
actual_w = w = cc.canvas.width = frame.ctx.canvas.width