├── index.php ├── includes ├── index.php ├── controls │ ├── index.php │ ├── class-textarea.php │ ├── class-switch.php │ ├── class-widget-form.php │ ├── class-radio.php │ ├── class-checkbox.php │ └── class-button-group.php ├── elements │ └── index.php ├── customizer │ ├── index.php │ ├── customizer-panels.php │ └── customizer-sections.php ├── shortcodes │ └── index.php ├── admin │ ├── helpers │ │ └── helpers-general.php │ ├── class-compatibility.php │ └── class-edit-page.php └── class-compatibility.php ├── assets ├── scss │ ├── components │ │ ├── canvas │ │ │ ├── _elements.scss │ │ │ ├── _canvas.scss │ │ │ └── elements │ │ │ │ └── _columns.scss │ │ ├── sidebar │ │ │ ├── controls │ │ │ │ ├── _editor.scss │ │ │ │ ├── _button-group.scss │ │ │ │ ├── _colorpicker.scss │ │ │ │ ├── _range.scss │ │ │ │ ├── _radio.scss │ │ │ │ ├── _style.scss │ │ │ │ ├── _checkbox.scss │ │ │ │ ├── _link.scss │ │ │ │ ├── _media.scss │ │ │ │ ├── _switch.scss │ │ │ │ └── _icon.scss │ │ │ ├── _sections.scss │ │ │ └── _notifications.scss │ │ └── frontend │ │ │ ├── _form.scss │ │ │ ├── _contact-form.scss │ │ │ ├── _gallery.scss │ │ │ ├── _map.scss │ │ │ ├── _jetpack-portfolio.scss │ │ │ ├── _jetpack-testimonials.scss │ │ │ ├── _content.scss │ │ │ ├── _widgets.scss │ │ │ ├── _hero.scss │ │ │ └── _card.scss │ ├── base │ │ └── sidebar │ │ │ ├── _lists.scss │ │ │ ├── _headings.scss │ │ │ └── _paragraph.scss │ ├── tools │ │ ├── _user-select.scss │ │ ├── _box-shadow.scss │ │ ├── _flex.scss │ │ ├── _clearfix.scss │ │ ├── _transform.scss │ │ ├── _prefixer.scss │ │ ├── _transition.scss │ │ └── _keyframes.scss │ ├── trumps │ │ ├── frontend │ │ │ ├── _icons.scss │ │ │ ├── _placeholder.scss │ │ │ ├── _formats.scss │ │ │ └── _notifications.scss │ │ ├── canvas │ │ │ ├── _rtl.scss │ │ │ └── _utility.scss │ │ └── shared │ │ │ └── _wordpress.scss │ ├── tinymce.scss │ ├── ie.scss │ ├── objects │ │ ├── _embeds.scss │ │ ├── _pagination.scss │ │ └── _slideshow.scss │ ├── generic │ │ ├── _box-sizing.scss │ │ └── _reset.scss │ ├── admin.scss │ ├── canvas.scss │ ├── sidebar.scss │ ├── _variables.scss │ └── frontend.scss ├── img │ ├── empty.png │ ├── spinner.gif │ └── spinner-2x.gif ├── js │ ├── src │ │ ├── admin.js │ │ ├── canvas │ │ │ ├── preview.js │ │ │ ├── components │ │ │ │ ├── elements │ │ │ │ │ ├── children │ │ │ │ │ │ ├── tab.js │ │ │ │ │ │ └── carousel-item.js │ │ │ │ │ └── containers │ │ │ │ │ │ ├── navigation │ │ │ │ │ │ ├── carousel-navigation-item.js │ │ │ │ │ │ └── tabs-navigation-item.js │ │ │ │ │ │ ├── carousel.js │ │ │ │ │ │ └── tabs.js │ │ │ │ └── behaviors │ │ │ │ │ └── droppable.js │ │ │ ├── entities │ │ │ │ └── models │ │ │ │ │ ├── wrappers │ │ │ │ │ └── section.js │ │ │ │ │ ├── containers │ │ │ │ │ ├── row.js │ │ │ │ │ ├── tabs.js │ │ │ │ │ └── carousel.js │ │ │ │ │ ├── children │ │ │ │ │ ├── grid-item.js │ │ │ │ │ └── column.js │ │ │ │ │ └── element-child.js │ │ │ └── modules │ │ │ │ ├── tools │ │ │ │ ├── select-region.js │ │ │ │ └── show │ │ │ │ │ ├── select-menu-item.js │ │ │ │ │ └── guide.js │ │ │ │ └── canvas │ │ │ │ └── canvas-region.js │ │ ├── sidebar │ │ │ ├── entities │ │ │ │ ├── collections │ │ │ │ │ ├── panels.js │ │ │ │ │ ├── sections.js │ │ │ │ │ ├── templates.js │ │ │ │ │ ├── library.js │ │ │ │ │ ├── settings.js │ │ │ │ │ ├── searchable.js │ │ │ │ │ └── controls.js │ │ │ │ └── models │ │ │ │ │ ├── setting.js │ │ │ │ │ ├── panel.js │ │ │ │ │ ├── section.js │ │ │ │ │ └── control.js │ │ │ ├── modules │ │ │ │ ├── modal │ │ │ │ │ ├── show │ │ │ │ │ │ ├── empty-modal.js │ │ │ │ │ │ ├── empty-section.js │ │ │ │ │ │ ├── sections.js │ │ │ │ │ │ ├── tabs.js │ │ │ │ │ │ └── tab.js │ │ │ │ │ └── modal.js │ │ │ │ ├── panels │ │ │ │ │ ├── show │ │ │ │ │ │ ├── panels-empty.js │ │ │ │ │ │ ├── panels.js │ │ │ │ │ │ └── panel-menu-item.js │ │ │ │ │ └── panels.js │ │ │ │ ├── dialog │ │ │ │ │ ├── dialog.js │ │ │ │ │ └── dialog-region.js │ │ │ │ ├── templates │ │ │ │ │ └── templates.js │ │ │ │ ├── library │ │ │ │ │ ├── library.js │ │ │ │ │ └── show │ │ │ │ │ │ └── library-menu-item.js │ │ │ │ └── sections │ │ │ │ │ └── show │ │ │ │ │ └── default-menu-item.js │ │ │ ├── components │ │ │ │ ├── controls │ │ │ │ │ ├── list-empty.js │ │ │ │ │ ├── textarea.js │ │ │ │ │ ├── select.js │ │ │ │ │ ├── radio.js │ │ │ │ │ ├── switch.js │ │ │ │ │ ├── text.js │ │ │ │ │ ├── checkbox.js │ │ │ │ │ ├── button-group.js │ │ │ │ │ └── input-group.js │ │ │ │ ├── sections │ │ │ │ │ └── section-empty.js │ │ │ │ ├── panels │ │ │ │ │ └── panel-empty.js │ │ │ │ └── behaviors │ │ │ │ │ └── panel.js │ │ │ └── preview.js │ │ └── shared │ │ │ ├── components │ │ │ ├── behaviors │ │ │ │ └── draggable.js │ │ │ └── ui │ │ │ │ └── lightbox.js │ │ │ └── utility │ │ │ ├── polyfills │ │ │ ├── raf.js │ │ │ └── transitions.js │ │ │ └── debug.js │ └── dist │ │ └── tinymce.min.js └── css │ ├── ie.min.css │ ├── ie.css │ ├── admin.min.css │ ├── ie.css.map │ ├── ie.min.css.map │ ├── admin.css │ ├── admin.css.map │ ├── admin.min.css.map │ ├── tinymce.min.css │ ├── tinymce.css │ ├── tinymce.css.map │ └── tinymce.min.css.map ├── languages ├── tailor-pt_BR.mo ├── tailor-pt_PT.mo ├── readme.txt └── tinymce-localization.php ├── partials ├── meta-date.php ├── meta-category.php ├── underscore │ ├── modal-item.php │ ├── modal-empty.php │ ├── sidebar-home-empty.php │ ├── sidebar-layout.php │ ├── dialog-save-template.php │ ├── dialog-import-template.php │ ├── element-empty.php │ ├── dialog-layout.php │ ├── canvas-tools.php │ ├── sidebar-home.php │ ├── modal-layout.php │ └── control-icon-select.php ├── empty.php ├── admin │ ├── field-textarea.php │ ├── html │ │ ├── notice.php │ │ ├── notice-missing-rest-api.php │ │ ├── notice-layout-deleted.php │ │ ├── notice-tailored-content.php │ │ └── page-settings.php │ ├── field-text.php │ ├── field-number.php │ ├── field-select.php │ ├── field-checkbox.php │ └── field-icon.php ├── sidebar │ └── sidebar-tools.php ├── navigation-thumbnail.php ├── loop-carousel.php ├── meta-author.php ├── loop-list.php ├── author-box.php ├── loop-slideshow.php ├── meta-post.php ├── pagination-links.php ├── loop-grid.php ├── meta-comment-number.php ├── content-post.php ├── meta-excerpt.php ├── meta-thumbnail.php └── author-links.php ├── .bin ├── bundle-js ├── bundle-min-js ├── build-css └── build-min-css ├── uninstall.php ├── lib └── scssphp │ ├── src │ ├── Version.php │ ├── Exception │ │ ├── ServerException.php │ │ ├── ParserException.php │ │ └── CompilerException.php │ ├── Node.php │ ├── Compiler │ │ └── Environment.php │ ├── Formatter │ │ ├── OutputBlock.php │ │ ├── Compact.php │ │ ├── Crunched.php │ │ ├── Compressed.php │ │ └── Expanded.php │ ├── Base │ │ └── Range.php │ ├── Block.php │ └── Util.php │ └── scss.inc.php ├── api.md └── package.json /index.php: -------------------------------------------------------------------------------- 1 | ' . get_the_date() . ''; -------------------------------------------------------------------------------- /assets/scss/tools/_clearfix.scss: -------------------------------------------------------------------------------- 1 | /// 2 | /// Micro clearfix provides an easy way to contain floats without adding additional markup 3 | /// 4 | @mixin clearfix { 5 | 6 | &::after { 7 | content: ""; 8 | display: table; 9 | clear: both; 10 | } 11 | } -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/list-empty.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The empty-list view. 3 | * 4 | * @since 1.0.0 5 | */ 6 | var EmptyListView = Marionette.ItemView.extend( { 7 | 8 | template : '#tmpl-tailor-control-list-empty' 9 | 10 | } ); 11 | 12 | module.exports = EmptyListView; -------------------------------------------------------------------------------- /assets/css/ie.css: -------------------------------------------------------------------------------- 1 | .tailor-ui .tailor-column, 2 | .tailor-ui .tailor-grid__item { 3 | float: left; 4 | } 5 | 6 | .tailor-ui .tailor-section::after, 7 | .tailor-ui .tailor-grid::after { 8 | content: ""; 9 | display: table; 10 | clear: both; 11 | } 12 | 13 | /*# sourceMappingURL=ie.css.map */ -------------------------------------------------------------------------------- /partials/meta-category.php: -------------------------------------------------------------------------------- 1 | ' . get_the_category_list( ', ' ) . ''; -------------------------------------------------------------------------------- /.bin/bundle-js: -------------------------------------------------------------------------------- 1 | browserify assets/js/src/canvas.js > assets/js/dist/canvas.js 2 | browserify assets/js/src/sidebar.js > assets/js/dist/sidebar.js 3 | browserify assets/js/src/frontend.js > assets/js/dist/frontend.js 4 | browserify assets/js/src/admin.js > assets/js/dist/admin.js 5 | browserify assets/js/src/tinymce.js > assets/js/dist/tinymce.js -------------------------------------------------------------------------------- /partials/underscore/modal-item.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/entities/models/setting.js: -------------------------------------------------------------------------------- 1 | var SettingModel = Backbone.Model.extend( { 2 | 3 | /** 4 | * The default parameters for a setting. 5 | * 6 | * @since 1.0.0 7 | * 8 | * @returns object 9 | */ 10 | defaults: { 11 | id : '', 12 | type : '' 13 | } 14 | } ); 15 | 16 | module.exports = SettingModel; 17 | -------------------------------------------------------------------------------- /partials/empty.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |

14 | 15 | 16 | 17 |

