summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/build/custom-css/custom-css/js/use-codemirror.min.js')
-rw-r--r--plugins/jetpack/_inc/build/custom-css/custom-css/js/use-codemirror.min.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/jetpack/_inc/build/custom-css/custom-css/js/use-codemirror.min.js b/plugins/jetpack/_inc/build/custom-css/custom-css/js/use-codemirror.min.js
new file mode 100644
index 00000000..4ee0adf8
--- /dev/null
+++ b/plugins/jetpack/_inc/build/custom-css/custom-css/js/use-codemirror.min.js
@@ -0,0 +1,3 @@
+/* Do not modify this file directly. It is compiled from other files. */
+/* jshint onevar: false, smarttabs: true */
+!function(t){var e={modes:{default:"text/css",less:"text/x-less",sass:"text/x-scss"},init:function(){this.$textarea=t("#safecss"),this.editor=window.CodeMirror.fromTextArea(this.$textarea.get(0),{mode:this.getMode(),lineNumbers:!0,tabSize:2,indentWithTabs:!0,lineWrapping:!0}),this.setEditorHeight()},addListeners:function(){t(window).on("resize",_.bind(_.debounce(this.setEditorHeight,100),this)),this.editor.on("change",_.bind(function(t){this.$textarea.val(t.getValue())},this)),t("#preprocessor_choices").change(_.bind(function(){this.editor.setOption("mode",this.getMode())},this))},setEditorHeight:function(){var e=t("html").height()-t(this.editor.getWrapperElement()).offset().top;this.editor.setSize(null,e)},getMode:function(){var e=t("#preprocessor_choices").val();return""!==e&&this.modes[e]||(e="default"),this.modes[e]}};t(document).ready(_.bind(e.init,e))}(jQuery); \ No newline at end of file