SiteOrigin CSS - Version 1.2.2

Version Description

  • 16 June 2018 =
  • Removed reference to non-existent view.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 SiteOrigin CSS
Version 1.2.2
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.2

Files changed (6) hide show
  1. js/editor.js +0 -26
  2. js/editor.min.js +1 -1
  3. lang/so-css.pot +153 -149
  4. readme.txt +8 -2
  5. so-css.php +51 -35
  6. tpl/page.php +10 -5
js/editor.js CHANGED
@@ -1787,25 +1787,6 @@
1787
  template: _.template( $('#template-webfont-teaser').html().trim() )
1788
  });
1789
 
1790
- socss.view.RevisionsListView = Backbone.View.extend( {
1791
-
1792
- initialize: function () {
1793
- this.listenTo( this.model, 'change:selectedPost', this.updateRevisionsList.bind( this ) )
1794
- },
1795
-
1796
- updateRevisionsList: function () {
1797
- $.get(
1798
- socssOptions.getRevisionsListAjaxUrl,
1799
- { postId: this.model.get( 'selectedPost' ).get( 'postId' ) },
1800
- function ( result ) {
1801
- this.$( '.custom-revisions-list' ).html( result );
1802
- }.bind( this )
1803
- );
1804
- },
1805
-
1806
- // TODO: This is using the server rendered partial. Update to use models and render
1807
- } );
1808
-
1809
  } )( jQuery, _, socssOptions );
1810
 
1811
  // Setup the main editor
@@ -1825,12 +1806,6 @@ jQuery( function ( $ ) {
1825
  // editor.render();
1826
  editor.setSnippets( socssOptions.snippets );
1827
 
1828
-
1829
- var revisionsList = new socss.view.RevisionsListView( {
1830
- el: $( '#so-custom-css-revisions' ),
1831
- model: editorModel,
1832
- } );
1833
-
1834
  // This is for hiding the getting started video
1835
  $( '#so-custom-css-getting-started a.hide' ).click( function ( e ) {
1836
  e.preventDefault();
@@ -1839,6 +1814,5 @@ jQuery( function ( $ ) {
1839
  } );
1840
 
1841
  window.socss.mainEditor = editor;
1842
- window.socss.revisionsList = revisionsList;
1843
  $( socss ).trigger( 'initialized' );
1844
  } );
1787
  template: _.template( $('#template-webfont-teaser').html().trim() )
1788
  });
1789
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1790
  } )( jQuery, _, socssOptions );
1791
 
1792
  // Setup the main editor
1806
  // editor.render();
1807
  editor.setSnippets( socssOptions.snippets );
1808
 
 
 
 
 
 
 
1809
  // This is for hiding the getting started video
1810
  $( '#so-custom-css-getting-started a.hide' ).click( function ( e ) {
1811
  e.preventDefault();
1814
  } );
1815
 
1816
  window.socss.mainEditor = editor;
 
1817
  $( socss ).trigger( 'initialized' );
1818
  } );
