';
19 |
20 | while ( $q->have_posts() ) {
21 |
22 | $q->the_post();
23 |
24 | echo '
';
25 | tailor_partial( 'content', get_post_type(), $entry_args );
26 | echo '';
27 | }
28 |
29 | 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 | '';
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 |
24 | ';
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 | ';
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 |
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 |
58 |
59 | <% _.each( choices, function( label, key ) { %>
60 |
63 | <% } ) %>
64 |
65 |
66 |
67 | ';ed.execCommand("mceInsertContent",0,"