summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-06-19 10:17:15 +0200
committerAleksander Machniak <alec@alec.pl>2014-06-19 10:17:15 +0200
commit370ef159a33dab9aef636a0ecc5adbe000fb85d7 (patch)
treec381c43a19caa559796bdb9d0cf55bc855bd705e
parent3e7536d653cb76351c60c3e40699612d618f1dc8 (diff)
Add missing colorpicker plugin for TinyMCE
-rw-r--r--program/js/tinymce/plugins/colorpicker/plugin.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/program/js/tinymce/plugins/colorpicker/plugin.min.js b/program/js/tinymce/plugins/colorpicker/plugin.min.js
new file mode 100644
index 000000000..d50c7cc45
--- /dev/null
+++ b/program/js/tinymce/plugins/colorpicker/plugin.min.js
@@ -0,0 +1 @@
+tinymce.PluginManager.add("colorpicker",function(e){function n(n,a){function i(e){var n=new tinymce.util.Color(e),a=n.toRgb();l.fromJSON({r:a.r,g:a.g,b:a.b,hex:n.toHex().substr(1)}),t(n.toHex())}function t(e){l.find("#preview")[0].getEl().style.background=e}var l=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:a,onchange:function(){var e=this.rgb();l&&(l.find("#r").value(e.r),l.find("#g").value(e.g),l.find("#b").value(e.b),l.find("#hex").value(this.value().substr(1)),t(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,a=l.find("colorpicker")[0];return e=this.name(),n=this.value(),"hex"==e?(n="#"+n,i(n),void a.value(n)):(n={r:l.find("#r").value(),g:l.find("#g").value(),b:l.find("#b").value()},a.value(n),void i(n))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+this.toJSON().hex)}});i(a)}e.settings.color_picker_callback||(e.settings.color_picker_callback=n)}); \ No newline at end of file