js/editor.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t,i){var s={model:{},collection:{},view:{},fn:{}};window.socss=s,s.model.CustomCssModel=Backbone.Model.extend({defaults:{postId:null,postTitle:null,css:null},urlRoot:i.postCssUrlRoot,url:function(){return this.urlRoot+"&postId="+this.get("postId")}}),s.model.CustomCssCollection=Backbone.Collection.extend({model:s.model.CustomCssModel,modelId:function(e){return e.postId}}),s.model.CSSEditorModel=Backbone.Model.extend({defaults:{customCssPosts:null}}),s.view.toolbar=Backbone.View.extend({button:t.template('<li><a href="#<%= action %>" class="toolbar-button socss-button"><%= text %></a></li>'),events:{"click .socss-button":"triggerEvent"},triggerEvent:function(t){t.preventDefault();var i=e(t.currentTarget);i.blur();var s=i.attr("href").replace("#","");this.$el.trigger("click_"+s)},addButton:function(t,i){return e(this.button({text:t,action:i})).appendTo(this.$(".toolbar-function-buttons .toolbar-buttons"))}}),s.view.editor=Backbone.View.extend({codeMirror:null,snippets:null,toolbar:null,visualProperties:null,inspector:null,cssSelectors:[],initValue:null,events:{"click_expand .custom-css-toolbar":"toggleExpand","click_visual .custom-css-toolbar":"showVisualEditor",submit:"onSubmit"},initialize:function(e){this.listenTo(this.model,"change:selectedPost",this.getSelectedPostCss),this.getSelectedPostCss().then(function(){e.openVisualEditor&&this.showVisualEditor()}.bind(this))},getSelectedPostCss:function(){var t,i=this.model.get("selectedPost");return t=i&&!i.has("css")?i.fetch():(new e.Deferred).resolve(),t.then(this.render.bind(this))},render:function(){var t=this.model.get("selectedPost");return t&&!t.has("css")?this:(this.codeMirror||this.setupEditor(),this.toolbar||(this.toolbar=new s.view.toolbar({el:this.$(".custom-css-toolbar"),model:this.model}),this.toolbar.render()),this.visualProperties||(this.visualProperties=new s.view.properties({editor:this,el:e("#so-custom-css-properties")}),this.visualProperties.render()),this.preview||(this.preview=new s.view.preview({editor:this,model:this.model,el:this.$(".custom-css-preview"),initURL:i.homeURL}),this.preview.render()),t&&(this.codeMirror.setValue(t.get("css")),this.codeMirror.clearHistory()),this)},setupEditor:function(){this.registerCodeMirrorAutocomplete();var t=this.$("textarea.css-editor");this.initValue=t.val();var s=this.initValue.match(/\n/gm),r=(s&&s.length,this.initValue);t.val(r),this.codeMirror=CodeMirror.fromTextArea(t.get(0),{tabSize:2,lineNumbers:!0,mode:"css",theme:"neat",inputStyle:"contenteditable",gutters:["CodeMirror-lint-markers"],lint:!0,search:!0,dialog:!0,annotateScrollbar:!0,extraKeys:{"Ctrl-F":"findPersistent","Alt-G":"jumpToLine"}}),this.codeMirror.on("change",function(e,t){var i=this.model.get("selectedPost");i&&i.get("css")!==e.getValue().trim()&&i.set("css",e.getValue().trim())}.bind(this)),e(window).on("beforeunload",function(){if(this.codeMirror.getValue().trim()!==this.initValue)return i.loc.leave}.bind(this)),this.$el.find(".custom-css-container").css("overflow","visible"),this.scaleEditor(),e(window).on("resize",function(){this.scaleEditor()}.bind(this)),this.setupCodeMirrorExtensions()},onSubmit:function(){this.initValue=this.codeMirror.getValue().trim()},registerCodeMirrorAutocomplete:function(){var e={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};CodeMirror.registerHelper("hint","css",function(t){function i(e){for(var t in e)a&&0!==t.lastIndexOf(a,0)||p.push(t)}var s=t.getCursor(),r=t.getTokenAt(s),o=CodeMirror.innerMode(t.getMode(),r.state);if("css"===o.mode.name){if("keyword"===r.type&&0==="!important".indexOf(r.string))return{list:["!important"],from:CodeMirror.Pos(s.line,r.start),to:CodeMirror.Pos(s.line,r.end)};var n=r.start,l=s.ch,a=r.string.slice(0,l-n);/[^\w$_-]/.test(a)&&(a="",n=l=s.ch);var c=CodeMirror.resolveMode("text/css"),p=[],d=o.state.state;if("top"===d){for(var h=t.getLine(s.line).trim(),u=this.cssSelectors,v=0;v<u.length;v++)-1!==u[v].selector.indexOf(h)&&p.push(u[v].selector);if(p.length)return{list:p,from:CodeMirror.Pos(s.line,0),to:CodeMirror.Pos(s.line,l)}}else if("pseudo"===d||"variable-3"===r.type?i(e):"block"===d||"maybeprop"===d?i(c.propertyKeywords):"prop"===d||"parens"===d||"at"===d||"params"===d?(i(c.valueKeywords),i(c.colorKeywords)):"media"!==d&&"media_parens"!==d||(i(c.mediaTypes),i(c.mediaFeatures)),p.length)return{list:p,from:CodeMirror.Pos(s.line,n),to:CodeMirror.Pos(s.line,l)}}}.bind(this))},setupCodeMirrorExtensions:function(){this.codeMirror.on("cursorActivity",function(e){var t=e.getCursor(),i=e.getTokenAt(t);CodeMirror.innerMode(e.getMode(),i.state);if("qualifier"===i.type||"tag"===i.type||"builtin"===i.type){var s=e.getLine(t.line),r=s.substring(0,i.end);this.preview.highlight(r)}else this.preview.clearHighlight()}.bind(this)),this.codeMirror.on("keyup",function(e,t){(t.keyCode>=65&&t.keyCode<=90||189===t.keyCode&&!t.shiftKey||190===t.keyCode&&!t.shiftKey||51===t.keyCode&&t.shiftKey||189===t.keyCode&&t.shiftKey)&&e.showHint({completeSingle:!1})})},scaleEditor:function(){var t=e(window).outerHeight();if(this.$el.hasClass("expanded"))this.$el.find(".CodeMirror-scroll").css("max-height",""),this.codeMirror.setSize("100%",t-this.$(".custom-css-toolbar").outerHeight());else{var i=e("#so-custom-css-form"),s=e("#wpadminbar").outerHeight(!0)+e("#siteorigin-custom-css").find("> h2").outerHeight(!0)+i.find("> .custom-css-toolbar").outerHeight(!0)+i.find("> p.description").outerHeight(!0)+i.find("> p.submit").outerHeight(!0)+parseFloat(e("#wpbody-content").css("padding-bottom"));this.$el.find(".CodeMirror-scroll").css("max-height",t-s),this.codeMirror.setSize("100%","auto")}},isExpanded:function(){return this.$el.hasClass("expanded")},toggleExpand:function(){this.$el.toggleClass("expanded"),this.scaleEditor()},setExpand:function(e){e?this.$el.addClass("expanded"):this.$el.removeClass("expanded"),this.scaleEditor()},showVisualEditor:function(){this.visualProperties.loadCSS(this.codeMirror.getValue().trim()),this.visualProperties.show()},setSnippets:function(e){t.isEmpty(e)||(this.snippets=new s.view.snippets({snippets:e}),this.snippets.editor=this,this.snippets.render(),this.toolbar.addButton("Snippets","snippets"),this.toolbar.on("click_snippets",function(){this.snippets.show()}.bind(this)))},addCode:function(e){var t=this.codeMirror,i="";i=1===t.doc.lineCount()&&0===t.doc.getLine(t.doc.lastLine()).length?"":0===t.doc.getLine(t.doc.lastLine()).length?"\n":"\n\n",t.doc.setCursor(t.doc.lastLine(),t.doc.getLine(t.doc.lastLine()).length),t.doc.replaceSelection(i+e)},addEmptySelector:function(e){this.addCode(e+" {\n \n}")},setInspector:function(e){this.inspector=e,this.cssSelectors=e.pageSelectors,e.on("click_selector",function(e){this.visualProperties.isVisible()?this.visualProperties.addSelector(e):this.addEmptySelector(e)}.bind(this)),e.on("click_property",function(e){this.visualProperties.isVisible()||this.codeMirror.replaceSelection(e+";\n ")}.bind(this)),e.on("set_active_element",function(e,t){this.visualProperties.isVisible()&&t.length&&this.visualProperties.addSelector(t[0].selector)}.bind(this))}}),s.view.preview=Backbone.View.extend({template:t.template(e("#template-preview-window").html()),editor:null,originalUri:null,currentUri:null,events:{"load #preview-iframe":"initPreview","mouseleave #preview-iframe":"clearHighlight",'keydown #preview-navigator input[type="text"]':"reloadPreview"},initialize:function(e){this.editor=e.editor,this.listenTo(this.model,"change:selectedPost",this.render.bind(this)),this.originalUri=new URI(e.initURL),this.currentUri=new URI(e.initURL),this.editor.codeMirror.on("change",function(e,t){this.updatePreviewCss()}.bind(this))},render:function(){var e=this.model.get("selectedPost");if(e&&!e.has("postUrl"))return e.fetch().then(this.render.bind(this)),this;this.$el.html(this.template()),e&&(this.currentUri=new URI(e.get("postUrl"))),this.currentUri.removeQuery("so_css_preview",1),this.$("#preview-navigator input").val(this.currentUri.toString()),this.currentUri.addQuery("so_css_preview",1),this.$("#preview-iframe").attr("src",this.currentUri.toString())},initPreview:function(){var t=this.$("#preview-iframe");this.currentUri=new URI(t.contents().get(0).location.href),this.currentUri.removeQuery("so_css_preview"),this.$("#preview-navigator input").val(this.currentUri.toString()),this.currentUri.addQuery("so_css_preview",1),t.contents().find("a").each(function(){var t=e(this).attr("href");if(void 0===t)return!0;var i=-1===t.indexOf("?")?"?":"&";e(this).attr("href",t+i+"so_css_preview=1")}),this.updatePreviewCss()},reloadPreview:function(e){var t=this.$('#preview-navigator input[type="text"]');if(13===e.keyCode){e.preventDefault();var i=new URI(t.val());this.originalUri.host()!==i.host()||this.originalUri.protocol()!==i.protocol()?(t.blur(),alert(t.data("invalid-uri")),t.focus()):(i.addQuery("so_css_preview",1),this.$("#preview-iframe").attr("src",i.toString()))}},updatePreviewCss:function(){var e=this.$("#preview-iframe");if(0!==e.length){var t=e.contents().find("head");0===t.find("style.siteorigin-custom-css").length&&t.append('<style class="siteorigin-custom-css" type="text/css"></style>');var i=t.find("style.siteorigin-custom-css"),s=this.editor.codeMirror.getValue().trim();i.html(s)}},highlight:function(e){try{this.editor.inspector.hl.highlight(e)}catch(e){console.log("No inspector to highlight with")}},clearHighlight:function(){try{this.editor.inspector.hl.clear()}catch(e){console.log("No inspector to highlight with")}}}),s.view.snippets=Backbone.View.extend({template:t.template(e("#template-snippet-browser").html()),snippet:t.template('<li class="snippet"><%- name %></li>'),className:"css-editor-snippet-browser",snippets:null,editor:null,events:{"click .close":"hide","click .buttons .insert-snippet":"insertSnippet","click .snippet":"clickSnippet"},currentSnippet:null,initialize:function(e){this.snippets=e.snippets},render:function(){this.$el.html(this.template());for(var t=0;t<this.snippets.length;t++)e(this.snippet({name:this.snippets[t].Name})).data({description:this.snippets[t].Description,css:this.snippets[t].css}).appendTo(this.$("ul.snippets"));return this.$(".snippets li.snippet").eq(0).click(),this.attach(),this},clickSnippet:function(t){t.preventDefault();var i=e(t.currentTarget);this.$(".snippets li.snippet").removeClass("active"),e(this).addClass("active"),this.viewSnippet({name:i.html(),description:i.data("description"),css:i.data("css")})},viewSnippet:function(e){var t=this.$(".main .snippet-view");t.find(".snippet-title").html(e.name),t.find(".snippet-description").html(e.description),t.find(".snippet-code").html(e.css),this.currentSnippet=e},insertSnippet:function(){var e=this.editor.codeMirror,t=this.currentSnippet.css,i="";i=1===e.doc.lineCount()&&0===e.doc.getLine(e.doc.lastLine()).length?"":0===e.doc.getLine(e.doc.lastLine()).length?"\n":"\n\n",e.doc.setCursor(e.doc.lastLine(),e.doc.getLine(e.doc.lastLine()).length),e.doc.replaceSelection(i+t),this.hide()},attach:function(){this.$el.appendTo("body")},show:function(){this.$el.show()},hide:function(){this.$el.hide()}}),s.view.properties=Backbone.View.extend({tabTemplate:t.template('<li data-section="<%- id %>"><span class="fa fa-<%- icon %>"></span> <%- title %></li>'),sectionTemplate:t.template('<div class="section" data-section="<%- id %>"><table class="fields-table"><tbody></tbody></table></div>'),controllerTemplate:t.template('<tr><th scope="row"><%- title %></th><td></td></tr>'),propertyControllers:[],editor:null,css:"",parsed:{},activeSelector:"",editorExpandedBefore:!1,events:{"click .close":"hide","click .section-tabs li":"onTabClick","change .toolbar select":"onToolbarSelectChange"},initialize:function(e){this.parser=window.css,this.editor=e.editor},render:function(){this.$(".section-tabs").empty(),this.$(".sections").empty(),this.$(".toolbar select").off(),this.propertyControllers=[];var r=i.propertyControllers;for(var o in r){var n=(e(this.tabTemplate({id:o,icon:r[o].icon,title:r[o].title})).appendTo(this.$(".section-tabs")),e(this.sectionTemplate({id:o})).appendTo(this.$(".sections")));if(!t.isEmpty(r[o].controllers))for(var l=0;l<r[o].controllers.length;l++){var a,c=e(this.controllerTemplate({title:r[o].controllers[l].title})).appendTo(n.find("tbody")),p=r[o].controllers[l];a=void 0===s.view.properties.controllers[p.type]?new s.view.propertyController({el:c.find("td"),propertiesView:this,args:void 0===p.args?{}:p.args}):new s.view.properties.controllers[p.type]({el:c.find("td"),propertiesView:this,args:void 0===p.args?{}:p.args}),this.propertyControllers.push(a),a.render()}}this.$(".section-tabs li").eq(0).click()},onTabClick:function(t){var i=e(t.currentTarget),s=this.$('.sections .section[data-section="'+i.data("section")+'"]');this.$(".sections .section").not(s).hide().removeClass("active"),s.show().addClass("active"),this.$(".section-tabs li").not(i).removeClass("active"),i.addClass("active")},onToolbarSelectChange:function(t){this.setActiveSelector(e(t.currentTarget).find(":selected").data("selector"))},setRuleValue:function(e,i){if(void 0!==this.activeSelector&&void 0!==this.activeSelector.declarations){for(var s=this.activeSelector.declarations,r=!0,o=!1,n=0;n<s.length;n++)if(s[n].property===e){r=!1;var l=s[n];l.value!==i&&(l.value=i,o=!0),t.isEmpty(l.value)&&s.splice(s.indexOf(l));break}r&&!t.isEmpty(i)&&(s.push({property:e,value:i,type:"declaration"}),o=!0),o&&this.updateMainEditor(!1)}},addImport:function(e){var i=t.filter(this.parsed.stylesheet.rules,function(e){return"import"===e.type});t.any(i,function(t){return t.import===e.import})||(this.parsed.stylesheet.rules.unshift(e),this.updateMainEditor(!1))},findImport:function(e){return t.find(this.parsed.stylesheet.rules,function(t){return"import"===t.type&&t.import.indexOf(e)>-1})},updateImport:function(e,t){var i=this.findImport(e);i.import!==t.import&&(i.import=t.import,this.updateMainEditor(!1))},removeImport:function(e){var i=t.findIndex(this.parsed.stylesheet.rules,function(t){return"import"===t.type&&t.import.indexOf(e)>-1});i>-1&&this.parsed.stylesheet.rules.splice(i,1)},getRuleValue:function(e){if(void 0===this.activeSelector||void 0===this.activeSelector.declarations)return"";for(var t=this.activeSelector.declarations,i=0;i<t.length;i++)if(t[i].property===e)return t[i].value;return""},updateMainEditor:function(e){this.editor.codeMirror.setValue(this.parser.stringify(this.parsed))},show:function(){this.editorExpandedBefore=this.editor.isExpanded(),this.editor.setExpand(!0),this.$el.show().animate({left:0},"fast")},hide:function(){this.editor.setExpand(this.editorExpandedBefore),this.$el.animate({left:-338},"fast",function(){e(this).hide()}),this.updateMainEditor(!0)},isVisible:function(){return this.$el.is(":visible")},loadCSS:function(i,s){this.css=i,this.parsed=this.parser.parse(i,{silent:!0});for(var r=this.parsed.stylesheet.rules,o=this.$(".toolbar select").empty(),n=0;n<r.length;n++){var l=r[n];if(t.contains(["rule","media"],l.type))if("media"===l.type)for(var a=0;a<l.rules.length;a++){var c="@media "+l.media,p=l.rules[a];"rule"==p.type&&o.append(e("<option>").html(c+": "+p.selectors.join(",")).attr("val",c+": "+p.selectors.join(",")).data("selector",p))}else o.append(e("<option>").html(l.selectors.join(",")).attr("val",l.selectors.join(",")).data("selector",l))}void 0===s&&(s=o.find("option").eq(0).attr("val")),t.isEmpty(s)||o.val(s).change()},setActiveSelector:function(e){this.activeSelector=e;for(var t=0;t<this.propertyControllers.length;t++)this.propertyControllers[t].refreshFromRule()},addSelector:function(e){var t=this.$(".toolbar select");t.val(e),t.val()===e?t.change():(this.editor.addEmptySelector(e),this.loadCSS(this.editor.codeMirror.getValue().trim(),e)),t.addClass("highlighted"),setTimeout(function(){t.removeClass("highlighted")},2e3)}}),s.view.propertyController=Backbone.View.extend({template:t.template('<input type="text" value="" class="socss-property-controller-input"/>'),activeRule:null,args:null,propertiesView:null,events:{"change .socss-property-controller-input":"onChange","keyup input.socss-property-controller-input":"onChange"},initialize:function(e){this.args=e.args,this.propertiesView=e.propertiesView,this.events=t.extend(s.view.propertyController.prototype.events,this.events),this.delegateEvents(this.events),this.on("set_value",this.updateRule,this),this.on("change",this.updateRule,this)},render:function(){this.$el.append(e(this.template({}))),this.field=this.$("input.socss-property-controller-input")},onChange:function(){this.trigger("change",this.field.val())},updateRule:function(){this.propertiesView.setRuleValue(this.args.property,this.getValue())},refreshFromRule:function(){var e=this.propertiesView.getRuleValue(this.args.property);this.setValue(e,{silent:!0})},getValue:function(){return this.field.val()},setValue:function(e,i){i=t.extend({silent:!1},i),this.field.val(e),i.silent||this.trigger("set_value",e)},reset:function(e){e=t.extend({silent:!1},e),this.setValue("",e)}}),s.view.properties.controllers={},s.view.properties.controllers.color=s.view.propertyController.extend({render:function(){s.view.propertyController.prototype.render.apply(this,arguments),this.field.minicolors({})},onChange:function(){this.trigger("change",this.field.minicolors("value"))},getValue:function(){return this.field.minicolors("value").trim()},setValue:function(e,i){i=t.extend({silent:!1},i),this.field.minicolors("value",e),i.silent||this.trigger("set_value",e)}}),s.view.properties.controllers.select=s.view.propertyController.extend({template:t.template('<select class="socss-property-controller-input"></select>'),events:{"click .select-tab":"onSelect"},render:function(){this.$el.append(e(this.template({}))),this.field=this.$("select"),this.field.append(e('<option value=""></option>').html(""));for(var t in this.args.options)this.field.append(e("<option></option>").attr("value",t).html(this.args.options[t]));void 0!==this.args.option_icons&&this.setupVisualSelect()},setupVisualSelect:function(){this.field.hide();var t=e('<div class="select-tabs"></div>').appendTo(this.$el);e('<div class="select-tab" data-value=""><span class="fa fa-circle-o"></span></div>').appendTo(t);for(var i in this.args.option_icons)e('<div class="select-tab"></div>').appendTo(t).append(e('<span class="fa"></span>').addClass("fa-"+this.args.option_icons[i])).attr("data-value",i);t.find(".select-tab").css("width",100/t.find(">div").length+"%")},onSelect:function(t){this.$(".select-tab").removeClass("active");var i=e(t.currentTarget);i.addClass("active"),this.field.val(i.data("value")).trigger("change")},setValue:function(e,i){i=t.extend({silent:!1},i),this.field.val(e),this.$(".select-tabs .select-tab").removeClass("active").filter('[data-value="'+e+'"]').addClass("active"),i.silent||this.trigger("set_value",e)}}),s.view.properties.controllers.image=s.view.propertyController.extend({template:t.template('<input type="text" value="" /> <span class="select socss-button"><span class="fa fa-upload"></span></span>'),events:{"click .select":"openMedia"},render:function(){this.media=wp.media({title:i.loc.select_image,library:{type:"image"},button:{text:i.loc.select,close:!1}}),this.$el.append(e(this.template({select:i.loc.select}))),this.field=this.$el.find("input"),this.media.on("select",function(){var e=this.media.state().get("selection").first().attributes,t=this.args.value.replace("{{url}}",e.url);this.field.val(t).change(),this.media.close()}.bind(this))},openMedia:function(){this.media.open()}}),s.view.properties.controllers.measurement=s.view.propertyController.extend({wrapperClass:"socss-field-measurement",events:{"click .toggle-dropdown":"toggleUnitDropdown","click .dropdown li":"onSelectUnit","keydown .socss-field-input":"onInputKeyPress","keyup .socss-field-input":"onInputKeyUp"},render:function(){s.view.propertyController.prototype.render.apply(this,arguments),this.setupMeasurementField()},setValue:function(e,i){i=t.extend({silent:!1},i),this.field.val(e).trigger("measurement_refresh"),i.silent||this.trigger("set_value",e)},units:["px","%","em","cm","mm","in","pt","pc","ex","ch","rem","vw","vh","vmin","vmax"],parseUnits:function(e){var t=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},i=this.units.map(t),s=new RegExp("([0-9\\.\\-]+)("+i.join("|")+")?","i"),r=s.exec(e);return null===r?{value:"",unit:""}:{value:r[1],unit:void 0===r[2]?"":r[2]}},setupMeasurementField:function(){this.field.hide(),this.$el.addClass(this.wrapperClass).data("unit","px");var t=e('<input type="text" class="socss-field-input"/>').appendTo(this.$el);e('<span class="toggle-dropdown dashicons dashicons-arrow-down"></span>').appendTo(this.$el);for(var i=e('<ul class="dropdown"></ul>').appendTo(this.$el),s=e('<span class="units"></span>').html("px").appendTo(this.$el),r=0;r<this.units.length;r++){var o=e("<li></li>").html(this.units[r]).data("unit",this.units[r]);"px"===this.units[r]&&o.addClass("active"),i.append(o)}this.field.on("measurement_refresh",function(){var i=this.parseUnits(this.field.val());t.val(i.value);var r=""===i.unit?"px":i.unit;this.$el.data("unit",r),s.html(r);var o=e('<span class="socss-hidden-placeholder"></span>').css({"font-size":"14px"}).html(i.value).appendTo("body"),n=o.width();n=Math.min(n,63),o.remove(),s.css("left",n+12)}.bind(this));var n=e('<div class="socss-diw"></div>').appendTo(this.$el),l=e('<div class="dec-button socss-button"><span class="fa fa-minus"></span></div>').appendTo(n),a=e('<div class="inc-button socss-button"><span class="fa fa-plus"></span></div>').appendTo(n);this.setupStepButton(l),this.setupStepButton(a)},updateValue:function(){var e=this.$(".socss-field-input"),t=this.parseUnits(e.val());""!==t.unit&&t.unit!==this.$el.data("unit")&&(e.val(t.value),this.setUnit(t.unit)),""===t.value?this.field.val(""):this.field.val(t.value+this.$el.data("unit")),this.field.trigger("change")},setUnit:function(e){this.$(".units").html(e),this.$el.data("unit",e),this.$(".socss-field-input").trigger("keydown")},toggleUnitDropdown:function(){this.$(".dropdown").toggle()},onSelectUnit:function(t){this.toggleUnitDropdown(),this.setUnit(e(t.currentTarget).data("unit")),this.updateValue()},onInputKeyUp:function(e){this.onInputKeyPress(e),this.updateValue()},onInputKeyPress:function(t){var i=this.$(".socss-field-input"),s="";"keydown"===t.type&&(t.keyCode>=48&&t.keyCode<=57?s=String.fromCharCode(t.keyCode):189===t.keyCode?s="-":190===t.keyCode&&(s="."));var r=e('<span class="socss-hidden-placeholder"></span>').css({"font-size":"14px"}).html(i.val()+s).appendTo("body"),o=r.width();o=Math.min(o,63),r.remove(),this.$(".units").css("left",o+12)},stepValue:function(e){var t=Number.parseInt(this.parseUnits(this.field.val()).value);Number.isNaN(t)&&(t=0);var i=t+e;this.$(".socss-field-input").val(i),this.updateValue(),this.field.trigger("measurement_refresh")},setupStepButton:function(e){var t,i,s=e.is(".dec-button")?-1:1;e.mousedown(function(){this.stepValue(s),i=setTimeout(function(){t=setInterval(function(){this.stepValue(s)}.bind(this),50)}.bind(this),500)}.bind(this)).on("mouseup mouseout",function(){i&&(clearTimeout(i),i=null),t&&(clearInterval(t),t=null)})}}),s.view.properties.controllers.number=s.view.propertyController.extend({initialize:function(e){s.view.propertyController.prototype.initialize.apply(this,arguments),this.args=t.extend({change:null,default:0,increment:1,decrement:-1,max:null,min:null},e.args)},render:function(){s.view.propertyController.prototype.render.apply(this,arguments),this.setupNumberField()},setupNumberField:function(){this.$el.addClass("socss-field-number");var t=e('<div class="socss-diw"></div>').appendTo(this.$el),i=e('<div class="dec-button socss-button"><span class="fa fa-minus"></span></div>').appendTo(t),s=e('<div class="inc-button socss-button"><span class="fa fa-plus"></span></div>').appendTo(t);return this.setupStepButton(i),this.setupStepButton(s),this},stepValue:function(e){var t=Number.parseFloat(this.field.val());Number.isNaN(t)&&(t=this.args.default);var i=t+e;i=Math.round(100*i)/100,null!==this.args.max&&(i=Math.min(this.args.max,i)),null!==this.args.min&&(i=Math.max(this.args.min,i)),this.field.val(i),this.field.trigger("change")},setupStepButton:function(e){var t,i,s=e.is(".dec-button")?this.args.decrement:this.args.increment;e.mousedown(function(){this.stepValue(s),i=setTimeout(function(){t=setInterval(function(){this.stepValue(s)}.bind(this),50)}.bind(this),500)}.bind(this)).on("mouseup mouseout",function(){i&&(clearTimeout(i),i=null),t&&(clearInterval(t),t=null)})}}),s.view.properties.controllers.sides=s.view.propertyController.extend({template:t.template(e("#template-sides-field").html().trim()),controllers:[],events:{"click .select-tab":"onTabClick"},render:function(){s.view.propertyController.prototype.render.apply(this,arguments),this.args.hasAll||(this.$(".select-tab").eq(0).remove(),this.$(".select-tab").css("width","25%")),this.$(".select-tab").each(function(i,r){for(var o=e(r).data("direction"),n=e('<li class="side">').appendTo(this.$(".sides")).hide(),l=0;l<this.args.controllers.length;l++){var a=this.args.controllers[l];if(s.view.properties.controllers[a.type],!0){var c="";c="all"===o?a.args.propertyAll:a.args.property.replace("{dir}",o);var p=t.extend({},a.args,{property:c}),d=new s.view.properties.controllers[a.type]({el:e("<div>").appendTo(n),propertiesView:this.propertiesView,args:p});d.render(),this.propertiesView.propertyControllers.push(d)}}}.bind(this)),this.$(".select-tab").eq(0).click()},onTabClick:function(t){var i=this.$(".select-tab");i.removeClass("active");var s=e(t.currentTarget);s.addClass("active");var r=this.$(".sides .side");r.hide(),r.eq(i.index(s)).show()}}),s.view.properties.controllers.font_select=s.view.propertyController.extend({template:t.template(e("#template-webfont-teaser").html().trim())}),s.view.RevisionsListView=Backbone.View.extend({initialize:function(){this.listenTo(this.model,"change:selectedPost",this.updateRevisionsList.bind(this))},updateRevisionsList:function(){e.get(i.getRevisionsListAjaxUrl,{postId:this.model.get("selectedPost").get("postId")},function(e){this.$(".custom-revisions-list").html(e)}.bind(this))}})}(jQuery,_,socssOptions),jQuery(function(e){var t=window.socss,i=new t.model.CSSEditorModel({customCssPosts:socssOptions.customCssPosts}),s=new t.view.editor({el:e("#so-custom-css-form").get(0),model:i,openVisualEditor:socssOptions.openVisualEditor});s.setSnippets(socssOptions.snippets);var r=new t.view.RevisionsListView({el:e("#so-custom-css-revisions"),model:i});e("#so-custom-css-getting-started a.hide").click(function(t){t.preventDefault(),e("#so-custom-css-getting-started").slideUp(),e.get(e(this).attr("href"))}),window.socss.mainEditor=s,window.socss.revisionsList=r,e(t).trigger("initialized")});
1
+ !function(e,t,i){var s={model:{},collection:{},view:{},fn:{}};window.socss=s,s.model.CustomCssModel=Backbone.Model.extend({defaults:{postId:null,postTitle:null,css:null},urlRoot:i.postCssUrlRoot,url:function(){return this.urlRoot+"&postId="+this.get("postId")}}),s.model.CustomCssCollection=Backbone.Collection.extend({model:s.model.CustomCssModel,modelId:function(e){return e.postId}}),s.model.CSSEditorModel=Backbone.Model.extend({defaults:{customCssPosts:null}}),s.view.toolbar=Backbone.View.extend({button:t.template('<li><a href="#<%= action %>" class="toolbar-button socss-button"><%= text %></a></li>'),events:{"click .socss-button":"triggerEvent"},triggerEvent:function(t){t.preventDefault();var i=e(t.currentTarget);i.blur();var s=i.attr("href").replace("#","");this.$el.trigger("click_"+s)},addButton:function(t,i){return e(this.button({text:t,action:i})).appendTo(this.$(".toolbar-function-buttons .toolbar-buttons"))}}),s.view.editor=Backbone.View.extend({codeMirror:null,snippets:null,toolbar:null,visualProperties:null,inspector:null,cssSelectors:[],initValue:null,events:{"click_expand .custom-css-toolbar":"toggleExpand","click_visual .custom-css-toolbar":"showVisualEditor",submit:"onSubmit"},initialize:function(e){this.listenTo(this.model,"change:selectedPost",this.getSelectedPostCss),this.getSelectedPostCss().then(function(){e.openVisualEditor&&this.showVisualEditor()}.bind(this))},getSelectedPostCss:function(){var t,i=this.model.get("selectedPost");return t=i&&!i.has("css")?i.fetch():(new e.Deferred).resolve(),t.then(this.render.bind(this))},render:function(){var t=this.model.get("selectedPost");return t&&!t.has("css")?this:(this.codeMirror||this.setupEditor(),this.toolbar||(this.toolbar=new s.view.toolbar({el:this.$(".custom-css-toolbar"),model:this.model}),this.toolbar.render()),this.visualProperties||(this.visualProperties=new s.view.properties({editor:this,el:e("#so-custom-css-properties")}),this.visualProperties.render()),this.preview||(this.preview=new s.view.preview({editor:this,model:this.model,el:this.$(".custom-css-preview"),initURL:i.homeURL}),this.preview.render()),t&&(this.codeMirror.setValue(t.get("css")),this.codeMirror.clearHistory()),this)},setupEditor:function(){this.registerCodeMirrorAutocomplete();var t=this.$("textarea.css-editor");this.initValue=t.val();var s=this.initValue.match(/\n/gm),r=(s&&s.length,this.initValue);t.val(r),this.codeMirror=CodeMirror.fromTextArea(t.get(0),{tabSize:2,lineNumbers:!0,mode:"css",theme:"neat",inputStyle:"contenteditable",gutters:["CodeMirror-lint-markers"],lint:!0,search:!0,dialog:!0,annotateScrollbar:!0,extraKeys:{"Ctrl-F":"findPersistent","Alt-G":"jumpToLine"}}),this.codeMirror.on("change",function(e,t){var i=this.model.get("selectedPost");i&&i.get("css")!==e.getValue().trim()&&i.set("css",e.getValue().trim())}.bind(this)),e(window).on("beforeunload",function(){if(this.codeMirror.getValue().trim()!==this.initValue)return i.loc.leave}.bind(this)),this.$el.find(".custom-css-container").css("overflow","visible"),this.scaleEditor(),e(window).on("resize",function(){this.scaleEditor()}.bind(this)),this.setupCodeMirrorExtensions()},onSubmit:function(){this.initValue=this.codeMirror.getValue().trim()},registerCodeMirrorAutocomplete:function(){var e={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};CodeMirror.registerHelper("hint","css",function(t){function i(e){for(var t in e)a&&0!==t.lastIndexOf(a,0)||p.push(t)}var s=t.getCursor(),r=t.getTokenAt(s),o=CodeMirror.innerMode(t.getMode(),r.state);if("css"===o.mode.name){if("keyword"===r.type&&0==="!important".indexOf(r.string))return{list:["!important"],from:CodeMirror.Pos(s.line,r.start),to:CodeMirror.Pos(s.line,r.end)};var n=r.start,l=s.ch,a=r.string.slice(0,l-n);/[^\w$_-]/.test(a)&&(a="",n=l=s.ch);var c=CodeMirror.resolveMode("text/css"),p=[],d=o.state.state;if("top"===d){for(var h=t.getLine(s.line).trim(),u=this.cssSelectors,v=0;v<u.length;v++)-1!==u[v].selector.indexOf(h)&&p.push(u[v].selector);if(p.length)return{list:p,from:CodeMirror.Pos(s.line,0),to:CodeMirror.Pos(s.line,l)}}else if("pseudo"===d||"variable-3"===r.type?i(e):"block"===d||"maybeprop"===d?i(c.propertyKeywords):"prop"===d||"parens"===d||"at"===d||"params"===d?(i(c.valueKeywords),i(c.colorKeywords)):"media"!==d&&"media_parens"!==d||(i(c.mediaTypes),i(c.mediaFeatures)),p.length)return{list:p,from:CodeMirror.Pos(s.line,n),to:CodeMirror.Pos(s.line,l)}}}.bind(this))},setupCodeMirrorExtensions:function(){this.codeMirror.on("cursorActivity",function(e){var t=e.getCursor(),i=e.getTokenAt(t);CodeMirror.innerMode(e.getMode(),i.state);if("qualifier"===i.type||"tag"===i.type||"builtin"===i.type){var s=e.getLine(t.line),r=s.substring(0,i.end);this.preview.highlight(r)}else this.preview.clearHighlight()}.bind(this)),this.codeMirror.on("keyup",function(e,t){(t.keyCode>=65&&t.keyCode<=90||189===t.keyCode&&!t.shiftKey||190===t.keyCode&&!t.shiftKey||51===t.keyCode&&t.shiftKey||189===t.keyCode&&t.shiftKey)&&e.showHint({completeSingle:!1})})},scaleEditor:function(){var t=e(window).outerHeight();if(this.$el.hasClass("expanded"))this.$el.find(".CodeMirror-scroll").css("max-height",""),this.codeMirror.setSize("100%",t-this.$(".custom-css-toolbar").outerHeight());else{var i=e("#so-custom-css-form"),s=e("#wpadminbar").outerHeight(!0)+e("#siteorigin-custom-css").find("> h2").outerHeight(!0)+i.find("> .custom-css-toolbar").outerHeight(!0)+i.find("> p.description").outerHeight(!0)+i.find("> p.submit").outerHeight(!0)+parseFloat(e("#wpbody-content").css("padding-bottom"));this.$el.find(".CodeMirror-scroll").css("max-height",t-s),this.codeMirror.setSize("100%","auto")}},isExpanded:function(){return this.$el.hasClass("expanded")},toggleExpand:function(){this.$el.toggleClass("expanded"),this.scaleEditor()},setExpand:function(e){e?this.$el.addClass("expanded"):this.$el.removeClass("expanded"),this.scaleEditor()},showVisualEditor:function(){this.visualProperties.loadCSS(this.codeMirror.getValue().trim()),this.visualProperties.show()},setSnippets:function(e){t.isEmpty(e)||(this.snippets=new s.view.snippets({snippets:e}),this.snippets.editor=this,this.snippets.render(),this.toolbar.addButton("Snippets","snippets"),this.toolbar.on("click_snippets",function(){this.snippets.show()}.bind(this)))},addCode:function(e){var t=this.codeMirror,i="";i=1===t.doc.lineCount()&&0===t.doc.getLine(t.doc.lastLine()).length?"":0===t.doc.getLine(t.doc.lastLine()).length?"\n":"\n\n",t.doc.setCursor(t.doc.lastLine(),t.doc.getLine(t.doc.lastLine()).length),t.doc.replaceSelection(i+e)},addEmptySelector:function(e){this.addCode(e+" {\n \n}")},setInspector:function(e){this.inspector=e,this.cssSelectors=e.pageSelectors,e.on("click_selector",function(e){this.visualProperties.isVisible()?this.visualProperties.addSelector(e):this.addEmptySelector(e)}.bind(this)),e.on("click_property",function(e){this.visualProperties.isVisible()||this.codeMirror.replaceSelection(e+";\n ")}.bind(this)),e.on("set_active_element",function(e,t){this.visualProperties.isVisible()&&t.length&&this.visualProperties.addSelector(t[0].selector)}.bind(this))}}),s.view.preview=Backbone.View.extend({template:t.template(e("#template-preview-window").html()),editor:null,originalUri:null,currentUri:null,events:{"load #preview-iframe":"initPreview","mouseleave #preview-iframe":"clearHighlight",'keydown #preview-navigator input[type="text"]':"reloadPreview"},initialize:function(e){this.editor=e.editor,this.listenTo(this.model,"change:selectedPost",this.render.bind(this)),this.originalUri=new URI(e.initURL),this.currentUri=new URI(e.initURL),this.editor.codeMirror.on("change",function(e,t){this.updatePreviewCss()}.bind(this))},render:function(){var e=this.model.get("selectedPost");if(e&&!e.has("postUrl"))return e.fetch().then(this.render.bind(this)),this;this.$el.html(this.template()),e&&(this.currentUri=new URI(e.get("postUrl"))),this.currentUri.removeQuery("so_css_preview",1),this.$("#preview-navigator input").val(this.currentUri.toString()),this.currentUri.addQuery("so_css_preview",1),this.$("#preview-iframe").attr("src",this.currentUri.toString())},initPreview:function(){var t=this.$("#preview-iframe");this.currentUri=new URI(t.contents().get(0).location.href),this.currentUri.removeQuery("so_css_preview"),this.$("#preview-navigator input").val(this.currentUri.toString()),this.currentUri.addQuery("so_css_preview",1),t.contents().find("a").each(function(){var t=e(this).attr("href");if(void 0===t)return!0;var i=-1===t.indexOf("?")?"?":"&";e(this).attr("href",t+i+"so_css_preview=1")}),this.updatePreviewCss()},reloadPreview:function(e){var t=this.$('#preview-navigator input[type="text"]');if(13===e.keyCode){e.preventDefault();var i=new URI(t.val());this.originalUri.host()!==i.host()||this.originalUri.protocol()!==i.protocol()?(t.blur(),alert(t.data("invalid-uri")),t.focus()):(i.addQuery("so_css_preview",1),this.$("#preview-iframe").attr("src",i.toString()))}},updatePreviewCss:function(){var e=this.$("#preview-iframe");if(0!==e.length){var t=e.contents().find("head");0===t.find("style.siteorigin-custom-css").length&&t.append('<style class="siteorigin-custom-css" type="text/css"></style>');var i=t.find("style.siteorigin-custom-css"),s=this.editor.codeMirror.getValue().trim();i.html(s)}},highlight:function(e){try{this.editor.inspector.hl.highlight(e)}catch(e){console.log("No inspector to highlight with")}},clearHighlight:function(){try{this.editor.inspector.hl.clear()}catch(e){console.log("No inspector to highlight with")}}}),s.view.snippets=Backbone.View.extend({template:t.template(e("#template-snippet-browser").html()),snippet:t.template('<li class="snippet"><%- name %></li>'),className:"css-editor-snippet-browser",snippets:null,editor:null,events:{"click .close":"hide","click .buttons .insert-snippet":"insertSnippet","click .snippet":"clickSnippet"},currentSnippet:null,initialize:function(e){this.snippets=e.snippets},render:function(){this.$el.html(this.template());for(var t=0;t<this.snippets.length;t++)e(this.snippet({name:this.snippets[t].Name})).data({description:this.snippets[t].Description,css:this.snippets[t].css}).appendTo(this.$("ul.snippets"));return this.$(".snippets li.snippet").eq(0).click(),this.attach(),this},clickSnippet:function(t){t.preventDefault();var i=e(t.currentTarget);this.$(".snippets li.snippet").removeClass("active"),e(this).addClass("active"),this.viewSnippet({name:i.html(),description:i.data("description"),css:i.data("css")})},viewSnippet:function(e){var t=this.$(".main .snippet-view");t.find(".snippet-title").html(e.name),t.find(".snippet-description").html(e.description),t.find(".snippet-code").html(e.css),this.currentSnippet=e},insertSnippet:function(){var e=this.editor.codeMirror,t=this.currentSnippet.css,i="";i=1===e.doc.lineCount()&&0===e.doc.getLine(e.doc.lastLine()).length?"":0===e.doc.getLine(e.doc.lastLine()).length?"\n":"\n\n",e.doc.setCursor(e.doc.lastLine(),e.doc.getLine(e.doc.lastLine()).length),e.doc.replaceSelection(i+t),this.hide()},attach:function(){this.$el.appendTo("body")},show:function(){this.$el.show()},hide:function(){this.$el.hide()}}),s.view.properties=Backbone.View.extend({tabTemplate:t.template('<li data-section="<%- id %>"><span class="fa fa-<%- icon %>"></span> <%- title %></li>'),sectionTemplate:t.template('<div class="section" data-section="<%- id %>"><table class="fields-table"><tbody></tbody></table></div>'),controllerTemplate:t.template('<tr><th scope="row"><%- title %></th><td></td></tr>'),propertyControllers:[],editor:null,css:"",parsed:{},activeSelector:"",editorExpandedBefore:!1,events:{"click .close":"hide","click .section-tabs li":"onTabClick","change .toolbar select":"onToolbarSelectChange"},initialize:function(e){this.parser=window.css,this.editor=e.editor},render:function(){this.$(".section-tabs").empty(),this.$(".sections").empty(),this.$(".toolbar select").off(),this.propertyControllers=[];var r=i.propertyControllers;for(var o in r){var n=(e(this.tabTemplate({id:o,icon:r[o].icon,title:r[o].title})).appendTo(this.$(".section-tabs")),e(this.sectionTemplate({id:o})).appendTo(this.$(".sections")));if(!t.isEmpty(r[o].controllers))for(var l=0;l<r[o].controllers.length;l++){var a,c=e(this.controllerTemplate({title:r[o].controllers[l].title})).appendTo(n.find("tbody")),p=r[o].controllers[l];a=void 0===s.view.properties.controllers[p.type]?new s.view.propertyController({el:c.find("td"),propertiesView:this,args:void 0===p.args?{}:p.args}):new s.view.properties.controllers[p.type]({el:c.find("td"),propertiesView:this,args:void 0===p.args?{}:p.args}),this.propertyControllers.push(a),a.render()}}this.$(".section-tabs li").eq(0).click()},onTabClick:function(t){var i=e(t.currentTarget),s=this.$('.sections .section[data-section="'+i.data("section")+'"]');this.$(".sections .section").not(s).hide().removeClass("active"),s.show().addClass("active"),this.$(".section-tabs li").not(i).removeClass("active"),i.addClass("active")},onToolbarSelectChange:function(t){this.setActiveSelector(e(t.currentTarget).find(":selected").data("selector"))},setRuleValue:function(e,i){if(void 0!==this.activeSelector&&void 0!==this.activeSelector.declarations){for(var s=this.activeSelector.declarations,r=!0,o=!1,n=0;n<s.length;n++)if(s[n].property===e){r=!1;var l=s[n];l.value!==i&&(l.value=i,o=!0),t.isEmpty(l.value)&&s.splice(s.indexOf(l));break}r&&!t.isEmpty(i)&&(s.push({property:e,value:i,type:"declaration"}),o=!0),o&&this.updateMainEditor(!1)}},addImport:function(e){var i=t.filter(this.parsed.stylesheet.rules,function(e){return"import"===e.type});t.any(i,function(t){return t.import===e.import})||(this.parsed.stylesheet.rules.unshift(e),this.updateMainEditor(!1))},findImport:function(e){return t.find(this.parsed.stylesheet.rules,function(t){return"import"===t.type&&t.import.indexOf(e)>-1})},updateImport:function(e,t){var i=this.findImport(e);i.import!==t.import&&(i.import=t.import,this.updateMainEditor(!1))},removeImport:function(e){var i=t.findIndex(this.parsed.stylesheet.rules,function(t){return"import"===t.type&&t.import.indexOf(e)>-1});i>-1&&this.parsed.stylesheet.rules.splice(i,1)},getRuleValue:function(e){if(void 0===this.activeSelector||void 0===this.activeSelector.declarations)return"";for(var t=this.activeSelector.declarations,i=0;i<t.length;i++)if(t[i].property===e)return t[i].value;return""},updateMainEditor:function(e){this.editor.codeMirror.setValue(this.parser.stringify(this.parsed))},show:function(){this.editorExpandedBefore=this.editor.isExpanded(),this.editor.setExpand(!0),this.$el.show().animate({left:0},"fast")},hide:function(){this.editor.setExpand(this.editorExpandedBefore),this.$el.animate({left:-338},"fast",function(){e(this).hide()}),this.updateMainEditor(!0)},isVisible:function(){return this.$el.is(":visible")},loadCSS:function(i,s){this.css=i,this.parsed=this.parser.parse(i,{silent:!0});for(var r=this.parsed.stylesheet.rules,o=this.$(".toolbar select").empty(),n=0;n<r.length;n++){var l=r[n];if(t.contains(["rule","media"],l.type))if("media"===l.type)for(var a=0;a<l.rules.length;a++){var c="@media "+l.media,p=l.rules[a];"rule"==p.type&&o.append(e("<option>").html(c+": "+p.selectors.join(",")).attr("val",c+": "+p.selectors.join(",")).data("selector",p))}else o.append(e("<option>").html(l.selectors.join(",")).attr("val",l.selectors.join(",")).data("selector",l))}void 0===s&&(s=o.find("option").eq(0).attr("val")),t.isEmpty(s)||o.val(s).change()},setActiveSelector:function(e){this.activeSelector=e;for(var t=0;t<this.propertyControllers.length;t++)this.propertyControllers[t].refreshFromRule()},addSelector:function(e){var t=this.$(".toolbar select");t.val(e),t.val()===e?t.change():(this.editor.addEmptySelector(e),this.loadCSS(this.editor.codeMirror.getValue().trim(),e)),t.addClass("highlighted"),setTimeout(function(){t.removeClass("highlighted")},2e3)}}),s.view.propertyController=Backbone.View.extend({template:t.template('<input type="text" value="" class="socss-property-controller-input"/>'),activeRule:null,args:null,propertiesView:null,events:{"change .socss-property-controller-input":"onChange","keyup input.socss-property-controller-input":"onChange"},initialize:function(e){this.args=e.args,this.propertiesView=e.propertiesView,this.events=t.extend(s.view.propertyController.prototype.events,this.events),this.delegateEvents(this.events),this.on("set_value",this.updateRule,this),this.on("change",this.updateRule,this)},render:function(){this.$el.append(e(this.template({}))),this.field=this.$("input.socss-property-controller-input")},onChange:function(){this.trigger("change",this.field.val())},updateRule:function(){this.propertiesView.setRuleValue(this.args.property,this.getValue())},refreshFromRule:function(){var e=this.propertiesView.getRuleValue(this.args.property);this.setValue(e,{silent:!0})},getValue:function(){return this.field.val()},setValue:function(e,i){i=t.extend({silent:!1},i),this.field.val(e),i.silent||this.trigger("set_value",e)},reset:function(e){e=t.extend({silent:!1},e),this.setValue("",e)}}),s.view.properties.controllers={},s.view.properties.controllers.color=s.view.propertyController.extend({render:function(){s.view.propertyController.prototype.render.apply(this,arguments),this.field.minicolors({})},onChange:function(){this.trigger("change",this.field.minicolors("value"))},getValue:function(){return this.field.minicolors("value").trim()},setValue:function(e,i){i=t.extend({silent:!1},i),this.field.minicolors("value",e),i.silent||this.trigger("set_value",e)}}),s.view.properties.controllers.select=s.view.propertyController.extend({template:t.template('<select class="socss-property-controller-input"></select>'),events:{"click .select-tab":"onSelect"},render:function(){this.$el.append(e(this.template({}))),this.field=this.$("select"),this.field.append(e('<option value=""></option>').html(""));for(var t in this.args.options)this.field.append(e("<option></option>").attr("value",t).html(this.args.options[t]));void 0!==this.args.option_icons&&this.setupVisualSelect()},setupVisualSelect:function(){this.field.hide();var t=e('<div class="select-tabs"></div>').appendTo(this.$el);e('<div class="select-tab" data-value=""><span class="fa fa-circle-o"></span></div>').appendTo(t);for(var i in this.args.option_icons)e('<div class="select-tab"></div>').appendTo(t).append(e('<span class="fa"></span>').addClass("fa-"+this.args.option_icons[i])).attr("data-value",i);t.find(".select-tab").css("width",100/t.find(">div").length+"%")},onSelect:function(t){this.$(".select-tab").removeClass("active");var i=e(t.currentTarget);i.addClass("active"),this.field.val(i.data("value")).trigger("change")},setValue:function(e,i){i=t.extend({silent:!1},i),this.field.val(e),this.$(".select-tabs .select-tab").removeClass("active").filter('[data-value="'+e+'"]').addClass("active"),i.silent||this.trigger("set_value",e)}}),s.view.properties.controllers.image=s.view.propertyController.extend({template:t.template('<input type="text" value="" /> <span class="select socss-button"><span class="fa fa-upload"></span></span>'),events:{"click .select":"openMedia"},render:function(){this.media=wp.media({title:i.loc.select_image,library:{type:"image"},button:{text:i.loc.select,close:!1}}),this.$el.append(e(this.template({select:i.loc.select}))),this.field=this.$el.find("input"),this.media.on("select",function(){var e=this.media.state().get("selection").first().attributes,t=this.args.value.replace("{{url}}",e.url);this.field.val(t).change(),this.media.close()}.bind(this))},openMedia:function(){this.media.open()}}),s.view.properties.controllers.measurement=s.view.propertyController.extend({wrapperClass:"socss-field-measurement",events:{"click .toggle-dropdown":"toggleUnitDropdown","click .dropdown li":"onSelectUnit","keydown .socss-field-input":"onInputKeyPress","keyup .socss-field-input":"onInputKeyUp"},render:function(){s.view.propertyController.prototype.render.apply(this,arguments),this.setupMeasurementField()},setValue:function(e,i){i=t.extend({silent:!1},i),this.field.val(e).trigger("measurement_refresh"),i.silent||this.trigger("set_value",e)},units:["px","%","em","cm","mm","in","pt","pc","ex","ch","rem","vw","vh","vmin","vmax"],parseUnits:function(e){var t=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},i=this.units.map(t),s=new RegExp("([0-9\\.\\-]+)("+i.join("|")+")?","i"),r=s.exec(e);return null===r?{value:"",unit:""}:{value:r[1],unit:void 0===r[2]?"":r[2]}},setupMeasurementField:function(){this.field.hide(),this.$el.addClass(this.wrapperClass).data("unit","px");var t=e('<input type="text" class="socss-field-input"/>').appendTo(this.$el);e('<span class="toggle-dropdown dashicons dashicons-arrow-down"></span>').appendTo(this.$el);for(var i=e('<ul class="dropdown"></ul>').appendTo(this.$el),s=e('<span class="units"></span>').html("px").appendTo(this.$el),r=0;r<this.units.length;r++){var o=e("<li></li>").html(this.units[r]).data("unit",this.units[r]);"px"===this.units[r]&&o.addClass("active"),i.append(o)}this.field.on("measurement_refresh",function(){var i=this.parseUnits(this.field.val());t.val(i.value);var r=""===i.unit?"px":i.unit;this.$el.data("unit",r),s.html(r);var o=e('<span class="socss-hidden-placeholder"></span>').css({"font-size":"14px"}).html(i.value).appendTo("body"),n=o.width();n=Math.min(n,63),o.remove(),s.css("left",n+12)}.bind(this));var n=e('<div class="socss-diw"></div>').appendTo(this.$el),l=e('<div class="dec-button socss-button"><span class="fa fa-minus"></span></div>').appendTo(n),a=e('<div class="inc-button socss-button"><span class="fa fa-plus"></span></div>').appendTo(n);this.setupStepButton(l),this.setupStepButton(a)},updateValue:function(){var e=this.$(".socss-field-input"),t=this.parseUnits(e.val());""!==t.unit&&t.unit!==this.$el.data("unit")&&(e.val(t.value),this.setUnit(t.unit)),""===t.value?this.field.val(""):this.field.val(t.value+this.$el.data("unit")),this.field.trigger("change")},setUnit:function(e){this.$(".units").html(e),this.$el.data("unit",e),this.$(".socss-field-input").trigger("keydown")},toggleUnitDropdown:function(){this.$(".dropdown").toggle()},onSelectUnit:function(t){this.toggleUnitDropdown(),this.setUnit(e(t.currentTarget).data("unit")),this.updateValue()},onInputKeyUp:function(e){this.onInputKeyPress(e),this.updateValue()},onInputKeyPress:function(t){var i=this.$(".socss-field-input"),s="";"keydown"===t.type&&(t.keyCode>=48&&t.keyCode<=57?s=String.fromCharCode(t.keyCode):189===t.keyCode?s="-":190===t.keyCode&&(s="."));var r=e('<span class="socss-hidden-placeholder"></span>').css({"font-size":"14px"}).html(i.val()+s).appendTo("body"),o=r.width();o=Math.min(o,63),r.remove(),this.$(".units").css("left",o+12)},stepValue:function(e){var t=Number.parseInt(this.parseUnits(this.field.val()).value);Number.isNaN(t)&&(t=0);var i=t+e;this.$(".socss-field-input").val(i),this.updateValue(),this.field.trigger("measurement_refresh")},setupStepButton:function(e){var t,i,s=e.is(".dec-button")?-1:1;e.mousedown(function(){this.stepValue(s),i=setTimeout(function(){t=setInterval(function(){this.stepValue(s)}.bind(this),50)}.bind(this),500)}.bind(this)).on("mouseup mouseout",function(){i&&(clearTimeout(i),i=null),t&&(clearInterval(t),t=null)})}}),s.view.properties.controllers.number=s.view.propertyController.extend({initialize:function(e){s.view.propertyController.prototype.initialize.apply(this,arguments),this.args=t.extend({change:null,default:0,increment:1,decrement:-1,max:null,min:null},e.args)},render:function(){s.view.propertyController.prototype.render.apply(this,arguments),this.setupNumberField()},setupNumberField:function(){this.$el.addClass("socss-field-number");var t=e('<div class="socss-diw"></div>').appendTo(this.$el),i=e('<div class="dec-button socss-button"><span class="fa fa-minus"></span></div>').appendTo(t),s=e('<div class="inc-button socss-button"><span class="fa fa-plus"></span></div>').appendTo(t);return this.setupStepButton(i),this.setupStepButton(s),this},stepValue:function(e){var t=Number.parseFloat(this.field.val());Number.isNaN(t)&&(t=this.args.default);var i=t+e;i=Math.round(100*i)/100,null!==this.args.max&&(i=Math.min(this.args.max,i)),null!==this.args.min&&(i=Math.max(this.args.min,i)),this.field.val(i),this.field.trigger("change")},setupStepButton:function(e){var t,i,s=e.is(".dec-button")?this.args.decrement:this.args.increment;e.mousedown(function(){this.stepValue(s),i=setTimeout(function(){t=setInterval(function(){this.stepValue(s)}.bind(this),50)}.bind(this),500)}.bind(this)).on("mouseup mouseout",function(){i&&(clearTimeout(i),i=null),t&&(clearInterval(t),t=null)})}}),s.view.properties.controllers.sides=s.view.propertyController.extend({template:t.template(e("#template-sides-field").html().trim()),controllers:[],events:{"click .select-tab":"onTabClick"},render:function(){s.view.propertyController.prototype.render.apply(this,arguments),this.args.hasAll||(this.$(".select-tab").eq(0).remove(),this.$(".select-tab").css("width","25%")),this.$(".select-tab").each(function(i,r){for(var o=e(r).data("direction"),n=e('<li class="side">').appendTo(this.$(".sides")).hide(),l=0;l<this.args.controllers.length;l++){var a=this.args.controllers[l];if(s.view.properties.controllers[a.type],!0){var c="";c="all"===o?a.args.propertyAll:a.args.property.replace("{dir}",o);var p=t.extend({},a.args,{property:c}),d=new s.view.properties.controllers[a.type]({el:e("<div>").appendTo(n),propertiesView:this.propertiesView,args:p});d.render(),this.propertiesView.propertyControllers.push(d)}}}.bind(this)),this.$(".select-tab").eq(0).click()},onTabClick:function(t){var i=this.$(".select-tab");i.removeClass("active");var s=e(t.currentTarget);s.addClass("active");var r=this.$(".sides .side");r.hide(),r.eq(i.index(s)).show()}}),s.view.properties.controllers.font_select=s.view.propertyController.extend({template:t.template(e("#template-webfont-teaser").html().trim())})}(jQuery,_,socssOptions),jQuery(function(e){var t=window.socss,i=new t.model.CSSEditorModel({customCssPosts:socssOptions.customCssPosts}),s=new t.view.editor({el:e("#so-custom-css-form").get(0),model:i,openVisualEditor:socssOptions.openVisualEditor});s.setSnippets(socssOptions.snippets),e("#so-custom-css-getting-started a.hide").click(function(t){t.preventDefault(),e("#so-custom-css-getting-started").slideUp(),e.get(e(this).attr("href"))}),window.socss.mainEditor=s,e(t).trigger("initialized")});
lang/so-css.pot CHANGED
@@ -17,522 +17,526 @@ msgstr ""
17
  "X-Poedit-SearchPathExcluded-0: *.js\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
 
