Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Merge 'feature/resolve-conflict' into 'feature/preview-future-site-st…
Browse files Browse the repository at this point in the history
…ate'
  • Loading branch information
PatelUtkarsh committed Dec 8, 2016
2 parents 90277a6 + 589c714 commit 2011a9a
Show file tree
Hide file tree
Showing 32 changed files with 6,174 additions and 3,508 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ node_js:
- stable

env:
- WP_VERSION=trunk WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=4.6.1 WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=1

install:
Expand Down
119 changes: 118 additions & 1 deletion css/customize-snapshots.css
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,121 @@
#customize-snapshot .snapshot-controls{
list-style: none;
margin: 0;
}
}

.snapshot-future-date-notification.notice{
margin-bottom: 5px;
border-top: 1px solid #eee;
padding: 5px;
}

/*Status Button*/
/** @todo Need to add snapshot specific class for all ui classes. **/

#snapshot-status-button-wrapper{
float: right;
position: relative;
margin-top: 9px;
height:28px;
}

#snapshot-status-button-wrapper .button-primary{
margin-top:0;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
}

.ui-selectmenu-menu {
padding: 0;
margin: 0;
position: absolute;
top: 0;
left: 0;
display: none;
}
.ui-selectmenu-menu .ui-menu {
overflow: auto;
/* Support: IE7 */
overflow-x: hidden;
background: #FFFFFF;
border-top: 0;
margin: 0;
border-radius: 0 0 5px 5px;
box-shadow: 0 1px 4px 0 rgba( 33,38,34,.12 ), 0 2px 11px 0 rgba( 30,36,37,.14 )
}

.ui-selectmenu-menu .ui-menu li{
padding: 5px 10px 5px 5px;
margin: 0;
}

.ui-selectmenu-menu .ui-menu .ui-state-focus{
background: #0073aa;
color: #FFFFFF;
cursor: pointer;
}

.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
font-size: 1em;
font-weight: bold;
line-height: 1.5;
padding: 2px 0.4em;
margin: 0.5em 0 0 0;
height: auto;
border: 0;
}
.ui-selectmenu-open {
display: block;
}

.ui-selectmenu-button span.ui-icon {
text-indent: 0;
float: right;
border-radius: 0 3px 3px 0;
padding-left:0;
padding-right:0;
}

.ui-selectmenu-button span.ui-icon:before{
display: inline-block;
font-size: 20px;
margin-left: -10px;
}

.ui-selectmenu-button span.ui-selectmenu-text {
border-radius: 3px 0 0 3px;
opacity:0;
}

.ui-selectmenu-menu.ui-front{
z-index: 999999;
}

.snapshot-status-button-overlay.button{
width: calc( 100% - 20px );
height: 28px;
position: absolute;
top: 0;
left: 0;
z-index: 1;
border-radius: 3px 0 0 3px;
box-shadow: none;
}

#customize-header-actions .ui-selectmenu-button{
padding-right: 0;
position: relative;
display: inline-block;
height: 28px;
overflow: hidden;
outline-width: 2px;
outline-offset: -2px;
}

.animated {
animation-duration: 0.5s;
animation-fill-mode: both;
}
21 changes: 20 additions & 1 deletion instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ function get_plugin_instance() {
* @return bool Whether previewing settings.
*/
function is_previewing_settings() {
return get_plugin_instance()->customize_snapshot_manager->is_previewing_settings();
$manager = get_plugin_instance()->customize_snapshot_manager;
if ( get_plugin_instance()->compat ) {
return $manager->is_previewing_settings();
} else {
return isset( $manager->customize_manager ) && $manager->customize_manager->is_preview();
}
}

/**
Expand All @@ -51,3 +56,17 @@ function current_snapshot_uuid() {
return $customize_snapshot_uuid;
}
}

/**
* Returns whether it is back compat or not.
*
* @return bool is compat.
*/
function is_back_compat() {
// Fix in case version contains 'src' for example 4.7-src in that case php version compare fails to compare correctly.
$wp_version = get_bloginfo( 'version' );
if ( $pos = strpos( $wp_version, 'src' ) ) {
$wp_version = substr( $wp_version, 0, $pos - 1 );
}
return version_compare( $wp_version, '4.7', '<' );
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var CustomizeSnapshotsPreview = (function( api, $ ) {
var customized = {};
api.each( function( setting ) {
if ( setting._dirty || -1 !== _.indexOf( component.data.initial_dirty_settings, setting.id ) ) {
customized[ setting.id ] = setting.get();
customized[setting.id] = setting.get();
}
} );
return {
Expand Down Expand Up @@ -194,7 +194,7 @@ var CustomizeSnapshotsPreview = (function( api, $ ) {

// Now preventDefault as is done on the normal submit.preview handler in customize-preview.js.
event.preventDefault();
});
} );
};

return component;
Expand Down

0 comments on commit 2011a9a

Please sign in to comment.