-------------------------------------------------------------------------------- /assets/scss/components/sidebar/controls/_range.scss: -------------------------------------------------------------------------------- 1 | .control { 2 | 3 | &--range { 4 | 5 | input { 6 | vertical-align: middle; 7 | } 8 | 9 | input[type=range] { 10 | float: left; 11 | margin-right: 6px; 12 | } 13 | 14 | input[type=text] { 15 | display: block; 16 | overflow: hidden; 17 | width: auto; 18 | max-width: 40px; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /assets/scss/trumps/canvas/_rtl.scss: -------------------------------------------------------------------------------- 1 | [dir=rtl] { 2 | 3 | .#{$global-class-prefix}ui { 4 | 5 | // Tools 6 | .tools { 7 | 8 | .select { 9 | 10 | &__menu { 11 | left: auto; 12 | right: 1px; 13 | } 14 | 15 | &__item { 16 | float: right; 17 | } 18 | 19 | &__controls { 20 | left: 1px; 21 | right: auto; 22 | } 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /uninstall.php: -------------------------------------------------------------------------------- 1 | ` assets/js/dist/canvas.min.js 2 | browserify assets/js/src/sidebar.js | uglifyjs > assets/js/dist/sidebar.min.js 3 | browserify assets/js/src/frontend.js | uglifyjs > assets/js/dist/frontend.min.js 4 | browserify assets/js/src/admin.js | uglifyjs > assets/js/dist/admin.min.js 5 | browserify assets/js/src/tinymce.js | uglifyjs > assets/js/dist/tinymce.min.js -------------------------------------------------------------------------------- /partials/admin/field-textarea.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/entities/models/panel.js: -------------------------------------------------------------------------------- 1 | var PanelModel = Backbone.Model.extend( { 2 | 3 | /** 4 | * The default parameters for a panel. 5 | * 6 | * @since 1.0.0 7 | * 8 | * @returns object 9 | */ 10 | defaults: { 11 | id : '', 12 | title : '', 13 | description : '', 14 | collection : '', 15 | priority : 0 16 | } 17 | } ); 18 | 19 | module.exports = PanelModel; 20 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/entities/models/section.js: -------------------------------------------------------------------------------- 1 | var SectionModel = Backbone.Model.extend( { 2 | 3 | /** 4 | * The default parameters for a section. 5 | * 6 | * @since 1.0.0 7 | * 8 | * @returns object 9 | */ 10 | defaults: { 11 | id : '', 12 | title : '', 13 | description : '', 14 | priority : 0, 15 | panel : '' 16 | } 17 | } ); 18 | 19 | module.exports = SectionModel; 20 | -------------------------------------------------------------------------------- /assets/scss/ie.scss: -------------------------------------------------------------------------------- 1 | @import "variables"; 2 | 3 | // 4 | // Tools 5 | // 6 | @import "tools/clearfix"; 7 | 8 | 9 | // 10 | // Exported selectors 11 | // 12 | .#{$global-class-prefix}ui { 13 | 14 | .#{$global-class-prefix}column, 15 | .#{$global-class-prefix}grid__item { 16 | float: left; 17 | } 18 | 19 | .#{$global-class-prefix}section, 20 | .#{$global-class-prefix}grid { 21 | @include clearfix; 22 | } 23 | } -------------------------------------------------------------------------------- /partials/admin/html/notice.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 18 | -------------------------------------------------------------------------------- /assets/css/admin.min.css: -------------------------------------------------------------------------------- 1 | .tailor-icon-kits{margin-bottom:1em}.tailor-icons__actions{max-width:120px}.tailor-icons__actions .button,.tailor-icons__actions .spinner{float:left}.tailor-icons__actions::after{content:"";display:table;clear:both}.settings-information{background-color:#fff;padding:1em 2em}@media only screen and (min-width: 641px){.settings-information{position:absolute;right:20px}} 2 | 3 | /*# sourceMappingURL=admin.min.css.map */ -------------------------------------------------------------------------------- /partials/underscore/modal-empty.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /partials/underscore/sidebar-home-empty.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /assets/js/src/canvas/components/elements/children/tab.js: -------------------------------------------------------------------------------- 1 | var ContainerView = require( './../element-container' ), 2 | TabView; 3 | 4 | TabView = ContainerView.extend( { 5 | 6 | /** 7 | * Sets the DOM element ID to the model ID. 8 | * 9 | * @since 1.0.0 10 | */ 11 | onRenderTemplate : function() { 12 | this.el.draggable = false; 13 | this.el.id = this.model.cid; 14 | } 15 | 16 | } ); 17 | 18 | module.exports = TabView; -------------------------------------------------------------------------------- /lib/scssphp/src/Version.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class Version 20 | { 21 | const VERSION = 'v0.6.6'; 22 | } 23 | -------------------------------------------------------------------------------- /partials/admin/field-text.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /assets/css/ie.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "file": "ie.css", 4 | "sources": [ 5 | "../scss/ie.scss", 6 | "../scss/_variables.scss", 7 | "../scss/tools/_clearfix.scss" 8 | ], 9 | "names": [], 10 | "mappings": "AAWA,AAEC,UAFS,CAET,cAAc;AAFf,AAGC,UAHS,CAGT,kBAAkB,CAAiB;EAClC,KAAK,EAAE,IAAI;CACX;;AALF,AAOC,UAPS,CAOT,eAAe,AEbb,OAAS;AFMZ,AAQC,UARS,CAQT,YAAY,AEdV,OAAS,CAAC;EACL,OAAO,EAAE,EAAE;EACX,OAAO,EAAE,KAAK;EACd,KAAK,EAAE,IAAI;CACd" 11 | } -------------------------------------------------------------------------------- /assets/css/ie.min.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "file": "ie.min.css", 4 | "sources": [ 5 | "../scss/ie.scss", 6 | "../scss/_variables.scss", 7 | "../scss/tools/_clearfix.scss" 8 | ], 9 | "names": [], 10 | "mappings": "AAWA,AAEC,UAFS,CAET,cAAc,CAFf,AAGC,UAHS,CAGT,kBAAkB,AAAiB,CAClC,KAAK,CAAE,IAAI,CACX,AALF,AAOC,UAPS,CAOT,eAAe,AEbb,OAAS,CFMZ,AAQC,UARS,CAQT,YAAY,AEdV,OAAS,AAAC,CACL,OAAO,CAAE,EAAE,CACX,OAAO,CAAE,KAAK,CACd,KAAK,CAAE,IAAI,CACd" 11 | } -------------------------------------------------------------------------------- /lib/scssphp/src/Exception/ServerException.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class ServerException extends \Exception 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /lib/scssphp/src/Exception/ParserException.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class ParserException extends \Exception 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /lib/scssphp/src/Exception/CompilerException.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class CompilerException extends \Exception 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /partials/admin/field-number.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /partials/sidebar/sidebar-tools.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 | 15 |
16 |
17 |
-------------------------------------------------------------------------------- /assets/js/src/canvas/components/elements/children/carousel-item.js: -------------------------------------------------------------------------------- 1 | var ContainerView = require( './../element-container' ), 2 | CarouselItemView; 3 | 4 | CarouselItemView = ContainerView.extend( { 5 | 6 | /** 7 | * Sets the DOM element ID to the model ID. 8 | * 9 | * @since 1.0.0 10 | */ 11 | onRenderTemplate : function() { 12 | this.el.draggable = false; 13 | this.el.id = this.model.cid; 14 | } 15 | 16 | } ); 17 | 18 | module.exports = CarouselItemView; -------------------------------------------------------------------------------- /assets/js/src/sidebar/entities/models/control.js: -------------------------------------------------------------------------------- 1 | var ControlModel = Backbone.Model.extend( { 2 | 3 | /** 4 | * The default parameters for a control. 5 | * 6 | * @since 1.0.0 7 | * 8 | * @returns object 9 | */ 10 | defaults: { 11 | id : '', 12 | label : '', 13 | description : '', 14 | type : '', 15 | choices : {}, 16 | priority : 0, 17 | setting : '', 18 | section : '' // Only used for controls on the Settings panel 19 | } 20 | } ); 21 | 22 | module.exports = ControlModel; 23 | -------------------------------------------------------------------------------- /assets/scss/objects/_embeds.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Exported selectors 3 | // 4 | .#{$global-class-prefix}responsive-embed { 5 | position: relative; 6 | display: block; 7 | padding: 0; 8 | padding-bottom: 56.25%; 9 | height: 0; 10 | overflow: hidden; 11 | 12 | iframe, 13 | embed, 14 | object, 15 | video { 16 | position: absolute; 17 | top: 0; 18 | left: 0; 19 | bottom: 0; 20 | height: 100%; 21 | width: 100%; 22 | border: 0; 23 | } 24 | 25 | &.tailor-responsive-embed-4by3 { 26 | padding-bottom: 75%; 27 | } 28 | } -------------------------------------------------------------------------------- /partials/underscore/sidebar-layout.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/sections/section-empty.js: -------------------------------------------------------------------------------- 1 | var EmptySectionView = Marionette.ItemView.extend( { 2 | 3 | className : 'empty', 4 | 5 | /** 6 | * Returns the appropriate template based on the section type. 7 | * 8 | * @since 1.0.0 9 | * @returns {string} 10 | */ 11 | getTemplate : function() { 12 | var type = this.model.get( 'type' ) || 'default'; 13 | return '#tmpl-tailor-section-' + type + '-empty'; 14 | } 15 | 16 | } ); 17 | 18 | module.exports = EmptySectionView; -------------------------------------------------------------------------------- /assets/scss/generic/_box-sizing.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Set the global `box-sizing` state to `border-box`. 3 | // 4 | // css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice 5 | // paulirish.com/2012/box-sizing-border-box-ftw 6 | // 7 | html { 8 | -webkit-box-sizing: border-box; 9 | -moz-box-sizing: border-box; 10 | box-sizing: border-box; 11 | } 12 | 13 | * { 14 | 15 | &, 16 | &::before, 17 | &::after { 18 | -webkit-box-sizing: inherit; 19 | -moz-box-sizing: inherit; 20 | box-sizing: inherit; 21 | } 22 | } -------------------------------------------------------------------------------- /partials/admin/html/notice-missing-rest-api.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 |

15 | ', 18 | '' 19 | ); ?> 20 |

21 |
-------------------------------------------------------------------------------- /partials/underscore/dialog-save-template.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /partials/admin/html/notice-layout-deleted.php: -------------------------------------------------------------------------------- 1 | 18 | 19 |

-------------------------------------------------------------------------------- /partials/underscore/dialog-import-template.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /assets/scss/tools/_transform.scss: -------------------------------------------------------------------------------- 1 | @mixin transform($property: none) { 2 | // none | 3 | @include prefixer(transform, $property, webkit moz ms o spec); 4 | } 5 | 6 | @mixin transform-origin($axes: 50%) { 7 | // x-axis - left | center | right | length | % 8 | // y-axis - top | center | bottom | length | % 9 | // z-axis - length 10 | @include prefixer(transform-origin, $axes, webkit moz ms o spec); 11 | } 12 | 13 | @mixin transform-style ($style: flat) { 14 | @include prefixer(transform-style, $style, webkit moz ms o spec); 15 | } 16 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/textarea.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Controls.Textarea 3 | * 4 | * A textarea control. 5 | * 6 | * @augments Marionette.ItemView 7 | */ 8 | var AbstractControl = require( './abstract-control' ), 9 | TextareaControl; 10 | 11 | TextareaControl = AbstractControl.extend( { 12 | 13 | ui : { 14 | 'input' : 'textarea', 15 | 'mediaButton' : '.js-setting-group .button', 16 | 'defaultButton' : '.js-default', 17 | 'controlGroups' : '.control__body > *' 18 | } 19 | 20 | } ); 21 | 22 | module.exports = TextareaControl; 23 | -------------------------------------------------------------------------------- /partials/admin/field-select.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /partials/underscore/element-empty.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/panels/panel-empty.js: -------------------------------------------------------------------------------- 1 | var EmptyPanelView = Marionette.ItemView.extend( { 2 | 3 | className : 'empty', 4 | 5 | initialize : function( options ) { 6 | this.type = options.type; 7 | }, 8 | 9 | /** 10 | * Returns the appropriate template based on the panel type. 11 | * 12 | * @since 1.0.0 13 | * @returns {string} 14 | */ 15 | getTemplate : function() { 16 | var type = this.type || 'default'; 17 | return '#tmpl-tailor-panel-' + type + '-empty'; 18 | } 19 | 20 | } ); 21 | 22 | module.exports = EmptyPanelView; -------------------------------------------------------------------------------- /assets/js/src/canvas/components/elements/containers/navigation/carousel-navigation-item.js: -------------------------------------------------------------------------------- 1 | module.exports = Marionette.ItemView.extend( { 2 | 3 | tagName : 'li', 4 | 5 | attributes : function() { 6 | return { 7 | 'data-id' : this.model.cid 8 | }; 9 | }, 10 | 11 | /** 12 | * Returns the element template. 13 | * 14 | * @since 1.0.0 15 | * 16 | * @returns {string} 17 | */ 18 | getTemplate : function() { 19 | return _.template( '' ); 20 | } 21 | 22 | } ); 23 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/panels/show/panels.js: -------------------------------------------------------------------------------- 1 | var PanelsView = Marionette.CompositeView.extend( { 2 | 3 | getChildView : function() { 4 | return Tailor.lookup( 'panels', false, 'Items' ); 5 | }, 6 | 7 | childViewContainer : '#items', 8 | 9 | emptyView : require( './panels-empty' ), 10 | 11 | behaviors : { 12 | Panel : {} 13 | }, 14 | 15 | /** 16 | * Returns the appropriate template based on the panel type. 17 | * 18 | * @since 1.0.0 19 | * @returns {string} 20 | */ 21 | template : '#tmpl-tailor-home' 22 | 23 | } ); 24 | 25 | module.exports = PanelsView; -------------------------------------------------------------------------------- /assets/scss/trumps/shared/_wordpress.scss: -------------------------------------------------------------------------------- 1 | .#{$global-class-prefix}ui { 2 | 3 | .screen-reader-text { 4 | position: absolute; 5 | margin: -1px; 6 | padding: 0; 7 | height: 1px; 8 | width: 1px; 9 | overflow: hidden; 10 | clip: rect(0 0 0 0); 11 | border: 0; 12 | word-wrap: normal !important; 13 | } 14 | 15 | .not-a-button { 16 | background: 0 0; 17 | border: none; 18 | -webkit-box-shadow: none; 19 | box-shadow: none; 20 | -webkit-border-radius: 0; 21 | border-radius: 0; 22 | outline: 0; 23 | padding: 0; 24 | margin: 0; 25 | } 26 | 27 | .is-hidden { 28 | display: none !important; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assets/scss/admin.scss: -------------------------------------------------------------------------------- 1 | @import "variables"; 2 | 3 | // 4 | // Tools 5 | // 6 | @import "tools/clearfix"; 7 | 8 | 9 | // 10 | // Exported selectors 11 | // 12 | .tailor { 13 | 14 | &-icon-kits { 15 | margin-bottom: 1em; 16 | } 17 | 18 | &-icons__actions { 19 | max-width: 120px; 20 | 21 | .button, 22 | .spinner { 23 | float: left; 24 | } 25 | 26 | @include clearfix; 27 | } 28 | } 29 | 30 | .settings-information { 31 | background-color: $global-white-color; 32 | padding: 1em 2em; 33 | } 34 | 35 | @media #{$wp-medium-up} { 36 | 37 | .settings-information { 38 | position: absolute; 39 | right: 20px; 40 | } 41 | } -------------------------------------------------------------------------------- /assets/css/admin.css: -------------------------------------------------------------------------------- 1 | .tailor-icon-kits { 2 | margin-bottom: 1em; 3 | } 4 | 5 | .tailor-icons__actions { 6 | max-width: 120px; 7 | } 8 | 9 | .tailor-icons__actions .button, 10 | .tailor-icons__actions .spinner { 11 | float: left; 12 | } 13 | 14 | .tailor-icons__actions::after { 15 | content: ""; 16 | display: table; 17 | clear: both; 18 | } 19 | 20 | .settings-information { 21 | background-color: #fff; 22 | padding: 1em 2em; 23 | } 24 | 25 | @media only screen and (min-width: 641px) { 26 | .settings-information { 27 | position: absolute; 28 | right: 20px; 29 | } 30 | } 31 | 32 | /*# sourceMappingURL=admin.css.map */ -------------------------------------------------------------------------------- /api.md: -------------------------------------------------------------------------------- 1 | # REST API 2 | 3 | | Endpoint | POST | GET | PUT | DELETE | 4 | |----------|:--------:|:--------:|:--------:|:--------:| 5 | | /wp-json/tailor/v2/elements/ | ✗ | ✔ | ✗ | ✗ | 6 | | /wp-json/tailor/v2/elements/**{tag}** | ✗ | ✔ | ✗ | ✗ | 7 | | /wp-json/tailor/v2/templates/ | ✔ | ✔ | ✗ | ✗ | 8 | | /wp-json/tailor/v2/templates/**{id}** | ✗ | ✔ | ✔ | ✔ | 9 | | /wp-json/tailor/v2/models/**{post_id}** | ✔ | ✔ | ✔ | ✔ | 10 | | /wp-json/tailor/v2/models/**{post_id}**/**{id}** | ✗ | ✔ | ✔ | ✔ | -------------------------------------------------------------------------------- /assets/js/src/sidebar/preview.js: -------------------------------------------------------------------------------- 1 | /* window._l10n, window._mediaQueries */ 2 | 3 | var $ = jQuery; 4 | var title = document.querySelector( '.tailor__home .title' ); 5 | 6 | Tailor.Api.Setting.onChange( 'sidebar:_post_title', function( to, from ) { 7 | if ( title.hasChildNodes() ) { 8 | var children = title.childNodes; 9 | for ( var i = 1; i < children.length; i++ ) { 10 | if ( 3 == children[ i ].nodeType && -1 !== children[ i ].nodeValue.indexOf( from ) ) { 11 | children[ i ].nodeValue = to; 12 | } 13 | } 14 | } 15 | 16 | document.title = window._l10n.tailoring + to; 17 | } ); -------------------------------------------------------------------------------- /assets/js/src/sidebar/entities/collections/templates.js: -------------------------------------------------------------------------------- 1 | var SearchableCollection = require( './searchable' ), 2 | TemplateCollection; 3 | 4 | TemplateCollection = SearchableCollection.extend( { 5 | 6 | model : require( '../models/template' ), 7 | 8 | comparator : 'name', 9 | 10 | /** 11 | * Returns the attributes of a model to use in a search. 12 | * 13 | * @since 1.0.0 14 | * 15 | * @param model 16 | * @returns {string} 17 | */ 18 | getHaystack : function( model ) { 19 | return [ 20 | model.get( 'id' ), 21 | model.get( 'label' ) 22 | ].join( ' ' ); 23 | } 24 | 25 | } ); 26 | 27 | module.exports = TemplateCollection; 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tailor", 3 | "version": "1.8.1", 4 | "scripts": { 5 | "bundle-js": "./.bin/bundle-js && ./.bin/bundle-min-js", 6 | "build-css": "./.bin/build-css && ./.bin/build-min-css", 7 | "build": "npm run bundle-js & npm run build-css", 8 | "postinstall": "npm run build" 9 | }, 10 | "author": "Andrew Worsfold (http://andrewworsfold.com)", 11 | "license": "gpl3", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/andrew-worsfold/tailor/tree/master" 15 | }, 16 | "devDependencies": { 17 | "browserify": "^13.1.1", 18 | "node-sass": "^3.10.1", 19 | "uglify-js": "^2.7.4" 20 | } 21 | } -------------------------------------------------------------------------------- /partials/navigation-thumbnail.php: -------------------------------------------------------------------------------- 1 | have_posts() ) { 14 | 15 | echo ''; 30 | echo ''; 31 | } 32 | else { 33 | tailor_partial( 'empty' ); 34 | } 35 | 36 | wp_reset_postdata(); -------------------------------------------------------------------------------- /assets/scss/objects/_pagination.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $pagination-font-size: 0.85em !default; 7 | $pagination-border-width: 1px !default; 8 | $pagination-border-style : solid !default; 9 | $pagination-border-color: $border-color !default; 10 | $pagination-border-radius: 4px !default; 11 | 12 | 13 | // 14 | // Exported selectors 15 | // 16 | .entry-pagination { 17 | 18 | .next, 19 | .previous, 20 | .page-numbers { 21 | display: inline-block; 22 | padding: 0.125em 0.5em; 23 | border-radius: $pagination-border-radius; 24 | background-color: #fefefe; 25 | font-size: $pagination-font-size; 26 | } 27 | 28 | a { 29 | border: $pagination-border-width $pagination-border-style $pagination-border-color; 30 | } 31 | } -------------------------------------------------------------------------------- /.bin/build-min-css: -------------------------------------------------------------------------------- 1 | node-sass --output-style compressed --sourceMap assets/css/admin.min.css.map assets/scss/admin.scss assets/css/admin.min.css 2 | node-sass --output-style compressed --sourceMap assets/css/canvas.min.css.map assets/scss/canvas.scss assets/css/canvas.min.css 3 | node-sass --output-style compressed --sourceMap assets/css/frontend.min.css.map assets/scss/frontend.scss assets/css/frontend.min.css 4 | node-sass --output-style compressed --sourceMap assets/css/ie.min.css.map assets/scss/ie.scss assets/css/ie.min.css 5 | node-sass --output-style compressed --sourceMap assets/css/sidebar.min.css.map assets/scss/sidebar.scss assets/css/sidebar.min.css 6 | node-sass --output-style compressed --sourceMap assets/css/tinymce.min.css.map assets/scss/tinymce.scss assets/css/tinymce.min.css -------------------------------------------------------------------------------- /lib/scssphp/src/Compiler/Environment.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class Environment 20 | { 21 | /** 22 | * @var \Leafo\ScssPhp\Block 23 | */ 24 | public $block; 25 | 26 | /** 27 | * @var \Leafo\ScssPhp\Compiler\Environment 28 | */ 29 | public $parent; 30 | 31 | /** 32 | * @var array 33 | */ 34 | public $store; 35 | 36 | /** 37 | * @var integer 38 | */ 39 | public $depth; 40 | } 41 | -------------------------------------------------------------------------------- /assets/scss/components/sidebar/controls/_radio.scss: -------------------------------------------------------------------------------- 1 | .control--radio { 2 | 3 | label { 4 | line-height: 32px; 5 | } 6 | 7 | input[type=radio] { 8 | border-radius: 50%; 9 | border: 1px solid #b4b9be; 10 | background: #fff; 11 | cursor: pointer; 12 | height: 16px; 13 | margin: -4px 5px 0 0; 14 | vertical-align: middle; 15 | width: 16px; 16 | -webkit-appearance: none; 17 | box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); 18 | transition: .05s border-color ease-in-out; 19 | 20 | &::before { 21 | border-radius: 50%; 22 | } 23 | 24 | &:checked::before { 25 | content: '\2022'; 26 | text-indent: -9999px; 27 | border-radius: 50%; 28 | width: 6px; 29 | height: 6px; 30 | margin: 1px -1px; 31 | background-color: #1e8cbe; 32 | float: left; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /assets/js/src/canvas/entities/models/containers/row.js: -------------------------------------------------------------------------------- 1 | var ContainerModel = require( './../element-container' ), 2 | RowModel; 3 | 4 | RowModel = ContainerModel.extend( { 5 | 6 | /** 7 | * Returns true if this element is a valid drop target. 8 | * 9 | * @since 1.0.0 10 | * 11 | * @param that The element being dragged 12 | * @param region The region of this element that the other element is over 13 | */ 14 | validTarget : function( that, region ) { 15 | if ( 'child' == that.get( 'type' ) || 'tailor_section' == that.get( 'tag' ) || 'center' == region ) { 16 | return false; 17 | } 18 | 19 | return _.contains( [ 'top', 'bottom' ], region ) && 'tailor_column' != that.get( 'tag' ); 20 | } 21 | 22 | } ); 23 | 24 | module.exports = RowModel; -------------------------------------------------------------------------------- /assets/js/src/canvas/components/behaviors/droppable.js: -------------------------------------------------------------------------------- 1 | var DroppableBehaviors = Marionette.Behavior.extend( { 2 | 3 | events : { 4 | 'dragover' : 'onDragOver', 5 | 'drop' : 'onDrop' 6 | }, 7 | 8 | /** 9 | * Triggers an event when the item is dragged over another item. 10 | * 11 | * @since 1.0.0 12 | * 13 | * @param e 14 | */ 15 | onDragOver: function( e ) { 16 | app.channel.trigger( 'canvas:dragover', e.originalEvent, this.view ); 17 | }, 18 | 19 | /** 20 | * Triggers an event when the item is dropped. 21 | * 22 | * @since 1.0.0 23 | * 24 | * @param e 25 | */ 26 | onDrop : function( e ) { 27 | app.channel.trigger( 'canvas:drop', e.originalEvent, this.view ); 28 | } 29 | 30 | } ); 31 | 32 | module.exports = DroppableBehaviors; -------------------------------------------------------------------------------- /includes/customizer/customizer-panels.php: -------------------------------------------------------------------------------- 1 | array( 24 | 'title' => __( 'Tailor', 'tailor' ), 25 | 'priority' => 999, 26 | ), 27 | ); 28 | 29 | return apply_filters( 'tailor_customizer_panels', $panels ); 30 | } 31 | } -------------------------------------------------------------------------------- /partials/meta-author.php: -------------------------------------------------------------------------------- 1 | post_author ) ) { 16 | $authordata = get_userdata( $post->post_author ); 17 | } 18 | 19 | if ( empty( $authordata ) ) { 20 | return; 21 | } 22 | 23 | $author_name = get_the_author(); 24 | 25 | $author_link = sprintf( 26 | '', 27 | esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ), 28 | esc_attr( sprintf( __( 'Posts by %s', 'tailor' ), $author_name ) ), 29 | $author_name 30 | ); 31 | 32 | echo '' . __( 'By', 'tailor' ) . ' ' . $author_link . ''; -------------------------------------------------------------------------------- /assets/js/src/canvas/modules/tools/select-region.js: -------------------------------------------------------------------------------- 1 | var SelectRegion = Backbone.Marionette.Region.extend( { 2 | 3 | /** 4 | * Adds a class name to the underlying view when selected. 5 | * 6 | * @since 1.0.0 7 | * 8 | * @param view 9 | * @param region 10 | * @param options 11 | */ 12 | onShow : function( view, region, options ) { 13 | view._view.el.classList.add( 'is-selected' ); 14 | }, 15 | 16 | /** 17 | * Removes a class name from the underlying view when deselected. 18 | * 19 | * @since 1.0.0 20 | * 21 | * @param view 22 | * @param region 23 | * @param options 24 | */ 25 | onEmpty : function( view, region, options ) { 26 | view._view.el.classList.remove( 'is-selected' ); 27 | } 28 | 29 | } ); 30 | 31 | module.exports = SelectRegion; -------------------------------------------------------------------------------- /partials/loop-list.php: -------------------------------------------------------------------------------- 1 | have_posts() ) { 18 | 19 | echo '
'; 20 | 21 | while ( $q->have_posts() ) { 22 | $q->the_post(); 23 | 24 | tailor_partial( 'content', get_post_type(), $entry_args ); 25 | } 26 | 27 | echo '
'; 28 | 29 | if ( isset( $layout_args['pagination'] ) && true == $layout_args['pagination'] ) { 30 | tailor_partial( 'pagination', 'links', array( 'q' => $q ) ); 31 | } 32 | } 33 | else { 34 | tailor_partial( 'empty' ); 35 | } 36 | 37 | wp_reset_postdata(); -------------------------------------------------------------------------------- /languages/readme.txt: -------------------------------------------------------------------------------- 1 | === How To Translate Tailor === 2 | 3 | == Who translates Tailor? How can I get involved? == 4 | 5 | Anyone can help by suggesting new translations [here](https://translate.wordpress.org/projects/wp-plugins/tailor/). 6 | 7 | Once you've suggested a new translation, a GlotPress validator will review it. They will then approve, reject, or change your suggestions. Once your changes get approved, they are automatically shipped to all Tailor users using WordPress in your language. 8 | 9 | == How does GlotPress work? == 10 | 11 | You can find detailed GlotPress documentation on [this page](https://en.support.wordpress.com/glotpress/). 12 | 13 | == I want to change translations locally. Where can I download the .PO file for my language? == 14 | 15 | You'll find options to create a .PO file and export translations at the bottom of each language page in GlotPress. -------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/modal/show/sections.js: -------------------------------------------------------------------------------- 1 | var SectionCollectionView = Marionette.CollectionView.extend( { 2 | 3 | childView : require( './section' ), 4 | 5 | emptyView : require( './empty-modal' ), 6 | 7 | /** 8 | * Returns the appropriate set of options for the child view. 9 | * 10 | * @since 1.0.0 11 | * 12 | * @param model 13 | * @param index 14 | * @returns {{model: *}} 15 | */ 16 | childViewOptions : function( model, index ) { 17 | 18 | return { 19 | model : model, 20 | element : this.element, 21 | collection : this.controls 22 | }; 23 | }, 24 | 25 | initialize : function( options ) { 26 | this.element = options.element; 27 | this.controls = options.controls; 28 | } 29 | 30 | } ); 31 | 32 | module.exports = SectionCollectionView; -------------------------------------------------------------------------------- /partials/underscore/dialog-layout.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /includes/customizer/customizer-sections.php: -------------------------------------------------------------------------------- 1 | array( 24 | 'title' => __( 'Layout', 'tailor' ), 25 | 'priority' => 10, 26 | 'panel' => 'tailor', 27 | ), 28 | ); 29 | 30 | return apply_filters( 'tailor_customizer_sections', $sections ); 31 | } 32 | } -------------------------------------------------------------------------------- /lib/scssphp/src/Formatter/OutputBlock.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class OutputBlock 20 | { 21 | /** 22 | * @var string 23 | */ 24 | public $type; 25 | 26 | /** 27 | * @var integer 28 | */ 29 | public $depth; 30 | 31 | /** 32 | * @var array 33 | */ 34 | public $selectors; 35 | 36 | /** 37 | * @var array 38 | */ 39 | public $lines; 40 | 41 | /** 42 | * @var array 43 | */ 44 | public $children; 45 | 46 | /** 47 | * @var \Leafo\ScssPhp\Formatter\OutputBlock 48 | */ 49 | public $parent; 50 | } 51 | -------------------------------------------------------------------------------- /partials/author-box.php: -------------------------------------------------------------------------------- 1 | 20 | 21 |
22 | 'tailor-author__avatar' ) ); ?> 23 |
24 |
25 |

26 | 27 | $author_id ) ) ?> 28 | 29 |

30 |
-------------------------------------------------------------------------------- /languages/tinymce-localization.php: -------------------------------------------------------------------------------- 1 | __( 'Select Icon', 'tailor' ), 28 | 'select' => __( 'Select', 'tailor' ), 29 | ); 30 | $locale = _WP_Editors::$mce_locale; 31 | $translated = 'tinyMCE.addI18n( "' . $locale . '.tailoricon", ' . json_encode( $strings ) . ");\n"; 32 | 33 | return $translated; 34 | } 35 | 36 | $strings = tailor_tinymce_localization(); -------------------------------------------------------------------------------- /assets/js/src/canvas/entities/models/children/grid-item.js: -------------------------------------------------------------------------------- 1 | var ChildModel = require( './../element-child' ), 2 | GridItemModel; 3 | 4 | GridItemModel = ChildModel.extend( { 5 | 6 | /** 7 | * Returns true if this element is a valid drop target. 8 | * 9 | * @since 1.0.0 10 | * 11 | * @param that The element being dragged 12 | * @param region The region of this element that the other element is over 13 | */ 14 | validTarget : function( that, region ) { 15 | if ( 'tailor_section' == that.get( 'tag' ) || _.contains( [ 'top', 'bottom', 'center' ], region ) ) { 16 | return false; 17 | } 18 | 19 | var parent = this.collection.getParent( this ); 20 | if ( parent.get( 'tag' ) == that.get( 'tag' ) ) { 21 | return false; 22 | } 23 | 24 | return that.get( 'tag' ) == this.get( 'tag' ); 25 | } 26 | 27 | } ); 28 | 29 | module.exports = GridItemModel; -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/select.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Controls.Select 3 | * 4 | * A select control. 5 | * 6 | * @augments Marionette.ItemView 7 | */ 8 | var AbstractControl = require( './abstract-control' ), 9 | SelectControl; 10 | 11 | SelectControl = AbstractControl.extend( { 12 | 13 | ui : { 14 | 'input' : 'select', 15 | 'mediaButton' : '.js-setting-group .button', 16 | 'defaultButton' : '.js-default', 17 | 'controlGroups' : '.control__body > *' 18 | }, 19 | 20 | events : { 21 | 'change @ui.input' : 'onFieldChange', 22 | 'click @ui.mediaButton' : 'onMediaButtonChange', 23 | 'click @ui.defaultButton' : 'onDefaultButtonChange' 24 | }, 25 | 26 | templateHelpers : { 27 | 28 | selected : function( media, key ) { 29 | return key === this.values[ media ] ? 'selected' : ''; 30 | } 31 | } 32 | 33 | } ); 34 | 35 | module.exports = SelectControl; 36 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/dialog/dialog.js: -------------------------------------------------------------------------------- 1 | var DialogView = require( './show/dialog' ), 2 | DialogModule; 3 | 4 | DialogModule = Marionette.Module.extend( { 5 | 6 | /** 7 | * Initializes the module. 8 | * 9 | * @since 1.0.0 10 | */ 11 | onStart : function() { 12 | var api = { 13 | 14 | /** 15 | * Opens the dialog window. 16 | * 17 | * @since 1.0.0 18 | * 19 | * @param options 20 | */ 21 | showDialog : function( options ) { 22 | app.dialog.show( new DialogView( options ) ); 23 | } 24 | }; 25 | 26 | this.listenTo( app.channel, 'dialog:open', api.showDialog ); 27 | 28 | /** 29 | * Fires when the module is initialized. 30 | * 31 | * @since 1.5.0 32 | * 33 | * @param this 34 | */ 35 | app.channel.trigger( 'module:dialog:ready', this ); 36 | } 37 | 38 | } ); 39 | 40 | module.exports = DialogModule; -------------------------------------------------------------------------------- /partials/loop-slideshow.php: -------------------------------------------------------------------------------- 1 | have_posts() ) { 18 | 19 | echo '
'; 20 | echo ''; 33 | echo '
'; 34 | } 35 | else { 36 | tailor_partial( 'empty' ); 37 | } 38 | 39 | wp_reset_postdata(); -------------------------------------------------------------------------------- /assets/scss/trumps/canvas/_utility.scss: -------------------------------------------------------------------------------- 1 | .#{$global-class-prefix}ui { 2 | 3 | // Override the visibility classes 4 | @media #{$mobile} { 5 | 6 | .u-hidden-mobile { 7 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVQYV2NkIAKckTrzn5GQOpAik2cmjHgVwhSBDMOpEFkRToXoirAqxKYIQyEuRSgK8SmCKySkCKyQGEUghQD+Nia8BIDCEQAAAABJRU5ErkJggg==) !important; 8 | } 9 | } 10 | 11 | @media #{$tablet} { 12 | 13 | .u-hidden-tablet { 14 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVQYV2NkIAKckTrzn5GQOpAik2cmjHgVwhSBDMOpEFkRToXoirAqxKYIQyEuRSgK8SmCKySkCKyQGEUghQD+Nia8BIDCEQAAAABJRU5ErkJggg==) !important; 15 | } 16 | } 17 | 18 | @media #{$desktop} { 19 | 20 | .u-hidden-desktop { 21 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVQYV2NkIAKckTrzn5GQOpAik2cmjHgVwhSBDMOpEFkRToXoirAqxKYIQyEuRSgK8SmCKySkCKyQGEUghQD+Nia8BIDCEQAAAABJRU5ErkJggg==) !important; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /partials/admin/field-checkbox.php: -------------------------------------------------------------------------------- 1 | $option ) { ?> 20 | 21 | 26 | 27 | 31 | 32 | 37 | 38 | = 1 ) { 28 | 29 | echo '
'; 30 | 31 | foreach ( $meta_order as $meta_type ) { 32 | if ( in_array( $meta_type, $meta ) ) { 33 | tailor_partial( 'meta', $meta_type ); 34 | } 35 | } 36 | 37 | echo '
'; 38 | } 39 | 40 | if ( in_array( 'excerpt', $meta ) ) { 41 | tailor_partial( 'meta', 'excerpt' ); 42 | } 43 | -------------------------------------------------------------------------------- /assets/js/src/canvas/entities/models/children/column.js: -------------------------------------------------------------------------------- 1 | var ChildModel = require( './../element-child' ), 2 | ColumnModel; 3 | 4 | ColumnModel = ChildModel.extend( { 5 | 6 | /** 7 | * Returns true if this element is a valid drop target. 8 | * 9 | * @since 1.0.0 10 | * 11 | * @param that The element being dragged 12 | * @param region The region of this element that the other element is over 13 | */ 14 | validTarget : function( that, region ) { 15 | if ( _.contains( [ 'tailor_section', 'tailor_row' ], that.get( 'tag' ) ) || ! _.contains( [ 'left', 'right' ], region ) ) { 16 | return false; 17 | } 18 | if ( 'child' == that.get( 'type' ) && that.get( 'tag' ) != this.get( 'tag' ) ) { 19 | return false; 20 | } 21 | var siblings = this.collection.getSiblings( this ); 22 | return that.get( 'parent' ) == this.get( 'parent' ) || siblings.length < 6; 23 | } 24 | 25 | } ); 26 | 27 | module.exports = ColumnModel; -------------------------------------------------------------------------------- /partials/pagination-links.php: -------------------------------------------------------------------------------- 1 | max_num_pages > 1 ) { 14 | 15 | $pagination_args = array( 16 | 'mid_size' => 1, 17 | 'prev_text' => _x( 'Previous', 'previous post', 'tailor' ), 18 | 'next_text' => _x( 'Next', 'next post', 'tailor' ), 19 | 'current' => $q->get( 'paged' ) ? absint( $q->get( 'paged' ) ) : 1, 20 | 'total' => $q->max_num_pages 21 | ); 22 | 23 | if ( $links = paginate_links( $pagination_args ) ) { ?> 24 | 25 | 31 | 32 | 18 | */ 19 | class Range 20 | { 21 | public $first; 22 | public $last; 23 | 24 | /** 25 | * Initialize range 26 | * 27 | * @param integer|float $first 28 | * @param integer|float $last 29 | */ 30 | public function __construct($first, $last) 31 | { 32 | $this->first = $first; 33 | $this->last = $last; 34 | } 35 | 36 | /** 37 | * Test for inclusion in range 38 | * 39 | * @param integer|float $value 40 | * 41 | * @return boolean 42 | */ 43 | public function includes($value) 44 | { 45 | return $value >= $this->first && $value <= $this->last; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/scssphp/src/Formatter/Compact.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | class Compact extends Formatter 22 | { 23 | /** 24 | * {@inheritdoc} 25 | */ 26 | public function __construct() 27 | { 28 | $this->indentLevel = 0; 29 | $this->indentChar = ''; 30 | $this->break = ''; 31 | $this->open = ' {'; 32 | $this->close = "}\n\n"; 33 | $this->tagSeparator = ','; 34 | $this->assignSeparator = ':'; 35 | $this->keepSemicolons = true; 36 | } 37 | 38 | /** 39 | * {@inheritdoc} 40 | */ 41 | public function indentStr() 42 | { 43 | return ' '; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /partials/admin/html/notice-tailored-content.php: -------------------------------------------------------------------------------- 1 | ID, '_tailor_layout', true ) ) { 15 | return; 16 | } 17 | 18 | $post_type_object = get_post_type_object( get_post_type( $post ) ); 19 | $alert_text = sprintf( 20 | __( 'This %1$s\'s layout was created by Tailor. You can modify content in the Editor and the changes will appear in both Tailor and the frontend.', 'tailor' ), 21 | lcfirst( $post_type_object->labels->singular_name ) 22 | ); 23 | 24 | $url = wp_nonce_url( admin_url( 'post.php?post=' . $post->ID . '&action=edit&tailor-delete-layout=1' ), 'tailor-delete-layout' ); ?> 25 | 26 |
27 |

28 | 29 |

30 |
-------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/radio.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Controls.Radio 3 | * 4 | * A radio control. 5 | * 6 | * @augments Marionette.ItemView 7 | */ 8 | var AbstractControl = require( './abstract-control' ), 9 | RadioControl; 10 | 11 | RadioControl = AbstractControl.extend( { 12 | 13 | events : { 14 | 'change @ui.input' : 'onFieldChange', 15 | 'click @ui.mediaButton' : 'onMediaButtonChange', 16 | 'click @ui.defaultButton' : 'onDefaultButtonChange' 17 | }, 18 | 19 | templateHelpers : { 20 | 21 | checked : function( media, key ) { 22 | return this.values[ media ] === key ? 'checked' : ''; 23 | } 24 | }, 25 | 26 | /** 27 | * Updates the current setting value when a field change occurs. 28 | * 29 | * @since 1.7.2 30 | */ 31 | onFieldChange : function() { 32 | this.setValue( this.ui.input.filter( '[name^="' + this.media + '"]:checked' ).val() ); 33 | } 34 | 35 | } ); 36 | 37 | module.exports = RadioControl; 38 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/modal/show/tabs.js: -------------------------------------------------------------------------------- 1 | var NavigationItemView = require( './tab' ), 2 | NavigationView; 3 | 4 | NavigationView = Marionette.CollectionView.extend( { 5 | 6 | tagName : 'ul', 7 | 8 | className : 'tabs', 9 | 10 | childView : NavigationItemView, 11 | 12 | childEvents : { 13 | select : 'onSelect' 14 | }, 15 | 16 | /** 17 | * Shows the first control section (tab). 18 | * 19 | * @since 1.0.0 20 | */ 21 | onRender : function() { 22 | if ( this.collection.length > 0 ) { 23 | this.children.first().triggerMethod( 'select' ); 24 | } 25 | }, 26 | 27 | /** 28 | * Shows the selected control section (tab). 29 | * 30 | * @since 1.0.0 31 | * 32 | * @param view 33 | */ 34 | onSelect : function( view ) { 35 | this.children.each( function( child ) { 36 | child.$el.toggleClass( 'is-active', view === child ); 37 | } ); 38 | } 39 | 40 | } ); 41 | 42 | module.exports = NavigationView; -------------------------------------------------------------------------------- /assets/scss/base/sidebar/_paragraph.scss: -------------------------------------------------------------------------------- 1 | p { 2 | margin-bottom: 1em; 3 | } 4 | 5 | a { 6 | color: #0073aa; 7 | -webkit-transition-property: border,background,color; 8 | transition-property: border,background,color; 9 | -webkit-transition-duration: .05s; 10 | transition-duration: .05s; 11 | -webkit-transition-timing-function: ease-in-out; 12 | transition-timing-function: ease-in-out; 13 | 14 | &:active, 15 | &:hover { 16 | color: #00a0d2; 17 | } 18 | 19 | &:focus { 20 | color: #124964; 21 | -webkit-box-shadow: 0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8); 22 | box-shadow: 0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8); 23 | } 24 | } 25 | 26 | .link { 27 | cursor: pointer; 28 | 29 | &--delete { 30 | 31 | &:hover { 32 | color: red; 33 | text-decoration: none; 34 | border: none; 35 | } 36 | } 37 | } 38 | 39 | kbd { 40 | padding: .2rem .4rem; 41 | font-size: 90%; 42 | color: #fff; 43 | background-color: #545454; 44 | border-radius: .2rem; 45 | box-shadow: inset 0 -.1rem 0 rgba( 0, 0, 0, .25 ); 46 | } -------------------------------------------------------------------------------- /lib/scssphp/src/Block.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class Block 20 | { 21 | /** 22 | * @var string 23 | */ 24 | public $type; 25 | 26 | /** 27 | * @var \Leafo\ScssPhp\Block 28 | */ 29 | public $parent; 30 | 31 | /** 32 | * @var integer 33 | */ 34 | public $sourceIndex; 35 | 36 | /** 37 | * @var integer 38 | */ 39 | public $sourceLine; 40 | 41 | /** 42 | * @var integer 43 | */ 44 | public $sourceColumn; 45 | 46 | /** 47 | * @var array 48 | */ 49 | public $selectors; 50 | 51 | /** 52 | * @var array 53 | */ 54 | public $comments; 55 | 56 | /** 57 | * @var array 58 | */ 59 | public $children; 60 | } 61 | -------------------------------------------------------------------------------- /assets/js/src/canvas/modules/tools/show/select-menu-item.js: -------------------------------------------------------------------------------- 1 | var SelectMenuItemView = Marionette.ItemView.extend( { 2 | 3 | tagName : 'div', 4 | 5 | className : 'select__item', 6 | 7 | events : { 8 | 'click' : 'onClick' 9 | }, 10 | 11 | getTemplate : function() { 12 | return _.template( '<%= label %>' ); 13 | }, 14 | 15 | /** 16 | * Toggles the breadcrumb list, or selects a breadcrumb. 17 | * 18 | * @since 1.0.0 19 | * 20 | * @param e 21 | */ 22 | onClick : function( e ) { 23 | if ( 0 === this._index ) { 24 | 25 | /** 26 | * Toggles the breadcrumbs. 27 | * 28 | * @since 1.0.0 29 | */ 30 | this.triggerMethod( 'toggle' ); 31 | } 32 | else { 33 | 34 | /** 35 | * Triggers a select event on the model. 36 | * 37 | * @since 1.0.0 38 | */ 39 | this.model.trigger( 'select' ); 40 | } 41 | 42 | e.stopPropagation(); 43 | } 44 | 45 | } ); 46 | 47 | module.exports = SelectMenuItemView; -------------------------------------------------------------------------------- /assets/scss/components/sidebar/controls/_style.scss: -------------------------------------------------------------------------------- 1 | .control--style { 2 | 3 | .control__input-group { 4 | 5 | .button { 6 | 7 | i::before { 8 | content: "\f225"; 9 | } 10 | 11 | &.is-active { 12 | 13 | i::before { 14 | content: "\f103"; 15 | } 16 | } 17 | } 18 | } 19 | 20 | /* 21 | ul { 22 | display: flex; 23 | } 24 | 25 | li { 26 | 27 | &:not( :first-child ) { 28 | 29 | input { 30 | border-left: none; 31 | } 32 | } 33 | 34 | span { 35 | margin-left: 2px; 36 | color: #a0a5aa; 37 | } 38 | 39 | .button { 40 | line-height: 20px; 41 | height: 26px; 42 | border: 1px solid #ddd; 43 | border-left: none; 44 | border-top-left-radius: 0; 45 | border-bottom-left-radius: 0; 46 | -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07); 47 | box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07); 48 | 49 | i::before { 50 | content: "\f225"; 51 | } 52 | 53 | &.is-active { 54 | 55 | i::before { 56 | content: "\f103"; 57 | } 58 | } 59 | } 60 | } */ 61 | } -------------------------------------------------------------------------------- /assets/js/src/shared/components/behaviors/draggable.js: -------------------------------------------------------------------------------- 1 | var DraggableBehaviors = Marionette.Behavior.extend( { 2 | 3 | events : { 4 | 'dragstart' : 'onDragStart', 5 | 'dragend' : 'onDragEnd', 6 | 'drag' : 'onDrag' 7 | }, 8 | 9 | /** 10 | * Triggers an event when dragging starts. 11 | * 12 | * @since 1.0.0 13 | * 14 | * @param e 15 | */ 16 | onDragStart : function( e ) { 17 | app.channel.trigger( 'canvas:dragstart', e.originalEvent, this.view ); 18 | }, 19 | 20 | /** 21 | * Triggers an event while dragging. 22 | * 23 | * @since 1.0.0 24 | * 25 | * @param e 26 | */ 27 | onDrag : function( e ) { 28 | app.channel.trigger( 'canvas:drag', e.originalEvent, this.view ); 29 | }, 30 | 31 | /** 32 | * Triggers an event when dragging ends. 33 | * 34 | * @since 1.0.0 35 | * 36 | * @param e 37 | */ 38 | onDragEnd : function( e ) { 39 | app.channel.trigger( 'canvas:dragend', e.originalEvent, this.view ); 40 | } 41 | 42 | } ); 43 | 44 | module.exports = DraggableBehaviors; -------------------------------------------------------------------------------- /partials/underscore/canvas-tools.php: -------------------------------------------------------------------------------- 1 | 17 | 18 | -------------------------------------------------------------------------------- /assets/scss/components/canvas/_canvas.scss: -------------------------------------------------------------------------------- 1 | .is-loading { 2 | background: url( ../img/spinner.gif ) no-repeat center center; 3 | -webkit-background-size: 20px 20px; 4 | background-size: 20px 20px; 5 | 6 | > * { 7 | opacity: 0.5; 8 | } 9 | } 10 | 11 | @media print, 12 | (-webkit-min-device-pixel-ratio: 1.25), 13 | (min-resolution: 120dpi) { 14 | 15 | .is-loading { 16 | background: url( ../img/spinner-2x.gif ) no-repeat center center; 17 | -webkit-background-size: 20px 20px; 18 | background-size: 20px 20px; 19 | } 20 | } 21 | 22 | [draggable=true] { 23 | -khtml-user-drag: element; 24 | -webkit-user-drag: element; 25 | -khtml-user-select: none; 26 | -webkit-user-select: none; 27 | 28 | @include prefixer( user-select, none, webkit moz ms spec ); 29 | } 30 | 31 | .#{$global-class-prefix}ui { 32 | 33 | .#{$global-class-prefix}element { 34 | cursor: default; 35 | 36 | .gm-style, 37 | iframe { 38 | pointer-events: none; 39 | } 40 | 41 | &.is-selected { 42 | 43 | .gm-style, 44 | iframe { 45 | pointer-events: all; 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /assets/js/src/canvas/entities/models/containers/tabs.js: -------------------------------------------------------------------------------- 1 | var ContainerModel = require( './../element-container' ), 2 | TabsModel; 3 | 4 | TabsModel = ContainerModel.extend( { 5 | 6 | /** 7 | * Creates a new template based on the element. 8 | * 9 | * @since 1.0.0 10 | * 11 | * @param id 12 | * @param view 13 | */ 14 | createTemplate : function( id, view ) { 15 | var isEditing = view.el.classList.contains( 'is-editing' ); 16 | view.$el.removeClass( 'is-dragging is-hovering is-selected is-editing' ); 17 | 18 | var $childViewContainer = view.getChildViewContainer( view ); 19 | var $children = $childViewContainer.contents().detach(); 20 | 21 | var $navigation = view.$el.find( '.tailor-tabs__navigation' ); 22 | var $navigationItems = $navigation.children().detach(); 23 | 24 | this.appendTemplate( id, view ); 25 | 26 | $childViewContainer.append( $children ); 27 | 28 | $navigation.append( $navigationItems ); 29 | 30 | if ( isEditing ) { 31 | view.el.classList.add( 'is-editing' ); 32 | } 33 | } 34 | 35 | } ); 36 | 37 | module.exports = TabsModel; -------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/dialog/dialog-region.js: -------------------------------------------------------------------------------- 1 | var DialogRegion = Backbone.Marionette.Region.extend( { 2 | 3 | /** 4 | * Initializes the dialog region. 5 | * 6 | * @since 1.0.0 7 | */ 8 | initialize : function() { 9 | this.$overlay = jQuery( '
' ); 10 | }, 11 | 12 | /** 13 | * Shows the dialog window and adds necessary event listeners. 14 | * 15 | * @since 1.0.0 16 | */ 17 | onShow : function( view, region, options ) { 18 | this.el.classList.add( 'is-visible' ); 19 | this.$overlay 20 | .on( 'click', jQuery.proxy( this.empty, this ) ) 21 | .appendTo( 'body' ); 22 | }, 23 | 24 | /** 25 | * Hides the dialog window and removes event listeners. 26 | * 27 | * @since 1.0.0 28 | */ 29 | onEmpty : function( view, region, options ) { 30 | this.el.classList.remove( 'is-visible' ); 31 | this.$overlay 32 | .off() 33 | .detach(); 34 | } 35 | 36 | } ); 37 | 38 | module.exports = DialogRegion; 39 | -------------------------------------------------------------------------------- /partials/underscore/sidebar-home.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /assets/scss/components/sidebar/controls/_checkbox.scss: -------------------------------------------------------------------------------- 1 | .control--checkbox { 2 | 3 | label { 4 | line-height: 32px; 5 | } 6 | 7 | input[type=checkbox] { 8 | border: 1px solid #b4b9be; 9 | background: $global-white-color; 10 | clear: none; 11 | cursor: pointer; 12 | display: inline-block; 13 | line-height: 0; 14 | height: 16px; 15 | margin: -4px 5px 0 0; 16 | outline: 0; 17 | padding: 0; 18 | text-align: center; 19 | vertical-align: middle; 20 | width: 16px; 21 | min-width: 16px; 22 | -webkit-appearance: none; 23 | -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1); 24 | box-shadow: inset 0 1px 2px rgba(0,0,0,.1); 25 | 26 | @include transition( border-color 50ms ease-in-out ); 27 | 28 | &:checked::before { 29 | float: left; 30 | display: inline-block; 31 | vertical-align: middle; 32 | width: 16px; 33 | font: 400 21px/1 dashicons; 34 | speak: none; 35 | -webkit-font-smoothing: antialiased; 36 | -moz-osx-font-smoothing: grayscale; 37 | content: '\f147'; 38 | margin: -3px 0 0 -4px; 39 | color: #1e8cbe; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/switch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Controls.Switch 3 | * 4 | * A switch control. 5 | * 6 | * @augments Marionette.ItemView 7 | */ 8 | var AbstractControl = require( './abstract-control' ), 9 | SwitchControl; 10 | 11 | SwitchControl = AbstractControl.extend( { 12 | 13 | events : { 14 | 'change @ui.input' : 'onFieldChange', 15 | 'click @ui.mediaButton' : 'onMediaButtonChange', 16 | 'click @ui.defaultButton' : 'onDefaultButtonChange' 17 | }, 18 | 19 | templateHelpers : { 20 | 21 | checked : function( media ) { 22 | return 1 == parseInt( this.values[ media ], 10 ) ? 'checked' : ''; 23 | } 24 | }, 25 | 26 | /** 27 | * Updates the current setting value when a field change occurs. 28 | * 29 | * @since 1.7.2 30 | */ 31 | onFieldChange : function() { 32 | var $field = this.ui.input.filter( '[name^="' + this.media + '"]' ); 33 | this.setValue( $field.get(0).checked ? '1' : '0' ); 34 | } 35 | 36 | } ); 37 | 38 | module.exports = SwitchControl; 39 | -------------------------------------------------------------------------------- /includes/controls/class-textarea.php: -------------------------------------------------------------------------------- 1 | 34 | 35 | 36 | 37 | 12 | 13 | -------------------------------------------------------------------------------- /assets/scss/components/frontend/_gallery.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $gallery-class-prefix: $global-class-prefix !default; 7 | $gallery-spacing-vertical: $global-spacing-vertical !default; 8 | $gallery-padding: 0 !default; 9 | $gallery-font-size: $global-font-size !default; 10 | $gallery-color: inherit !default; 11 | $gallery-border-width: $global-border-width !default; 12 | $gallery-border-style : none !default; 13 | $gallery-border-color: $global-border-color !default; 14 | $gallery-border-radius: 0 !default; 15 | $gallery-background-color: transparent !default; 16 | $gallery-box-shadow: none !default; 17 | 18 | 19 | // 20 | // Exported selectors 21 | // 22 | .#{$global-class-prefix}ui { 23 | 24 | .#{$gallery-class-prefix}gallery { 25 | position: relative; 26 | padding: $gallery-padding; 27 | margin-bottom: $gallery-spacing-vertical; 28 | font-size: $gallery-font-size; 29 | color: $gallery-color; 30 | background-color: $gallery-background-color; 31 | border: $gallery-border-width $gallery-border-style $gallery-border-color; 32 | border-radius: $gallery-border-radius; 33 | box-shadow: $gallery-box-shadow; 34 | } 35 | } -------------------------------------------------------------------------------- /partials/loop-grid.php: -------------------------------------------------------------------------------- 1 | have_posts() ) { 18 | 19 | $grid_class_name = "tailor-grid--tablet tailor-grid--{$layout_args['items_per_row']}"; 20 | if ( true == $layout_args['masonry'] ) { 21 | $grid_class_name .= ' tailor-grid--masonry'; 22 | } 23 | 24 | echo '
'; 25 | 26 | while ( $q->have_posts() ) { 27 | 28 | $q->the_post(); 29 | 30 | echo '
'; 31 | tailor_partial( 'content', get_post_type(), $entry_args ); 32 | echo '
'; 33 | } 34 | 35 | echo '
'; 36 | 37 | if ( isset( $layout_args['pagination'] ) && true == $layout_args['pagination'] ) { 38 | tailor_partial( 'pagination', 'links', array( 'q' => $q ) ); 39 | } 40 | } 41 | else { 42 | tailor_partial( 'empty' ); 43 | } 44 | 45 | wp_reset_postdata(); -------------------------------------------------------------------------------- /assets/js/src/canvas/entities/models/containers/carousel.js: -------------------------------------------------------------------------------- 1 | var ContainerModel = require( './../element-container' ), 2 | CarouselModel; 3 | 4 | CarouselModel = ContainerModel.extend( { 5 | 6 | /** 7 | * Creates a new template based on the element. 8 | * 9 | * @since 1.0.0 10 | * 11 | * @param id 12 | * @param view 13 | */ 14 | createTemplate : function( id, view ) { 15 | var isEditing = view.el.classList.contains( 'is-editing' ); 16 | view.$el.removeClass( 'is-dragging is-hovering is-selected is-editing' ); 17 | 18 | var $childViewContainer = view.getChildViewContainer( view ); 19 | var $children = $childViewContainer.contents().detach(); 20 | 21 | var $navigation = view.$el.find( '.slick-dots' ).detach(); 22 | 23 | this.appendTemplate( id, view ); 24 | 25 | $childViewContainer.append( $children ); 26 | 27 | $navigation.insertAfter( $childViewContainer ); 28 | 29 | if ( isEditing ) { 30 | view.el.classList.add( 'is-editing' ); 31 | } 32 | } 33 | 34 | } ); 35 | 36 | module.exports = CarouselModel; -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/text.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Controls.Text 3 | * 4 | * A text control. 5 | * 6 | * @augments Marionette.ItemView 7 | */ 8 | var AbstractControl = require( './abstract-control' ), 9 | TextControl; 10 | 11 | TextControl = AbstractControl.extend( { 12 | 13 | templateHelpers : { 14 | 15 | /** 16 | * Returns the attributes for the control. 17 | * 18 | * @since 1.0.0 19 | * 20 | * @returns {string} 21 | */ 22 | inputAttrs : function() { 23 | var atts = ''; 24 | _.each( this.attrs, function( value, attr ) { 25 | atts += ( attr + '="' + value + '"' ); 26 | } ); 27 | return atts; 28 | } 29 | }, 30 | 31 | /** 32 | * Provides additional data to the template rendering function. 33 | * 34 | * @since 1.7.2 35 | * 36 | * @returns {*} 37 | */ 38 | addSerializedData : function( data ) { 39 | data.attrs = this.model.get( 'input_attrs' ); 40 | return data; 41 | } 42 | 43 | } ); 44 | 45 | module.exports = TextControl; 46 | -------------------------------------------------------------------------------- /assets/scss/components/frontend/_map.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $map-class-prefix: $global-class-prefix !default; 7 | $map-spacing-vertical: $global-spacing-vertical !default; 8 | $map-padding: 0 !default; 9 | $map-font-size: $global-font-size !default; 10 | $map-color: inherit !default; 11 | $map-border-width: $global-border-width !default; 12 | $map-border-style : $global-border-style !default; 13 | $map-border-color: $global-border-color !default; 14 | $map-border-radius: 0 !default; 15 | $map-background-color: transparent !default; 16 | $map-box-shadow: none !default; 17 | 18 | 19 | // 20 | // Exported selectors 21 | // 22 | .#{$global-class-prefix}ui { 23 | 24 | .#{$map-class-prefix}map { 25 | padding: $map-padding; 26 | margin-bottom: $map-spacing-vertical; 27 | font-size: $map-font-size; 28 | color: $map-color; 29 | background-color: $map-background-color; 30 | border: $map-border-width $map-border-style $map-border-color; 31 | border-radius: $map-border-radius; 32 | box-shadow: $map-box-shadow; 33 | width: 100%; 34 | 35 | &__canvas { 36 | height: 400px; 37 | } 38 | 39 | &__marker { 40 | display: none; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /assets/scss/tools/_prefixer.scss: -------------------------------------------------------------------------------- 1 | $prefix-for-webkit: true !default; 2 | $prefix-for-mozilla: true !default; 3 | $prefix-for-microsoft: true !default; 4 | $prefix-for-opera: true !default; 5 | $prefix-for-spec: true !default; 6 | // required for keyframe mixin 7 | 8 | @mixin disable-prefix-for-all() { 9 | $prefix-for-webkit: false; 10 | $prefix-for-mozilla: false; 11 | $prefix-for-microsoft: false; 12 | $prefix-for-opera: false; 13 | $prefix-for-spec: false; 14 | } 15 | 16 | @mixin prefixer( $property, $value, $prefixes ) { 17 | @each $prefix in $prefixes { 18 | @if $prefix == webkit { 19 | @if $prefix-for-webkit { 20 | -webkit-#{$property}: $value; 21 | } 22 | } @else if $prefix == moz { 23 | @if $prefix-for-mozilla { 24 | -moz-#{$property}: $value; 25 | } 26 | } @else if $prefix == ms { 27 | @if $prefix-for-microsoft { 28 | -ms-#{$property}: $value; 29 | } 30 | } @else if $prefix == o { 31 | @if $prefix-for-opera { 32 | -o-#{$property}: $value; 33 | } 34 | } @else if $prefix == spec { 35 | @if $prefix-for-spec { 36 | #{$property}: $value; 37 | } 38 | } @else { 39 | @warn "Unrecognized prefix: #{$prefix}"; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /assets/scss/components/frontend/_jetpack-portfolio.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $portfolio-class-prefix: $global-class-prefix !default; 7 | $portfolio-spacing-vertical: $global-spacing-vertical !default; 8 | $portfolio-padding: 0 !default; 9 | $portfolio-font-size: $global-font-size !default; 10 | $portfolio-color: inherit !default; 11 | $portfolio-border-width: $global-border-width !default; 12 | $portfolio-border-style : none !default; 13 | $portfolio-border-color: $global-border-color !default; 14 | $portfolio-border-radius: 0 !default; 15 | $portfolio-background-color: transparent !default; 16 | $portfolio-box-shadow: none !default; 17 | 18 | 19 | // 20 | // Exported selectors 21 | // 22 | .#{$global-class-prefix}ui { 23 | 24 | .#{$portfolio-class-prefix}jetpack-portfolio { 25 | padding: $portfolio-padding; 26 | margin-bottom: $portfolio-spacing-vertical; 27 | font-size: $portfolio-font-size; 28 | color: $portfolio-color; 29 | background-color: $portfolio-background-color; 30 | border: $portfolio-border-width $content-border-style $content-border-color; 31 | border-radius: $portfolio-border-radius; 32 | box-shadow: $portfolio-box-shadow; 33 | } 34 | } -------------------------------------------------------------------------------- /includes/controls/class-switch.php: -------------------------------------------------------------------------------- 1 | 34 | 35 | /> 36 | 37 | 38 | %3$s', 36 | esc_url( get_comments_link() ), 37 | esc_attr( sprintf( __( 'Leave a comment on: “%s”', 'tailor' ), get_the_title() ) ), 38 | $comment_text 39 | ); 40 | } 41 | else { 42 | printf( 43 | '%1$s', 44 | $comment_text 45 | ); 46 | } -------------------------------------------------------------------------------- /assets/css/tinymce.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "file": "tinymce.css", 4 | "sources": [ 5 | "../scss/tinymce.scss", 6 | "../scss/_variables.scss", 7 | "../scss/generic/_box-sizing.scss", 8 | "../scss/trumps/frontend/_icons.scss", 9 | "../scss/trumps/frontend/_formats.scss" 10 | ], 11 | "names": [], 12 | "mappings": "AEMA,AAAA,IAAI,CAAC;EACJ,kBAAkB,EAAE,UAAU;EAC9B,eAAe,EAAE,UAAU;EAC3B,UAAU,EAAE,UAAU;CACtB;;AAED,AAEC,CAFA,EAAD,AAGC,CAHA,AAGA,QAAS,EAHV,AAIC,CAJA,AAIA,OAAQ,CAAC;EACR,kBAAkB,EAAE,OAAO;EAC3B,eAAe,EAAE,OAAO;EACxB,UAAU,EAAE,OAAO;CACnB;;ACpBF,AAGC,UAHS,CAGT,YAAY;AAFb,AAEC,cAFa,CAEb,YAAY,CAAiB;EAC5B,WAAW,EAAE,GAAG;CAChB;;ACLF,AAEC,UAFS,CAET,KAAK,CAAC;EACL,SAAS,EAAE,OAAO;EAClB,cAAc,EAAE,IAAI;EACpB,WAAW,EAAE,GAAG;CAChB;;AANF,AAQC,UARS,CAQT,QAAQ,AAEP,YAAa,AAAA,aAAa,CAAC;EAC1B,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,KAAK;EACd,UAAU,EAAC,MAAM;EACjB,SAAS,EAAC,KAAK;EACf,WAAW,EAAC,CAAC;EACb,MAAM,EAAC,2BACR;CAAE;;AAjBJ,AAqBC,UArBS,CAqBT,UAAU,CAAC;EACV,OAAO,EAAE,KAAK;EACd,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,KAAK;EACd,MAAM,EAAE,WAAW;EACnB,KAAK,EAAE,MAAM;EACb,UAAU,EHAO,OAAO;CGUxB;;AArCF,AAqBC,UArBS,CA6BR,iBAAQ,CAAC;EACR,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,WAAW;CACnB;;AAhCH,AAkCE,UAlCQ,CAqBT,UAAU,CAaT,CAAC,AAAA,WAAW,CAAC;EACZ,aAAa,EAAE,CAAC;CAChB" 13 | } -------------------------------------------------------------------------------- /assets/css/tinymce.min.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "file": "tinymce.min.css", 4 | "sources": [ 5 | "../scss/tinymce.scss", 6 | "../scss/_variables.scss", 7 | "../scss/generic/_box-sizing.scss", 8 | "../scss/trumps/frontend/_icons.scss", 9 | "../scss/trumps/frontend/_formats.scss" 10 | ], 11 | "names": [], 12 | "mappings": "AEMA,AAAA,IAAI,AAAC,CACJ,kBAAkB,CAAE,UAAU,CAC9B,eAAe,CAAE,UAAU,CAC3B,UAAU,CAAE,UAAU,CACtB,AAED,AAEC,CAFA,CAAD,AAGC,CAHA,AAGA,QAAS,CAHV,AAIC,CAJA,AAIA,OAAQ,AAAC,CACR,kBAAkB,CAAE,OAAO,CAC3B,eAAe,CAAE,OAAO,CACxB,UAAU,CAAE,OAAO,CACnB,ACpBF,AAGC,UAHS,CAGT,YAAY,CAFb,AAEC,cAFa,CAEb,YAAY,AAAiB,CAC5B,WAAW,CAAE,GAAG,CAChB,ACLF,AAEC,UAFS,CAET,KAAK,AAAC,CACL,SAAS,CAAE,OAAO,CAClB,cAAc,CAAE,IAAI,CACpB,WAAW,CAAE,GAAG,CAChB,AANF,AAQC,UARS,CAQT,QAAQ,AAEP,YAAa,AAAA,aAAa,AAAC,CAC1B,KAAK,CAAE,IAAI,CACX,OAAO,CAAE,KAAK,CACd,UAAU,CAAC,MAAM,CACjB,SAAS,CAAC,KAAK,CACf,WAAW,CAAC,CAAC,CACb,MAAM,CAAC,2BACR,CAAE,AAjBJ,AAqBC,UArBS,CAqBT,UAAU,AAAC,CACV,OAAO,CAAE,KAAK,CACd,KAAK,CAAE,IAAI,CACX,OAAO,CAAE,KAAK,CACd,MAAM,CAAE,WAAW,CACnB,KAAK,CAAE,MAAM,CACb,UAAU,CHAO,OAAO,CGUxB,AArCF,AAqBC,UArBS,CA6BR,iBAAQ,AAAC,CACR,KAAK,CAAE,KAAK,CACZ,MAAM,CAAE,WAAW,CACnB,AAhCH,AAkCE,UAlCQ,CAqBT,UAAU,CAaT,CAAC,AAAA,WAAW,AAAC,CACZ,aAAa,CAAE,CAAC,CAChB" 13 | } -------------------------------------------------------------------------------- /assets/js/src/shared/utility/polyfills/raf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * requestAnimationFrame polyfill. 3 | * 4 | * https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame 5 | */ 6 | ( function( window ) { 7 | 8 | 'use strict'; 9 | 10 | var lastTime = 0, 11 | vendors = [ 'ms', 'moz', 'webkit', 'o' ]; 12 | 13 | for ( var x = 0; x < vendors.length && ! window.requestAnimationFrame; ++x ) { 14 | window.requestAnimationFrame = window[ vendors[ x ] + 'RequestAnimationFrame' ]; 15 | window.cancelAnimationFrame = window[ vendors[ x ] + 'CancelAnimationFrame' ] || window[ vendors[ x ] + 'CancelRequestAnimationFrame' ]; 16 | } 17 | 18 | if ( ! window.requestAnimationFrame ) { 19 | window.requestAnimationFrame = function( callback, el ) { 20 | var currTime = new Date().getTime(); 21 | var timeToCall = Math.max( 0, 16 - ( currTime - lastTime ) ); 22 | var id = window.setTimeout( function() { 23 | callback( currTime + timeToCall ); 24 | }, 25 | timeToCall ); 26 | lastTime = currTime + timeToCall; 27 | return id; 28 | }; 29 | } 30 | 31 | if ( ! window.cancelAnimationFrame ) { 32 | window.cancelAnimationFrame = function( id ) { 33 | clearTimeout( id ); 34 | }; 35 | } 36 | 37 | } ) ( window ); 38 | -------------------------------------------------------------------------------- /assets/scss/trumps/frontend/_notifications.scss: -------------------------------------------------------------------------------- 1 | $notification-padding: 0.5em 1em !default; 2 | $notification-border-width: $global-border-width !default; 3 | $notification-border-style: $global-border-style !default; 4 | $notification-border-color: $global-border-color !default; 5 | $notification-background-color: $global-background-color !default; 6 | $notification-box-shadow: $global-box-shadow !default; 7 | 8 | 9 | // 10 | // Exported selectors 11 | // 12 | .#{$global-class-prefix}ui { 13 | 14 | .error { 15 | padding: $notification-padding; 16 | margin-bottom: 0; 17 | border: $notification-border-width $notification-border-style $notification-border-color; 18 | } 19 | 20 | .#{$global-class-prefix}notification { 21 | padding: $notification-padding; 22 | margin-bottom: 0; 23 | border: $notification-border-width $notification-border-style $notification-border-color; 24 | 25 | &--success, 26 | &--warning, 27 | &--error { 28 | border-left-width: 2px; 29 | } 30 | 31 | &--success { 32 | border-left-color: $global-success-color; 33 | } 34 | 35 | &--warning { 36 | border-left-color: $global-warning-color; 37 | } 38 | 39 | &--error { 40 | border-left-color: $global-error-color; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /assets/scss/sidebar.scss: -------------------------------------------------------------------------------- 1 | @import "variables"; 2 | 3 | // 4 | // Tools 5 | // 6 | @import "tools/keyframes"; 7 | @import "tools/transform"; 8 | @import "tools/transition"; 9 | @import "tools/user-select"; 10 | @import "tools/prefixer"; 11 | @import "tools/clearfix"; 12 | @import "tools/box-shadow"; 13 | 14 | // 15 | // Generic styles 16 | // 17 | @import "generic/normalize"; 18 | @import "generic/reset"; 19 | @import "generic/box-sizing"; 20 | 21 | // 22 | // Base styles 23 | // 24 | @import "base/sidebar/forms"; 25 | @import "base/sidebar/headings"; 26 | @import "base/sidebar/paragraph"; 27 | @import "base/sidebar/lists"; 28 | 29 | // 30 | // Components 31 | // 32 | @import "components/sidebar/sidebar"; 33 | @import "components/sidebar/panels"; 34 | @import "components/sidebar/items"; 35 | @import "components/sidebar/sections"; 36 | @import "components/sidebar/controls"; 37 | @import "components/sidebar/preview"; 38 | 39 | @import "components/sidebar/dialogs"; 40 | @import "components/sidebar/modals"; 41 | @import "components/sidebar/notifications"; 42 | 43 | // 44 | // Trumps 45 | // 46 | @import "trumps/shared/wordpress"; 47 | @import "trumps/sidebar/rtl"; 48 | 49 | // 50 | // Vendor 51 | // 52 | @import "vendor/codemirror"; 53 | @import "vendor/select2"; -------------------------------------------------------------------------------- /assets/js/src/canvas/modules/tools/show/guide.js: -------------------------------------------------------------------------------- 1 | var GuideView = Marionette.ItemView.extend( { 2 | 3 | template : false, 4 | 5 | /** 6 | * Positions the insertion guide over a given element. 7 | * 8 | * @since 1.0.0 9 | * 10 | * @param view 11 | * @param drop 12 | */ 13 | position : function( view, drop ) { 14 | var $el = view.$el; 15 | var offset = $el.offset(); 16 | var parentOffset = this.$el.offsetParent().offset(); 17 | 18 | this.el.style.visibility = 'visible'; 19 | this.el.className = 'guide guide--' + drop + ' guide--' + view.model.get( 'tag' ); 20 | this.el.style.left = offset.left - parentOffset.left + 'px'; 21 | this.el.style.top = offset.top - parentOffset.top + 'px'; 22 | this.el.style.width = $el.outerWidth() + 'px'; 23 | this.el.style.height = $el.outerHeight() + 'px'; 24 | this.el.style.opacity = 1; 25 | }, 26 | 27 | /** 28 | * Resets the insertion guide. 29 | * 30 | * @since 1.0.0 31 | */ 32 | reset : function() { 33 | this.el.style = ''; 34 | this.el.style.visibility = 'hidden'; 35 | this.el.style.opacity = 0; 36 | } 37 | 38 | } ); 39 | 40 | module.exports = GuideView; -------------------------------------------------------------------------------- /partials/admin/field-icon.php: -------------------------------------------------------------------------------- 1 | 16 | 17 |
18 |
19 | 20 | 23 | 24 | 36 | 37 | 38 | 39 |
40 |