20
- #: tmp/inc/controller-config.php:5
21
  msgid "Text"
22
  msgstr ""
23
 
24
- #: tmp/inc/controller-config.php:9
25
  msgid "Text Color"
26
  msgstr ""
27
 
28
- #: tmp/inc/controller-config.php:16
29
  msgid "Font Size"
30
  msgstr ""
31
 
32
- #: tmp/inc/controller-config.php:24
33
  msgid "Line Height"
34
  msgstr ""
35
 
36
- #: tmp/inc/controller-config.php:32
37
  msgid "Font Weight"
38
  msgstr ""
39
 
40
- #: tmp/inc/controller-config.php:37, tmp/inc/controller-config.php:60, tmp/inc/controller-config.php:93, tmp/inc/controller-config.php:164
41
  msgid "Normal"
42
  msgstr ""
43
 
44
- #: tmp/inc/controller-config.php:38
45
  msgid "Bold"
46
  msgstr ""
47
 
48
- #: tmp/inc/controller-config.php:39
49
  msgid "Bolder"
50
  msgstr ""
51
 
52
- #: tmp/inc/controller-config.php:40
53
  msgid "Lighter"
54
  msgstr ""
55
 
56
- #: tmp/inc/controller-config.php:54
57
  msgid "Font Style"
58
  msgstr ""
