Version Description
- 14 June 2021 =
- Inspector: Added a new Border Radius setting to the Decoration tab.
- Allowed for right-clicking anywhere in the Basic Editor.
Download this release
Release Info
Developer | SiteOrigin |
Plugin | SiteOrigin CSS |
Version | 1.3.0 |
Comparing to | |
See all releases |
Code changes from version 1.2.14 to 1.3.0
- inc/controller-config.php +19 -1
- js/editor.js +18 -2
- js/editor.min.js +1 -1
- lang/so-css.pot +53 -49
- readme.txt +24 -14
- so-css.php +2 -2
- tpl/js-templates.php +9 -1
inc/controller-config.php
CHANGED
@@ -193,7 +193,7 @@ return array (
|
|
193 |
)
|
194 |
),
|
195 |
array(
|
196 |
-
'title' => __('Background
|
197 |
'type' => 'image',
|
198 |
'args' => array(
|
199 |
'property' => 'background-image',
|
@@ -299,6 +299,24 @@ return array (
|
|
299 |
)
|
300 |
),
|
301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
)
|
303 |
),
|
304 |
|
193 |
)
|
194 |
),
|
195 |
array(
|
196 |
+
'title' => __('Background Image', 'so-css'),
|
197 |
'type' => 'image',
|
198 |
'args' => array(
|
199 |
'property' => 'background-image',
|
299 |
)
|
300 |
),
|
301 |
|
302 |
+
array(
|
303 |
+
'title' => __( 'Border Radius', 'so-css' ),
|
304 |
+
'type' => 'sides',
|
305 |
+
'args' => array(
|
306 |
+
'controllers' => array(
|
307 |
+
array(
|
308 |
+
'type' => 'measurement',
|
309 |
+
'args' => array(
|
310 |
+
'property' => 'border-{dir}-radius',
|
311 |
+
'propertyAll' => 'border-radius',
|
312 |
+
'defaultUnit' => 'px'
|
313 |
+
)
|
314 |
+
),
|
315 |
+
),
|
316 |
+
'isRadius' => true,
|
317 |
+
'hasAll' => true,
|
318 |
+
)
|
319 |
+
),
|
320 |
)
|
321 |
),
|
322 |
|
js/editor.js
CHANGED
@@ -371,10 +371,12 @@
|
|
371 |
*/
|
372 |
scaleEditor: function () {
|
373 |
var windowHeight = $( window ).outerHeight();
|
|
|
374 |
if ( this.$el.hasClass( 'expanded' ) ) {
|
375 |
// If we're in the expanded view, then resize the editor
|
376 |
this.$el.find( '.CodeMirror-scroll' ).css( 'max-height', '' );
|
377 |
-
|
|
|
378 |
}
|
379 |
else {
|
380 |
// Attempt to calculate approximate space available for editor when not expanded.
|
@@ -384,9 +386,17 @@
|
|
384 |
$form.find( '> .custom-css-toolbar' ).outerHeight( true ) +
|
385 |
$form.find( '> p.description' ).outerHeight( true ) +
|
386 |
parseFloat( $( '#wpbody-content' ).css( 'padding-bottom' ) );
|
387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
this.codeMirror.setSize( '100%', 'auto' );
|
389 |
}
|
|
|
390 |
},
|
391 |
|
392 |
/**
|
@@ -1739,6 +1749,12 @@
|
|
1739 |
this.$( '.select-tab' ).eq( 0 ).remove();
|
1740 |
this.$( '.select-tab' ).css( 'width', '25%' );
|
1741 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1742 |
|
1743 |
this.$( '.select-tab' ).each( function ( index, element ) {
|
1744 |
var dir = $( element ).data( 'direction' );
|
371 |
*/
|
372 |
scaleEditor: function () {
|
373 |
var windowHeight = $( window ).outerHeight();
|
374 |
+
var areaHeight;
|
375 |
if ( this.$el.hasClass( 'expanded' ) ) {
|
376 |
// If we're in the expanded view, then resize the editor
|
377 |
this.$el.find( '.CodeMirror-scroll' ).css( 'max-height', '' );
|
378 |
+
areaHeight = windowHeight - this.$( '.custom-css-toolbar' ).outerHeight();
|
379 |
+
this.codeMirror.setSize( '100%', areaHeight );
|
380 |
}
|
381 |
else {
|
382 |
// Attempt to calculate approximate space available for editor when not expanded.
|
386 |
$form.find( '> .custom-css-toolbar' ).outerHeight( true ) +
|
387 |
$form.find( '> p.description' ).outerHeight( true ) +
|
388 |
parseFloat( $( '#wpbody-content' ).css( 'padding-bottom' ) );
|
389 |
+
|
390 |
+
areaHeight = windowHeight - otherEltsHeight;
|
391 |
+
// The container has a min-height of 300px so we need to ensure the areaHeight is at least that large.
|
392 |
+
if ( areaHeight < 300 ) {
|
393 |
+
areaHeight = 300;
|
394 |
+
}
|
395 |
+
|
396 |
+
this.$el.find( '.CodeMirror-scroll' ).css( 'min-height', areaHeight + 'px' );
|
397 |
this.codeMirror.setSize( '100%', 'auto' );
|
398 |
}
|
399 |
+
this.$el.find( '.CodeMirror-code' ).css( 'min-height', areaHeight + 'px' );
|
400 |
},
|
401 |
|
402 |
/**
|
1749 |
this.$( '.select-tab' ).eq( 0 ).remove();
|
1750 |
this.$( '.select-tab' ).css( 'width', '25%' );
|
1751 |
}
|
1752 |
+
|
1753 |
+
if ( ! this.args.isRadius ) {
|
1754 |
+
this.$( '.select-tabs[data-type="radius"]' ).remove();
|
1755 |
+
} else {
|
1756 |
+
this.$( '.select-tabs[data-type="box"]' ).remove();
|
1757 |
+
}
|
1758 |
|
1759 |
this.$( '.select-tab' ).each( function ( index, element ) {
|
1760 |
var dir = $( element ).data( 'direction' );
|
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.trigger("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=this.model.get("selectedPost");return(t&&!t.has("css")?t.fetch():(new e.Deferred).resolve()).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(){var s=this.$("textarea.css-editor");this.initValue=s.val();var r=this.initValue.match(/\n/gm),o=(r&&r.length,this.initValue);s.val(o);var n={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"}};void 0!==wp.codeEditor?(n=t.extend(wp.codeEditor.defaultSettings.codemirror,n),this.codeMirror=wp.codeEditor.initialize(s.get(0),n).codemirror):(this.registerCodeMirrorAutocomplete(),this.codeMirror=CodeMirror.fromTextArea(s.get(0),n),this.setupCodeMirrorExtensions()),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))},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){var i=t.getCursor(),s=t.getTokenAt(i),r=CodeMirror.innerMode(t.getMode(),s.state);if("css"===r.mode.name){if("keyword"===s.type&&0==="!important".indexOf(s.string))return{list:["!important"],from:CodeMirror.Pos(i.line,s.start),to:CodeMirror.Pos(i.line,s.end)};var o=s.start,n=i.ch,l=s.string.slice(0,n-o);/[^\w$_-]/.test(l)&&(l="",o=n=i.ch);var a=CodeMirror.resolveMode("text/css"),c=[],p=r.state.state;if("top"===p){for(var d=t.getLine(i.line).trim(),h=this.cssSelectors,u=0;u<h.length;u++)-1!==h[u].selector.indexOf(d)&&c.push(h[u].selector);if(c.length)return{list:c,from:CodeMirror.Pos(i.line,0),to:CodeMirror.Pos(i.line,n)}}else if("pseudo"===p||"variable-3"===s.type?v(e):"block"===p||"maybeprop"===p?v(a.propertyKeywords):"prop"===p||"parens"===p||"at"===p||"params"===p?(v(a.valueKeywords),v(a.colorKeywords)):"media"!==p&&"media_parens"!==p||(v(a.mediaTypes),v(a.mediaFeatures)),c.length)return{list:c,from:CodeMirror.Pos(i.line,o),to:CodeMirror.Pos(i.line,n)}}function v(e){for(var t in e)l&&0!==t.lastIndexOf(l,0)||c.push(t)}}.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).substring(0,i.end);this.preview.highlight(s)}else this.preview.clearHighlight()}.bind(this)),"function"==typeof CodeMirror.showHint&&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)+parseFloat(e("#wpbody-content").css("padding-bottom"));this.$el.find(".CodeMirror-scroll").css("max-height",t-s+"px"),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:{"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()).on("load",this.initPreview.bind(this))},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);var i=t.contents().find(".single-product").length;t.contents().find("a").each((function(){var t=e(this),s=t.attr("href");if(void 0===s||i&&t.parents(".wc-tabs").length)return!0;var r=-1===s.indexOf("?")?"?":"&";t.attr("href",s+r+"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.trigger("blur"),alert(t.data("invalid-uri")),t.trigger("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).trigger("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){e(this.tabTemplate({id:o,icon:r[o].icon,title:r[o].title})).appendTo(this.$(".section-tabs"));var n=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).trigger("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).trigger("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.trigger("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(){for(var t in this.$el.append(e(this.template({}))),this.field=this.$("select"),this.field.append(e('<option value=""></option>').html("")),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);for(var i in e('<div class="select-tab" data-value=""><span class="fa fa-circle-o"></span></div>').appendTo(t),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).trigger("change"),this.trigger("set_value",t),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=this.units.map((function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")})),i=new RegExp("([0-9\\.\\-]+)("+t.join("|")+")?","i").exec(e);return null===i?{value:"",unit:""}:{value:i[1],unit:void 0===i[2]?"":i[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.on("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.on("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];s.view.properties.controllers[a.type];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").on("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"),e('.button-primary[name="siteorigin_custom_css_save"]').on("click",(function(){e("#so-custom-css-form").trigger("submit")}))}));
|
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.trigger("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=this.model.get("selectedPost");return(t&&!t.has("css")?t.fetch():(new e.Deferred).resolve()).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(){var s=this.$("textarea.css-editor");this.initValue=s.val();var r=this.initValue.match(/\n/gm),o=(r&&r.length,this.initValue);s.val(o);var n={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"}};void 0!==wp.codeEditor?(n=t.extend(wp.codeEditor.defaultSettings.codemirror,n),this.codeMirror=wp.codeEditor.initialize(s.get(0),n).codemirror):(this.registerCodeMirrorAutocomplete(),this.codeMirror=CodeMirror.fromTextArea(s.get(0),n),this.setupCodeMirrorExtensions()),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))},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){var i=t.getCursor(),s=t.getTokenAt(i),r=CodeMirror.innerMode(t.getMode(),s.state);if("css"===r.mode.name){if("keyword"===s.type&&0==="!important".indexOf(s.string))return{list:["!important"],from:CodeMirror.Pos(i.line,s.start),to:CodeMirror.Pos(i.line,s.end)};var o=s.start,n=i.ch,l=s.string.slice(0,n-o);/[^\w$_-]/.test(l)&&(l="",o=n=i.ch);var a=CodeMirror.resolveMode("text/css"),c=[],p=r.state.state;if("top"===p){for(var d=t.getLine(i.line).trim(),h=this.cssSelectors,u=0;u<h.length;u++)-1!==h[u].selector.indexOf(d)&&c.push(h[u].selector);if(c.length)return{list:c,from:CodeMirror.Pos(i.line,0),to:CodeMirror.Pos(i.line,n)}}else if("pseudo"===p||"variable-3"===s.type?v(e):"block"===p||"maybeprop"===p?v(a.propertyKeywords):"prop"===p||"parens"===p||"at"===p||"params"===p?(v(a.valueKeywords),v(a.colorKeywords)):"media"!==p&&"media_parens"!==p||(v(a.mediaTypes),v(a.mediaFeatures)),c.length)return{list:c,from:CodeMirror.Pos(i.line,o),to:CodeMirror.Pos(i.line,n)}}function v(e){for(var t in e)l&&0!==t.lastIndexOf(l,0)||c.push(t)}}.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).substring(0,i.end);this.preview.highlight(s)}else this.preview.clearHighlight()}.bind(this)),"function"==typeof CodeMirror.showHint&&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,i=e(window).outerHeight();if(this.$el.hasClass("expanded"))this.$el.find(".CodeMirror-scroll").css("max-height",""),t=i-this.$(".custom-css-toolbar").outerHeight(),this.codeMirror.setSize("100%",t);else{var s=e("#so-custom-css-form");(t=i-(e("#wpadminbar").outerHeight(!0)+e("#siteorigin-custom-css").find("> h2").outerHeight(!0)+s.find("> .custom-css-toolbar").outerHeight(!0)+s.find("> p.description").outerHeight(!0)+parseFloat(e("#wpbody-content").css("padding-bottom"))))<300&&(t=300),this.$el.find(".CodeMirror-scroll").css("min-height",t+"px"),this.codeMirror.setSize("100%","auto")}this.$el.find(".CodeMirror-code").css("min-height",t+"px")},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:{"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()).on("load",this.initPreview.bind(this))},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);var i=t.contents().find(".single-product").length;t.contents().find("a").each((function(){var t=e(this),s=t.attr("href");if(void 0===s||i&&t.parents(".wc-tabs").length)return!0;var r=-1===s.indexOf("?")?"?":"&";t.attr("href",s+r+"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.trigger("blur"),alert(t.data("invalid-uri")),t.trigger("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).trigger("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){e(this.tabTemplate({id:o,icon:r[o].icon,title:r[o].title})).appendTo(this.$(".section-tabs"));var n=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).trigger("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).trigger("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.trigger("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(){for(var t in this.$el.append(e(this.template({}))),this.field=this.$("select"),this.field.append(e('<option value=""></option>').html("")),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);for(var i in e('<div class="select-tab" data-value=""><span class="fa fa-circle-o"></span></div>').appendTo(t),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).trigger("change"),this.trigger("set_value",t),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=this.units.map((function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")})),i=new RegExp("([0-9\\.\\-]+)("+t.join("|")+")?","i").exec(e);return null===i?{value:"",unit:""}:{value:i[1],unit:void 0===i[2]?"":i[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.on("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.on("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.args.isRadius?this.$('.select-tabs[data-type="box"]').remove():this.$('.select-tabs[data-type="radius"]').remove(),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];s.view.properties.controllers[a.type];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").on("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"),e('.button-primary[name="siteorigin_custom_css_save"]').on("click",(function(){e("#so-custom-css-form").trigger("submit")}))}));
|
lang/so-css.pot
CHANGED
@@ -148,7 +148,7 @@ msgstr ""
|
|
148 |
msgid "Font Style"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: inc/controller-config.php:59, inc/controller-config.php:75, inc/controller-config.php:104, inc/controller-config.php:
|
152 |
msgid "None"
|
153 |
msgstr ""
|
154 |
|
@@ -204,11 +204,11 @@ msgstr ""
|
|
204 |
msgid "Text Align"
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: inc/controller-config.php:124, inc/controller-config.php:
|
208 |
msgid "Left"
|
209 |
msgstr ""
|
210 |
|
211 |
-
#: inc/controller-config.php:125, inc/controller-config.php:
|
212 |
msgid "Right"
|
213 |
msgstr ""
|
214 |
|
@@ -265,7 +265,7 @@ msgid "Background Color"
|
|
265 |
msgstr ""
|
266 |
|
267 |
#: inc/controller-config.php:196
|
268 |
-
msgid "Background
|
269 |
msgstr ""
|
270 |
|
271 |
#: inc/controller-config.php:204
|
@@ -328,175 +328,179 @@ msgstr ""
|
|
328 |
msgid "Borders"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: inc/controller-config.php:
|
|
|
|
|
|
|
|
|
332 |
msgid "Layout"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#: inc/controller-config.php:
|
336 |
msgid "Margin"
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: inc/controller-config.php:
|
340 |
msgid "Padding"
|
341 |
msgstr ""
|
342 |
|
343 |
-
#: inc/controller-config.php:
|
344 |
msgid "Position"
|
345 |
msgstr ""
|
346 |
|
347 |
-
#: inc/controller-config.php:
|
348 |
msgid "Absolute"
|
349 |
msgstr ""
|
350 |
|
351 |
-
#: inc/controller-config.php:
|
352 |
msgid "Fixed"
|
353 |
msgstr ""
|
354 |
|
355 |
-
#: inc/controller-config.php:
|
356 |
msgid "Relative"
|
357 |
msgstr ""
|
358 |
|
359 |
-
#: inc/controller-config.php:
|
360 |
msgid "Static"
|
361 |
msgstr ""
|
362 |
|
363 |
-
#: inc/controller-config.php:
|
364 |
msgid "Inherit"
|
365 |
msgstr ""
|
366 |
|
367 |
-
#: inc/controller-config.php:
|
368 |
msgid "Absolute Position"
|
369 |
msgstr ""
|
370 |
|
371 |
-
#: inc/controller-config.php:
|
372 |
msgid "Width"
|
373 |
msgstr ""
|
374 |
|
375 |
-
#: inc/controller-config.php:
|
376 |
msgid "Height"
|
377 |
msgstr ""
|
378 |
|
379 |
-
#: inc/controller-config.php:
|
380 |
msgid "Display"
|
381 |
msgstr ""
|
382 |
|
383 |
-
#: inc/controller-config.php:
|
384 |
msgid "Inline"
|
385 |
msgstr ""
|
386 |
|
387 |
-
#: inc/controller-config.php:
|
388 |
msgid "Block"
|
389 |
msgstr ""
|
390 |
|
391 |
-
#: inc/controller-config.php:
|
392 |
msgid "Flex"
|
393 |
msgstr ""
|
394 |
|
395 |
-
#: inc/controller-config.php:
|
396 |
msgid "Inline Block"
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: inc/controller-config.php:
|
400 |
msgid "Inline Flex"
|
401 |
msgstr ""
|
402 |
|
403 |
-
#: inc/controller-config.php:
|
404 |
msgid "Inline Table"
|
405 |
msgstr ""
|
406 |
|
407 |
-
#: inc/controller-config.php:
|
408 |
msgid "List Item"
|
409 |
msgstr ""
|
410 |
|
411 |
-
#: inc/controller-config.php:
|
412 |
msgid "Run In"
|
413 |
msgstr ""
|
414 |
|
415 |
-
#: inc/controller-config.php:
|
416 |
msgid "Table"
|
417 |
msgstr ""
|
418 |
|
419 |
-
#: inc/controller-config.php:
|
420 |
msgid "Table Caption"
|
421 |
msgstr ""
|
422 |
|
423 |
-
#: inc/controller-config.php:
|
424 |
msgid "Table Column Group"
|
425 |
msgstr ""
|
426 |
|
427 |
-
#: inc/controller-config.php:
|
428 |
msgid "Table Header Group"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: inc/controller-config.php:
|
432 |
msgid "Table Footer Group"
|
433 |
msgstr ""
|
434 |
|
435 |
-
#: inc/controller-config.php:
|
436 |
msgid "Table Row Group"
|
437 |
msgstr ""
|
438 |
|
439 |
-
#: inc/controller-config.php:
|
440 |
msgid "Table Cell"
|
441 |
msgstr ""
|
442 |
|
443 |
-
#: inc/controller-config.php:
|
444 |
msgid "Table Column"
|
445 |
msgstr ""
|
446 |
|
447 |
-
#: inc/controller-config.php:
|
448 |
msgid "Table Row"
|
449 |
msgstr ""
|
450 |
|
451 |
-
#: inc/controller-config.php:
|
452 |
msgid "Float"
|
453 |
msgstr ""
|
454 |
|
455 |
-
#: inc/controller-config.php:
|
456 |
msgid "Clear"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: inc/controller-config.php:
|
460 |
msgid "Both"
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: inc/controller-config.php:
|
464 |
msgid "Visibility"
|
465 |
msgstr ""
|
466 |
|
467 |
-
#: inc/controller-config.php:
|
468 |
msgid "Visible"
|
469 |
msgstr ""
|
470 |
|
471 |
-
#: inc/controller-config.php:
|
472 |
msgid "Hidden"
|
473 |
msgstr ""
|
474 |
|
475 |
-
#: inc/controller-config.php:
|
476 |
msgid "Collapse"
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: inc/controller-config.php:
|
480 |
msgid "Overflow"
|
481 |
msgstr ""
|
482 |
|
483 |
-
#: inc/controller-config.php:
|
484 |
msgid "Scroll"
|
485 |
msgstr ""
|
486 |
|
487 |
-
#: inc/controller-config.php:
|
488 |
msgid "Auto"
|
489 |
msgstr ""
|
490 |
|
491 |
-
#: inc/controller-config.php:
|
492 |
msgid "Overflow X"
|
493 |
msgstr ""
|
494 |
|
495 |
-
#: inc/controller-config.php:
|
496 |
msgid "Overflow Y"
|
497 |
msgstr ""
|
498 |
|
499 |
-
#: inc/controller-config.php:
|
500 |
msgid "Z-Index"
|
501 |
msgstr ""
|
502 |
|
@@ -516,11 +520,11 @@ msgstr ""
|
|
516 |
msgid "Insert Snippet"
|
517 |
msgstr ""
|
518 |
|
519 |
-
#: tpl/js-templates.php:
|
520 |
msgid "Invalid URI. Please make sure you're using a URL from the same site."
|
521 |
msgstr ""
|
522 |
|
523 |
-
#: tpl/js-templates.php:
|
524 |
msgid "Get a %sGoogle Font%s selector."
|
525 |
msgstr ""
|
526 |
|
148 |
msgid "Font Style"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: inc/controller-config.php:59, inc/controller-config.php:75, inc/controller-config.php:104, inc/controller-config.php:415, inc/controller-config.php:442, inc/controller-config.php:454
|
152 |
msgid "None"
|
153 |
msgstr ""
|
154 |
|
204 |
msgid "Text Align"
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: inc/controller-config.php:124, inc/controller-config.php:443, inc/controller-config.php:455
|
208 |
msgid "Left"
|
209 |
msgstr ""
|
210 |
|
211 |
+
#: inc/controller-config.php:125, inc/controller-config.php:444, inc/controller-config.php:456
|
212 |
msgid "Right"
|
213 |
msgstr ""
|
214 |
|
265 |
msgstr ""
|
266 |
|
267 |
#: inc/controller-config.php:196
|
268 |
+
msgid "Background Image"
|
269 |
msgstr ""
|
270 |
|
271 |
#: inc/controller-config.php:204
|
328 |
msgid "Borders"
|
329 |
msgstr ""
|
330 |
|
331 |
+
#: inc/controller-config.php:303
|
332 |
+
msgid "Border Radius"
|
333 |
+
msgstr ""
|
334 |
+
|
335 |
+
#: inc/controller-config.php:326
|
336 |
msgid "Layout"
|
337 |
msgstr ""
|
338 |
|
339 |
+
#: inc/controller-config.php:330
|
340 |
msgid "Margin"
|
341 |
msgstr ""
|
342 |
|
343 |
+
#: inc/controller-config.php:347
|
344 |
msgid "Padding"
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: inc/controller-config.php:364
|
348 |
msgid "Position"
|
349 |
msgstr ""
|
350 |
|
351 |
+
#: inc/controller-config.php:369
|
352 |
msgid "Absolute"
|
353 |
msgstr ""
|
354 |
|
355 |
+
#: inc/controller-config.php:370
|
356 |
msgid "Fixed"
|
357 |
msgstr ""
|
358 |
|
359 |
+
#: inc/controller-config.php:371
|
360 |
msgid "Relative"
|
361 |
msgstr ""
|
362 |
|
363 |
+
#: inc/controller-config.php:372
|
364 |
msgid "Static"
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: inc/controller-config.php:373
|
368 |
msgid "Inherit"
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: inc/controller-config.php:378
|
372 |
msgid "Absolute Position"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: inc/controller-config.php:394
|
376 |
msgid "Width"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: inc/controller-config.php:402
|
380 |
msgid "Height"
|
381 |
msgstr ""
|
382 |
|
383 |
+
#: inc/controller-config.php:410
|
384 |
msgid "Display"
|
385 |
msgstr ""
|
386 |
|
387 |
+
#: inc/controller-config.php:416
|
388 |
msgid "Inline"
|
389 |
msgstr ""
|
390 |
|
391 |
+
#: inc/controller-config.php:417
|
392 |
msgid "Block"
|
393 |
msgstr ""
|
394 |
|
395 |
+
#: inc/controller-config.php:418
|
396 |
msgid "Flex"
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: inc/controller-config.php:419
|
400 |
msgid "Inline Block"
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: inc/controller-config.php:420
|
404 |
msgid "Inline Flex"
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: inc/controller-config.php:421
|
408 |
msgid "Inline Table"
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: inc/controller-config.php:422
|
412 |
msgid "List Item"
|
413 |
msgstr ""
|
414 |
|
415 |
+
#: inc/controller-config.php:423
|
416 |
msgid "Run In"
|
417 |
msgstr ""
|
418 |
|
419 |
+
#: inc/controller-config.php:424
|
420 |
msgid "Table"
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: inc/controller-config.php:425
|
424 |
msgid "Table Caption"
|
425 |
msgstr ""
|
426 |
|
427 |
+
#: inc/controller-config.php:426
|
428 |
msgid "Table Column Group"
|
429 |
msgstr ""
|
430 |
|
431 |
+
#: inc/controller-config.php:427
|
432 |
msgid "Table Header Group"
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: inc/controller-config.php:428
|
436 |
msgid "Table Footer Group"
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: inc/controller-config.php:429
|
440 |
msgid "Table Row Group"
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: inc/controller-config.php:430
|
444 |
msgid "Table Cell"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: inc/controller-config.php:431
|
448 |
msgid "Table Column"
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: inc/controller-config.php:432
|
452 |
msgid "Table Row"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: inc/controller-config.php:437
|
456 |
msgid "Float"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: inc/controller-config.php:449
|
460 |
msgid "Clear"
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: inc/controller-config.php:457
|
464 |
msgid "Both"
|
465 |
msgstr ""
|
466 |
|
467 |
+
#: inc/controller-config.php:462
|
468 |
msgid "Visibility"
|
469 |
msgstr ""
|
470 |
|
471 |
+
#: inc/controller-config.php:467, inc/controller-config.php:479, inc/controller-config.php:492, inc/controller-config.php:505
|
472 |
msgid "Visible"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: inc/controller-config.php:468, inc/controller-config.php:480, inc/controller-config.php:493, inc/controller-config.php:506
|
476 |
msgid "Hidden"
|
477 |
msgstr ""
|
478 |
|
479 |
+
#: inc/controller-config.php:469
|
480 |
msgid "Collapse"
|
481 |
msgstr ""
|
482 |
|
483 |
+
#: inc/controller-config.php:474
|
484 |
msgid "Overflow"
|
485 |
msgstr ""
|
486 |
|
487 |
+
#: inc/controller-config.php:481, inc/controller-config.php:494, inc/controller-config.php:507
|
488 |
msgid "Scroll"
|
489 |
msgstr ""
|
490 |
|
491 |
+
#: inc/controller-config.php:482, inc/controller-config.php:495, inc/controller-config.php:508
|
492 |
msgid "Auto"
|
493 |
msgstr ""
|
494 |
|
495 |
+
#: inc/controller-config.php:487
|
496 |
msgid "Overflow X"
|
497 |
msgstr ""
|
498 |
|
499 |
+
#: inc/controller-config.php:500
|
500 |
msgid "Overflow Y"
|
501 |
msgstr ""
|
502 |
|
503 |
+
#: inc/controller-config.php:513
|
504 |
msgid "Z-Index"
|
505 |
msgstr ""
|
506 |
|
520 |
msgid "Insert Snippet"
|
521 |
msgstr ""
|
522 |
|
523 |
+
#: tpl/js-templates.php:59
|
524 |
msgid "Invalid URI. Please make sure you're using a URL from the same site."
|
525 |
msgstr ""
|
526 |
|
527 |
+
#: tpl/js-templates.php:69
|
528 |
msgid "Get a %sGoogle Font%s selector."
|
529 |
msgstr ""
|
530 |
|
readme.txt
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
=== SiteOrigin CSS ===
|
2 |
-
Tags: css,
|
3 |
Requires at least: 3.9
|
4 |
Tested up to: 5.7
|
5 |
-
Stable tag: 1.
|
6 |
-
Build time: 2021-
|
7 |
License: GPLv2 or later
|
8 |
-
Contributors: gpriday
|
9 |
Donate link: https://siteorigin.com/downloads/premium/
|
10 |
|
11 |
-
SiteOrigin CSS is the simple
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
SiteOrigin CSS is the simple
|
16 |
|
17 |
We've created a site editing experience that will suit both beginners and advanced users alike. Beginners will love the simple visual controls and real-time preview. Advanced users will love the code autocompletion that makes writing CSS faster than ever.
|
18 |
|
@@ -20,25 +20,25 @@ We've created a site editing experience that will suit both beginners and advanc
|
|
20 |
|
21 |
= Inspector =
|
22 |
|
23 |
-
The hardest part of editing your site's design using CSS is usually finding the correct selector to use. The powerful inspector that comes with SiteOrigin CSS makes this easy. While viewing a full preview of your site, just click on an element and it'll help you identify the best selector to use to target that element.
|
24 |
|
25 |
-
The
|
26 |
|
27 |
= Visual Editor =
|
28 |
|
29 |
-
Don't like playing around with code? No problem. SiteOrigin CSS has a set of simple controls that make it easy to choose colors, styles and measurements. Combined with the
|
30 |
|
31 |
= CSS Editor =
|
32 |
|
33 |
-
SiteOrigin CSS has a powerful CSS editor, the likes of which you'd usually only expect from high-end IDEs. It has autocompletion for both CSS selectors and attributes. It also features very useful CSS linting
|
34 |
|
35 |
= It's Free =
|
36 |
|
37 |
-
We're committed to keeping SiteOrigin CSS
|
38 |
|
39 |
= Works With Any Theme =
|
40 |
|
41 |
-
There's an ever-growing collection of awesome WordPress themes, and now with SiteOrigin CSS you can edit every single one of them to your heart's content. No matter what theme you're using, SiteOrigin CSS will work perfectly.
|
42 |
|
43 |
= Actively Developed =
|
44 |
|
@@ -51,7 +51,7 @@ We're actively developing SiteOrigin CSS. Keep track of what's happening over on
|
|
51 |
|
52 |
== Screenshots ==
|
53 |
1. Inspector for finding elements on your site.
|
54 |
-
2. Simple visual controls including a background image uploader.
|
55 |
3. A full CSS editor that works in real-time with a preview of your site.
|
56 |
4. Code completion for all your theme's selectors.
|
57 |
|
@@ -61,10 +61,20 @@ We're actively developing SiteOrigin CSS. Keep track of what's happening over on
|
|
61 |
|
62 |
== Support ==
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
== Changelog ==
|
67 |
|
|
|
|
|
|
|
|
|
68 |
= 1.2.14 - 26 April 2021 =
|
69 |
* Resolved Photo Gallery by 10Web plugin conflict.
|
70 |
|
1 |
=== SiteOrigin CSS ===
|
2 |
+
Tags: css, visual css, css editor, design, customize
|
3 |
Requires at least: 3.9
|
4 |
Tested up to: 5.7
|
5 |
+
Stable tag: 1.3.0
|
6 |
+
Build time: 2021-06-14T12:29:46+02:00
|
7 |
License: GPLv2 or later
|
8 |
+
Contributors: gpriday, alexgso
|
9 |
Donate link: https://siteorigin.com/downloads/premium/
|
10 |
|
11 |
+
SiteOrigin CSS is the simple yet powerful CSS editor for WordPress. It gives you visual controls that let you edit the look and feel of your site in real-time.
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
SiteOrigin CSS is the simple yet powerful CSS editor for WordPress. It gives you visual controls that let you edit the look and feel of your site in real-time.
|
16 |
|
17 |
We've created a site editing experience that will suit both beginners and advanced users alike. Beginners will love the simple visual controls and real-time preview. Advanced users will love the code autocompletion that makes writing CSS faster than ever.
|
18 |
|
20 |
|
21 |
= Inspector =
|
22 |
|
23 |
+
The hardest part of editing your site's design using CSS is usually finding the correct selector to use. The powerful inspector that comes with SiteOrigin CSS makes this easy. While viewing a full preview of your site, just click on an element, and it'll help you identify the best selector to use to target that element.
|
24 |
|
25 |
+
The inspector will help you even if you have no idea what a CSS selector is.
|
26 |
|
27 |
= Visual Editor =
|
28 |
|
29 |
+
Don't like playing around with code? No problem. SiteOrigin CSS has a set of simple controls that make it easy to choose colors, styles, and measurements. Combined with the inspector, you'll be able to make changes in just a few clicks.
|
30 |
|
31 |
= CSS Editor =
|
32 |
|
33 |
+
SiteOrigin CSS has a powerful CSS editor, the likes of which you'd usually only expect from high-end IDEs. It has autocompletion for both CSS selectors and attributes. It also features very useful CSS linting to help you identify issues in your code before you publish your changes.
|
34 |
|
35 |
= It's Free =
|
36 |
|
37 |
+
We're committed to keeping SiteOrigin CSS free. You can install it on as many sites as you like without ever worrying about licensing. All future updates and upgrades will be free, and we even offer free support over on our friendly support forums.
|
38 |
|
39 |
= Works With Any Theme =
|
40 |
|
41 |
+
There's an ever-growing collection of awesome WordPress themes, and now with SiteOrigin CSS, you can edit every single one of them to your heart's content. No matter what theme you're using, SiteOrigin CSS will work perfectly.
|
42 |
|
43 |
= Actively Developed =
|
44 |
|
51 |
|
52 |
== Screenshots ==
|
53 |
1. Inspector for finding elements on your site.
|
54 |
+
2. Simple visual controls, including a background image uploader.
|
55 |
3. A full CSS editor that works in real-time with a preview of your site.
|
56 |
4. Code completion for all your theme's selectors.
|
57 |
|
61 |
|
62 |
== Support ==
|
63 |
|
64 |
+
Free support is available on the [SiteOrigin support forums](https://siteorigin.com/thread/).
|
65 |
+
|
66 |
+
== SiteOrigin Premium ==
|
67 |
+
|
68 |
+
[SiteOrigin Premium](https://siteorigin.com/downloads/premium/) enhances SiteOrigin CSS with a Google Web Font Selector. Choose from hundreds of beautiful web fonts right in the visual editor.
|
69 |
+
|
70 |
+
SiteOrigin Premium also includes access to our next-level email support service, perfect for those times when you need fast and effective technical support.
|
71 |
|
72 |
== Changelog ==
|
73 |
|
74 |
+
= 1.3.0 - 14 June 2021 =
|
75 |
+
* Inspector: Added a new Border Radius setting to the Decoration tab.
|
76 |
+
* Allowed for right-clicking anywhere in the Basic Editor.
|
77 |
+
|
78 |
= 1.2.14 - 26 April 2021 =
|
79 |
* Resolved Photo Gallery by 10Web plugin conflict.
|
80 |
|
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.
|
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.
|
18 |
define( 'SOCSS_JS_SUFFIX', '.min' );
|
19 |
|
20 |
/**
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin CSS
|
4 |
Description: An advanced CSS editor from SiteOrigin.
|
5 |
+
Version: 1.3.0
|
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.3.0' );
|
18 |
define( 'SOCSS_JS_SUFFIX', '.min' );
|
19 |
|
20 |
/**
|
tpl/js-templates.php
CHANGED
@@ -31,7 +31,7 @@
|
|
31 |
<script type="text/template" id="template-sides-field">
|
32 |
<div class="spacing-field">
|
33 |
|
34 |
-
<ul class="select-tabs side-tabs">
|
35 |
<li class="select-tab side-tab" data-direction="all"><div class="spacing-all"></div></li>
|
36 |
<li class="select-tab side-tab" data-direction="top"><div class="spacing-top"></div></li>
|
37 |
<li class="select-tab side-tab" data-direction="right"><div class="spacing-right"></div></li>
|
@@ -39,6 +39,14 @@
|
|
39 |
<li class="select-tab side-tab" data-direction="left"><div class="spacing-left"></div></li>
|
40 |
</ul>
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
<ul class="sides">
|
43 |
|
44 |
</ul>
|
31 |
<script type="text/template" id="template-sides-field">
|
32 |
<div class="spacing-field">
|
33 |
|
34 |
+
<ul class="select-tabs side-tabs" data-type="box">
|
35 |
<li class="select-tab side-tab" data-direction="all"><div class="spacing-all"></div></li>
|
36 |
<li class="select-tab side-tab" data-direction="top"><div class="spacing-top"></div></li>
|
37 |
<li class="select-tab side-tab" data-direction="right"><div class="spacing-right"></div></li>
|
39 |
<li class="select-tab side-tab" data-direction="left"><div class="spacing-left"></div></li>
|
40 |
</ul>
|
41 |
|
42 |
+
<ul class="select-tabs side-tabs" data-type="radius">
|
43 |
+
<li class="select-tab side-tab" data-direction="all"><div class="spacing-all"></div></li>
|
44 |
+
<li class="select-tab side-tab" data-direction="top-right"><div class="spacing-top spacing-right"></div></li>
|
45 |
+
<li class="select-tab side-tab" data-direction="bottom-right"><div class="spacing-bottom spacing-right"></div></li>
|
46 |
+
<li class="select-tab side-tab" data-direction="bottom-left"><div class="spacing-bottom spacing-left"></div></li>
|
47 |
+
<li class="select-tab side-tab" data-direction="top-left"><div class="spacing-top spacing-left"></div></li>
|
48 |
+
</ul>
|
49 |
+
|
50 |
<ul class="sides">
|
51 |
|
52 |
</ul>
|