diff options
Diffstat (limited to 'js')
| -rw-r--r-- | js/api/gallery.js | 9 | ||||
| -rw-r--r-- | js/frames.js | 1 | ||||
| -rw-r--r-- | js/user.js | 7 |
3 files changed, 15 insertions, 2 deletions
diff --git a/js/api/gallery.js b/js/api/gallery.js index 48d6a92..8f9914b 100644 --- a/js/api/gallery.js +++ b/js/api/gallery.js @@ -25,7 +25,7 @@ shader_gallery.bind = function(){ var $option = $("<option>") var username = "users" - $option.val(username).html(username) + $option.val("LATEST").html(username) $el.append( $option ) users.sort(function(a,b){ @@ -40,7 +40,12 @@ shader_gallery.bind = function(){ $(document).on("change", "#pick-user", function(){ var name = $(this).val() - ShaderAPI.username(name, load_shaders) + if (name == "LATEST") { + ShaderAPI.latest(load_shaders) + } + else { + ShaderAPI.username(name, load_shaders) + } }) $(document).on("click", ".shader", function(){ run_shader( $(this).data("shader") ) diff --git a/js/frames.js b/js/frames.js index fc6ee24..93d4ac3 100644 --- a/js/frames.js +++ b/js/frames.js @@ -37,6 +37,7 @@ frame_editor.bind = function(){ } function add_frame(){ + $("#render").enable() var frame_count = $("#framecount").int() if (frame_count < 2) { add_single_frame() @@ -10,6 +10,13 @@ user.load = function(){ user.username = user.getCookie() $("#username").val(user.username) } +user.prefs = new function(){} +user.prefs.get = function (key){ + return localStorage.getItem("im.prefs." + key) +} +user.prefs.set = function (key,value){ + return localStorage.setItem("im.prefs." + key, value) +} user.sanitize = function(){ return $("#username").val().replace(/[^-_ a-zA-Z0-9]/g,"") } |