59
 
60
- #: tmp/inc/controller-config.php:59, tmp/inc/controller-config.php:75, tmp/inc/controller-config.php:104, tmp/inc/controller-config.php:397, tmp/inc/controller-config.php:424, tmp/inc/controller-config.php:436
61
  msgid "None"
62
  msgstr ""
63
 
64
- #: tmp/inc/controller-config.php:61
65
  msgid "Italic"
66
  msgstr ""
67
 
68
- #: tmp/inc/controller-config.php:70
69
  msgid "Text Decoration"
70
  msgstr ""
71
 
72
- #: tmp/inc/controller-config.php:76
73
  msgid "Underline"
74
  msgstr ""
75
 
76
- #: tmp/inc/controller-config.php:77
77
  msgid "Overline"
78
  msgstr ""
79
 
80
- #: tmp/inc/controller-config.php:78
81
  msgid "Line Through"
82
  msgstr ""
83
 
84
- #: tmp/inc/controller-config.php:88
85
  msgid "Font Variant"
86
  msgstr ""
87
 
88
- #: tmp/inc/controller-config.php:94
89
  msgid "Small Caps"
90
  msgstr ""
91
 
92
- #: tmp/inc/controller-config.php:99
93
  msgid "Text Transform"
94
  msgstr ""
95
 
