init
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+115
@@ -0,0 +1,115 @@
|
||||
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
|
||||
.wp-customizer .expanded .widget-conditional .widget-conditional-inner {
|
||||
width: 98%; /* Safari/Chrome, other WebKit */ /* Firefox, other Gecko */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.wp-customizer .expanded .widget-conditional .form{
|
||||
overflow: scroll;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.widget-liquid-right .widget.expanded {
|
||||
overflow: visible;
|
||||
}
|
||||
.widget-conditional-hide {
|
||||
display: none;
|
||||
}
|
||||
.widget-conditional .widget-conditional-inner {
|
||||
background: #F9F9F9;
|
||||
border: 1px solid #DFDFDF;
|
||||
padding: 12px 10px 0;
|
||||
|
||||
}
|
||||
.widget-conditional {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.widget-conditional .conditions{
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.widget-conditional .condition,
|
||||
.widget-conditional .condition-top {
|
||||
clear:both;
|
||||
}
|
||||
.widget-conditional .condition {
|
||||
padding-top: 12px;
|
||||
position: relative;
|
||||
}
|
||||
.widget-conditional .condition select {
|
||||
width: 120px;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.widget-conditional .condition-top select {
|
||||
width: auto;
|
||||
}
|
||||
.widget-conditional .condition-control {
|
||||
padding-top: 4px;
|
||||
clear: both;
|
||||
margin-top: -20px;
|
||||
}
|
||||
.widget-conditional .selection {
|
||||
margin-left: 50px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.widget-conditional .conditions-rule-has-children {
|
||||
display: block;
|
||||
}
|
||||
.widget-conditional .condition .actions {
|
||||
margin-top: -28px;
|
||||
}.widget-conditional .condition .actions {
|
||||
margin-top: -28px;
|
||||
}
|
||||
|
||||
.widget-conditional .condition-control a {
|
||||
text-decoration: none;
|
||||
position: absolute;
|
||||
top: 17px;
|
||||
text-indent: -9999px;
|
||||
z-index: 1;
|
||||
}
|
||||
.widget-conditional .condition-control a:before {
|
||||
position: absolute;
|
||||
text-indent: 0;
|
||||
right: 0;
|
||||
}
|
||||
.widget-conditional .condition-control .delete-condition {
|
||||
right: 0;
|
||||
color: #f11;
|
||||
}
|
||||
.widget-conditional .condition-control .add-condition {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.widget-conditional .condition:last-child .condition-conjunction,
|
||||
.widget-conditional .condition:last-child .condition-intersection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-conditional.conjunction .condition-intersection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-conditional.intersection .condition-conjunction {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wp-core-ui .button.display-options {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.wp-core-ui .button.display-options:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.wp-customizer .widget-conditional select {
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
height: auto;
|
||||
}
|
||||
.wp-customizer .widget-conditional .condition-control a {
|
||||
top: 15px;
|
||||
}
|
||||
@media screen and ( max-width: 782px ) {
|
||||
.widget-conditional .condition-control a {
|
||||
top: 20px;
|
||||
}
|
||||
}
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
.wp-customizer .expanded .widget-conditional .widget-conditional-inner {
|
||||
width: 98%; /* Safari/Chrome, other WebKit */ /* Firefox, other Gecko */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.wp-customizer .expanded .widget-conditional .form {
|
||||
overflow: scroll;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widget.expanded {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.widget-conditional-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-conditional .widget-conditional-inner {
|
||||
background: #f6f7f7;
|
||||
border: 1px solid #dcdcde;
|
||||
padding: 12px 10px 0;
|
||||
}
|
||||
|
||||
.widget-conditional {
|
||||
margin-bottom: 12px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.widget-conditional .conditions {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.widget-conditional .condition,
|
||||
.widget-conditional .condition-top {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.widget-conditional .condition {
|
||||
padding-top: 12px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.widget-conditional .condition select {
|
||||
width: 120px;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.widget-conditional .condition-top select {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.widget-conditional .condition-control {
|
||||
padding-top: 4px;
|
||||
clear: both;
|
||||
margin-top: -20px;
|
||||
}
|
||||
|
||||
.widget-conditional .selection {
|
||||
margin-left: 50px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.widget-conditional .conditions-rule-has-children {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.widget-conditional .condition .actions {
|
||||
margin-top: -28px;
|
||||
}
|
||||
|
||||
.widget-conditional .condition .actions {
|
||||
margin-top: -28px;
|
||||
}
|
||||
|
||||
.widget-conditional .condition-control a {
|
||||
text-decoration: none;
|
||||
position: absolute;
|
||||
top: 17px;
|
||||
text-indent: -9999px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-conditional .condition-control a {
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
.widget-conditional .condition-control a:before {
|
||||
position: absolute;
|
||||
text-indent: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .condition-control .delete-condition,
|
||||
.widget-conditional .condition-control .delete-condition {
|
||||
right: 0;
|
||||
color: #f11;
|
||||
}
|
||||
|
||||
.widget-conditional .condition-control .add-condition {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .widget-conditional-inner a.dashicons {
|
||||
font-family: dashicons;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional-inner select {
|
||||
display: initial;
|
||||
width: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .widget-conditional-inner select:disabled {
|
||||
color: #a7aaad;
|
||||
border-color: #dcdcde;
|
||||
background-color: #f6f7f7;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper .wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .alignleft {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.widget-conditional .condition:last-child .condition-conjunction,
|
||||
.widget-conditional .condition:last-child .condition-intersection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-conditional.conjunction .condition-intersection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-conditional.intersection .condition-conjunction {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wp-core-ui .button.display-options {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.wp-core-ui .button.display-options:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.wp-customizer .widget-conditional select {
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.wp-customizer .widget-conditional .condition-control a {
|
||||
top: 15px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.widget-conditional .condition-control a {
|
||||
top: 20px;
|
||||
}
|
||||
}
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional-inner {
|
||||
/*
|
||||
* fonts of labels are reset to 13px in gutenberg editor for legacy widgets, ensure a consistent look on non-labels
|
||||
*/
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Rules for gutenberg advanced panel
|
||||
*/
|
||||
.widget-vis__wrapper .components-base-control,
|
||||
.widget-vis__rule .components-base-control {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.widget-vis__rule {
|
||||
padding: 12px;
|
||||
border: 1px solid #dcdcde;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.widget-vis__rule-major,
|
||||
.widget-vis__rule-minor {
|
||||
display: flex;
|
||||
justify-content: stretch;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.widget-vis__if,
|
||||
.widget-vis__is {
|
||||
margin-left: 8px;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
.widget-vis__show-hide {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.components-button.widget-vis__add-new-rule {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.widget-vis__delete-rule {
|
||||
margin-top: 6px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.widget-vis__match-all {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.widget-vis__select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.widget-vis__select .components-input-control__container {
|
||||
position: relative;
|
||||
top: 4px;
|
||||
}
|
||||
|
||||
.widget-vis__select-multi-level select option:disabled {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions/widget-conditions-rtl.min.css
Vendored
+1
@@ -0,0 +1 @@
|
||||
.wp-customizer .expanded .widget-conditional .widget-conditional-inner{box-sizing:border-box;width:98%}.wp-customizer .expanded .widget-conditional .form{margin-bottom:20px;overflow:scroll}.widget-liquid-right .widget.expanded{overflow:visible}.widget-conditional-hide{display:none}.widget-conditional .widget-conditional-inner{background:#f6f7f7;border:1px solid #dcdcde;padding:12px 10px 0}.widget-conditional{margin-bottom:12px;margin-top:10px}.widget-conditional .conditions{margin-bottom:12px}.widget-conditional .condition,.widget-conditional .condition-top{clear:both}.widget-conditional .condition{padding-top:12px;position:relative}.widget-conditional .condition select{position:relative;width:120px;z-index:2}.widget-conditional .condition-top select{width:auto}.widget-conditional .condition-control{clear:both;margin-top:-20px;padding-top:4px}.widget-conditional .selection{margin-left:50px;margin-right:20px}.widget-conditional .conditions-rule-has-children{display:block}.widget-conditional .condition .actions{margin-top:-28px}.widget-conditional .condition-control a{position:absolute;text-decoration:none;text-indent:-9999px;top:17px;z-index:1}.wp-block-legacy-widget__edit-form .widget-conditional .condition-control a{top:20px}.widget-conditional .condition-control a:before{position:absolute;right:0;text-indent:0;top:0}.widget-conditional .condition-control .delete-condition,.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .condition-control .delete-condition{color:#f11;right:0}.widget-conditional .condition-control .add-condition{left:0}.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .widget-conditional-inner a.dashicons{font-family:dashicons}.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional-inner select{background-color:#fff;display:initial;width:auto}.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .widget-conditional-inner select:disabled{background-color:#f6f7f7;border-color:#dcdcde;color:#a7aaad}.editor-styles-wrapper .wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .alignleft{margin-right:20px}.widget-conditional .condition:last-child .condition-conjunction,.widget-conditional .condition:last-child .condition-intersection,.widget-conditional.conjunction .condition-intersection,.widget-conditional.intersection .condition-conjunction{display:none}.wp-core-ui .button.display-options{margin-left:5px}.wp-core-ui .button.display-options:hover{text-decoration:none}.wp-customizer .widget-conditional select{height:auto;max-width:none;min-width:0}.wp-customizer .widget-conditional .condition-control a{top:15px}@media screen and (max-width:782px){.widget-conditional .condition-control a{top:20px}}.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional-inner{font-size:13px}.widget-vis__rule,.widget-vis__rule .components-base-control,.widget-vis__wrapper .components-base-control{margin-bottom:12px}.widget-vis__rule{border:1px solid #dcdcde;display:flex;flex-direction:column;padding:12px}.widget-vis__rule-major,.widget-vis__rule-minor{align-items:center;display:flex;justify-content:stretch}.widget-vis__if,.widget-vis__is{margin-left:8px;width:10px}.widget-vis__show-hide{margin-bottom:0}.components-button.widget-vis__add-new-rule{display:block}.widget-vis__delete-rule{margin-top:6px;text-align:left}.widget-vis__match-all{margin-top:12px}.widget-vis__select{width:100%}.widget-vis__select .components-input-control__container{position:relative;top:4px}.widget-vis__select-multi-level select option:disabled{font-size:18px;font-weight:600}
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
.wp-customizer .expanded .widget-conditional .widget-conditional-inner {
|
||||
width: 98%;
|
||||
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
||||
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.wp-customizer .expanded .widget-conditional .form{
|
||||
overflow: scroll;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.widget-liquid-right .widget.expanded {
|
||||
overflow: visible;
|
||||
}
|
||||
.widget-conditional-hide {
|
||||
display: none;
|
||||
}
|
||||
.widget-conditional .widget-conditional-inner {
|
||||
background: #f6f7f7;
|
||||
border: 1px solid #dcdcde;
|
||||
padding: 12px 10px 0;
|
||||
|
||||
}
|
||||
.widget-conditional {
|
||||
margin-bottom: 12px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.widget-conditional .conditions{
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.widget-conditional .condition,
|
||||
.widget-conditional .condition-top {
|
||||
clear:both;
|
||||
}
|
||||
.widget-conditional .condition {
|
||||
padding-top: 12px;
|
||||
position: relative;
|
||||
}
|
||||
.widget-conditional .condition select {
|
||||
width: 120px;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.widget-conditional .condition-top select {
|
||||
width: auto;
|
||||
}
|
||||
.widget-conditional .condition-control {
|
||||
padding-top: 4px;
|
||||
clear: both;
|
||||
margin-top: -20px;
|
||||
}
|
||||
.widget-conditional .selection {
|
||||
margin-right: 50px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.widget-conditional .conditions-rule-has-children {
|
||||
display: block;
|
||||
}
|
||||
.widget-conditional .condition .actions {
|
||||
margin-top: -28px;
|
||||
}.widget-conditional .condition .actions {
|
||||
margin-top: -28px;
|
||||
}
|
||||
|
||||
.widget-conditional .condition-control a {
|
||||
text-decoration: none;
|
||||
position: absolute;
|
||||
top: 17px;
|
||||
text-indent: -9999px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-conditional .condition-control a {
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
.widget-conditional .condition-control a:before {
|
||||
position: absolute;
|
||||
text-indent: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .condition-control .delete-condition,
|
||||
.widget-conditional .condition-control .delete-condition {
|
||||
left: 0;
|
||||
color: #f11;
|
||||
}
|
||||
.widget-conditional .condition-control .add-condition {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .widget-conditional-inner a.dashicons {
|
||||
font-family: dashicons;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional-inner select {
|
||||
display:initial;
|
||||
width:auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .widget-conditional-inner select:disabled {
|
||||
color: #a7aaad;
|
||||
border-color: #dcdcde;
|
||||
background-color: #f6f7f7;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper .wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .alignleft {
|
||||
margin-left:20px
|
||||
}
|
||||
|
||||
.widget-conditional .condition:last-child .condition-conjunction,
|
||||
.widget-conditional .condition:last-child .condition-intersection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-conditional.conjunction .condition-intersection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-conditional.intersection .condition-conjunction {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wp-core-ui .button.display-options {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.wp-core-ui .button.display-options:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.wp-customizer .widget-conditional select {
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
height: auto;
|
||||
}
|
||||
.wp-customizer .widget-conditional .condition-control a {
|
||||
top: 15px;
|
||||
}
|
||||
@media screen and ( max-width: 782px ) {
|
||||
.widget-conditional .condition-control a {
|
||||
top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional-inner {
|
||||
/*
|
||||
* fonts of labels are reset to 13px in gutenberg editor for legacy widgets, ensure a consistent look on non-labels
|
||||
*/
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Rules for gutenberg advanced panel
|
||||
*/
|
||||
|
||||
.widget-vis__wrapper .components-base-control,
|
||||
.widget-vis__rule .components-base-control {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.widget-vis__rule {
|
||||
padding: 12px;
|
||||
border: 1px solid #dcdcde;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.widget-vis__rule-major,
|
||||
.widget-vis__rule-minor {
|
||||
display: flex;
|
||||
justify-content: stretch;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.widget-vis__if,
|
||||
.widget-vis__is {
|
||||
margin-right: 8px;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
.widget-vis__show-hide {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.components-button.widget-vis__add-new-rule {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.widget-vis__delete-rule {
|
||||
margin-top: 6px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.widget-vis__match-all {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.widget-vis__select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.widget-vis__select .components-input-control__container {
|
||||
position: relative;
|
||||
top: 4px;
|
||||
}
|
||||
|
||||
.widget-vis__select-multi-level select option:disabled {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
+313
@@ -0,0 +1,313 @@
|
||||
/* global isRtl, widget_conditions_parent_pages, widget_conditions_data */
|
||||
|
||||
jQuery( function ( $ ) {
|
||||
// Gutenberg 'widgets.php' screen.
|
||||
var widgets_shell = $( '#widgets-editor' );
|
||||
|
||||
if ( 0 === widgets_shell.length ) {
|
||||
// Legacy 'widgets.php' screen + customizer.
|
||||
widgets_shell = $( 'div#widgets-right' );
|
||||
|
||||
// For backwards compatibility
|
||||
if ( 0 === widgets_shell.length ) {
|
||||
widgets_shell = $( 'form#customize-controls' );
|
||||
}
|
||||
}
|
||||
|
||||
function setWidgetMargin( $widget ) {
|
||||
var currentWidth, extra;
|
||||
|
||||
if ( $( 'body' ).hasClass( 'wp-customizer' ) ) {
|
||||
// set the inside widget 2 top this way we can see the widget settings
|
||||
$widget.find( '.widget-inside' ).css( 'top', 0 );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $widget.hasClass( 'expanded' ) ) {
|
||||
// The expanded widget must be at least 400px wide in order to
|
||||
// contain the visibility settings. IE wasn't handling the
|
||||
// margin-left value properly.
|
||||
|
||||
if ( $widget.attr( 'style' ) ) {
|
||||
$widget.data( 'original-style', $widget.attr( 'style' ) );
|
||||
}
|
||||
|
||||
currentWidth = $widget.width();
|
||||
|
||||
if ( currentWidth < 400 ) {
|
||||
extra = 400 - currentWidth;
|
||||
if ( isRtl ) {
|
||||
$widget
|
||||
.css( 'position', 'relative' )
|
||||
.css( 'right', '-' + extra + 'px' )
|
||||
.css( 'width', '400px' );
|
||||
} else {
|
||||
$widget
|
||||
.css( 'position', 'relative' )
|
||||
.css( 'left', '-' + extra + 'px' )
|
||||
.css( 'width', '400px' );
|
||||
}
|
||||
}
|
||||
} else if ( $widget.data( 'original-style' ) ) {
|
||||
// Restore any original inline styles when visibility is toggled off.
|
||||
$widget.attr( 'style', $widget.data( 'original-style' ) ).data( 'original-style', null );
|
||||
} else {
|
||||
$widget.removeAttr( 'style' );
|
||||
}
|
||||
}
|
||||
|
||||
function moveWidgetVisibilityButton( $widget ) {
|
||||
var $displayOptionsButton = $widget.find( 'a.display-options' ).first(),
|
||||
$relativeWidget = $widget.find( 'input.widget-control-save' );
|
||||
|
||||
if ( 0 === $relativeWidget.length ) {
|
||||
// The save button doesn't exist in gutenberg widget editor, the conditional HTML ought to be displayed
|
||||
// last inside the widget options, so display the button before that.
|
||||
$relativeWidget = $widget.find( 'div.widget-conditional' );
|
||||
}
|
||||
$displayOptionsButton.insertBefore( $relativeWidget );
|
||||
|
||||
// Widgets with no configurable options don't show the Save button's container.
|
||||
$displayOptionsButton
|
||||
.parent()
|
||||
.removeClass( 'widget-control-noform' )
|
||||
.find( '.spinner' )
|
||||
.remove()
|
||||
.css( 'float', 'left' )
|
||||
.prependTo( $displayOptionsButton.parent() );
|
||||
}
|
||||
|
||||
$( '.widget' ).each( function () {
|
||||
moveWidgetVisibilityButton( $( this ) );
|
||||
} );
|
||||
|
||||
$( document ).on( 'widget-added', function ( e, $widget ) {
|
||||
if ( $widget.find( 'div.widget-control-actions a.display-options' ).length === 0 ) {
|
||||
moveWidgetVisibilityButton( $widget );
|
||||
}
|
||||
} );
|
||||
|
||||
widgets_shell.on( 'click.widgetconditions', 'a.add-condition', function ( e ) {
|
||||
var $condition = $( this ).closest( 'div.condition' ),
|
||||
$conditionClone = $condition
|
||||
.clone()
|
||||
.data( 'rule-major', '' )
|
||||
.data( 'rule-minor', '' )
|
||||
.data( 'has-children', '' )
|
||||
.insertAfter( $condition );
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$conditionClone.find( 'select.conditions-rule-major' ).val( '' );
|
||||
$conditionClone.find( 'select.conditions-rule-minor' ).html( '' ).attr( 'disabled' );
|
||||
$conditionClone
|
||||
.find( 'span.conditions-rule-has-children' )
|
||||
.hide()
|
||||
.find( 'input[type="checkbox"]' )
|
||||
.removeAttr( 'checked' );
|
||||
|
||||
resetRuleIndexes( $conditionClone.closest( '.conditions' ) );
|
||||
} );
|
||||
|
||||
widgets_shell.on( 'click.widgetconditions', 'a.display-options', function ( e ) {
|
||||
var $displayOptionsButton = $( this ),
|
||||
$widget = $displayOptionsButton.closest( 'div.widget' );
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$widget.find( 'div.widget-conditional' ).toggleClass( 'widget-conditional-hide' );
|
||||
$( this ).toggleClass( 'active' );
|
||||
$widget.toggleClass( 'expanded' );
|
||||
setWidgetMargin( $widget );
|
||||
|
||||
if ( $( this ).hasClass( 'active' ) ) {
|
||||
$widget.find( 'input[name=widget-conditions-visible]' ).val( '1' );
|
||||
$widget.find( '.condition' ).each( function () {
|
||||
buildMinorConditions( $( this ) );
|
||||
} );
|
||||
} else {
|
||||
$widget.find( 'input[name=widget-conditions-visible]' ).val( '0' );
|
||||
}
|
||||
} );
|
||||
|
||||
widgets_shell.on( 'click.widgetconditions', 'a.delete-condition', function ( e ) {
|
||||
var $condition = $( this ).closest( 'div.condition' );
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if ( $condition.is( ':first-child' ) && $condition.is( ':last-child' ) ) {
|
||||
$( this ).closest( 'div.widget' ).find( 'a.display-options' ).click();
|
||||
$condition.find( 'select.conditions-rule-major' ).val( '' ).change();
|
||||
} else {
|
||||
$condition.find( 'select.conditions-rule-major' ).change();
|
||||
$condition.detach();
|
||||
}
|
||||
|
||||
resetRuleIndexes( $condition.closest( '.conditions' ) );
|
||||
} );
|
||||
|
||||
widgets_shell.on( 'click.widgetconditions', 'div.widget-top', function () {
|
||||
var $widget = $( this ).closest( 'div.widget' ),
|
||||
$displayOptionsButton = $widget.find( 'a.display-options' );
|
||||
|
||||
if ( $displayOptionsButton.hasClass( 'active' ) ) {
|
||||
$displayOptionsButton.attr( 'opened', 'true' );
|
||||
}
|
||||
|
||||
if ( $displayOptionsButton.attr( 'opened' ) ) {
|
||||
$displayOptionsButton.removeAttr( 'opened' );
|
||||
$widget.toggleClass( 'expanded' );
|
||||
setWidgetMargin( $widget );
|
||||
}
|
||||
} );
|
||||
|
||||
widgets_shell.on( 'change.widgetconditions', 'input.conditions-match-all', function () {
|
||||
$( this )
|
||||
.parents( '.widget-conditional' )
|
||||
.toggleClass( 'conjunction' )
|
||||
.toggleClass( 'intersection' );
|
||||
} );
|
||||
|
||||
$( document ).on( 'change.widgetconditions', 'select.conditions-rule-major', function () {
|
||||
var $conditionsRuleMajor = $( this ),
|
||||
$conditionsRuleMinor = $conditionsRuleMajor.siblings( 'select.conditions-rule-minor:first' ),
|
||||
$conditionsRuleHasChildren = $conditionsRuleMajor.siblings(
|
||||
'span.conditions-rule-has-children'
|
||||
),
|
||||
$condition = $conditionsRuleMinor.closest( '.condition' );
|
||||
|
||||
$condition.data( 'rule-minor', '' ).data( 'rule-major', $conditionsRuleMajor.val() );
|
||||
|
||||
if ( $conditionsRuleMajor.val() ) {
|
||||
buildMinorConditions( $condition );
|
||||
} else {
|
||||
$conditionsRuleMajor
|
||||
.siblings( 'select.conditions-rule-minor' )
|
||||
.attr( 'disabled', 'disabled' )
|
||||
.html( '' );
|
||||
$conditionsRuleHasChildren.hide().find( 'input[type="checkbox"]' ).removeAttr( 'checked' );
|
||||
}
|
||||
} );
|
||||
|
||||
$( document ).on( 'change.widgetconditions', 'select.conditions-rule-minor', function () {
|
||||
var $conditionsRuleMinor = $( this ),
|
||||
$conditionsRuleMajor = $conditionsRuleMinor.siblings( 'select.conditions-rule-major' ),
|
||||
$conditionsRuleHasChildren = $conditionsRuleMinor.siblings(
|
||||
'span.conditions-rule-has-children'
|
||||
),
|
||||
$condition = $conditionsRuleMinor.closest( '.condition' );
|
||||
|
||||
$condition.data( 'rule-minor', $conditionsRuleMinor.val() );
|
||||
|
||||
if ( $conditionsRuleMajor.val() === 'page' ) {
|
||||
if ( $conditionsRuleMinor.val() in widget_conditions_parent_pages ) {
|
||||
$conditionsRuleHasChildren.show();
|
||||
} else {
|
||||
$conditionsRuleHasChildren.hide().find( 'input[type="checkbox"]' ).removeAttr( 'checked' );
|
||||
}
|
||||
} else {
|
||||
$conditionsRuleHasChildren.hide().find( 'input[type="checkbox"]' ).removeAttr( 'checked' );
|
||||
}
|
||||
} );
|
||||
|
||||
$( document ).on( 'widget-updated widget-synced', function ( e, widget ) {
|
||||
widget.find( '.condition' ).each( function () {
|
||||
buildMinorConditions( $( this ) );
|
||||
} );
|
||||
} );
|
||||
|
||||
function buildMinorConditions( condition ) {
|
||||
var minor,
|
||||
hasChildren,
|
||||
majorData,
|
||||
i,
|
||||
j,
|
||||
key,
|
||||
val,
|
||||
_len,
|
||||
_jlen,
|
||||
subkey,
|
||||
subval,
|
||||
optgroup,
|
||||
select = condition.find( '.conditions-rule-minor' ).html( '' ),
|
||||
major = condition.data( 'rule-major' );
|
||||
|
||||
// Disable the select, if major rule is empty or if it's a `post_type`.
|
||||
// "Post Type" rule has been removed in Jetpack 4.7, and
|
||||
// because it breaks all other rules we should `return`.
|
||||
if ( ! major || 'post_type' === major ) {
|
||||
select.attr( 'disabled', 'disabled' );
|
||||
return;
|
||||
}
|
||||
|
||||
minor = condition.data( 'rule-minor' );
|
||||
hasChildren = condition.data( 'rule-has-children' );
|
||||
majorData = widget_conditions_data[ major ];
|
||||
|
||||
for ( i = 0, _len = majorData.length; i < _len; i++ ) {
|
||||
key = majorData[ i ][ 0 ];
|
||||
val = majorData[ i ][ 1 ];
|
||||
|
||||
if ( typeof val === 'object' ) {
|
||||
optgroup = $( '<optgroup/>' ).attr( 'label', key );
|
||||
|
||||
for ( j = 0, _jlen = val.length; j < _jlen; j++ ) {
|
||||
subkey = majorData[ i ][ 1 ][ j ][ 0 ];
|
||||
subval = majorData[ i ][ 1 ][ j ][ 1 ];
|
||||
|
||||
optgroup.append(
|
||||
$( '<option/>' )
|
||||
.val( subkey )
|
||||
.text( decodeEntities( subval.replace( / /g, '\xA0' ) ) )
|
||||
);
|
||||
}
|
||||
|
||||
select.append( optgroup );
|
||||
} else {
|
||||
select.append(
|
||||
$( '<option/>' )
|
||||
.val( key )
|
||||
.text( decodeEntities( val.replace( / /g, '\xA0' ) ) )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
select.removeAttr( 'disabled' );
|
||||
select.val( minor );
|
||||
|
||||
if ( 'page' === major && minor in widget_conditions_parent_pages ) {
|
||||
select.siblings( 'span.conditions-rule-has-children' ).show();
|
||||
|
||||
if ( hasChildren ) {
|
||||
select
|
||||
.siblings( 'span.conditions-rule-has-children' )
|
||||
.find( 'input[type="checkbox"]' )
|
||||
.attr( 'checked', 'checked' );
|
||||
}
|
||||
} else {
|
||||
select
|
||||
.siblings( 'span.conditions-rule-has-children' )
|
||||
.hide()
|
||||
.find( 'input[type="checkbox"]' )
|
||||
.removeAttr( 'checked' );
|
||||
}
|
||||
}
|
||||
|
||||
function resetRuleIndexes( widget ) {
|
||||
var index = 0;
|
||||
widget
|
||||
.find( 'span.conditions-rule-has-children' )
|
||||
.find( 'input[type="checkbox"]' )
|
||||
.each( function () {
|
||||
$( this ).attr( 'name', 'conditions[page_children][' + index + ']' );
|
||||
index++;
|
||||
} );
|
||||
}
|
||||
|
||||
function decodeEntities( encodedString ) {
|
||||
var textarea = document.createElement( 'textarea' );
|
||||
textarea.innerHTML = encodedString;
|
||||
return textarea.value;
|
||||
}
|
||||
} );
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
.wp-customizer .expanded .widget-conditional .widget-conditional-inner{box-sizing:border-box;width:98%}.wp-customizer .expanded .widget-conditional .form{margin-bottom:20px;overflow:scroll}.widget-liquid-right .widget.expanded{overflow:visible}.widget-conditional-hide{display:none}.widget-conditional .widget-conditional-inner{background:#f6f7f7;border:1px solid #dcdcde;padding:12px 10px 0}.widget-conditional{margin-bottom:12px;margin-top:10px}.widget-conditional .conditions{margin-bottom:12px}.widget-conditional .condition,.widget-conditional .condition-top{clear:both}.widget-conditional .condition{padding-top:12px;position:relative}.widget-conditional .condition select{position:relative;width:120px;z-index:2}.widget-conditional .condition-top select{width:auto}.widget-conditional .condition-control{clear:both;margin-top:-20px;padding-top:4px}.widget-conditional .selection{margin-left:20px;margin-right:50px}.widget-conditional .conditions-rule-has-children{display:block}.widget-conditional .condition .actions{margin-top:-28px}.widget-conditional .condition-control a{position:absolute;text-decoration:none;text-indent:-9999px;top:17px;z-index:1}.wp-block-legacy-widget__edit-form .widget-conditional .condition-control a{top:20px}.widget-conditional .condition-control a:before{left:0;position:absolute;text-indent:0;top:0}.widget-conditional .condition-control .delete-condition,.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .condition-control .delete-condition{color:#f11;left:0}.widget-conditional .condition-control .add-condition{right:0}.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .widget-conditional-inner a.dashicons{font-family:dashicons}.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional-inner select{background-color:#fff;display:initial;width:auto}.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .widget-conditional-inner select:disabled{background-color:#f6f7f7;border-color:#dcdcde;color:#a7aaad}.editor-styles-wrapper .wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional .alignleft{margin-left:20px}.widget-conditional .condition:last-child .condition-conjunction,.widget-conditional .condition:last-child .condition-intersection,.widget-conditional.conjunction .condition-intersection,.widget-conditional.intersection .condition-conjunction{display:none}.wp-core-ui .button.display-options{margin-right:5px}.wp-core-ui .button.display-options:hover{text-decoration:none}.wp-customizer .widget-conditional select{height:auto;max-width:none;min-width:0}.wp-customizer .widget-conditional .condition-control a{top:15px}@media screen and (max-width:782px){.widget-conditional .condition-control a{top:20px}}.wp-block-legacy-widget__edit-form .widget-inside.widget-inside .widget-conditional-inner{font-size:13px}.widget-vis__rule,.widget-vis__rule .components-base-control,.widget-vis__wrapper .components-base-control{margin-bottom:12px}.widget-vis__rule{border:1px solid #dcdcde;display:flex;flex-direction:column;padding:12px}.widget-vis__rule-major,.widget-vis__rule-minor{align-items:center;display:flex;justify-content:stretch}.widget-vis__if,.widget-vis__is{margin-right:8px;width:10px}.widget-vis__show-hide{margin-bottom:0}.components-button.widget-vis__add-new-rule{display:block}.widget-vis__delete-rule{margin-top:6px;text-align:right}.widget-vis__match-all{margin-top:12px}.widget-vis__select{width:100%}.widget-vis__select .components-input-control__container{position:relative;top:4px}.widget-vis__select-multi-level select option:disabled{font-size:18px;font-weight:600}
|
||||
Reference in New Issue
Block a user