summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2014-02-07 09:54:35 -0500
committerjules <jules@okfoc.us>2014-02-07 09:54:35 -0500
commitf8b8dd6b8fe71b7689aad873fb8f8b82d6f46b67 (patch)
treea407ea875b0ec00b72167c438b46d2852e1561f8
parent2b1d57245acbe0c9202c0e1d736242926211150d (diff)
fix picker
-rw-r--r--js/api/gallery.js9
-rw-r--r--js/frames.js1
-rw-r--r--js/user.js7
-rw-r--r--tutorial.html8
4 files changed, 18 insertions, 7 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()
diff --git a/js/user.js b/js/user.js
index a1ac53e..16bf163 100644
--- a/js/user.js
+++ b/js/user.js
@@ -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,"")
}
diff --git a/tutorial.html b/tutorial.html
index ba6d216..47973de 100644
--- a/tutorial.html
+++ b/tutorial.html
@@ -11,16 +11,14 @@ a{ color: #a39; }
</style>
</head>
<body>
-<article id="pre">Shaders are little programs that draw a picture, pixel by pixel. With ShaderBlaster, use shaders on gifs and images to make new effects.
+<article id="pre">Shaders are procedures that draw a picture by coloring each pixel individually. Use shaders on gifs and images to make new effects.
Your basic variables are position (x, y),
time (t), and color (r, g, b, a).
-Many math functions such as <i>cos</i> and <i>sqrt</i> are available, along with functions from GLSL like <i>step</i> and <i>mix</i>. You can see a full list by clicking "commands" above.
+Many math functions such as <i>cos</i> and <i>sqrt</i> are available, along with functions from GLSL like <i>step</i> and <i>mix</i>. You can see a full list by clicking "commands" above. When you make a cool effect, render a gif and save the shader for others to use.
-Click "images" below to search <a href="http://dump.fm/">Dumpfm</a> and <a href="http://asdf.us/im/">Photoblaster</a> for images, or enter a URL at top left.
-
-If you make a cool effect, you can render it out to a gif, or save the shader for others to use.
+You can apply these shaders to any image. Click "images" below to search <a href="http://dump.fm/">Dumpfm</a> and <a href="http://asdf.us/im/">Photoblaster</a>, or enter a URL at top left.
</article>
</body>
<script>