96
- #: tmp/inc/controller-config.php:105
97
  msgid "Capitalize"
98
  msgstr ""
99
 
100
- #: tmp/inc/controller-config.php:106
101
  msgid "Uppercase"
102
  msgstr ""
103
 
104
- #: tmp/inc/controller-config.php:107
105
  msgid "Lowercase"
106
  msgstr ""
107
 
108
- #: tmp/inc/controller-config.php:112
109
  msgid "Font Family"
110
  msgstr ""
111
 
112
- #: tmp/inc/controller-config.php:119
113
  msgid "Text Align"
114
  msgstr ""
115
 
116
- #: tmp/inc/controller-config.php:124, tmp/inc/controller-config.php:425, tmp/inc/controller-config.php:437
117
  msgid "Left"
118
  msgstr ""
119
 
120
- #: tmp/inc/controller-config.php:125, tmp/inc/controller-config.php:426, tmp/inc/controller-config.php:438
121
  msgid "Right"
122
  msgstr ""
123
 
124
- #: tmp/inc/controller-config.php:126
125
  msgid "Center"
126
  msgstr ""
127
 
128
- #: tmp/inc/controller-config.php:127
129
  msgid "Justify"
130
  msgstr ""
131
 
132
- #: tmp/inc/controller-config.php:138
133
  msgid "Text Indent"
134
  msgstr ""
135
 
136
- #: tmp/inc/controller-config.php:145
137
  msgid "Letter Spacing"
138
  msgstr ""
139
 
140
- #: tmp/inc/controller-config.php:152
141
  msgid "Word Spacing"
142
  msgstr ""
143
 
144
- #: tmp/inc/controller-config.php:159
145
  msgid "White Space"
146
  msgstr ""
147
 
148
- #: tmp/inc/controller-config.php:165
149
  msgid "Encountered"
150
  msgstr ""
151
 
152
- #: tmp/inc/controller-config.php:166
153
  msgid "Pre"
154
  msgstr ""
155
 
156
- #: tmp/inc/controller-config.php:167
157
  msgid "Pre Line"
158
  msgstr ""
159
 
160
- #: tmp/inc/controller-config.php:168
161
  msgid "Pre Wrap"
162
  msgstr ""
163
 
164
- #: tmp/inc/controller-config.php:173
165
  msgid "Text Shadow"
166
  msgstr ""
167
 
168
- #: tmp/inc/controller-config.php:185
169
  msgid "Decoration"
170
  msgstr ""
171
 
172
- #: tmp/inc/controller-config.php:189
173
  msgid "Background Color"
174
  msgstr ""
175
 
176
- #: tmp/inc/controller-config.php:196
177
  msgid "Background image"
178
  msgstr ""
179
 
180
- #: tmp/inc/controller-config.php:204
181
  msgid "Background Position"
182
  msgstr ""
183
 
184
- #: tmp/inc/controller-config.php:211
185
  msgid "Background Repeat"
186
  msgstr ""
187
 
188
- #: tmp/inc/controller-config.php:216
189
  msgid "repeat"
190
  msgstr ""
191
 
192
- #: tmp/inc/controller-config.php:217
193
  msgid "repeat-x"
194
  msgstr ""
195
 
196
- #: tmp/inc/controller-config.php:218
197
  msgid "repeat-y"
198
  msgstr ""
199
 
200
- #: tmp/inc/controller-config.php:219
201
  msgid "no-repeat"
202
  msgstr ""
203
 
204
- #: tmp/inc/controller-config.php:224
205
  msgid "Background Size"
206
  msgstr ""
207
 
208
- #: tmp/inc/controller-config.php:229
209
  msgid "auto"
210
  msgstr ""
211
 
212
- #: tmp/inc/controller-config.php:230
213
  msgid "length"
214
  msgstr ""
215
 
216
- #: tmp/inc/controller-config.php:231
217
  msgid "percentage"
218
  msgstr ""
219
 
220
- #: tmp/inc/controller-config.php:232
221
  msgid "cover"
222
  msgstr ""
223
 
224
- #: tmp/inc/controller-config.php:233
225
  msgid "contain"
226
  msgstr ""
227
 
228
- #: tmp/inc/controller-config.php:239
229
  msgid "Box Shadow"
230
  msgstr ""
231
 
232
- #: tmp/inc/controller-config.php:247
233
  msgid "Opacity"
234
  msgstr ""
235
 
236
- #: tmp/inc/controller-config.php:260
237
  msgid "Borders"
238
  msgstr ""
239
 
240
- #: tmp/inc/controller-config.php:308
241
  msgid "Layout"
242
  msgstr ""
243
 
244
- #: tmp/inc/controller-config.php:312
245
  msgid "Margin"
246
  msgstr ""
247
 
248
- #: tmp/inc/controller-config.php:329
249
  msgid "Padding"
250
  msgstr ""
251
 
252
- #: tmp/inc/controller-config.php:346
253
  msgid "Position"
254
  msgstr ""
255
 
256
- #: tmp/inc/controller-config.php:351
257
  msgid "Absolute"
258
  msgstr ""
259
 
260
- #: tmp/inc/controller-config.php:352
261
  msgid "Fixed"
262
  msgstr ""
263
 
264
- #: tmp/inc/controller-config.php:353
265
  msgid "Relative"
266
  msgstr ""
267
 
268
- #: tmp/inc/controller-config.php:354
269
  msgid "Static"
270
  msgstr ""
271
 
272
- #: tmp/inc/controller-config.php:355
273
  msgid "Inherit"
274
  msgstr ""
275
 
276
- #: tmp/inc/controller-config.php:360
277
  msgid "Absolute Position"
278
  msgstr ""
279
 
280
- #: tmp/inc/controller-config.php:376
281
  msgid "Width"
282
  msgstr ""
283
 
284
- #: tmp/inc/controller-config.php:384
285
  msgid "Height"
286
  msgstr ""
287
 
288
- #: tmp/inc/controller-config.php:392
289
  msgid "Display"
290
  msgstr ""
291
 
292
- #: tmp/inc/controller-config.php:398
293
  msgid "Inline"
294
  msgstr ""
295
 
296
- #: tmp/inc/controller-config.php:399
297
  msgid "Block"
298
  msgstr ""
299
 
300
- #: tmp/inc/controller-config.php:400
301
  msgid "Flex"
302
  msgstr ""
303
 
304
- #: tmp/inc/controller-config.php:401
305
  msgid "Inline Block"
306
  msgstr ""
307
 
308
- #: tmp/inc/controller-config.php:402
309
  msgid "Inline Flex"
310
  msgstr ""
311
 
312
- #: tmp/inc/controller-config.php:403
313
  msgid "Inline Table"
314
  msgstr ""
315
 
316
- #: tmp/inc/controller-config.php:404
317
  msgid "List Item"
318
  msgstr ""
319
 
320
- #: tmp/inc/controller-config.php:405
321
  msgid "Run In"
322
  msgstr ""
323
 
324
- #: tmp/inc/controller-config.php:406
325
  msgid "Table"
326
  msgstr ""
327
 
328
- #: tmp/inc/controller-config.php:407
329
  msgid "Table Caption"
330
  msgstr ""
331
 
332
- #: tmp/inc/controller-config.php:408
333
  msgid "Table Column Group"
334
  msgstr ""
335
 
336
- #: tmp/inc/controller-config.php:409
337
  msgid "Table Header Group"
338
  msgstr ""
339
 
340
- #: tmp/inc/controller-config.php:410
341
  msgid "Table Footer Group"
342
  msgstr ""
343
 
344
- #: tmp/inc/controller-config.php:411
345
  msgid "Table Row Group"
346
  msgstr ""
347
 
348
- #: tmp/inc/controller-config.php:412
349
  msgid "Table Cell"
350
  msgstr ""
351
 
352
- #: tmp/inc/controller-config.php:413
353
  msgid "Table Column"
354
  msgstr ""
355
 
356
- #: tmp/inc/controller-config.php:414
357
  msgid "Table Row"
358
  msgstr ""
359
 
360
- #: tmp/inc/controller-config.php:419
361
  msgid "Float"
362
  msgstr ""
363
 
364
- #: tmp/inc/controller-config.php:431
365
  msgid "Clear"
366
  msgstr ""
367
 
368
- #: tmp/inc/controller-config.php:439
369
  msgid "Both"
370
  msgstr ""
371
 
372
- #: tmp/inc/controller-config.php:444
373
  msgid "Visibility"
374
  msgstr ""
375
 
376
- #: tmp/inc/controller-config.php:449, tmp/inc/controller-config.php:461, tmp/inc/controller-config.php:474, tmp/inc/controller-config.php:487
377
  msgid "Visible"
378
  msgstr ""
379
 
380
- #: tmp/inc/controller-config.php:450, tmp/inc/controller-config.php:462, tmp/inc/controller-config.php:475, tmp/inc/controller-config.php:488
381
  msgid "Hidden"
382
  msgstr ""
383
 
384
- #: tmp/inc/controller-config.php:451
385
  msgid "Collapse"
386
  msgstr ""
387
 
388
- #: tmp/inc/controller-config.php:456
389
  msgid "Overflow"
390
  msgstr ""
391
 
392
- #: tmp/inc/controller-config.php:463, tmp/inc/controller-config.php:476, tmp/inc/controller-config.php:489
393
  msgid "Scroll"
394
  msgstr ""
395
 
396
- #: tmp/inc/controller-config.php:464, tmp/inc/controller-config.php:477, tmp/inc/controller-config.php:490
397
  msgid "Auto"
398
  msgstr ""
399
 
400
- #: tmp/inc/controller-config.php:469
401
  msgid "Overflow X"
402
  msgstr ""
403
 
404
- #: tmp/inc/controller-config.php:482
405
  msgid "Overflow Y"
406
  msgstr ""
407
 
408
- #: tmp/inc/controller-config.php:495
409
  msgid "Z-Index"
410
  msgstr ""
411
 
412
- #: tmp/so-css.php:521, tmp/so-css.php:521, tmp/so-css.php:583
413
  msgid "Custom CSS"
414
  msgstr ""
415
 
416
- #: tmp/so-css.php:587
417
  msgid "SiteOrigin CSS adds any custom CSS you enter here into your site's header. "
418
  msgstr ""
419
 
420
- #: tmp/so-css.php:589
421
  msgid "These changes will persist across updates so it's best to make all your changes here. "
422
  msgstr ""
423
 
424
- #: tmp/so-css.php:759
425
- msgid "Changes apply to <%= themeName %> and its child themes"
426
- msgstr ""
427
-
428
- #: tmp/so-css.php:761
429
- msgid "Changes apply to the post <%= postTitle %> when the current theme is <%= themeName %> or its child themes"
430
- msgstr ""
431
-
432
- #: tmp/so-css.php:781
433
  msgid "Unchanged"
434
  msgstr ""
435
 
436
- #: tmp/so-css.php:783
437
  msgid "Select"
438
  msgstr ""
439
 
440
- #: tmp/so-css.php:785
441
  msgid "Select Image"
442
  msgstr ""
443
 
444
- #: tmp/so-css.php:787
445
  msgid "Are you sure you want to leave without saving?"
446
  msgstr ""
447
 
448
- #: tmp/so-css.php:855
449
  msgid "CSS Editor"
450
  msgstr ""
451
 
452
- #: tmp/so-css.php:857
453
  msgid "Support"
454
  msgstr ""
455
 
456
- #: tmp/so-css.php:1109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  msgid "%d chars"
458
  msgstr ""
459
 
460
- #: tmp/so-css.php:1109
461
  msgid "Latest"
462
  msgstr ""
463
 
464
- #: tmp/so-css.php:1345
465
- msgid "Changes apply to %s and its child themes"
466
  msgstr ""
467
 
468
- #: tmp/tpl/inspector-templates.php:4
469
  msgid "Navigate To: "
470
  msgstr ""
471
 
472
- #: tmp/tpl/js-templates.php:15
473
  msgid "CSS Snippets"
474
  msgstr ""
475
 
476
- #: tmp/tpl/js-templates.php:27
477
  msgid "Search Snippets"
478
  msgstr ""
479
 
480
- #: tmp/tpl/js-templates.php:51
481
  msgid "Insert Snippet"
482
  msgstr ""
483
 
484
- #: tmp/tpl/js-templates.php:101
485
  msgid "Invalid URI. Please make sure you're using a URL from the same site."
486
  msgstr ""
487
 
488
- #: tmp/tpl/js-templates.php:121
489
  msgid "Get a %sGoogle Font%s selector."
490
  msgstr ""
491
 
492
- #: tmp/tpl/page.php:35
493
- msgid "SiteOrigin CSS"
494
- msgstr ""
495
-
496
- #: tmp/tpl/page.php:45
497
  msgid "Site design updated."
498
  msgstr ""
499
 
500
- #: tmp/tpl/page.php:55
501
  msgid "Editing revision dated %s. Click %sRevert to this revision%s to keep using it."
502
  msgstr ""
503
 
504
- #: tmp/tpl/page.php:73
505
  msgid "Get The Full Experience"
506
  msgstr ""
507
 
508
- #: tmp/tpl/page.php:77
509
  msgid "%sSiteOrigin Premium%s adds a <strong>Google Web Font</strong> selector to SiteOrigin CSS so you can easily change any font."
510
  msgstr ""
511
 
512
- #: tmp/tpl/page.php:93
513
  msgid "Getting Started Video"
514
  msgstr ""
515
 
516
- #: tmp/tpl/page.php:95
517
  msgid "Dismiss"
518
  msgstr ""
519
 
520
- #: tmp/tpl/page.php:113
521
  msgid "CSS Revisions"
522
  msgstr ""
523
 
524
- #: tmp/tpl/page.php:117
525
  msgid "Are you sure you want to load this revision?"
526
  msgstr ""
527
-
528
- #: tmp/tpl/page.php:201
529
- msgid "!empty$current_revision?__Revert to this revision"
530
- msgstr ""
531
-
532
- #: tmp/tpl/page.php:201
533
- msgid "Revert to this revision"
534
- msgstr ""
535
-
536
- #: tmp/tpl/page.php:201
537
- msgid "Save CSS"
538
- msgstr ""
17
  "X-Poedit-SearchPathExcluded-0: *.js\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
 
20
+ #: tmp/dist/so-css/inc/controller-config.php:5, tmp/inc/controller-config.php:5
21
  msgid "Text"
22
  msgstr ""
23
 
24
+ #: tmp/dist/so-css/inc/controller-config.php:9, tmp/inc/controller-config.php:9
25
  msgid "Text Color"
26
  msgstr ""
27
 
28
+ #: tmp/dist/so-css/inc/controller-config.php:16, tmp/inc/controller-config.php:16
29
  msgid "Font Size"
30
  msgstr ""
31
 
32
+ #: tmp/dist/so-css/inc/controller-config.php:24, tmp/inc/controller-config.php:24
33
  msgid "Line Height"
34
  msgstr ""
35
 
36
+ #: tmp/dist/so-css/inc/controller-config.php:32, tmp/inc/controller-config.php:32
37
  msgid "Font Weight"
38
  msgstr ""
39
 
