summaryrefslogtreecommitdiff
path: root/program/js/tinymce
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/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