From ff36ed287ec8747fe25e429bc5fa11961274bbd3 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 2 Feb 2014 02:25:07 -0500 Subject: add examples from json --- js/api/gallery.js | 7 ++++--- js/api/localstorage.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'js/api') diff --git a/js/api/gallery.js b/js/api/gallery.js index c83d5f6..0e6614b 100644 --- a/js/api/gallery.js +++ b/js/api/gallery.js @@ -39,14 +39,15 @@ shader_gallery.bind = function(){ }) } -function new_shader(){ +function new_shader(opt){ + opt = opt || {} shader_id_root = null run_shader({ id: "", shader_id: "", image_url: $("#url").val(), - script: "", - name: "" + script: opt.shader || "", + name: opt.name || "" }) } function run_shader(shader_object){ diff --git a/js/api/localstorage.js b/js/api/localstorage.js index eeae658..309d49d 100644 --- a/js/api/localstorage.js +++ b/js/api/localstorage.js @@ -5,7 +5,7 @@ local_shaders.init = function(){ } local_shaders.bind = function(){ local_shaders.buttons = {} - if ('SHADERS' in window) { + if ('EXAMPLE_SHADERS' in window) { local_shaders.bindButtons( window.SHADERS ) } local_shaders.bindButtons( local_shaders.getShaders() ) -- cgit v1.2.3-70-g09d2