40
+ #: tmp/dist/so-css/inc/controller-config.php:37, tmp/dist/so-css/inc/controller-config.php:60, tmp/dist/so-css/inc/controller-config.php:93, tmp/dist/so-css/inc/controller-config.php:164, tmp/inc/controller-config.php:37, tmp/inc/controller-config.php:60, tmp/inc/controller-config.php:93, tmp/inc/controller-config.php:164
41
  msgid "Normal"
42
  msgstr ""
43
 
44
+ #: tmp/dist/so-css/inc/controller-config.php:38, tmp/inc/controller-config.php:38
45
  msgid "Bold"
46
  msgstr ""
47
 
48
+ #: tmp/dist/so-css/inc/controller-config.php:39, tmp/inc/controller-config.php:39
49
  msgid "Bolder"
50
  msgstr ""
51
 
52
+ #: tmp/dist/so-css/inc/controller-config.php:40, tmp/inc/controller-config.php:40
53
  msgid "Lighter"
54
  msgstr ""
55
 
56
+ #: tmp/dist/so-css/inc/controller-config.php:54, tmp/inc/controller-config.php:54
57
  msgid "Font Style"
58
  msgstr ""
59
 
60
+ #: tmp/dist/so-css/inc/controller-config.php:59, tmp/dist/so-css/inc/controller-config.php:75, tmp/dist/so-css/inc/controller-config.php:104, tmp/dist/so-css/inc/controller-config.php:397, tmp/dist/so-css/inc/controller-config.php:424, tmp/dist/so-css/inc/controller-config.php:436, tmp/inc/controller-config.php:59, tmp/inc/controller-config.php:75, tmp/inc/controller-config.php:104, tmp/inc/controller-config.php:397, tmp/inc/controller-config.php:424, tmp/inc/controller-config.php:436
61
  msgid "None"
62
  msgstr ""
63
 
64
+ #: tmp/dist/so-css/inc/controller-config.php:61, tmp/inc/controller-config.php:61
65
  msgid "Italic"
66
  msgstr ""
67
 
68
+ #: tmp/dist/so-css/inc/controller-config.php:70, tmp/inc/controller-config.php:70
69
  msgid "Text Decoration"
70
  msgstr ""
71
 
72
+ #: tmp/dist/so-css/inc/controller-config.php:76, tmp/inc/controller-config.php:76
73
  msgid "Underline"
74
  msgstr ""
75
 
76
+ #: tmp/dist/so-css/inc/controller-config.php:77, tmp/inc/controller-config.php:77
77
  msgid "Overline"
78
  msgstr ""
79
 
80
+ #: tmp/dist/so-css/inc/controller-config.php:78, tmp/inc/controller-config.php:78
81
  msgid "Line Through"
82
  msgstr ""
83
 
84
+ #: tmp/dist/so-css/inc/controller-config.php:88, tmp/inc/controller-config.php:88
85
  msgid "Font Variant"
86
  msgstr ""
87
 
88
+ #: tmp/dist/so-css/inc/controller-config.php:94, tmp/inc/controller-config.php:94
89
  msgid "Small Caps"
90
  msgstr ""
91
 
92
+ #: tmp/dist/so-css/inc/controller-config.php:99, tmp/inc/controller-config.php:99
93
  msgid "Text Transform"
94
  msgstr ""
95
 
96
+ #: tmp/dist/so-css/inc/controller-config.php:105, tmp/inc/controller-config.php:105
97
  msgid "Capitalize"
98
  msgstr ""
99
 
100
+ #: tmp/dist/so-css/inc/controller-config.php:106, tmp/inc/controller-config.php:106
101
  msgid "Uppercase"
102
  msgstr ""
103
 
104
+ #: tmp/dist/so-css/inc/controller-config.php:107, tmp/inc/controller-config.php:107
105
  msgid "Lowercase"
106
  msgstr ""
107
 
108
+ #: tmp/dist/so-css/inc/controller-config.php:112, tmp/inc/controller-config.php:112
109
  msgid "Font Family"
110
  msgstr ""
111
 
112
+ #: tmp/dist/so-css/inc/controller-config.php:119, tmp/inc/controller-config.php:119
113
  msgid "Text Align"
114
  msgstr ""
115
 
116
+ #: tmp/dist/so-css/inc/controller-config.php:124, tmp/dist/so-css/inc/controller-config.php:425, tmp/dist/so-css/inc/controller-config.php:437, tmp/inc/controller-config.php:124, tmp/inc/controller-config.php:425, tmp/inc/controller-config.php:437
117
  msgid "Left"
118
  msgstr ""
119
 
120
+ #: tmp/dist/so-css/inc/controller-config.php:125, tmp/dist/so-css/inc/controller-config.php:426, tmp/dist/so-css/inc/controller-config.php:438, tmp/inc/controller-config.php:125, tmp/inc/controller-config.php:426, tmp/inc/controller-config.php:438
121
  msgid "Right"
122
  msgstr ""
123
 
124
+ #: tmp/dist/so-css/inc/controller-config.php:126, tmp/inc/controller-config.php:126
125
  msgid "Center"
126
  msgstr ""
127
 
128
+ #: tmp/dist/so-css/inc/controller-config.php:127, tmp/inc/controller-config.php:127
129
  msgid "Justify"
130
  msgstr ""
131
 
132
+ #: tmp/dist/so-css/inc/controller-config.php:138, tmp/inc/controller-config.php:138
133
  msgid "Text Indent"
134
  msgstr ""
135
 
136
+ #: tmp/dist/so-css/inc/controller-config.php:145, tmp/inc/controller-config.php:145
137
  msgid "Letter Spacing"
138
  msgstr ""
139
 
140
+ #: tmp/dist/so-css/inc/controller-config.php:152, tmp/inc/controller-config.php:152
141
  msgid "Word Spacing"
142
  msgstr ""
143
 
144
+ #: tmp/dist/so-css/inc/controller-config.php:159, tmp/inc/controller-config.php:159
145
  msgid "White Space"
146
  msgstr ""
147
 
148
+ #: tmp/dist/so-css/inc/controller-config.php:165, tmp/inc/controller-config.php:165
149
  msgid "Encountered"
150
  msgstr ""
151
 
152
+ #: tmp/dist/so-css/inc/controller-config.php:166, tmp/inc/controller-config.php:166
153
  msgid "Pre"
154
  msgstr ""
155
 
156
+ #: tmp/dist/so-css/inc/controller-config.php:167, tmp/inc/controller-config.php:167
157
  msgid "Pre Line"
158
  msgstr ""
159
 
160
+ #: tmp/dist/so-css/inc/controller-config.php:168, tmp/inc/controller-config.php:168
161
  msgid "Pre Wrap"
162
  msgstr ""
163
 
164
+ #: tmp/dist/so-css/inc/controller-config.php:173, tmp/inc/controller-config.php:173
165
  msgid "Text Shadow"
166
  msgstr ""
167
 
168
+ #: tmp/dist/so-css/inc/controller-config.php:185, tmp/inc/controller-config.php:185
169
  msgid "Decoration"
170
  msgstr ""
171
 
172
+ #: tmp/dist/so-css/inc/controller-config.php:189, tmp/inc/controller-config.php:189
173
  msgid "Background Color"
174
  msgstr ""
175
 
176
+ #: tmp/dist/so-css/inc/controller-config.php:196, tmp/inc/controller-config.php:196
177
  msgid "Background image"
178
  msgstr ""
179
 
180
+ #: tmp/dist/so-css/inc/controller-config.php:204, tmp/inc/controller-config.php:204
181
  msgid "Background Position"
182
  msgstr ""
183
 
184
+ #: tmp/dist/so-css/inc/controller-config.php:211, tmp/inc/controller-config.php:211
185
  msgid "Background Repeat"
186
  msgstr ""
187
 
188
+ #: tmp/dist/so-css/inc/controller-config.php:216, tmp/inc/controller-config.php:216
189
  msgid "repeat"
190
  msgstr ""
191
 
192
+ #: tmp/dist/so-css/inc/controller-config.php:217, tmp/inc/controller-config.php:217
193
  msgid "repeat-x"
194
  msgstr ""
195
 
196
+ #: tmp/dist/so-css/inc/controller-config.php:218, tmp/inc/controller-config.php:218
197
  msgid "repeat-y"
198
  msgstr ""
199
 
200
+ #: tmp/dist/so-css/inc/controller-config.php:219, tmp/inc/controller-config.php:219
201
  msgid "no-repeat"
202
  msgstr ""
203
 
204
+ #: tmp/dist/so-css/inc/controller-config.php:224, tmp/inc/controller-config.php:224
205
  msgid "Background Size"
206
  msgstr ""
207
 
208
+ #: tmp/dist/so-css/inc/controller-config.php:229, tmp/inc/controller-config.php:229
209
  msgid "auto"
210
  msgstr ""
211
 
212
+ #: tmp/dist/so-css/inc/controller-config.php:230, tmp/inc/controller-config.php:230
213
  msgid "length"
214
  msgstr ""
215
 
216
+ #: tmp/dist/so-css/inc/controller-config.php:231, tmp/inc/controller-config.php:231
217
  msgid "percentage"
218
  msgstr ""
219
 
220
+ #: tmp/dist/so-css/inc/controller-config.php:232, tmp/inc/controller-config.php:232
221
  msgid "cover"
222
  msgstr ""
223
 
224
+ #: tmp/dist/so-css/inc/controller-config.php:233, tmp/inc/controller-config.php:233
225
  msgid "contain"
226
  msgstr ""
227
 
228
+ #: tmp/dist/so-css/inc/controller-config.php:239, tmp/inc/controller-config.php:239
229
  msgid "Box Shadow"
230
  msgstr ""
231
 
232
+ #: tmp/dist/so-css/inc/controller-config.php:247, tmp/inc/controller-config.php:247
233
  msgid "Opacity"
234
  msgstr ""
235
 
236
+ #: tmp/dist/so-css/inc/controller-config.php:260, tmp/inc/controller-config.php:260
237
  msgid "Borders"
238
  msgstr ""
239
 
240
+ #: tmp/dist/so-css/inc/controller-config.php:308, tmp/inc/controller-config.php:308
241
  msgid "Layout"
242
  msgstr ""
243
 
244
+ #: tmp/dist/so-css/inc/controller-config.php:312, tmp/inc/controller-config.php:312
245
  msgid "Margin"
246
  msgstr ""
247
 
248
+ #: tmp/dist/so-css/inc/controller-config.php:329, tmp/inc/controller-config.php:329
249
  msgid "Padding"
250
  msgstr ""
251
 
252
+ #: tmp/dist/so-css/inc/controller-config.php:346, tmp/inc/controller-config.php:346
253
  msgid "Position"
254
  msgstr ""
255
 
256
+ #: tmp/dist/so-css/inc/controller-config.php:351, tmp/inc/controller-config.php:351
257
  msgid "Absolute"
258
  msgstr ""
259
 
260
+ #: tmp/dist/so-css/inc/controller-config.php:352, tmp/inc/controller-config.php:352
261
  msgid "Fixed"
262
  msgstr ""
263
 
264
+ #: tmp/dist/so-css/inc/controller-config.php:353, tmp/inc/controller-config.php:353
265
  msgid "Relative"
266
  msgstr ""
267
 
268
+ #: tmp/dist/so-css/inc/controller-config.php:354, tmp/inc/controller-config.php:354
269
  msgid "Static"
270
  msgstr ""
271
 
272
+ #: tmp/dist/so-css/inc/controller-config.php:355, tmp/inc/controller-config.php:355
273
  msgid "Inherit"
274
  msgstr ""
275
 
276
+ #: tmp/dist/so-css/inc/controller-config.php:360, tmp/inc/controller-config.php:360
277
  msgid "Absolute Position"
278
  msgstr ""
279
 
280
+ #: tmp/dist/so-css/inc/controller-config.php:376, tmp/inc/controller-config.php:376
281
  msgid "Width"
282
  msgstr ""
283
 
284
+ #: tmp/dist/so-css/inc/controller-config.php:384, tmp/inc/controller-config.php:384
285
  msgid "Height"
286
  msgstr ""
287
 
288
+ #: tmp/dist/so-css/inc/controller-config.php:392, tmp/inc/controller-config.php:392
289
  msgid "Display"
290
  msgstr ""
291
 
292
+ #: tmp/dist/so-css/inc/controller-config.php:398, tmp/inc/controller-config.php:398
293
  msgid "Inline"
294
  msgstr ""
295
 
296
+ #: tmp/dist/so-css/inc/controller-config.php:399, tmp/inc/controller-config.php:399
297
  msgid "Block"
298
  msgstr ""
299
 
300
+ #: tmp/dist/so-css/inc/controller-config.php:400, tmp/inc/controller-config.php:400
301
  msgid "Flex"
302
  msgstr ""
303
 
304
+ #: tmp/dist/so-css/inc/controller-config.php:401, tmp/inc/controller-config.php:401
305
  msgid "Inline Block"
306
  msgstr ""
307
 
308
+ #: tmp/dist/so-css/inc/controller-config.php:402, tmp/inc/controller-config.php:402
309
  msgid "Inline Flex"
310
  msgstr ""
311
 
312
+ #: tmp/dist/so-css/inc/controller-config.php:403, tmp/inc/controller-config.php:403
313
  msgid "Inline Table"
314
  msgstr ""
315
 
316
+ #: tmp/dist/so-css/inc/controller-config.php:404, tmp/inc/controller-config.php:404
317
  msgid "List Item"
318
  msgstr ""
319
 
320
+ #: tmp/dist/so-css/inc/controller-config.php:405, tmp/inc/controller-config.php:405
321
  msgid "Run In"
322
  msgstr ""
323
 
324
+ #: tmp/dist/so-css/inc/controller-config.php:406, tmp/inc/controller-config.php:406
325
  msgid "Table"
326
  msgstr ""
327
 
328
+ #: tmp/dist/so-css/inc/controller-config.php:407, tmp/inc/controller-config.php:407
329
  msgid "Table Caption"
330
  msgstr ""
331
 
332
+ #: tmp/dist/so-css/inc/controller-config.php:408, tmp/inc/controller-config.php:408
333
  msgid "Table Column Group"
334
  msgstr ""
335
 
336
+ #: tmp/dist/so-css/inc/controller-config.php:409, tmp/inc/controller-config.php:409
337
  msgid "Table Header Group"
338
  msgstr ""
339
 
340
+ #: tmp/dist/so-css/inc/controller-config.php:410, tmp/inc/controller-config.php:410
341
  msgid "Table Footer Group"
342
  msgstr ""
343
 
344
+ #: tmp/dist/so-css/inc/controller-config.php:411, tmp/inc/controller-config.php:411
345
  msgid "Table Row Group"
346
  msgstr ""
347
 
348
+ #: tmp/dist/so-css/inc/controller-config.php:412, tmp/inc/controller-config.php:412
349
  msgid "Table Cell"
350
  msgstr ""
351
 
352
+ #: tmp/dist/so-css/inc/controller-config.php:413, tmp/inc/controller-config.php:413
353
  msgid "Table Column"
354
  msgstr ""
355
 
356
+ #: tmp/dist/so-css/inc/controller-config.php:414, tmp/inc/controller-config.php:414
357
  msgid "Table Row"
358
  msgstr ""
359
 
360
+ #: tmp/dist/so-css/inc/controller-config.php:419, tmp/inc/controller-config.php:419
361
  msgid "Float"
362
  msgstr ""
363
 
364
+ #: tmp/dist/so-css/inc/controller-config.php:431, tmp/inc/controller-config.php:431
365
  msgid "Clear"
366
  msgstr ""
367
 
368
+ #: tmp/dist/so-css/inc/controller-config.php:439, tmp/inc/controller-config.php:439
369
  msgid "Both"
370
  msgstr ""
371
 
372
+ #: tmp/dist/so-css/inc/controller-config.php:444, tmp/inc/controller-config.php:444
373
  msgid "Visibility"
374
  msgstr ""
375
 
