summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-01-19 13:52:16 +0100
committerczaks <marcin@6irc.net>2014-01-19 13:52:16 +0100
commite201534123fd796483ba081974e8fca684f59e41 (patch)
tree7a1cdaf2e1f12454afaebafe226927456926736a
parent2500f53701cda14f424409bd8d21b1f706c6c636 (diff)
document oekaki.js ( vichan-devel/Tinyboard#26 )
-rw-r--r--js/oekaki.js30
1 files changed, 29 insertions, 1 deletions
diff --git a/js/oekaki.js b/js/oekaki.js
index e08f2d3f..cb7aff39 100644
--- a/js/oekaki.js
+++ b/js/oekaki.js
@@ -1,3 +1,22 @@
+/*
+ * oekaki.js
+ * https://github.com/vichan-devel/Tinyboard/blob/master/js/oekaki.js
+ *
+ * Warning: this script is unsupported and staged for deletion/replacement
+ * Please consult this bug report:
+ * https://github.com/vichan-devel/Tinyboard/issues/20
+ *
+ * Released under the MIT license
+ * Copyright (c) 2013 copypaste <wizardchan@hush.com>
+ * Copyright (c) 2013-2014 Marcin Ɓabanowski <marcin@6irc.net>
+ *
+ * Usage: (it wouldn't work when mixed with ajax.js)
+ * $config['additional_javascript'][] = 'js/jquery.min.js';
+ * $config['additional_javascript'][] = 'js/oekaki.js';
+ * $config['additional_javascript'][] = 'js/jscolor/jscolor.js';
+ * //$config['additional_javascript'][] = 'js/upload-selection.js';
+ */
+
$(function() {
// Init
var oekaki_form = '\
@@ -239,7 +258,16 @@ $("form[name='post']").on("submit", function(e){
success: function(data) {
location.reload();
},
- error: function(jq, data) {alert($('h2',jq.responseText).text());}
+ error: function(jq, data, et) {
+if (jq.responseText == '' && data == 'error') {
+//probably jquery bug, ignore
+location.reload();
+}
+else
+{
+ alert($('h2',jq.responseText).text());
+}
+}
});
}