41 | 42 | 43 |

44 |
-------------------------------------------------------------------------------- /assets/js/src/sidebar/components/behaviors/panel.js: -------------------------------------------------------------------------------- 1 | var PanelBehavior = Marionette.Behavior.extend( { 2 | 3 | ui: { 4 | backButton : '.back-button', 5 | helpButton : '.help-button', 6 | helpDescription : '.help-description', 7 | searchBar : '.search' 8 | }, 9 | 10 | events : { 11 | 'click @ui.helpButton': 'toggleHelp', 12 | 'change @ui.searchBar' : 'doSearch', 13 | 'input @ui.searchBar': 'doSearch', 14 | 'keyup @ui.searchBar': 'doSearch', 15 | 'search @ui.searchBar': 'doSearch' 16 | }, 17 | 18 | triggers : { 19 | 'click @ui.backButton': 'back' 20 | }, 21 | 22 | /** 23 | * Toggles the help text when the Help button is pressed. 24 | * 25 | * @since 1.0.0 26 | */ 27 | toggleHelp : function() { 28 | this.ui.helpButton.toggleClass( 'is-open' ); 29 | this.ui.helpDescription.slideToggle( 150 ); 30 | }, 31 | 32 | /** 33 | * Performs a collection search based on the search criteria provided. 34 | * 35 | * @since 1.0.0 36 | * 37 | * @param e 38 | */ 39 | doSearch : function( e ) { 40 | this.view.collection.doSearch( e.target.value ); 41 | } 42 | 43 | } ); 44 | 45 | module.exports = PanelBehavior; -------------------------------------------------------------------------------- /assets/js/src/canvas/components/elements/containers/carousel.js: -------------------------------------------------------------------------------- 1 | var ContainerView = require( './../element-container' ), 2 | CarouselNavigationView = require( './navigation/carousel-navigation' ), 3 | CarouselView; 4 | 5 | CarouselView = ContainerView.extend( { 6 | 7 | /** 8 | * Destroys the carousel navigation dots before the template is refreshed. 9 | * 10 | * @since 1.0.0 11 | */ 12 | onBeforeRenderTemplate : function() { 13 | if ( this.navigation ) { 14 | this.navigation.triggerMethod( 'destroy' ); 15 | } 16 | }, 17 | 18 | /** 19 | * Inserts the carousel navigation dots into the DOM. 20 | * 21 | * @since 1.0.0 22 | */ 23 | onRenderTemplate : function() { 24 | this.navigation = new CarouselNavigationView( { 25 | model : this.model, 26 | collection : this.collection, 27 | sort : false 28 | } ); 29 | 30 | this.$el.append( this.navigation.render().el ); 31 | }, 32 | 33 | /** 34 | * Destroys the carousel navigation dots before the carousel is destroyed. 35 | * 36 | * @since 1.0.0 37 | */ 38 | onBeforeDestroy : function() { 39 | this.triggerAll( 'before:element:destroy', this ); 40 | this.navigation.triggerMethod( 'destroy' ); 41 | } 42 | 43 | } ); 44 | 45 | module.exports = CarouselView; -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/checkbox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Controls.Checkbox 3 | * 4 | * A checkbox control. 5 | * 6 | * @augments Marionette.ItemView 7 | */ 8 | var AbstractControl = require( './abstract-control' ), 9 | CheckboxControl; 10 | 11 | CheckboxControl = AbstractControl.extend( { 12 | 13 | events : { 14 | 'change @ui.input' : 'onFieldChange', 15 | 'click @ui.mediaButton' : 'onMediaButtonChange', 16 | 'click @ui.defaultButton' : 'onDefaultButtonChange' 17 | }, 18 | 19 | templateHelpers : { 20 | 21 | checked : function( media, key ) { 22 | var values = this.values[ media ].split( ',' ); 23 | return -1 !== values.indexOf( key ) ? 'checked' : ''; 24 | } 25 | }, 26 | 27 | /** 28 | * Updates the current setting value when a field change occurs. 29 | * 30 | * @since 1.7.2 31 | */ 32 | onFieldChange : function( e ) { 33 | var values = []; 34 | _.each( this.ui.input.filter( '[name^="' + this.media + '"]:checked' ), function( field ) { 35 | if ( field.checked ) { 36 | values.push( field.value || 0 ); 37 | } 38 | } ); 39 | this.setValue( values.join( ',' ) ); 40 | } 41 | 42 | } ); 43 | 44 | module.exports = CheckboxControl; 45 | -------------------------------------------------------------------------------- /assets/scss/components/frontend/_jetpack-testimonials.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $testimonials-class-prefix: $global-class-prefix !default; 7 | $testimonials-spacing-vertical: $global-spacing-vertical !default; 8 | $testimonials-padding: 0 !default; 9 | $testimonials-font-size: $global-font-size !default; 10 | $testimonials-color: inherit !default; 11 | $testimonials-border-width: $global-border-width !default; 12 | $testimonials-border-style : none !default; 13 | $testimonials-border-color: $global-border-color !default; 14 | $testimonials-border-radius: 0 !default; 15 | $testimonials-background-color: transparent !default; 16 | $testimonials-box-shadow: none !default; 17 | 18 | 19 | // 20 | // Exported selectors 21 | // 22 | .#{$global-class-prefix}ui { 23 | 24 | .#{$testimonials-class-prefix}jetpack-testimonials { 25 | padding: $testimonials-padding; 26 | margin-bottom: $testimonials-spacing-vertical; 27 | font-size: $testimonials-font-size; 28 | color: $testimonials-color; 29 | background-color: $testimonials-background-color; 30 | border: $testimonials-border-width $content-border-style $content-border-color; 31 | border-radius: $testimonials-border-radius; 32 | box-shadow: $testimonials-box-shadow; 33 | 34 | .testimonial-entry { 35 | margin-bottom: 0; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /assets/scss/objects/_slideshow.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $slideshow-class-prefix: $global-class-prefix !default; 7 | $slideshow-spacing-vertical: 0 !default; 8 | $slideshow-padding: 0 !default; 9 | 10 | // Element specific 11 | $slideshow-thumbnail-spacing: 4px !default; 12 | 13 | 14 | // 15 | // Exported selectors 16 | // 17 | .#{$global-class-prefix}ui { 18 | 19 | .#{$slideshow-class-prefix}slideshow { 20 | padding: $slideshow-padding; 21 | 22 | &__slides, 23 | &__slide { 24 | padding: 0; 25 | margin: 0; 26 | list-style: none; 27 | } 28 | 29 | &__slide { 30 | 31 | img { 32 | max-width: 100%; 33 | } 34 | } 35 | 36 | .slick-track { 37 | display: block; 38 | } 39 | 40 | .slick-dots li { 41 | margin: 0 $slideshow-thumbnail-spacing; 42 | list-style: none; 43 | } 44 | 45 | .slick-dots { 46 | bottom: 0; 47 | text-align: center; 48 | border-top: none; 49 | margin: $global-spacing-vertical 0; 50 | } 51 | 52 | .slick-dots li { 53 | margin: 0; 54 | display: inline-block; 55 | width: 80px; 56 | height: auto; 57 | max-width: calc( 25% - #{$slideshow-thumbnail-spacing} ); 58 | cursor: pointer; 59 | 60 | &:not( .slick-active ) { 61 | opacity: 0.5; 62 | } 63 | 64 | img { 65 | max-width: 100%; 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/templates/templates.js: -------------------------------------------------------------------------------- 1 | 2 | var TemplateCollection = require( '../../entities/collections/templates' ), 3 | TemplatesPanel = require( './show/templates-panel' ), 4 | TemplateItem = require( './show/template-menu-item' ), 5 | TemplatesModule; 6 | 7 | Tailor.Panels.Templates = TemplatesPanel; 8 | Tailor.Items.Templates = TemplateItem; 9 | 10 | TemplatesModule = Marionette.Module.extend( { 11 | 12 | onBeforeStart : function( options ) { 13 | var module = this; 14 | 15 | this.collection = new TemplateCollection( options.templates ); 16 | 17 | var api = { 18 | 19 | /** 20 | * Returns the template item collection. 21 | * 22 | * @since 1.0.0 23 | * 24 | * @returns {*} 25 | */ 26 | getTemplates : function() { 27 | return module.collection; 28 | } 29 | }; 30 | 31 | app.channel.reply( 'sidebar:templates', api.getTemplates ); 32 | }, 33 | 34 | /** 35 | * Initializes the module. 36 | */ 37 | onStart : function() { 38 | 39 | /** 40 | * Fires when the module is initialized. 41 | * 42 | * @since 1.5.0 43 | * 44 | * @param this 45 | */ 46 | app.channel.trigger( 'module:templates:ready', this ); 47 | } 48 | 49 | } ); 50 | 51 | module.exports = TemplatesModule; -------------------------------------------------------------------------------- /assets/scss/components/frontend/_content.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $content-class-prefix: $global-class-prefix !default; 7 | $content-spacing-vertical: $global-spacing-vertical !default; 8 | $content-padding: 0 !default; 9 | $content-font-size: $global-font-size !default; 10 | $content-color: inherit !default; 11 | $content-border-width: $global-border-width !default; 12 | $content-border-style : none !default; 13 | $content-border-color: $global-border-color !default; 14 | $content-border-radius: 0 !default; 15 | $content-background-color: transparent !default; 16 | $content-box-shadow: none !default; 17 | 18 | 19 | // 20 | // Exported selectors 21 | // 22 | .#{$global-class-prefix}ui { 23 | 24 | .#{$content-class-prefix}content { 25 | padding: $content-padding; 26 | margin-bottom: $content-spacing-vertical; 27 | font-size: $content-font-size; 28 | color: $content-color; 29 | background-color: $content-background-color; 30 | border: $content-border-width $content-border-style $content-border-color; 31 | border-radius: $content-border-radius; 32 | box-shadow: $content-box-shadow; 33 | 34 | // To ensure floats used within the content area are cleared 35 | @include clearfix; 36 | 37 | > :last-child { 38 | margin-bottom: 0; 39 | } 40 | 41 | &--placeholder { 42 | 43 | p { 44 | opacity: 0.5; 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /partials/content-post.php: -------------------------------------------------------------------------------- 1 | 21 | 22 |
23 | 24 | $image_link, 28 | 'image_size' => $image_size, 29 | 'aspect_ratio' => $aspect_ratio, 30 | 'stretch' => $stretch, 31 | ) ); 32 | } ?> 33 | 34 |
35 |