376
+ #: tmp/dist/so-css/inc/controller-config.php:449, tmp/dist/so-css/inc/controller-config.php:461, tmp/dist/so-css/inc/controller-config.php:474, tmp/dist/so-css/inc/controller-config.php:487, tmp/inc/controller-config.php:449, tmp/inc/controller-config.php:461, tmp/inc/controller-config.php:474, tmp/inc/controller-config.php:487
377
  msgid "Visible"
378
  msgstr ""
379
 
380
+ #: tmp/dist/so-css/inc/controller-config.php:450, tmp/dist/so-css/inc/controller-config.php:462, tmp/dist/so-css/inc/controller-config.php:475, tmp/dist/so-css/inc/controller-config.php:488, tmp/inc/controller-config.php:450, tmp/inc/controller-config.php:462, tmp/inc/controller-config.php:475, tmp/inc/controller-config.php:488
381
  msgid "Hidden"
382
  msgstr ""
383
 
384
+ #: tmp/dist/so-css/inc/controller-config.php:451, tmp/inc/controller-config.php:451
385
  msgid "Collapse"
386
  msgstr ""
387
 
388
+ #: tmp/dist/so-css/inc/controller-config.php:456, tmp/inc/controller-config.php:456
389
  msgid "Overflow"
390
  msgstr ""
391
 
392
+ #: tmp/dist/so-css/inc/controller-config.php:463, tmp/dist/so-css/inc/controller-config.php:476, tmp/dist/so-css/inc/controller-config.php:489, tmp/inc/controller-config.php:463, tmp/inc/controller-config.php:476, tmp/inc/controller-config.php:489
393
  msgid "Scroll"
394
  msgstr ""
395
 
396
+ #: tmp/dist/so-css/inc/controller-config.php:464, tmp/dist/so-css/inc/controller-config.php:477, tmp/dist/so-css/inc/controller-config.php:490, tmp/inc/controller-config.php:464, tmp/inc/controller-config.php:477, tmp/inc/controller-config.php:490
397
  msgid "Auto"
398
  msgstr ""
399
 
400
+ #: tmp/dist/so-css/inc/controller-config.php:469, tmp/inc/controller-config.php:469
401
  msgid "Overflow X"
402
  msgstr ""
403
 
404
+ #: tmp/dist/so-css/inc/controller-config.php:482, tmp/inc/controller-config.php:482
405
  msgid "Overflow Y"
406
  msgstr ""
407
 
408
+ #: tmp/dist/so-css/inc/controller-config.php:495, tmp/inc/controller-config.php:495
409
  msgid "Z-Index"
410
  msgstr ""
411
 
412
+ #: tmp/dist/so-css/so-css.php:521, tmp/dist/so-css/so-css.php:521, tmp/dist/so-css/so-css.php:583, tmp/so-css.php:525, tmp/so-css.php:525, tmp/so-css.php:587
413
  msgid "Custom CSS"
414
  msgstr ""
415
 
416
+ #: tmp/dist/so-css/so-css.php:587, tmp/so-css.php:591
417
  msgid "SiteOrigin CSS adds any custom CSS you enter here into your site's header. "
418
  msgstr ""
419
 
420
+ #: tmp/dist/so-css/so-css.php:589, tmp/so-css.php:593
421
  msgid "These changes will persist across updates so it's best to make all your changes here. "
422
  msgstr ""
423
 
424
+ #: tmp/dist/so-css/so-css.php:767, tmp/so-css.php:771
 
 
 
 
 
 
 
 
425
  msgid "Unchanged"
426
  msgstr ""
427
 
428
+ #: tmp/dist/so-css/so-css.php:769, tmp/so-css.php:773
429
  msgid "Select"
430
  msgstr ""
431
 
432
+ #: tmp/dist/so-css/so-css.php:771, tmp/so-css.php:775
433
  msgid "Select Image"
434
  msgstr ""
435
 
436
+ #: tmp/dist/so-css/so-css.php:773, tmp/so-css.php:777
437
  msgid "Are you sure you want to leave without saving?"
438
  msgstr ""
439
 
440
+ #: tmp/dist/so-css/so-css.php:841, tmp/so-css.php:845
441
  msgid "CSS Editor"
442
  msgstr ""
443
 
444
+ #: tmp/dist/so-css/so-css.php:843, tmp/so-css.php:847
445
  msgid "Support"
446
  msgstr ""
447
 
448
+ #: tmp/dist/so-css/so-css.php:865, tmp/so-css.php:869
449
+ msgid "SiteOrigin CSS"
450
+ msgstr ""
451
+
452
+ #: tmp/dist/so-css/so-css.php:871, tmp/so-css.php:875
453
+ msgid "Changes apply to %s and its child themes"
454
+ msgstr ""
455
+
456
+ #: tmp/dist/so-css/so-css.php:873, tmp/so-css.php:877
457
+ msgid "Save CSS"
458
+ msgstr ""
459
+
460
+ #: tmp/dist/so-css/so-css.php:887, tmp/so-css.php:891
461
+ msgid "Editing CSS for: %s"
462
+ msgstr ""
463
+
464
+ #: tmp/dist/so-css/so-css.php:897, tmp/so-css.php:901
465
+ msgid "Changes apply to the %s %s when the current theme is %s or its child themes"
466
+ msgstr ""
467
+
468
+ #: tmp/dist/so-css/so-css.php:911, tmp/so-css.php:915
469
+ msgid "Save %s CSS"
470
+ msgstr ""
471
+
472
+ #: tmp/dist/so-css/so-css.php:937, tmp/so-css.php:941
473
+ msgid "Revert to this revision"
474
+ msgstr ""
475
+
476
+ #: tmp/dist/so-css/so-css.php:1155, tmp/so-css.php:1159
477
  msgid "%d chars"
478
  msgstr ""
479
 
480
+ #: tmp/dist/so-css/so-css.php:1155, tmp/so-css.php:1159
481
  msgid "Latest"
482
  msgstr ""
483
 
484
+ #: tmp/dist/so-css/so-css.php:1167, tmp/so-css.php:1171
485
+ msgid "No revisions yet."
486
  msgstr ""
487
 
488
+ #: tmp/dist/so-css/tpl/inspector-templates.php:4, tmp/tpl/inspector-templates.php:4
489
  msgid "Navigate To: "
490
  msgstr ""
491
 
492
+ #: tmp/dist/so-css/tpl/js-templates.php:15, tmp/tpl/js-templates.php:15
493
  msgid "CSS Snippets"
494
  msgstr ""
495
 
496
+ #: tmp/dist/so-css/tpl/js-templates.php:27, tmp/tpl/js-templates.php:27
497
  msgid "Search Snippets"
498
  msgstr ""
499
 
500
+ #: tmp/dist/so-css/tpl/js-templates.php:51, tmp/tpl/js-templates.php:51
501
  msgid "Insert Snippet"
502
  msgstr ""
503
 
504
+ #: tmp/dist/so-css/tpl/js-templates.php:101, tmp/tpl/js-templates.php:101
505
  msgid "Invalid URI. Please make sure you're using a URL from the same site."
506
  msgstr ""
507
 
508
+ #: tmp/dist/so-css/tpl/js-templates.php:121, tmp/tpl/js-templates.php:121
509
  msgid "Get a %sGoogle Font%s selector."
510
  msgstr ""
511
 
512
+ #: tmp/dist/so-css/tpl/page.php:55, tmp/tpl/page.php:55
 
 
 
 
513
  msgid "Site design updated."
514
  msgstr ""
515
 
516
+ #: tmp/dist/so-css/tpl/page.php:65, tmp/tpl/page.php:65
517
  msgid "Editing revision dated %s. Click %sRevert to this revision%s to keep using it."
518
  msgstr ""
519
 
520
+ #: tmp/dist/so-css/tpl/page.php:83, tmp/tpl/page.php:83
521
  msgid "Get The Full Experience"
522
  msgstr ""
523
 
524
+ #: tmp/dist/so-css/tpl/page.php:87, tmp/tpl/page.php:87
525
  msgid "%sSiteOrigin Premium%s adds a <strong>Google Web Font</strong> selector to SiteOrigin CSS so you can easily change any font."
526
  msgstr ""
527
 
528
+ #: tmp/dist/so-css/tpl/page.php:103, tmp/tpl/page.php:103
529
  msgid "Getting Started Video"
530
  msgstr ""
531
 
532
+ #: tmp/dist/so-css/tpl/page.php:105, tmp/tpl/page.php:105
533
  msgid "Dismiss"
534
  msgstr ""
535
 
536
+ #: tmp/dist/so-css/tpl/page.php:123, tmp/tpl/page.php:123
537
  msgid "CSS Revisions"
538
  msgstr ""
539
 
540
+ #: tmp/dist/so-css/tpl/page.php:127, tmp/tpl/page.php:127
541
  msgid "Are you sure you want to load this revision?"
542
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Tags: css, design, edit, customize
3
  Requires at least: 3.9
4
  Tested up to: 4.9
5
- Stable tag: 1.2.0
6
- Build time: 2018-06-06T16:02:13+02:00
7
  License: GPLv2 or later
8
  Contributors: gpriday
9
  Donate link: https://siteorigin.com/downloads/contribution/
@@ -65,6 +65,12 @@ We offer free support on the [SiteOrigin support forums](https://siteorigin.com/
65
 
66
  == Changelog ==
67
 
 
 
 
 
 
 
68
  = 1.2.0 - 6 June 2018 =
69
  * Updated CSS library.
70
  * UI changes to make it more obvious when viewing revision.
2
  Tags: css, design, edit, customize
3
  Requires at least: 3.9
4
  Tested up to: 4.9
5
+ Stable tag: 1.2.2
6
+ Build time: 2018-06-16T14:41:39+02:00
7
  License: GPLv2 or later
8
  Contributors: gpriday
9
  Donate link: https://siteorigin.com/downloads/contribution/
65
 
66
  == Changelog ==
67
 
68
+ = 1.2.2 - 16 June 2018 =
69
+ * Removed reference to non-existent view.
70
+
71
+ = 1.2.1 - 15 June 2018 =
72
+ * Removed `.min` suffix from new stylesheets for CodeMirror plugins.
73
+
74
  = 1.2.0 - 6 June 2018 =
75
  * Updated CSS library.
76
  * UI changes to make it more obvious when viewing revision.
so-css.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin CSS
4
  Description: An advanced CSS editor from SiteOrigin.
5
- Version: 1.2.0
6
  Author: SiteOrigin
7
  Author URI: https://siteorigin.com
8
  Plugin URI: https://siteorigin.com/css/
@@ -14,7 +14,7 @@ Text Domain: so-css
14
  // Handle the legacy CSS editor that came with SiteOrigin themes
15
  include plugin_dir_path( __FILE__ ) . 'inc/legacy.php';
16
 
17
- define( 'SOCSS_VERSION', '1.2.0' );
18
  define( 'SOCSS_JS_SUFFIX', '.min' );
19
 
20
  /**
@@ -30,7 +30,9 @@ class SiteOrigin_CSS {
30
 
31
  // Main header actions
32
  add_action( 'plugins_loaded', array( $this, 'set_plugin_textdomain' ) );
33
- add_action( 'wp_head', array( $this, 'action_wp_head' ), 20 );
 
 
34
 
35
  // All the admin actions
36
  add_action( 'admin_menu', array( $this, 'action_admin_menu' ) );
@@ -204,9 +206,9 @@ class SiteOrigin_CSS {
204
  }
205
 
206
  /**
207
- * Display the custom CSS in the header.
208
  */
209
- function action_wp_head() {
210
 
211
  $this->enqueue_custom_css( $this->theme );
212
 
@@ -268,16 +270,16 @@ class SiteOrigin_CSS {
268
 
269
  // Sanitize CSS input. Should keep most tags, apart from script and style tags.
270
  $custom_css = self::sanitize_css( filter_input( INPUT_POST, 'custom_css' ) );
271
- $selected_post_id = filter_input( INPUT_POST, 'selected_post_id', FILTER_VALIDATE_INT );
272
 
273
- $current = $this->get_custom_css( $this->theme, $selected_post_id );
274
- $this->save_custom_css( $custom_css, $this->theme, $selected_post_id );
275
 
276
  // If this has changed, then add a revision.
277
  if ( $current != $custom_css ) {
278
- $this->add_custom_css_revision( $custom_css, $this->theme, $selected_post_id );
279
 
280
- $this->save_custom_css_file( $custom_css, $this->theme, $selected_post_id );
281
  }
282
  }
283
  }
@@ -325,13 +327,11 @@ class SiteOrigin_CSS {
325
 
326
  // CodeMirror search and dialog addons
327
  wp_enqueue_script( 'codemirror-dialog', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/dialog/dialog' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror' ), '5.2.0' );
328
- wp_enqueue_style( 'codemirror-dialog', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/dialog/dialog' . SOCSS_JS_SUFFIX . '.css', '5.2.0' );
329
 
330
  wp_enqueue_script( 'codemirror-search', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/search' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror' ), '5.37.0' );
331
  wp_enqueue_script( 'codemirror-search-searchcursor', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/searchcursor' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search' ), '5.37.0' );
332
  wp_enqueue_script( 'codemirror-search-match-cursor', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/match-highlighter' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search' ), '5.37.0' );
333
  wp_enqueue_script( 'codemirror-search-matchesonscrollbar', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/matchesonscrollbar' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search' ), '5.37.0' );
334
- wp_enqueue_style( 'codemirror-search-matchesonscrollbar', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/matchesonscrollbar' . SOCSS_JS_SUFFIX . '.css', array(), '5.37.0' );
335
  wp_enqueue_script( 'codemirror-scroll-annotatescrollbar', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/scroll/annotatescrollbar' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search', 'codemirror-search-matchesonscrollbar' ), '5.37.0' );
336
  wp_enqueue_script( 'codemirror-jump-to-line', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/jump-to-line' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search' ), '5.37.0' );
337
 
