From 31584986e47b2e796f10c547c115080e028937ed Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 29 Jan 2014 22:05:59 +0100 Subject: [PATCH] wpaint.js: second iteration; not ready yet; vichan-devel#20 --- js/upload-selection.js | 12 +++++------- js/wpaint.js | 24 +++++++++++++++++++----- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/js/upload-selection.js b/js/upload-selection.js index aa1448d7..9c4ebd34 100644 --- a/js/upload-selection.js +++ b/js/upload-selection.js @@ -7,8 +7,8 @@ * * Usage: * $config['additional_javascript'][] = 'js/jquery.min.js'; + * //$config['additional_javascript'][] = 'js/wpaint.js'; * $config['additional_javascript'][] = 'js/upload-selection.js'; - * //$config['additional_javascript'][] = 'js/oekaki.js'; //WARNING: unsupported * */ @@ -16,7 +16,7 @@ $(function(){ var enabled_file = true; var enabled_url = $("#upload_url").length > 0; var enabled_embed = $("#upload_embed").length > 0; - var enabled_oekaki = $("#oekaki").length > 0; + var enabled_oekaki = typeof window.oekaki != "undefined"; var disable_all = function() { $("#upload").hide(); @@ -26,8 +26,8 @@ $(function(){ $("#oekaki").hide(); if (enabled_oekaki) { - if ($("#confirm_oekaki").is(':checked')) { - $("#confirm_oekaki").click(); + if (window.oekaki.initialized) { + window.oekaki.deinit(); } } }; @@ -55,9 +55,7 @@ $(function(){ disable_all(); $("#oekaki").show(); - if (!$("#confirm_oekaki").is(':checked')) { - $("#confirm_oekaki").click(); - } + window.oekaki.init(); }; if (enabled_url || enabled_embed || enabled_oekaki) { diff --git a/js/wpaint.js b/js/wpaint.js index 9e4ef2a5..0c8c8be0 100644 --- a/js/wpaint.js +++ b/js/wpaint.js @@ -10,12 +10,26 @@ * $config['additional_javascript'][] = 'js/jquery-ui.custom.min.js'; * $config['additional_javascript'][] = 'js/ajax.js'; * $config['additional_javascript'][] = 'js/wPaint/lib/wColorPicker.min.js'; - * $config['additional_javascript'][] = 'js/wPaint/lib/wPaint.min.js'; - * $config['additional_javascript'][] = 'js/wPaint/lib/plugins/main/wPaint.menu.main.min.js'; - * //$config['additional_javascript'][] = 'js/wPaint/lib/plugins/text/wPaint.menu.text.min.js'; - * //$config['additional_javascript'][] = 'js/wPaint/lib/plugins/shapes/wPaint.menu.main.shapes.min.js'; - * //$config['additional_javascript'][] = 'js/wPaint/lib/plugins/file/wPaint.menu.main.file.min.js'; + * $config['additional_javascript'][] = 'js/wPaint/wPaint.min.js'; + * $config['additional_javascript'][] = 'js/wPaint/plugins/main/wPaint.menu.main.min.js'; + * //$config['additional_javascript'][] = 'js/wPaint/plugins/text/wPaint.menu.text.min.js'; + * //$config['additional_javascript'][] = 'js/wPaint/plugins/shapes/wPaint.menu.main.shapes.min.js'; + * //$config['additional_javascript'][] = 'js/wPaint/plugins/file/wPaint.menu.main.file.min.js'; * $config['additional_javascript'][] = 'js/wpaint.js'; + * $config['additional_javascript'][] = 'js/upload-selection.js'; * */ +(function(){ + +var oekaki = window.oekaki = {}; + +oekaki.init = function() { +}; + +oekaki.deinit = function() { +}; + +oekaki.initialized = false; + +})();