36 | 37 |

38 | 39 | $meta, 42 | ) ); ?> 43 | 44 |
45 |
46 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/button-group.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Controls.ButtonGroup 3 | * 4 | * A button group control. 5 | * 6 | * @augments Marionette.ItemView 7 | */ 8 | var AbstractControl = require( './abstract-control' ), 9 | ButtonGroupControl; 10 | 11 | ButtonGroupControl = AbstractControl.extend( { 12 | 13 | ui : { 14 | 'input' : '.control__body .button', 15 | 'mediaButton' : '.js-setting-group .button', 16 | 'defaultButton' : '.js-default', 17 | 'controlGroups' : '.control__body > *' 18 | }, 19 | 20 | events : { 21 | 'click @ui.input' : 'onFieldChange', 22 | 'click @ui.mediaButton' : 'onMediaButtonChange', 23 | 'click @ui.defaultButton' : 'onDefaultButtonChange' 24 | }, 25 | 26 | templateHelpers : { 27 | 28 | active : function( media, key ) { 29 | return key === this.values[ media ] ? 'active' : ''; 30 | } 31 | }, 32 | 33 | /** 34 | * Updates the current setting value when a field change occurs. 35 | * 36 | * @since 1.7.2 37 | */ 38 | onFieldChange : function( e ) { 39 | this.ui.input.filter( '[name^="' + this.media + '"]' ).removeClass( 'active' ); 40 | var button = e.currentTarget; 41 | button.classList.add( 'active' ); 42 | this.setValue( button.value ); 43 | } 44 | 45 | } ); 46 | 47 | module.exports = ButtonGroupControl; 48 | -------------------------------------------------------------------------------- /assets/scss/tools/_transition.scss: -------------------------------------------------------------------------------- 1 | // Shorthand mixin. Supports multiple parentheses-deliminated values for each variable. 2 | // Example: @include transition (all, 2.0s, ease-in-out); 3 | // @include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s)); 4 | // @include transition ($property:(opacity, width), $delay: (1.5s, 2.5s)); 5 | 6 | @mixin transition ($properties...) { 7 | @if length($properties) >= 1 { 8 | @include prefixer(transition, $properties, webkit moz spec); 9 | } 10 | 11 | @else { 12 | $properties: all 0.15s ease-out 0; 13 | @include prefixer(transition, $properties, webkit moz spec); 14 | } 15 | } 16 | 17 | @mixin transition-property ($properties...) { 18 | -webkit-transition-property: transition-property-names($properties, 'webkit'); 19 | -moz-transition-property: transition-property-names($properties, 'moz'); 20 | transition-property: transition-property-names($properties, false); 21 | } 22 | 23 | @mixin transition-duration ($times...) { 24 | @include prefixer(transition-duration, $times, webkit moz spec); 25 | } 26 | 27 | @mixin transition-timing-function ($motions...) { 28 | // ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier() 29 | @include prefixer(transition-timing-function, $motions, webkit moz spec); 30 | } 31 | 32 | @mixin transition-delay ($times...) { 33 | @include prefixer(transition-delay, $times, webkit moz spec); 34 | } 35 | -------------------------------------------------------------------------------- /includes/admin/helpers/helpers-general.php: -------------------------------------------------------------------------------- 1 | $editable_role ) { 47 | if ( ! empty( $editable_role['capabilities']['edit_posts'] ) && 1 === (int) $editable_role['capabilities']['edit_posts'] ) { 48 | $roles[ $name ] = $editable_role['name']; 49 | } 50 | } 51 | 52 | return $roles; 53 | } 54 | } -------------------------------------------------------------------------------- /assets/scss/components/sidebar/_notifications.scss: -------------------------------------------------------------------------------- 1 | 2 | @include keyframes( scale ) { 3 | 4 | 0% { 5 | @include transform( scale( 0.9 ) ); 6 | opacity: 0; 7 | } 8 | 100% { 9 | @include transform( scale( 1 ) ); 10 | opacity: 1; 11 | } 12 | } 13 | 14 | 15 | // 16 | // Exported selectors 17 | // 18 | .#{$global-class-prefix}ui { 19 | 20 | .notification-container { 21 | position: fixed; 22 | top: 10px; 23 | right: 25px; 24 | } 25 | 26 | .notification { 27 | float: right; 28 | clear: both; 29 | padding: 1em; 30 | margin-bottom: ( $global-spacing-horizontal / 2 ); 31 | background-color: $global-white-color; 32 | border: $global-border-width $global-border-style $global-border-color; 33 | opacity: 0; 34 | border-left: 4px solid #fff; 35 | 36 | p { 37 | margin: 0; 38 | } 39 | 40 | &--success { 41 | border-left-color: $global-success-color; 42 | } 43 | 44 | &--warning { 45 | border-left-color: $global-warning-color; 46 | } 47 | 48 | &--error { 49 | border-left-color: $global-error-color; 50 | } 51 | 52 | @include transform( scale( 0.8 ) ); 53 | @include transition-property( opacity ); 54 | @include transition-property( transform ); 55 | @include transition-duration( 250ms ); 56 | @include user-select( none ); 57 | @include box-shadow( 0 1px 1px 0 rgba( 0, 0, 0, 0.1 ), 0 1px 1px 0 rgba( 0, 0, 0, 0.1 ) ); 58 | 59 | &.is-visible { 60 | opacity: 1; 61 | 62 | @include transform( scale( 1 ) ); 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /partials/meta-excerpt.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 | 15 | post_excerpt : $post->post_content; 23 | $excerpt_length = empty( $excerpt_length ) ? 30 : $excerpt_length; 24 | 25 | /** 26 | * Filters the entry excerpt length. 27 | * 28 | * @since 1.5.6 29 | * 30 | * @param int $excerpt_length 31 | */ 32 | $excerpt_length = apply_filters( 'tailor_excerpt_length', $excerpt_length ); 33 | $excerpt_more = sprintf( '...
%s', get_permalink(), __( 'Continue reading ›', 'tailor' ) ); 34 | $trimmed_excerpt = wp_trim_words( $excerpt, $excerpt_length, $excerpt_more ); 35 | 36 | /** 37 | * Filters the entry excerpt. 38 | * 39 | * @since 1.0.0 40 | * 41 | * @param string $trimmed_excerpt 42 | * @param string $excerpt 43 | * @param int $excerpt_length 44 | * @param string $excerpt_more 45 | */ 46 | $trimmed_excerpt = apply_filters( 'tailor_excerpt', $trimmed_excerpt, $excerpt, $excerpt_length, $excerpt_more ); 47 | } 48 | 49 | echo $trimmed_excerpt; ?> 50 | 51 |
-------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/library/library.js: -------------------------------------------------------------------------------- 1 | 2 | var LibraryCollection = require( '../../entities/collections/library' ), 3 | LibraryMenuItem = require( './show/library-menu-item' ), 4 | LibraryModule; 5 | 6 | Tailor.Items.Library = LibraryMenuItem; 7 | 8 | LibraryModule = Marionette.Module.extend( { 9 | 10 | onBeforeStart : function( options ) { 11 | var collection = new LibraryCollection( options.library ); 12 | var api = { 13 | 14 | /** 15 | * Returns a given library item if a tag is provided, otherwise the library. 16 | * 17 | * @since 1.0.0 18 | * 19 | * @param tag 20 | * @returns {*} 21 | */ 22 | getLibraryItem : function ( tag ) { 23 | if ( tag ) { 24 | return collection.findWhere( { tag : tag } ); 25 | } 26 | return collection; 27 | } 28 | }; 29 | 30 | app.channel.reply( 'sidebar:library', api.getLibraryItem ); 31 | }, 32 | 33 | /** 34 | * Initializes the module. 35 | * 36 | * @since 1.0.0 37 | */ 38 | onStart : function() { 39 | 40 | /** 41 | * Fires when the module is initialized. 42 | * 43 | * @since 1.5.0 44 | * 45 | * @param this 46 | */ 47 | app.channel.trigger( 'module:library:ready', this ); 48 | } 49 | 50 | } ); 51 | 52 | module.exports = LibraryModule; -------------------------------------------------------------------------------- /lib/scssphp/scss.inc.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | class Crunched extends Formatter 23 | { 24 | /** 25 | * {@inheritdoc} 26 | */ 27 | public function __construct() 28 | { 29 | $this->indentLevel = 0; 30 | $this->indentChar = ' '; 31 | $this->break = ''; 32 | $this->open = '{'; 33 | $this->close = '}'; 34 | $this->tagSeparator = ','; 35 | $this->assignSeparator = ':'; 36 | $this->keepSemicolons = false; 37 | } 38 | 39 | /** 40 | * {@inheritdoc} 41 | */ 42 | public function blockLines(OutputBlock $block) 43 | { 44 | $inner = $this->indentStr(); 45 | 46 | $glue = $this->break . $inner; 47 | 48 | foreach ($block->lines as $index => $line) { 49 | if (substr($line, 0, 2) === '/*') { 50 | unset($block->lines[$index]); 51 | } 52 | } 53 | 54 | echo $inner . implode($glue, $block->lines); 55 | 56 | if (! empty($block->children)) { 57 | echo $this->break; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /assets/scss/tools/_keyframes.scss: -------------------------------------------------------------------------------- 1 | // Adds keyframes blocks for supported prefixes, removing redundant prefixes in the block's content 2 | @mixin keyframes($name) { 3 | $original-prefix-for-webkit: $prefix-for-webkit; 4 | $original-prefix-for-mozilla: $prefix-for-mozilla; 5 | $original-prefix-for-microsoft: $prefix-for-microsoft; 6 | $original-prefix-for-opera: $prefix-for-opera; 7 | $original-prefix-for-spec: $prefix-for-spec; 8 | 9 | @if $original-prefix-for-webkit { 10 | @include disable-prefix-for-all(); 11 | $prefix-for-webkit: true; 12 | @-webkit-keyframes #{$name} { 13 | @content; 14 | } 15 | } 16 | @if $original-prefix-for-mozilla { 17 | @include disable-prefix-for-all(); 18 | $prefix-for-mozilla: true; 19 | @-moz-keyframes #{$name} { 20 | @content; 21 | } 22 | } 23 | @if $original-prefix-for-opera { 24 | @include disable-prefix-for-all(); 25 | $prefix-for-opera: true; 26 | @-o-keyframes #{$name} { 27 | @content; 28 | } 29 | } 30 | @if $original-prefix-for-spec { 31 | @include disable-prefix-for-all(); 32 | $prefix-for-spec: true; 33 | @keyframes #{$name} { 34 | @content; 35 | } 36 | } 37 | 38 | $prefix-for-webkit: $original-prefix-for-webkit; 39 | $prefix-for-mozilla: $original-prefix-for-mozilla; 40 | $prefix-for-microsoft: $original-prefix-for-microsoft; 41 | $prefix-for-opera: $original-prefix-for-opera; 42 | $prefix-for-spec: $original-prefix-for-spec; 43 | } 44 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/panels/show/panel-menu-item.js: -------------------------------------------------------------------------------- 1 | var $ = Backbone.$, 2 | PanelItem; 3 | 4 | PanelItem = Marionette.ItemView.extend( { 5 | 6 | events : { 7 | click : 'onClick', 8 | keypress : 'onKeyPress' 9 | }, 10 | 11 | modelEvents : { 12 | focus : 'onFocus' 13 | }, 14 | 15 | template : '#tmpl-tailor-panel-default-item', 16 | 17 | /** 18 | * Uses the rendered template HTML as the $el. 19 | * 20 | * @since 1.0.0 21 | * @param html 22 | * @returns {exports} 23 | */ 24 | attachElContent : function( html ) { 25 | var $el = $( html ); 26 | 27 | this.$el.replaceWith( $el ); 28 | this.setElement( $el ); 29 | this.el.setAttribute( 'tabindex', 0 ); 30 | 31 | return this; 32 | }, 33 | 34 | /** 35 | * Displays the associated panel when the item is clicked. 36 | * 37 | * @since 1.0.0 38 | */ 39 | onClick : function() { 40 | this.triggerMethod( 'show:panel' ); 41 | }, 42 | 43 | /** 44 | * Displays the associated panel when the item is selected using the keyboard. 45 | * 46 | * @since 1.0.0 47 | */ 48 | onKeyPress : function( e ) { 49 | if ( 13 === e.which ) { 50 | this.triggerMethod( 'show:panel' ); 51 | } 52 | }, 53 | 54 | /** 55 | * Sets focus on the list item. 56 | * 57 | * @since 1.0.0 58 | */ 59 | onFocus : function() { 60 | this.el.focus(); 61 | } 62 | 63 | } ); 64 | 65 | module.exports = PanelItem; 66 | -------------------------------------------------------------------------------- /assets/scss/components/frontend/_widgets.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $widgets-class-prefix: $global-class-prefix !default; 7 | $widgets-spacing-vertical: $global-spacing-vertical !default; 8 | $widgets-padding: 0 !default; 9 | $widgets-font-size: $global-font-size !default; 10 | $widgets-color: inherit !default; 11 | $widgets-border-width: $global-border-width !default; 12 | $widgets-border-style : none !default; 13 | $widgets-border-color: $global-border-color !default; 14 | $widgets-border-radius: 0 !default; 15 | $widgets-background-color: transparent !default; 16 | $widgets-box-shadow: none !default; 17 | 18 | 19 | // 20 | // Exported selectors 21 | // 22 | .#{$global-class-prefix}ui { 23 | 24 | .#{$widgets-class-prefix}widget { 25 | padding: $widgets-padding; 26 | margin-bottom: $widgets-spacing-vertical; 27 | font-size: $widgets-font-size; 28 | color: $widgets-color; 29 | background-color: $widgets-background-color; 30 | border: $widgets-border-width $widgets-border-style $widgets-border-color; 31 | border-radius: $widgets-border-radius; 32 | box-shadow: $widgets-box-shadow; 33 | } 34 | 35 | .#{$widgets-class-prefix}widget-area { 36 | padding: $widgets-padding; 37 | margin-bottom: $widgets-spacing-vertical; 38 | font-size: $widgets-font-size; 39 | color: $widgets-color; 40 | background-color: $widgets-background-color; 41 | border: $widgets-border-width $widgets-border-style $widgets-border-color; 42 | border-radius: $widgets-border-radius; 43 | box-shadow: $widgets-box-shadow; 44 | } 45 | } -------------------------------------------------------------------------------- /assets/js/src/sidebar/entities/collections/searchable.js: -------------------------------------------------------------------------------- 1 | var $ = Backbone.$, 2 | SearchableCollection; 3 | 4 | SearchableCollection = Backbone.Collection.extend( { 5 | 6 | /** 7 | * Performs a search based on a given search term. 8 | * 9 | * @since 1.0.0 10 | * 11 | * @param value 12 | */ 13 | doSearch: function( value ) { 14 | 15 | // Don't do anything if we've already done this search 16 | if ( this.terms === value ) { 17 | return; 18 | } 19 | this.terms = value; 20 | 21 | if ( this.terms.length > 0 ) { 22 | this.search( this.terms ); 23 | } 24 | 25 | // If search is blank, show all items 26 | if ( this.terms === '' ) { 27 | this.each( function( item ) { 28 | item.set( 'match', true ); 29 | } ); 30 | } 31 | }, 32 | 33 | /** 34 | * Shows or hides items based on whether they match the search criteria. 35 | * 36 | * @since 1.0.0 37 | * 38 | * @param term 39 | */ 40 | search: function( term ) { 41 | var match, haystack; 42 | 43 | // Escape the term string for RegExp meta characters 44 | term = term.replace( /[-\/\\^$*+?.()|[\]{}]/g, '\\$&' ); 45 | 46 | // Consider spaces as word delimiters and match the whole string so matching terms can be combined 47 | term = term.replace( / /g, ')(?=.*' ); 48 | 49 | match = new RegExp( '^(?=.*' + term + ').+', 'i' ); 50 | 51 | this.each( function( item ) { 52 | haystack = this.getHaystack( item ); 53 | item.set( 'match', match.test( haystack ) ); 54 | }, this ); 55 | } 56 | 57 | } ); 58 | 59 | module.exports = SearchableCollection; 60 | -------------------------------------------------------------------------------- /assets/scss/components/sidebar/controls/_link.scss: -------------------------------------------------------------------------------- 1 | 2 | // Contextual styles 3 | .dialog__container { 4 | 5 | .search--content { 6 | padding: 6px 10px; 7 | } 8 | 9 | .spinner { 10 | position: absolute; 11 | right: 1.5em; 12 | top: 0.5em; 13 | } 14 | 15 | .query-notice { 16 | display: block; 17 | padding: 6px; 18 | margin: 0; 19 | background-color: #f7fcfe; 20 | border-left: 4px solid #00a0d2; 21 | } 22 | 23 | .search-results { 24 | margin-top: 0.5em; 25 | 26 | label { 27 | position: relative; 28 | display: block; 29 | padding: 4px 6px 4px 10px; 30 | border: 1px solid #f1f1f1; 31 | border-top: none; 32 | color: #32373c; 33 | cursor: pointer; 34 | 35 | &:first-child { 36 | border-top: 1px solid #f1f1f1; 37 | } 38 | 39 | &:hover { 40 | background: #eaf2fa; 41 | } 42 | 43 | input { 44 | display: none; 45 | 46 | &:checked { 47 | 48 | &~.entry-title, 49 | &~.entry-type { 50 | font-weight: bold; 51 | } 52 | } 53 | } 54 | 55 | .entry-title { 56 | display: inline-block; 57 | width: 80%; 58 | width: -webkit-calc(100% - 68px); 59 | width: calc(100% - 68px); 60 | word-wrap: break-word; 61 | } 62 | 63 | .entry-type { 64 | text-transform: uppercase; 65 | color: #666; 66 | font-size: 11px; 67 | position: absolute; 68 | right: 5px; 69 | top: 5px; 70 | } 71 | } 72 | } 73 | } 74 | 75 | .is-searching { 76 | 77 | .dialog__container { 78 | 79 | .spinner { 80 | visibility: visible; 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /assets/scss/components/frontend/_hero.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $hero-class-prefix: $global-class-prefix !default; 7 | $hero-spacing-vertical: $global-spacing-vertical !default; 8 | $hero-padding: 2em !default; 9 | $hero-font-size: 1em !default; 10 | $hero-color: inherit !default; 11 | $hero-border-width: $global-border-width !default; 12 | $hero-border-style : $global-border-style !default; 13 | $hero-border-color: $global-border-color !default; 14 | $hero-border-radius: 0 !default; 15 | $hero-background-color: transparent !default; 16 | $hero-box-shadow: none !default; 17 | 18 | 19 | // 20 | // Exported selectors 21 | // 22 | .#{$global-class-prefix}ui { 23 | 24 | .#{$hero-class-prefix}hero { 25 | padding: $hero-padding; 26 | margin-bottom: $hero-spacing-vertical; 27 | font-size: $hero-font-size; 28 | color: $hero-color; 29 | background-color: $hero-background-color; 30 | border: $hero-border-width $hero-border-style $hero-border-color; 31 | border-radius: $hero-border-radius; 32 | box-shadow: $hero-box-shadow; 33 | 34 | h1 { 35 | font-size: ( $hero-font-size * 3 ); 36 | } 37 | 38 | h2 { 39 | font-size: ( $hero-font-size * 2.25 ); 40 | } 41 | 42 | h1, 43 | h2 { 44 | color: inherit; 45 | font-weight: inherit; 46 | } 47 | } 48 | } 49 | 50 | 51 | // 52 | // Media queries 53 | // 54 | @media #{$tablet-up} { 55 | 56 | .#{$global-class-prefix}ui { 57 | 58 | .#{$hero-class-prefix}hero { 59 | padding: ( $hero-padding * 1.25 ); 60 | font-size: ( $hero-font-size * 1.25 ); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /assets/js/src/shared/utility/polyfills/transitions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Makes animation and transition support status and end names available as global variables. 3 | */ 4 | ( function( window ) { 5 | 6 | 'use strict'; 7 | 8 | var el = document.createElement( 'fakeelement' ); 9 | 10 | function getAnimationEvent(){ 11 | var t, 12 | animations = { 13 | 'animation' : 'animationend', 14 | 'OAnimation' : 'oAnimationEnd', 15 | 'MozAnimation' : 'animationend', 16 | 'WebkitAnimation' : 'webkitAnimationEnd' 17 | }; 18 | 19 | for ( t in animations ) { 20 | if ( animations.hasOwnProperty( t ) && 'undefined' !== typeof el.style[ t ] ) { 21 | return animations[ t ]; 22 | } 23 | } 24 | 25 | return false; 26 | } 27 | 28 | function getTransitionEvent(){ 29 | var t, 30 | transitions = { 31 | 'transition' : 'transitionend', 32 | 'OTransition' : 'oTransitionEnd', 33 | 'MozTransition' : 'transitionend', 34 | 'WebkitTransition' : 'webkitTransitionEnd' 35 | }; 36 | 37 | for ( t in transitions ) { 38 | if ( transitions.hasOwnProperty( t ) && 'undefined' !== typeof el.style[ t ] ) { 39 | return transitions[ t ]; 40 | } 41 | } 42 | 43 | return false; 44 | } 45 | 46 | window.animationEndName = getAnimationEvent(); 47 | window.transitionEndName = getTransitionEvent(); 48 | 49 | } ) ( window ); 50 | -------------------------------------------------------------------------------- /assets/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | $global-class-prefix: 'tailor-' !default; 2 | 3 | $global-section-width: 100% !default; 4 | $global-spacing-vertical: 1rem !default; 5 | $global-spacing-horizontal: 1rem !default; 6 | $global-transition-duration: 150ms !default; 7 | 8 | $global-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif !default; 9 | $global-font-size: 1em !default; 10 | $global-line-height: 1.5 !default; 11 | 12 | $global-primary-color: #0f95ee !default; 13 | $global-secondary-color: #a0a5aa !default; 14 | $global-text-color: #404040 !default; 15 | $global-background-color: #fdfdfd !default; 16 | $global-white-color: #fff !default; 17 | $global-success-color: #7ad03a !default; 18 | $global-warning-color: #ffba00 !default; 19 | $global-error-color: #dd3d36 !default; 20 | 21 | $global-border-width: 1px !default; 22 | $global-border-style: solid !default; 23 | $global-border-color: #efefef !default; 24 | $global-border-radius: 2px !default; 25 | $global-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(0, 0, 0, 0.05) !default; 26 | 27 | $text-color: #404040 !default; 28 | $background-color: #fdfdfd !default; 29 | $border-color: #efefef !default; //darken( $background-color, 5% ) !default; 30 | 31 | $mobile: "only screen and (max-width: 320px)" !default; 32 | $tablet: "only screen and (min-width: 321px) and (max-width: 720px)" !default; 33 | $tablet-up: "only screen and (min-width: 321px)" !default; 34 | $desktop: "only screen and (min-width: 721px)" !default; 35 | 36 | $wp-medium-up: "only screen and ( min-width: 641px )"; 37 | -------------------------------------------------------------------------------- /lib/scssphp/src/Util.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | class Util 22 | { 23 | /** 24 | * Asserts that `value` falls within `range` (inclusive), leaving 25 | * room for slight floating-point errors. 26 | * 27 | * @param string $name The name of the value. Used in the error message. 28 | * @param Range $range Range of values. 29 | * @param array $value The value to check. 30 | * @param string $unit The unit of the value. Used in error reporting. 31 | * 32 | * @return mixed `value` adjusted to fall within range, if it was outside by a floating-point margin. 33 | * 34 | * @throws \Exception 35 | */ 36 | public static function checkRange($name, Range $range, $value, $unit = '') 37 | { 38 | $val = $value[1]; 39 | $grace = new Range(-0.00001, 0.00001); 40 | 41 | if ($range->includes($val)) { 42 | return $val; 43 | } 44 | 45 | if ($grace->includes($val - $range->first)) { 46 | return $range->first; 47 | } 48 | 49 | if ($grace->includes($val - $range->last)) { 50 | return $range->last; 51 | } 52 | 53 | throw new \Exception("$name {$val} must be between {$range->first} and {$range->last}$unit"); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /includes/admin/class-compatibility.php: -------------------------------------------------------------------------------- 1 |

%s

', $message ); 53 | } 54 | } 55 | } 56 | 57 | new Tailor_Admin_Compatibility; -------------------------------------------------------------------------------- /assets/scss/components/sidebar/controls/_media.scss: -------------------------------------------------------------------------------- 1 | .control { 2 | 3 | .thumbnail { 4 | margin: 1px; 5 | width: auto; 6 | cursor: pointer; 7 | 8 | img { 9 | display: block; 10 | padding: 3px; 11 | margin: 0 auto; 12 | border: 1px solid #ddd; 13 | max-width: 100%; 14 | background-color: $background-color; 15 | } 16 | } 17 | 18 | &--gallery, 19 | &--image, 20 | &--video { 21 | 22 | img, 23 | video { 24 | max-width: 100%; 25 | } 26 | 27 | .video-preview, 28 | .thumbnails { 29 | margin-bottom: 8px; 30 | } 31 | } 32 | 33 | &--gallery { 34 | 35 | .thumbnails { 36 | @include clearfix; 37 | } 38 | 39 | .thumbnail { 40 | float: left; 41 | width: calc( 25% - 2px ); 42 | } 43 | } 44 | } 45 | 46 | .thumbnails, 47 | .video-preview { 48 | 49 | &.is-loading { 50 | background: url( ../img/spinner.gif ) no-repeat center; 51 | 52 | img { 53 | width: 100%; 54 | max-height: 150px; 55 | } 56 | 57 | > * { 58 | visibility: hidden; 59 | } 60 | } 61 | } 62 | 63 | @media print, 64 | (-webkit-min-device-pixel-ratio: 1.25), 65 | (min-resolution: 120dpi) { 66 | 67 | .thumbnails, 68 | .video-preview { 69 | 70 | &.is-loading { 71 | background: url( ../img/spinner-2x.gif ) no-repeat center; 72 | } 73 | } 74 | } 75 | 76 | .video-preview.is-loading { 77 | position: relative; 78 | padding-bottom: 56.25%; 79 | padding-top: 25px; 80 | height: 0; 81 | 82 | .video-placeholder { 83 | position: absolute; 84 | top: 0; 85 | left: 0; 86 | width: 100%; 87 | height: 100%; 88 | } 89 | } 90 | 91 | .media-frame-content .gallery-settings { 92 | display: none; 93 | } -------------------------------------------------------------------------------- /partials/admin/html/page-settings.php: -------------------------------------------------------------------------------- 1 | version(); ?> 16 | 17 |
18 | 19 |

20 | 21 |
22 |

23 |

', $version,'' ); ?>

24 | 25 |

26 |
    27 |
  • 28 |
  • 29 |
30 |

31 | ', '' 34 | ); ?> 35 |

36 |
37 | 38 |
39 | 40 | 41 |
42 | 43 | 47 | 48 |
49 |
50 |
51 | 52 | -------------------------------------------------------------------------------- /lib/scssphp/src/Formatter/Compressed.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | class Compressed extends Formatter 23 | { 24 | /** 25 | * {@inheritdoc} 26 | */ 27 | public function __construct() 28 | { 29 | $this->indentLevel = 0; 30 | $this->indentChar = ' '; 31 | $this->break = ''; 32 | $this->open = '{'; 33 | $this->close = '}'; 34 | $this->tagSeparator = ','; 35 | $this->assignSeparator = ':'; 36 | $this->keepSemicolons = false; 37 | } 38 | 39 | /** 40 | * {@inheritdoc} 41 | */ 42 | public function blockLines(OutputBlock $block) 43 | { 44 | $inner = $this->indentStr(); 45 | 46 | $glue = $this->break . $inner; 47 | 48 | foreach ($block->lines as $index => $line) { 49 | if (substr($line, 0, 2) === '/*' && substr($line, 2, 1) !== '!') { 50 | unset($block->lines[$index]); 51 | } elseif (substr($line, 0, 3) === '/*!') { 52 | $block->lines[$index] = '/*' . substr($line, 3); 53 | } 54 | } 55 | 56 | echo $inner . implode($glue, $block->lines); 57 | 58 | if (! empty($block->children)) { 59 | echo $this->break; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /assets/scss/components/sidebar/controls/_switch.scss: -------------------------------------------------------------------------------- 1 | $switch-margin: 2px !default; 2 | 3 | .control--switch { 4 | 5 | .switch { 6 | position: relative; 7 | display: inline-block; 8 | margin: $switch-margin; 9 | width: $global-font-size; 10 | height: $global-font-size; 11 | visibility: hidden; 12 | cursor: pointer; 13 | 14 | &::before, 15 | &::after { 16 | content: ""; 17 | display: block; 18 | visibility: visible; 19 | position: absolute; 20 | 21 | transition: all $global-transition-duration ease-in-out; 22 | } 23 | 24 | &::before { 25 | width: 34px; 26 | height: $global-font-size; 27 | border-radius: ( $global-font-size / 2 ); 28 | background-color: #b3b3b3; 29 | } 30 | 31 | &::after { 32 | width: 20px; 33 | height: 20px; 34 | top: -( $switch-margin * 2 ); 35 | left: -( $switch-margin * 2 ); 36 | border-radius: 50%; 37 | background-color: #fff; 38 | box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.25 ); 39 | } 40 | } 41 | 42 | input { 43 | display: none; 44 | 45 | &:checked { 46 | 47 | &~.switch { 48 | 49 | &::before { 50 | background-color: $global-primary-color; 51 | } 52 | 53 | &::after { 54 | left: calc( 100% + #{$switch-margin} ); 55 | } 56 | } 57 | } 58 | } 59 | } 60 | 61 | [dir=rtl] { 62 | 63 | .control--switch { 64 | 65 | .switch { 66 | 67 | &::after { 68 | left: auto; 69 | right: -( $switch-margin * 2 ); 70 | } 71 | } 72 | 73 | input { 74 | 75 | &:checked { 76 | 77 | &~.switch { 78 | 79 | &::after { 80 | left: auto; 81 | right: calc( 100% + #{$switch-margin} ); 82 | } 83 | } 84 | } 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /includes/admin/class-edit-page.php: -------------------------------------------------------------------------------- 1 | $post_id, 38 | 'post_content' => $post->post_content, 39 | ) ); 40 | 41 | wp_redirect( esc_url_raw( add_query_arg( array( 'tailor-layout-deleted' => '1' ), $url ) ) ); 42 | } 43 | 44 | /** 45 | * Displays admin notices. 46 | * 47 | * @since 1.7.5 48 | */ 49 | static function tailor_notices() { 50 | 51 | // Only show the notice on the Edit Post screen 52 | $screen = get_current_screen(); 53 | if ( 'post' !== $screen->base ) { 54 | return; 55 | } 56 | 57 | tailor_partial( 'admin/html/notice', 'layout-deleted' ); 58 | tailor_partial( 'admin/html/notice', 'tailored-content' ); 59 | } 60 | } 61 | 62 | Tailor_Edit_Page::add_actions(); -------------------------------------------------------------------------------- /assets/js/src/canvas/components/elements/containers/navigation/tabs-navigation-item.js: -------------------------------------------------------------------------------- 1 | module.exports = Marionette.ItemView.extend( { 2 | 3 | tagName : 'li', 4 | 5 | className : function() { 6 | return 'tailor-tabs__navigation-item tailor-' + this.model.get( 'id' ); 7 | }, 8 | 9 | modelEvents : { 10 | 'change:atts' : 'onChangeAttributes' 11 | }, 12 | 13 | /** 14 | * Adds the view ID to the element for use by the tab script. 15 | * 16 | * @since 1.0.0 17 | * 18 | * @returns {*} 19 | */ 20 | attributes : function() { 21 | return { 22 | 'data-id' : this.model.cid 23 | }; 24 | }, 25 | 26 | /** 27 | * Returns the element template. 28 | * 29 | * @since 1.0.0 30 | * 31 | * @returns {string} 32 | */ 33 | getTemplate : function() { 34 | return _.template( '<%= title || "Tab" %>' ); 35 | }, 36 | 37 | /** 38 | * Provides the required information to the template rendering function. 39 | * 40 | * @since 1.0.0 41 | * 42 | * @returns {*} 43 | */ 44 | serializeData : function() { 45 | var data = Marionette.ItemView.prototype.serializeData.apply( this, arguments ); 46 | var atts = this.model.get( 'atts' ); 47 | data.title = atts.title; 48 | 49 | return data; 50 | }, 51 | 52 | /** 53 | * Update the title when the attributes are updated. 54 | * 55 | * @since 1.0.0 56 | * 57 | * @param model 58 | * @param atts 59 | */ 60 | onChangeAttributes : function( model, atts ) { 61 | this.el.innerHTML = atts.title || 'Tab'; 62 | } 63 | 64 | } ); 65 | -------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/sections/show/default-menu-item.js: -------------------------------------------------------------------------------- 1 | var $ = Backbone.$, 2 | DefaultItem; 3 | 4 | DefaultItem = Marionette.ItemView.extend( { 5 | 6 | events : { 7 | click : 'onClick', 8 | keypress : 'onKeyPress' 9 | }, 10 | 11 | modelEvents : { 12 | 'focus' : 'onFocus' 13 | }, 14 | 15 | /** 16 | * Returns the appropriate template based on the panel type. 17 | * 18 | * @since 1.0.0 19 | * @returns {string} 20 | */ 21 | template : '#tmpl-tailor-panel-default-item', 22 | 23 | /** 24 | * Uses the rendered template HTML as the $el. 25 | * 26 | * @since 1.0.0 27 | * @param html 28 | * @returns {exports} 29 | */ 30 | attachElContent : function( html ) { 31 | var $el = $( html ); 32 | this.$el.replaceWith( $el ); 33 | this.setElement( $el ); 34 | this.el.setAttribute( 'tabindex', 0 ); 35 | 36 | return this; 37 | }, 38 | 39 | /** 40 | * Displays the associated section when the item is clicked. 41 | * 42 | * @since 1.0.0 43 | */ 44 | onClick : function() { 45 | this.triggerMethod( 'show:section' ); 46 | }, 47 | 48 | /** 49 | * Displays the associated section when the item is selected using the keyboard. 50 | * 51 | * @since 1.0.0 52 | */ 53 | onKeyPress : function( e ) { 54 | if ( 13 === e.which ) { 55 | this.triggerMethod( 'show:section' ); 56 | } 57 | }, 58 | 59 | /** 60 | * Sets focus on the list item. 61 | * 62 | * @since 1.0.0 63 | */ 64 | onFocus : function() { 65 | this.el.focus(); 66 | } 67 | 68 | } ); 69 | 70 | module.exports = DefaultItem; 71 | -------------------------------------------------------------------------------- /assets/scss/components/sidebar/controls/_icon.scss: -------------------------------------------------------------------------------- 1 | .control--icon { 2 | 3 | p { 4 | text-align: center; 5 | } 6 | 7 | i { 8 | display: inline-block; 9 | padding: 12px 0; 10 | width: 10%; 11 | height: 50px; 12 | cursor: pointer; 13 | font-size: 24px; 14 | line-height: 1; 15 | text-decoration: inherit; 16 | font-weight: normal; 17 | font-style: normal; 18 | vertical-align: top; 19 | text-align: center; 20 | -webkit-font-smoothing: antialiased; 21 | -moz-osx-font-smoothing: grayscale; 22 | } 23 | } 24 | 25 | .icon-control { 26 | max-height: 350px; 27 | overflow-y: auto; 28 | } 29 | 30 | .icon-list { 31 | margin: 0; 32 | list-style: none; 33 | 34 | &__icon { 35 | display: inline-block; 36 | padding: 12px 0; 37 | width: 10%; 38 | background-color: $global-white-color; 39 | text-align: center; 40 | cursor: pointer; 41 | 42 | input[type=radio] { 43 | display: none; 44 | } 45 | 46 | i { 47 | display: inline-block; 48 | font-size: 20px; 49 | line-height: 1; 50 | text-decoration: inherit; 51 | font-weight: normal; 52 | font-style: normal; 53 | vertical-align: top; 54 | text-align: center; 55 | -webkit-font-smoothing: antialiased; 56 | -moz-osx-font-smoothing: grayscale; 57 | 58 | &:hover { 59 | color: $global-primary-color; 60 | } 61 | } 62 | 63 | input[type=radio]:checked + i { 64 | color: $global-primary-color; 65 | } 66 | } 67 | 68 | @include clearfix; 69 | } 70 | 71 | // Contextual styles 72 | .dialog__container { 73 | 74 | .search--icon { 75 | padding: 6px 10px; 76 | margin-bottom: 8px; 77 | } 78 | 79 | .select--icon { 80 | width: 100%; 81 | max-width: none; 82 | margin: 0 0 6px; 83 | } 84 | } -------------------------------------------------------------------------------- /partials/meta-thumbnail.php: -------------------------------------------------------------------------------- 1 | ' . get_the_post_thumbnail( $post, $image_size, array( 'alt' => the_title_attribute( 'echo=0' ) ) ) . ''; 37 | 38 | // Add the thumbnail link, if required 39 | if ( 'none' !== $image_link ) { 40 | if ( 'file' == $image_link || 'lightbox' == $image_link ) { 41 | $thumbnail_link = get_the_post_thumbnail_url( $post, 'full' ); 42 | } 43 | else { 44 | $thumbnail_link = get_permalink( $post->ID ); 45 | } 46 | 47 | $thumbnail_image = "{$thumbnail_image}"; 48 | } ?> 49 | 50 |
51 | 52 | 53 | 54 |
-------------------------------------------------------------------------------- /assets/js/src/sidebar/modules/modal/modal.js: -------------------------------------------------------------------------------- 1 | var ModalView = require( './show/modal' ), 2 | ModalModule; 3 | 4 | ModalModule = Marionette.Module.extend( { 5 | 6 | /** 7 | * Initializes the module. 8 | * 9 | * @since 1.0.0 10 | */ 11 | onStart : function() { 12 | var api = { 13 | 14 | /** 15 | * Opens a modal window to edit the given element. 16 | * 17 | * @since 1.0.0 18 | * 19 | * @param model 20 | */ 21 | openModal : function( model ) { 22 | 23 | // Closes the current modal window and prompts the user to save any unsaved changes 24 | if ( app.modal.hasView() ) { 25 | if ( model === app.modal.currentView.model ) { 26 | return; 27 | } 28 | app.modal.currentView.triggerMethod( 'close' ); 29 | } 30 | 31 | app.modal.show( new ModalView( { 32 | model : model 33 | } ) ); 34 | }, 35 | 36 | /** 37 | * Closes the current modal window. 38 | * 39 | * @since 1.0.0 40 | */ 41 | closeModal : function() { 42 | app.modal.empty(); 43 | } 44 | }; 45 | 46 | this.listenTo( app.channel, 'modal:open', api.openModal ); 47 | this.listenTo( app.channel, 'elements:reset', api.closeModal ); 48 | 49 | /** 50 | * Fires when the module is initialized. 51 | * 52 | * @since 1.5.0 53 | * 54 | * @param this 55 | */ 56 | app.channel.trigger( 'module:modal:ready', this ); 57 | } 58 | 59 | } ); 60 | 61 | module.exports = ModalModule; -------------------------------------------------------------------------------- /lib/scssphp/src/Formatter/Expanded.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | class Expanded extends Formatter 23 | { 24 | /** 25 | * {@inheritdoc} 26 | */ 27 | public function __construct() 28 | { 29 | $this->indentLevel = 0; 30 | $this->indentChar = ' '; 31 | $this->break = "\n"; 32 | $this->open = ' {'; 33 | $this->close = '}'; 34 | $this->tagSeparator = ', '; 35 | $this->assignSeparator = ': '; 36 | $this->keepSemicolons = true; 37 | } 38 | 39 | /** 40 | * {@inheritdoc} 41 | */ 42 | protected function indentStr() 43 | { 44 | return str_repeat($this->indentChar, $this->indentLevel); 45 | } 46 | 47 | /** 48 | * {@inheritdoc} 49 | */ 50 | protected function blockLines(OutputBlock $block) 51 | { 52 | $inner = $this->indentStr(); 53 | 54 | $glue = $this->break . $inner; 55 | 56 | foreach ($block->lines as $index => $line) { 57 | if (substr($line, 0, 2) === '/*') { 58 | $block->lines[$index] = preg_replace('/(\r|\n)+/', $glue, $line); 59 | } 60 | } 61 | 62 | echo $inner . implode($glue, $block->lines); 63 | 64 | if (empty($block->selectors) || ! empty($block->children)) { 65 | echo $this->break; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /assets/js/src/canvas/components/elements/containers/tabs.js: -------------------------------------------------------------------------------- 1 | var ContainerView = require( './../element-container' ), 2 | TabsNavigationView = require( './navigation/tabs-navigation' ), 3 | TabsView; 4 | 5 | TabsView = ContainerView.extend( { 6 | 7 | ui : { 8 | navigation : '.tailor-tabs__navigation' 9 | }, 10 | 11 | /** 12 | * Destroys the tabs navigation before the template is refreshed. 13 | * 14 | * @since 1.0.0 15 | */ 16 | onBeforeRenderTemplate : function() { 17 | if ( this.navigation ) { 18 | this.navigation.triggerMethod( 'destroy' ); 19 | } 20 | }, 21 | 22 | /** 23 | * Inserts the tabs navigation into the DOM. 24 | * 25 | * @since 1.0.0 26 | */ 27 | onRenderTemplate : function() { 28 | this.navigation = new TabsNavigationView( { 29 | el : this.ui.navigation, 30 | model : this.model, 31 | collection : this.collection, 32 | sort : false 33 | } ); 34 | 35 | this.navigation.render(); 36 | }, 37 | 38 | /** 39 | * Triggers events when a child element template is refreshed. 40 | * 41 | * @since 1.0.0 42 | * 43 | * @param childView 44 | */ 45 | childRefreshed : function( childView ) { 46 | childView.el.id = childView.model.cid; 47 | childView.el.classList.add( 'is-active' ); 48 | 49 | this.triggerAll( 'element:child:refresh', childView ); 50 | }, 51 | 52 | /** 53 | * Destroys the tabs navigation before the tabs element is destroyed. 54 | * 55 | * @since 1.0.0 56 | */ 57 | onBeforeDestroy : function() { 58 | this.triggerAll( 'before:element:destroy', this ); 59 | this.navigation.triggerMethod( 'destroy' ); 60 | } 61 | 62 | } ); 63 | 64 | module.exports = TabsView; -------------------------------------------------------------------------------- /assets/scss/components/frontend/_card.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | 5 | // General 6 | $card-class-prefix: $global-class-prefix !default; 7 | $card-spacing-vertical: $global-spacing-vertical !default; 8 | $card-padding: 1em !default; 9 | $card-font-size: $global-font-size !default; 10 | $card-color: inherit !default; 11 | $card-border-width: $global-border-width !default; 12 | $card-border-style : $global-border-style !default; 13 | $card-border-color: $global-border-color !default; 14 | $card-border-radius: 0 !default; 15 | $card-background-color: transparent !default; 16 | $card-box-shadow: $global-box-shadow !default; 17 | 18 | 19 | // 20 | // Exported selectors 21 | // 22 | .#{$global-class-prefix}ui { 23 | 24 | .#{$card-class-prefix}card { 25 | margin-bottom: $card-spacing-vertical; 26 | font-size: $card-font-size; 27 | color: $card-color; 28 | background-color: $card-background-color; 29 | border: $card-border-width $card-border-style $card-border-color; 30 | border-radius: $card-border-radius; 31 | overflow: hidden; 32 | box-shadow: $card-box-shadow; 33 | 34 | &__header { 35 | margin: 0; 36 | display: table; 37 | width: 100%; 38 | border-bottom: $card-border-width $card-border-style $card-border-color; 39 | } 40 | 41 | &__title { 42 | display: table-cell; 43 | vertical-align: bottom; 44 | color: inherit; 45 | font-size: ( $card-font-size * 1.25 ); 46 | } 47 | 48 | &__header:not( :empty ), 49 | &__content { 50 | padding: $card-padding ( $card-padding * 1.25 ); 51 | } 52 | 53 | // States 54 | &.has-header-image { 55 | 56 | .#{$card-class-prefix}card { 57 | 58 | &__header { 59 | color: #fff; 60 | text-shadow: 1px 1px #666; 61 | height: 180px; 62 | } 63 | } 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /partials/underscore/control-icon-select.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /partials/author-links.php: -------------------------------------------------------------------------------- 1 | ' . 25 | "" . 26 | ''; 27 | } 28 | 29 | if ( $twitter_link = esc_url( get_the_author_meta( 'twitter', $author_id ) ) ) { 30 | $link_title = esc_attr( sprintf( __( 'View %s\'s Twitter page', 'tailor' ), $display_name ) ); 31 | $social_links .= '
  • ' . 32 | "" . 33 | '
  • '; 34 | } 35 | 36 | if ( $google_plus_link = esc_url( get_the_author_meta( 'googleplus', $author_id ) ) ) { 37 | $link_title = esc_attr( sprintf( __( 'View %s\'s Google Plus profile', 'tailor' ), $display_name ) ); 38 | $social_links .= '
  • ' . 39 | "" . 40 | '
  • '; 41 | } 42 | 43 | if ( '' !== $social_links ) { 44 | echo ''; 45 | } -------------------------------------------------------------------------------- /includes/controls/class-widget-form.php: -------------------------------------------------------------------------------- 1 | widget_id_base; 35 | $array['widget_class_name'] = $this->widget_class_name; 36 | return $array; 37 | } 38 | 39 | /** 40 | * Prints the Underscore (JS) template for this control. 41 | * 42 | * Class variables are available in the JS object provided by the to_json method. 43 | * 44 | * @since 1.6.0 45 | * @access protected 46 | * 47 | * @see Tailor_Control::to_json() 48 | * @see Tailor_Control::print_template() 49 | */ 50 | protected function render_template() { 51 | 52 | global $wp_widget_factory; 53 | if ( ! empty( $wp_widget_factory->widgets[ $this->widget_class_name ] ) ) { 54 | $wp_widget_factory->widgets[ $this->widget_class_name ]->form( array() ); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /assets/js/src/shared/utility/debug.js: -------------------------------------------------------------------------------- 1 | app.channel.on( 'debug', function() { 2 | 3 | function printCollectionLevel( collection, parent, depth ) { 4 | depth = depth + 1; 5 | var children = collection.where( { parent : parent } ); 6 | var level = depth; 7 | 8 | if ( 0 === children.length ) { 9 | return; 10 | } 11 | 12 | var spacing = Array( depth ).join( "\t" ); 13 | _.each( children, function( child ) { 14 | console.log( spacing + ' ' + child.get( 'label' ) + ' (id: ' + child.get( 'id' ) + ', order: ' + child.get( 'order' ) + ')' ); 15 | printCollectionLevel( collection, child.get( 'id' ), level ); 16 | 17 | } ); 18 | } 19 | 20 | function printIndexLevel( view, depth ) { 21 | depth = depth + 1; 22 | var level = depth; 23 | 24 | if ( ! view.children ) { 25 | return; 26 | } 27 | 28 | var spacing = Array( depth ).join( "\t" ); 29 | 30 | view.children.each( function( child ) { 31 | console.log( spacing + ' ' + child.model.get( 'label' ) + ' (id: ' + child.model.get( 'id' ) + ', order: ' + child._index + ')' ); 32 | printIndexLevel( child, level ); 33 | } ); 34 | } 35 | 36 | function printCollection() { 37 | 38 | var models = app.channel.request( 'canvas:elements' ); 39 | 40 | console.log( models ); 41 | 42 | //models.sort( { silent : true } ); 43 | printCollectionLevel( models, '', 0 ); 44 | } 45 | 46 | function printIndices() { 47 | var canvas = app.canvasRegion.currentView; 48 | printIndexLevel( canvas, 0 ); 49 | } 50 | 51 | console.log('\n Collection:'); 52 | printCollection(); 53 | 54 | console.log('\n Indices:'); 55 | printIndices(); 56 | 57 | } ); 58 | -------------------------------------------------------------------------------- /assets/js/src/shared/components/ui/lightbox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Components.Lightbox 3 | * 4 | * A lightbox component. 5 | * 6 | * @class 7 | */ 8 | var $ = window.jQuery, 9 | Components = window.Tailor.Components, 10 | Lightbox; 11 | 12 | Lightbox = Components.create( { 13 | 14 | getDefaults: function() { 15 | return { 16 | type : 'image', 17 | delegate : '.is-lightbox-image', 18 | closeMarkup : '', 19 | gallery : { 20 | enabled : true, 21 | arrowMarkup: '' 22 | }, 23 | image : { 24 | titleSrc: function( item ) { 25 | return item.el.find( 'figcaption' ).text(); 26 | } 27 | } 28 | }; 29 | }, 30 | 31 | /** 32 | * Initializes the component. 33 | * 34 | * @since 1.7.5 35 | */ 36 | onInitialize: function() { 37 | this.magnificPopup(); 38 | }, 39 | 40 | /** 41 | * Initializes the Magnific Popup plugin. 42 | * 43 | * @since 1.7.5 44 | */ 45 | magnificPopup : function() { 46 | this.$el.magnificPopup( this.options ); 47 | } 48 | 49 | } ); 50 | 51 | /** 52 | * Lightbox jQuery plugin. 53 | * 54 | * @since 1.0.0 55 | * 56 | * @param options 57 | * @param callbacks 58 | * @returns {*} 59 | */ 60 | $.fn.tailorLightbox = function( options, callbacks ) { 61 | return this.each( function() { 62 | var instance = $.data( this, 'tailorLightbox' ); 63 | if ( ! instance ) { 64 | $.data( this, 'tailorLightbox', new Lightbox( this, options, callbacks ) ); 65 | } 66 | } ); 67 | }; 68 | 69 | module.exports = Lightbox; -------------------------------------------------------------------------------- /assets/scss/frontend.scss: -------------------------------------------------------------------------------- 1 | @import "variables"; 2 | 3 | // 4 | // Tools 5 | // 6 | @import "tools/flex"; 7 | @import "tools/keyframes"; 8 | @import "tools/transform"; 9 | @import "tools/transition"; 10 | @import "tools/user-select"; 11 | @import "tools/prefixer"; 12 | @import "tools/clearfix"; 13 | @import "tools/box-shadow"; 14 | 15 | // 16 | // Generic styles 17 | // 18 | @import "generic/box-sizing"; 19 | 20 | // 21 | // Components 22 | // 23 | @import "components/frontend/author"; 24 | @import "components/frontend/box"; 25 | @import "components/frontend/button"; 26 | @import "components/frontend/content"; 27 | @import "components/frontend/contact-form"; 28 | @import "components/frontend/tabs"; 29 | @import "components/frontend/carousel"; 30 | @import "components/frontend/columns"; 31 | @import "components/frontend/jetpack-portfolio"; 32 | @import "components/frontend/jetpack-testimonials"; 33 | @import "components/frontend/list"; 34 | @import "components/frontend/gallery"; 35 | @import "components/frontend/grid"; 36 | @import "components/frontend/form"; 37 | @import "components/frontend/map"; 38 | @import "components/frontend/card"; 39 | @import "components/frontend/hero"; 40 | @import "components/frontend/toggles"; 41 | @import "components/frontend/posts"; 42 | @import "components/frontend/section"; 43 | @import "components/frontend/widgets"; 44 | 45 | // 46 | // Objects 47 | // 48 | @import "objects/embeds"; 49 | @import "objects/slideshow"; 50 | @import "objects/pagination"; 51 | @import "objects/attachment"; 52 | 53 | // 54 | // Vendor 55 | // 56 | @import "vendor/slick"; 57 | @import "vendor/magnific-popup"; 58 | 59 | // 60 | // Trumps 61 | // 62 | @import "trumps/frontend/placeholder"; 63 | @import "trumps/frontend/notifications"; 64 | @import "trumps/frontend/icons"; 65 | @import "trumps/frontend/formats"; 66 | @import "trumps/frontend/utility"; 67 | 68 | @import "trumps/shared/wordpress"; -------------------------------------------------------------------------------- /assets/scss/components/canvas/elements/_columns.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Variables 3 | // 4 | $column-class-prefix: $global-class-prefix !default; 5 | $column-sizer-width: 1rem !default; 6 | 7 | 8 | // 9 | // Mixins 10 | // 11 | @mixin row( $size ) { 12 | 13 | .#{$global-class-prefix}ui { 14 | 15 | // Row 16 | .#{$size}-columns { 17 | 18 | // Column 19 | .#{$column-class-prefix}column { 20 | 21 | &__helper { 22 | display: block; 23 | } 24 | 25 | &:last-of-type { 26 | 27 | > .#{$column-class-prefix}column { 28 | 29 | // Hide the column handle for the last column 30 | &__helper { 31 | display: none; 32 | } 33 | } 34 | } 35 | } 36 | } 37 | } 38 | } 39 | 40 | 41 | // 42 | // Exported selectors 43 | // 44 | .#{$global-class-prefix}ui { 45 | 46 | .#{$column-class-prefix}column { 47 | 48 | &__helper, 49 | &__sizer, 50 | &__width { 51 | position: absolute; 52 | top: 0; 53 | z-index: 1001; 54 | } 55 | 56 | &__helper { 57 | left: 0; 58 | width: 100%; 59 | height: 100%; 60 | display: block; 61 | pointer-events: none; 62 | } 63 | 64 | &:last-of-type { 65 | 66 | > .#{$column-class-prefix}column { 67 | 68 | // Hide the column handle for the last column 69 | &__helper { 70 | display: none; 71 | } 72 | } 73 | } 74 | 75 | &__sizer { 76 | bottom: 0; 77 | right: - ( $column-sizer-width / 2 ); 78 | width: $column-sizer-width; 79 | cursor: col-resize; 80 | pointer-events: all; 81 | } 82 | 83 | &__width { 84 | position: absolute; 85 | top: 1px; 86 | pointer-events: none; 87 | width: 50px; 88 | 89 | @include label( $element-border-color--hover ); 90 | 91 | &--left { 92 | left: 0; 93 | } 94 | 95 | &--right { 96 | right: 0; 97 | } 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /assets/js/src/canvas/entities/models/element-child.js: -------------------------------------------------------------------------------- 1 | var CompositeModel = require( './element-composite' ), 2 | ChildModel; 3 | 4 | ChildModel = CompositeModel.extend( { 5 | 6 | /** 7 | * Returns true if this element is a valid drop target. 8 | * 9 | * @since 1.0.0 10 | * 11 | * @param that The element being dragged 12 | * @param region The region of this element that the other element is over 13 | */ 14 | validTarget : function( that, region ) { 15 | if ( 'tailor_section' == that.get( 'tag' ) || _.contains( [ 'left', 'right', 'center' ], region ) ) { 16 | return false; 17 | } 18 | 19 | var parent = this.collection.getParent( this ); 20 | if ( parent.get( 'tag' ) == that.get( 'tag' ) ) { 21 | return false; 22 | } 23 | 24 | return that.get( 'tag' ) == this.get( 'tag' ); 25 | }, 26 | 27 | /** 28 | * Initializes the tabs model. 29 | * 30 | * @since 1.0.0 31 | */ 32 | initialize : function() { 33 | this.addEventListeners(); 34 | }, 35 | 36 | /** 37 | * Adds the required event listeners. 38 | * 39 | * @since 1.0.0 40 | */ 41 | addEventListeners : function() { 42 | this.listenTo( this, 'element:move:top', this.insertBefore ); 43 | this.listenTo( this, 'element:move:bottom', this.insertAfter ); 44 | this.listenTo( this, 'element:move:left', this.insertBefore ); // Column 45 | this.listenTo( this, 'element:move:right', this.insertAfter ); // Column 46 | 47 | this.listenTo( this, 'element:copy:top', this.copyBefore ); 48 | this.listenTo( this, 'element:copy:bottom', this.copyAfter ); 49 | this.listenTo( this, 'element:copy:left', this.copyBefore ); // Column 50 | this.listenTo( this, 'element:copy:right', this.copyAfter ); // Column 51 | } 52 | 53 | } ); 54 | 55 | module.exports = ChildModel; -------------------------------------------------------------------------------- /assets/js/src/sidebar/components/controls/input-group.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Tailor.Controls.InputGroup 3 | * 4 | * An input group control. 5 | * 6 | * @augments Marionette.ItemView 7 | */ 8 | var AbstractControl = require( './abstract-control' ), 9 | InputGroup; 10 | 11 | InputGroup = AbstractControl.extend( { 12 | 13 | /** 14 | * Provides additional data to the template rendering function. 15 | * 16 | * @since 1.7.2 17 | * 18 | * @returns {*} 19 | */ 20 | addSerializedData : function( data ) { 21 | data.choices = this.model.get( 'choices' ); 22 | data.values = {}; 23 | 24 | _.each( this.getValues(), function( value, media ) { 25 | data.values[ media ] = {}; 26 | var values = []; 27 | if ( _.isString( value ) ) { 28 | if ( -1 != value.indexOf( ',' ) ) { 29 | values = value.split( ',' ); 30 | } 31 | else { 32 | values = value.split( '-' ); // Old format 33 | } 34 | } 35 | 36 | var i = 0; 37 | for ( var choice in data.choices ) { 38 | if ( data.choices.hasOwnProperty( choice ) ) { 39 | data.values[ media ][ choice ] = values[ i ]; 40 | i ++; 41 | } 42 | } 43 | } ); 44 | 45 | return data; 46 | }, 47 | 48 | /** 49 | * Updates the current setting value when a field change occurs. 50 | * 51 | * @since 1.7.2 52 | */ 53 | onFieldChange : function( e ) { 54 | var fields = this.ui.input.filter( '[name^="' + this.media + '"]' ).serializeArray(); 55 | var values = _.map( fields, function( field ) { 56 | return field.value; 57 | } ); 58 | this.setValue( values.join( ',' ) ); 59 | } 60 | 61 | } ); 62 | 63 | module.exports = InputGroup; 64 | -------------------------------------------------------------------------------- /includes/class-compatibility.php: -------------------------------------------------------------------------------- 1 | choices; 41 | return $array; 42 | } 43 | 44 | /** 45 | * Prints the Underscore (JS) template for this control. 46 | * 47 | * Class variables are available in the JS object provided by the to_json method. 48 | * 49 | * @since 1.0.0 50 | * @access protected 51 | * 52 | * @see Tailor_Control::to_json() 53 | * @see Tailor_Control::print_template() 54 | */ 55 | protected function render_template() { ?> 56 | 57 | <% _.each( choices, function( label, key ) { %> 58 | 62 | <% } ) %> 63 | 64 | choices; 41 | return $array; 42 | } 43 | 44 | /** 45 | * Prints the Underscore (JS) template for this control. 46 | * 47 | * Class variables are available in the JS object provided by the to_json method. 48 | * 49 | * @since 1.0.0 50 | * @access protected 51 | * 52 | * @see Tailor_Control::to_json() 53 | * @see Tailor_Control::print_template() 54 | */ 55 | protected function render_template() { ?> 56 | 57 | <% _.each( choices, function( label, key ) { %> 58 | 62 | <% } ) %> 63 | 64 | choices; 41 | return $array; 42 | } 43 | 44 | /** 45 | * Prints the Underscore (JS) template for this control. 46 | * 47 | * Class variables are available in the JS object provided by the to_json method. 48 | * 49 | * @since 1.0.0 50 | * @access protected 51 | * 52 | * @see Tailor_Control::to_json() 53 | * @see Tailor_Control::print_template() 54 | */ 55 | protected function render_template() { ?> 56 | 57 |
    58 | 59 | <% _.each( choices, function( label, key ) { %> 60 | 63 | <% } ) %> 64 | 65 |
    66 | 67 | ';ed.execCommand("mceInsertContent",0,""+icon+"  "+content+"
    ")},onClose:function(){this.$el.find(".search--icon").off("input")}})})}});tinymce.PluginManager.add("tailoricon",tinymce.plugins.tailoricon)})(tinymce,jQuery)},{}]},{},[1]); --------------------------------------------------------------------------------