@@ -340,6 +340,8 @@ class SiteOrigin_CSS {
340
  wp_enqueue_style( 'codemirror-theme-neat', plugin_dir_url( __FILE__ ) . 'lib/codemirror/theme/neat.css', array(), '5.2.0' );
341
  wp_enqueue_style( 'codemirror-lint-css', plugin_dir_url( __FILE__ ) . 'lib/codemirror/addon/lint/lint.css', array(), '5.2.0' );
342
  wp_enqueue_style( 'codemirror-show-hint', plugin_dir_url( __FILE__ ) . 'lib/codemirror/addon/hint/show-hint.css', array(), '5.2.0' );
 
 
343
 
344
  // Enqueue the scripts for theme CSS processing
345
  wp_enqueue_script( 'siteorigin-css-parser-lib', plugin_dir_url( __FILE__ ) . 'js/css' . SOCSS_JS_SUFFIX . '.js', array( 'jquery' ), SOCSS_VERSION );
@@ -371,15 +373,8 @@ class SiteOrigin_CSS {
371
 
372
  $home_url = add_query_arg( 'so_css_preview', '1', $init_url );
373
 
374
- $theme = wp_get_theme();
375
-
376
  wp_localize_script( 'siteorigin-custom-css', 'socssOptions', array(
377
  'themeCSS' => SiteOrigin_CSS::single()->get_theme_css(),
378
- 'themeName' => $theme->get( 'Name' ),
379
- 'editorDescriptions' => array(
380
- 'global' => __( 'Changes apply to <%= themeName %> and its child themes', 'so-css' ),
381
- 'post' => __( 'Changes apply to the post <%= postTitle %> when the current theme is <%= themeName %> or its child themes', 'so-css' ),
382
- ),
383
  'homeURL' => $home_url,
384
  'postCssUrlRoot' => wp_nonce_url( admin_url('admin-ajax.php?action=socss_get_post_css'), 'get_post_css' ),
385
  'getRevisionsListAjaxUrl' => wp_nonce_url( admin_url('admin-ajax.php?action=socss_get_revisions_list'), 'get_revisions_list' ),
@@ -437,6 +432,32 @@ class SiteOrigin_CSS {
437
  $theme = filter_input( INPUT_GET, 'theme' );
438
  $time = filter_input( INPUT_GET, 'time', FILTER_VALIDATE_INT );
439
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  $custom_css = $this->get_custom_css( $this->theme, $socss_post_id );
441
  $custom_css_revisions = $this->get_custom_css_revisions( $this->theme, $socss_post_id );
442
  $current_revision = 0;
@@ -446,6 +467,10 @@ class SiteOrigin_CSS {
446
  $custom_css = $custom_css_revisions[ $time ];
447
  }
448
 
 
 
 
 
449
  if ( ! empty( $custom_css_revisions ) ) {
450
  krsort( $custom_css_revisions );
451
  }
@@ -534,7 +559,7 @@ class SiteOrigin_CSS {
534
 
535
  $revisions = $this->get_custom_css_revisions( $theme, $post_id );
536
 
537
- if ( is_array( $revisions ) ) {
538
  $i = 0;
539
  foreach ( $revisions as $time => $css ) {
540
  $is_current = ( empty( $current_revision ) && $i == 0 ) || ( ! empty( $current_revision ) && $time == $current_revision );
@@ -547,16 +572,18 @@ class SiteOrigin_CSS {
547
  <?php if ( ! $is_current ) : ?>
548
  <a href="<?php echo esc_url( add_query_arg( $query_args, admin_url( 'themes.php?page=so_custom_css' ) ) ) ?>"
549
  class="load-css-revision">
550
- <?php endif; ?>
551
- <?php echo date('j F Y @ H:i:s', $time + get_option('gmt_offset') * 60 * 60) ?>
552
- <?php if ( ! $is_current ) : ?>
553
  </a>
554
- <?php endif; ?>
555
  (<?php printf( __('%d chars', 'so-css'), strlen( $css ) ) ?>)<?php if ( $i == 0 ) : ?> (<?php _e( 'Latest', 'so-css' ) ?>)<?php endif; ?>
556
  </li>
557
  <?php
558
  $i++;
559
  }
 
 
560
  }
561
  }
562
 
@@ -662,17 +689,6 @@ class SiteOrigin_CSS {
662
  return $css;
663
  }
664
 
665
- /**
666
- * Get the editor description
667
- *
668
- * @return string
669
- */
670
- static function editor_description() {
671
- $theme = wp_get_theme();
672
-
673
- return sprintf( __( 'Changes apply to %s and its child themes', 'so-css' ), $theme->get( 'Name' ) );
674
- }
675
-
676
  function enqueue_inspector_scripts() {
677
  if ( ! current_user_can( 'edit_theme_options' ) ) {
678
  return;
2
  /*
3
  Plugin Name: SiteOrigin CSS
4
  Description: An advanced CSS editor from SiteOrigin.
5
+ Version: 1.2.2
6
  Author: SiteOrigin
7
  Author URI: https://siteorigin.com
8
  Plugin URI: https://siteorigin.com/css/
14
  // Handle the legacy CSS editor that came with SiteOrigin themes
15
  include plugin_dir_path( __FILE__ ) . 'inc/legacy.php';
16
 
17
+ define( 'SOCSS_VERSION', '1.2.2' );
18
  define( 'SOCSS_JS_SUFFIX', '.min' );
19
 
20
  /**
30
 
31
  // Main header actions
32
  add_action( 'plugins_loaded', array( $this, 'set_plugin_textdomain' ) );
33
+
34
+ // Priority 20 is necessary to ensure our CSS takes precedence.
35
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 20 );
36
 
37
  // All the admin actions
38
  add_action( 'admin_menu', array( $this, 'action_admin_menu' ) );
206
  }
207
 
208
  /**
209
+ * Enqueue or print inline CSS.
210
  */
211
+ function enqueue_css() {
212
 
213
  $this->enqueue_custom_css( $this->theme );
214
 
270
 
271
  // Sanitize CSS input. Should keep most tags, apart from script and style tags.
272
  $custom_css = self::sanitize_css( filter_input( INPUT_POST, 'custom_css' ) );
273
+ $socss_post_id = filter_input( INPUT_GET, 'socss_post_id', FILTER_VALIDATE_INT );
274
 
275
+ $current = $this->get_custom_css( $this->theme, $socss_post_id );
276
+ $this->save_custom_css( $custom_css, $this->theme, $socss_post_id );
277
 
278
  // If this has changed, then add a revision.
279
  if ( $current != $custom_css ) {
280
+ $this->add_custom_css_revision( $custom_css, $this->theme, $socss_post_id );
281
 
282
+ $this->save_custom_css_file( $custom_css, $this->theme, $socss_post_id );
283
  }
284
  }
285
  }
327
 
328
  // CodeMirror search and dialog addons
329
  wp_enqueue_script( 'codemirror-dialog', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/dialog/dialog' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror' ), '5.2.0' );
 
330
 
331
  wp_enqueue_script( 'codemirror-search', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/search' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror' ), '5.37.0' );
332
  wp_enqueue_script( 'codemirror-search-searchcursor', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/searchcursor' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search' ), '5.37.0' );
333
  wp_enqueue_script( 'codemirror-search-match-cursor', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/match-highlighter' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search' ), '5.37.0' );
334
  wp_enqueue_script( 'codemirror-search-matchesonscrollbar', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/matchesonscrollbar' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search' ), '5.37.0' );
 
335
  wp_enqueue_script( 'codemirror-scroll-annotatescrollbar', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/scroll/annotatescrollbar' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search', 'codemirror-search-matchesonscrollbar' ), '5.37.0' );
336
  wp_enqueue_script( 'codemirror-jump-to-line', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/jump-to-line' . SOCSS_JS_SUFFIX . '.js', array( 'codemirror', 'codemirror-search' ), '5.37.0' );
337
 
340
  wp_enqueue_style( 'codemirror-theme-neat', plugin_dir_url( __FILE__ ) . 'lib/codemirror/theme/neat.css', array(), '5.2.0' );
341
  wp_enqueue_style( 'codemirror-lint-css', plugin_dir_url( __FILE__ ) . 'lib/codemirror/addon/lint/lint.css', array(), '5.2.0' );
342
  wp_enqueue_style( 'codemirror-show-hint', plugin_dir_url( __FILE__ ) . 'lib/codemirror/addon/hint/show-hint.css', array(), '5.2.0' );
343
+ wp_enqueue_style( 'codemirror-dialog', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/dialog/dialog.css', '5.2.0' );
344
+ wp_enqueue_style( 'codemirror-search-matchesonscrollbar', plugin_dir_url(__FILE__) . 'lib/codemirror/addon/search/matchesonscrollbar.css', array(), '5.37.0' );
345
 
346
  // Enqueue the scripts for theme CSS processing
347
  wp_enqueue_script( 'siteorigin-css-parser-lib', plugin_dir_url( __FILE__ ) . 'js/css' . SOCSS_JS_SUFFIX . '.js', array( 'jquery' ), SOCSS_VERSION );
373
 
374
  $home_url = add_query_arg( 'so_css_preview', '1', $init_url );
375
 
 
 
376
  wp_localize_script( 'siteorigin-custom-css', 'socssOptions', array(
377
  'themeCSS' => SiteOrigin_CSS::single()->get_theme_css(),
 
 
 
 
 
378
  'homeURL' => $home_url,
379
  'postCssUrlRoot' => wp_nonce_url( admin_url('admin-ajax.php?action=socss_get_post_css'), 'get_post_css' ),
380
  'getRevisionsListAjaxUrl' => wp_nonce_url( admin_url('admin-ajax.php?action=socss_get_revisions_list'), 'get_revisions_list' ),
432
  $theme = filter_input( INPUT_GET, 'theme' );
433
  $time = filter_input( INPUT_GET, 'time', FILTER_VALIDATE_INT );
434
 
435
+ $page_title = __( 'SiteOrigin CSS', 'so-css' );
436
+ $theme_obj = wp_get_theme();
437
+ $theme_name = $theme_obj->get( 'Name' );
438
+ $editor_description = sprintf( __( 'Changes apply to %s and its child themes', 'so-css' ), $theme_name );
439
+ $save_button_label = __( 'Save CSS', 'so-css' );
440
+ $form_save_url = admin_url( 'themes.php?page=so_custom_css' );
441
+
442
+ if ( ! empty( $socss_post_id ) ) {
443
+ $selected_post = get_post( $socss_post_id );
444
+
445
+ $page_title = sprintf(
446
+ __( 'Editing CSS for: %s', 'so-css' ),
447
+ $selected_post->post_title
448
+ );
449
+
450
+ $editor_description = sprintf(
451
+ __( 'Changes apply to the %s %s when the current theme is %s or its child themes', 'so-css' ),
452
+ $selected_post->post_type,
453
+ $selected_post->post_title,
454
+ $theme_name
455
+ );
456
+ $post_type_obj = get_post_type_object( $selected_post->post_type );
457
+ $post_type_labels = $post_type_obj->labels;
458
+ $save_button_label = sprintf( __( 'Save %s CSS', 'so-css' ), $post_type_labels->singular_name );
459
+ $form_save_url = add_query_arg( 'socss_post_id', urlencode( $socss_post_id ), $form_save_url );
460
+ }
461
  $custom_css = $this->get_custom_css( $this->theme, $socss_post_id );
462
  $custom_css_revisions = $this->get_custom_css_revisions( $this->theme, $socss_post_id );
463
  $current_revision = 0;
467
  $custom_css = $custom_css_revisions[ $time ];
468
  }
469
 
470
+ if ( ! empty ( $current_revision ) ) {
471
+ $save_button_label = __( 'Revert to this revision', 'so-css' );
472
+ }
473
+
474
  if ( ! empty( $custom_css_revisions ) ) {
475
  krsort( $custom_css_revisions );
476
  }
559
 
560
  $revisions = $this->get_custom_css_revisions( $theme, $post_id );
561
 
562
+ if ( is_array( $revisions ) && ! empty( $revisions ) ) {
563
  $i = 0;
564
  foreach ( $revisions as $time => $css ) {
565
  $is_current = ( empty( $current_revision ) && $i == 0 ) || ( ! empty( $current_revision ) && $time == $current_revision );
572
  <?php if ( ! $is_current ) : ?>
573
  <a href="<?php echo esc_url( add_query_arg( $query_args, admin_url( 'themes.php?page=so_custom_css' ) ) ) ?>"
574
  class="load-css-revision">
575
+ <?php endif; ?>
576
+ <?php echo date('j F Y @ H:i:s', $time + get_option('gmt_offset') * 60 * 60) ?>
577
+ <?php if ( ! $is_current ) : ?>
578
  </a>
579
+ <?php endif; ?>
580
  (<?php printf( __('%d chars', 'so-css'), strlen( $css ) ) ?>)<?php if ( $i == 0 ) : ?> (<?php _e( 'Latest', 'so-css' ) ?>)<?php endif; ?>
581
  </li>
582
  <?php
583
  $i++;
584
  }
585
+ } else {
586
+ printf( '<em>%s</em>', __( 'No revisions yet.', 'so-css' ) );
587
  }
588
  }
589
 
689
  return $css;
690
  }
691
 
 
 
 
 
 
 
 
 
 
 
 
692
  function enqueue_inspector_scripts() {
693
  if ( ! current_user_can( 'edit_theme_options' ) ) {
694
  return;
tpl/page.php CHANGED
@@ -1,8 +1,13 @@
1
  <?php
2
  /**
 
3
  * @var $custom_css string The custom CSS string to be edited.
4
  * @var $current_revision int If the CSS to be edited is a revision, this will contain the timestamp of the revision.
5
  * @var $custom_css_revisions array Saved revisions for the current theme.
 
 
 
 
6
  */
7
 
8
  $snippets = SiteOrigin_CSS::single()->get_snippets();
@@ -15,7 +20,7 @@ if ( ! empty( $current_revision ) ) {
15
  <div class="wrap" id="siteorigin-custom-css">
16
  <h2>
17
  <img src="<?php echo plugin_dir_url(__FILE__) . '../css/images/icon.png' ?>" class="icon" />
18
- <?php _e( 'SiteOrigin CSS', 'so-css' ) ?>
19
  </h2>
20
 
21
 
@@ -36,7 +41,7 @@ if ( ! empty( $current_revision ) ) {
36
  <div class="postbox">
37
  <h3 class="hndle"><span><?php _e('Get The Full Experience', 'so-css') ?></span></h3>
38
  <div class="inside">
39
- <?php printf( __( '%sSiteOrigin Premium%s adds a <strong>Google Web Font</strong> selector to SiteOrigin CSS so you can easily change any font.', 'so-css' ) , '<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugins/web-font-selector" target="_blank">', '</a>' ); ?>
40
  </div>
41
  </div>
42
  <?php endif; ?>
@@ -66,7 +71,7 @@ if ( ! empty( $current_revision ) ) {
66
 
67
  </div>
68
 
69
- <form action="<?php echo esc_url( admin_url('themes.php?page=so_custom_css') ) ?>" method="POST" id="so-custom-css-form">
70
 
71
  <div class="custom-css-toolbar">
72
  <div class="toolbar-function-buttons">
@@ -95,10 +100,10 @@ if ( ! empty( $current_revision ) ) {
95
  <textarea name="custom_css" id="custom-css-textarea" class="css-editor" rows="<?php echo max( 10, substr_count( $custom_css, "\n" ) + 1 ) ?>"><?php echo esc_textarea( $custom_css ) ?></textarea>
96
  <?php wp_nonce_field( 'custom_css', '_sononce' ) ?>
97
  </div>
98
- <p class="description"><?php echo SiteOrigin_CSS::editor_description(); ?></p>
99
 
100
  <p class="submit">
101
- <input type="submit" name="siteorigin_custom_css_save" class="button-primary" value="<?php esc_attr_e( ( ! empty ( $current_revision ) ? __( 'Revert to this revision', 'so-css' ) : __( 'Save CSS', 'so-css' ) ) ); ?>" />
102
  </p>
103
 
104
  <div class="custom-css-preview">
1
  <?php
2
  /**
3
+ * @var $page_title string The title of the page. Includes the post title if a post was selected.
4
  * @var $custom_css string The custom CSS string to be edited.
5
  * @var $current_revision int If the CSS to be edited is a revision, this will contain the timestamp of the revision.
6
  * @var $custom_css_revisions array Saved revisions for the current theme.
7
+ * @var $editor_description string Description to provide context for the CSS being edited.
8
+ * @var $socss_post_id int ID of the post for which we're editing CSS.
9
+ * @var $save_button_label string Label of the save button depending on whether a post or revision has been selected.
10
+ * @var $form_save_url string URL to use when saving the CSS.
11
  */
12
 
13
  $snippets = SiteOrigin_CSS::single()->get_snippets();
20
  <div class="wrap" id="siteorigin-custom-css">
21
  <h2>
22
  <img src="<?php echo plugin_dir_url(__FILE__) . '../css/images/icon.png' ?>" class="icon" />
23
+ <?php echo esc_html( $page_title ) ?>
24
  </h2>
25
 
26
 
41
  <div class="postbox">
42
  <h3 class="hndle"><span><?php _e('Get The Full Experience', 'so-css') ?></span></h3>
43
  <div class="inside">
44
+ <?php printf( __( '%sSiteOrigin Premium%s adds a <strong>Google Web Font</strong> selector to SiteOrigin CSS so you can easily change any font.', 'so-css' ) , '<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/web-font-selector" target="_blank">', '</a>' ); ?>
45
  </div>
46
  </div>
47
  <?php endif; ?>
71
 
72
  </div>
73
 
74
+ <form action="<?php echo esc_url( $form_save_url ) ?>" method="POST" id="so-custom-css-form">
75
 
76
  <div class="custom-css-toolbar">
77
  <div class="toolbar-function-buttons">
100
  <textarea name="custom_css" id="custom-css-textarea" class="css-editor" rows="<?php echo max( 10, substr_count( $custom_css, "\n" ) + 1 ) ?>"><?php echo esc_textarea( $custom_css ) ?></textarea>
101
  <?php wp_nonce_field( 'custom_css', '_sononce' ) ?>
102
  </div>
103
+ <p class="description"><?php esc_html_e( $editor_description ) ?></p>
104
 
105
  <p class="submit">
106
+ <input type="submit" name="siteorigin_custom_css_save" class="button-primary" value="<?php esc_attr_e( $save_button_label ); ?>" />
107
  </p>
108
 
109
  <div class="custom-css-preview">