summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/build/custom-css/custom-css')
-rw-r--r--plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css-preview.min.js4
-rw-r--r--plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css.core-4.9.min.js2
-rw-r--r--plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css.min.js2
-rw-r--r--plugins/jetpack/_inc/build/custom-css/custom-css/js/css-editor.min.js4
-rw-r--r--plugins/jetpack/_inc/build/custom-css/custom-css/js/use-codemirror.min.js3
5 files changed, 15 insertions, 0 deletions
diff --git a/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css-preview.min.js b/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css-preview.min.js
new file mode 100644
index 00000000..2e96ee3c
--- /dev/null
+++ b/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css-preview.min.js
@@ -0,0 +1,4 @@
+/* Do not modify this file directly. It is compiled from other files. */
+// Originally based on https://raw.githubusercontent.com/xwp/wp-custom-scss-demo/master/custom-scss-demo-preview.js
+/* globals jpCustomizerCssPreview */
+!function(e,s){e.settingPreviewHandlers?e.settingPreviewHandlers.custom_css=function(){}:parent.console.warn("Missing core patch that adds support for settingPreviewHandlers"),e.selectiveRefresh.partialConstructor.custom_css=e.selectiveRefresh.Partial.extend({refresh:function(){var t,r,c=this,n=e("jetpack_custom_css[preprocessor]").get();return jpCustomizerCssPreview.preprocessors.hasOwnProperty(n)?e.selectiveRefresh.Partial.prototype.refresh.call(c):(t=new s.Deferred,r=e("custom_css["+e.settings.theme.stylesheet+"]"),_.each(c.placements(),function(e){e.container.text(r.get())}),t.resolve(),t.promise())}})}(wp.customize,jQuery); \ No newline at end of file
diff --git a/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css.core-4.9.min.js b/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css.core-4.9.min.js
new file mode 100644
index 00000000..6290096c
--- /dev/null
+++ b/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css.core-4.9.min.js
@@ -0,0 +1,2 @@
+/* Do not modify this file directly. It is compiled from other files. */
+!function(s,t){function n(s){var n=t.control.value(s);return n?n.container:null}s(document).ready(function(){var e=n("jetpack_css_mode_control");e&&e.prepend('<span class="customize-control-title">'+window._jp_css_settings.l10n.mode+"</span>");var i=n("jetpack_mobile_css_control");i&&i.prepend('<span class="customize-control-title">'+window._jp_css_settings.l10n.mobile+"</span>");var o=n("wpcom_custom_css_content_width_control");o&&(o.append('<span class="description">'+window._jp_css_settings.l10n.contentWidth+"<span>"),o.find("input").after("<span>px</span>")),s("<div />",{id:"css-help-links",class:"css-help"}).appendTo(n("custom_css")),s("<a />",{id:"help-link",target:"_blank",href:window._jp_css_settings.cssHelpUrl,text:window._jp_css_settings.l10n.css_help_title}).prependTo("#css-help-links"),window._jp_css_settings.areThereCssRevisions&&s("<a />",{id:"revisions-link",target:"_blank",href:window._jp_css_settings.revisionsUrl,text:window._jp_css_settings.l10n.revisions}).prependTo("#css-help-links"),t("jetpack_custom_css[preprocessor]",function(s){s.bind(function(s){var n={default:"text/css",less:"text/x-less",sass:"text/x-scss"},e="text/css";void 0!==n[s]&&(e=n[s]),t.control("custom_css").deferred.codemirror.done(function(s){s.setOption("mode",e),"text/css"===e?s.setOption("lint",!0):s.setOption("lint",!1)})})})})}(jQuery,this.wp.customize); \ No newline at end of file
diff --git a/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css.min.js b/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css.min.js
new file mode 100644
index 00000000..870e958e
--- /dev/null
+++ b/plugins/jetpack/_inc/build/custom-css/custom-css/js/core-customizer-css.min.js
@@ -0,0 +1,2 @@
+/* Do not modify this file directly. It is compiled from other files. */
+!function(t,s,i){i.controlConstructor.jetpackCss=i.Control.extend({modes:{default:"text/css",less:"text/x-less",sass:"text/x-scss"},_updating:!1,ready:function(){this.opts=window._jp_css_settings,this.$input=s("<textarea />",{name:this.setting.id,class:"for-codemirror hidden"}).val(this.setting()),this.container.append(this.$input),i(this.setting.id,_.bind(function(t){var s=new i.Element(this.$input);this.elements=[s],s.sync(t),s.set(t())},this)),this.opts.useRichEditor?this.initCodeMirror():this.$input.removeClass("hidden"),i.bind("ready",_.bind(this.addLabels,this))},initCodeMirror:function(){this.editor=window.CodeMirror.fromTextArea(this.$input.get(0),{mode:this.getMode(),lineNumbers:!0,tabSize:2,indentWithTabs:!0,lineWrapping:!0}),this.addListeners()},addListeners:function(){var t=!1;s("#accordion-section-custom_css > .accordion-section-title").click(_.bind(_.debounce(this.editor.refresh,250),this.editor)),this.editor.on("focus",function(t){t.refresh()}),this.editor.on("change",_.bind(function(s){this._updating=!0,this.$input.val(s.getValue()).trigger("change"),this._updating=!1,t||(window.ga&&window.ga("send","event","Customizer","Typed Custom CSS"),t=!0)},this)),this.editor.on("focus",function(){window.ga&&window.ga("send","event","Customizer","Focused CSS Editor")}),this.setting.bind("change",_.bind(this.externalChange,this))},getMode:function(){var t=i("jetpack_custom_css[preprocessor]")();return""!==t&&this.modes[t]||(t="default"),this.modes[t]},externalChange:function(){this._updating||this.editor.setValue(this.setting())},refresh:function(t){"accordion-section-custom_css"===t&&setTimeout(_.bind(function(){this.editor.refresh()},this),300)},addLabels:function(){this.addTitle("jetpack_css_mode_control",this.opts.l10n.mode),this.addTitle("jetpack_mobile_css_control",this.opts.l10n.mobile),this.addDesc("wpcom_custom_css_content_width_control",this.opts.l10n.contentWidth);var t=this._getControl("wpcom_custom_css_content_width_control");t&&t.find("input").after("<span>px</span>"),s("<div />",{id:"css-help-links",class:"css-help"}).appendTo(this.container),s("<a />",{id:"help-link",target:"_blank",href:this.opts.cssHelpUrl,text:this.opts.l10n.css_help_title}).prependTo("#css-help-links"),this.opts.areThereCssRevisions&&s("<a />",{id:"revisions-link",target:"_blank",href:this.opts.revisionsUrl,text:this.opts.l10n.revisions}).prependTo("#css-help-links")},addTitle:function(t,s){var i=this._getControl(t);i&&i.prepend('<span class="customize-control-title">'+s+"<span>")},addDesc:function(t,s){var i=this._getControl(t);i&&i.append('<span class="description">'+s+"<span>")},_getControl:function(t){var s=i.control.value(t);return s?s.container:null}})}(this.wp,jQuery,this.wp.customize); \ No newline at end of file
diff --git a/plugins/jetpack/_inc/build/custom-css/custom-css/js/css-editor.min.js b/plugins/jetpack/_inc/build/custom-css/custom-css/js/css-editor.min.js
new file mode 100644
index 00000000..6f4d6058
--- /dev/null
+++ b/plugins/jetpack/_inc/build/custom-css/custom-css/js/css-editor.min.js
@@ -0,0 +1,4 @@
+/* Do not modify this file directly. It is compiled from other files. */
+/* jshint onevar: false, smarttabs: true */
+/* global postboxes, addLoadEvent */
+!function(e){var s,o,c,t;c=function(){s.height(o.height()-s.offset().top-250)},t=function(){s=e("#safecss"),o=e(window),postboxes.add_postbox_toggles("editcss"),c(),e("#safecssform").on("click","#preview",function(e){e.preventDefault(),document.forms.safecssform.target="csspreview",document.forms.safecssform.action.value="preview",document.forms.safecssform.submit(),document.forms.safecssform.target="",document.forms.safecssform.action.value="save"})},window.onresize=c,addLoadEvent(t)}(jQuery),jQuery(function(e){e(".edit-preprocessor").bind("click",function(s){s.preventDefault(),e("#preprocessor-select").slideDown(),e(this).hide()}),e(".cancel-preprocessor").bind("click",function(s){s.preventDefault(),e("#preprocessor-select").slideUp(function(){e(".edit-preprocessor").show(),e("#preprocessor_choices").val(e("#custom_css_preprocessor").val())})}),e(".save-preprocessor").bind("click",function(s){s.preventDefault(),e("#preprocessor-select").slideUp(),e("#preprocessor-display").text(e("#preprocessor_choices option:selected").text()),e("#custom_css_preprocessor").val(e("#preprocessor_choices").val()).change(),e(".edit-preprocessor").show()}),e(".edit-css-mode").bind("click",function(s){s.preventDefault(),e("#css-mode-select").slideDown(),e(this).hide()}),e(".cancel-css-mode").bind("click",function(s){s.preventDefault(),e("#css-mode-select").slideUp(function(){e(".edit-css-mode").show(),e("input[name=add_to_existing_display][value="+e("#add_to_existing").val()+"]").attr("checked",!0)})}),e(".save-css-mode").bind("click",function(s){s.preventDefault(),e("#css-mode-select").slideUp(),e("#css-mode-display").text("true"==e("input[name=add_to_existing_display]:checked").val()?"Add-on":"Replacement"),e("#add_to_existing").val(e("input[name=add_to_existing_display]:checked").val()),e(".edit-css-mode").show()})}); \ No newline at end of file
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