From 4652ab2698d46193db346de4cc9b666d909158b8 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 23 Aug 2016 09:14:38 -0700 Subject: [PATCH 1/6] Add missing changelog header --- readme.md | 2 ++ readme.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/readme.md b/readme.md index d7507964..4ea6fe21 100644 --- a/readme.md +++ b/readme.md @@ -87,6 +87,7 @@ if ( ! $bypass_object_cache ) { ## Changelog ## +### 0.5.1 - 2016-08-23 ### * Added: Pass `Customize_Snapshot` instance as second param to `customize_snapshot_save` filter. See [#77](https://github.com/xwp/wp-customize-snapshots/pull/77). * Fixed: Restrict user from publishing or scheduling a snapshot unless they can `customize_publish`. See [#74](https://github.com/xwp/wp-customize-snapshots/pull/74). * Fixed: Fix logic for when to show the snapshot publish error admin notice and show underlying error codes when there are validity errors. See [#79](https://github.com/xwp/wp-customize-snapshots/pull/79). @@ -96,6 +97,7 @@ See full commit log: [`0.5.0...0.5.1`](https://github.com/xwp/wp-customize-posts Issues in milestone: [`milestone:0.5.1`](https://github.com/xwp/wp-customize-snapshots/issues?q=milestone%3A0.5.1) Props: Utkarsh Patel (@PatelUtkarsh), Luke Gedeon (@lgedeon), Weston Ruter (@westonruter) + ### 0.5.0 - 2016-08-11 ### Added: diff --git a/readme.txt b/readme.txt index 254f354d..e6dd3049 100644 --- a/readme.txt +++ b/readme.txt @@ -64,6 +64,8 @@ if ( ! $bypass_object_cache ) { == Changelog == += 0.5.1 - 2016-08-23 = + * Added: Pass `Customize_Snapshot` instance as second param to `customize_snapshot_save` filter. See [#77](https://github.com/xwp/wp-customize-snapshots/pull/77). * Fixed: Restrict user from publishing or scheduling a snapshot unless they can `customize_publish`. See [#74](https://github.com/xwp/wp-customize-snapshots/pull/74). * Fixed: Fix logic for when to show the snapshot publish error admin notice and show underlying error codes when there are validity errors. See [#79](https://github.com/xwp/wp-customize-snapshots/pull/79). From 892fd4b09107c3c44ff605213f4ece9009ca17b8 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 23 Aug 2016 09:18:28 -0700 Subject: [PATCH 2/6] Fix links to commit logs --- readme.md | 4 ++-- readme.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 4ea6fe21..3cbb6f61 100644 --- a/readme.md +++ b/readme.md @@ -92,7 +92,7 @@ if ( ! $bypass_object_cache ) { * Fixed: Restrict user from publishing or scheduling a snapshot unless they can `customize_publish`. See [#74](https://github.com/xwp/wp-customize-snapshots/pull/74). * Fixed: Fix logic for when to show the snapshot publish error admin notice and show underlying error codes when there are validity errors. See [#79](https://github.com/xwp/wp-customize-snapshots/pull/79). -See full commit log: [`0.5.0...0.5.1`](https://github.com/xwp/wp-customize-posts/compare/0.5.0...0.5.1) +See full commit log: [`0.5.0...0.5.1`](https://github.com/xwp/wp-customize-snapshots/compare/0.5.0...0.5.1) Issues in milestone: [`milestone:0.5.1`](https://github.com/xwp/wp-customize-snapshots/issues?q=milestone%3A0.5.1) @@ -127,7 +127,7 @@ Removed: * The scope parameter has been removed, as has storing non-dirty settings in a snapshot. (#59) -See full commit log: [`0.4.0...0.5.0`](https://github.com/xwp/wp-customize-posts/compare/0.4.0...0.5.0) +See full commit log: [`0.4.0...0.5.0`](https://github.com/xwp/wp-customize-snapshots/compare/0.4.0...0.5.0) Issues in milestone: [`milestone:0.5.0`](https://github.com/xwp/wp-customize-snapshots/issues?q=milestone%3A0.5.0) diff --git a/readme.txt b/readme.txt index e6dd3049..ffabe589 100644 --- a/readme.txt +++ b/readme.txt @@ -70,7 +70,7 @@ if ( ! $bypass_object_cache ) { * Fixed: Restrict user from publishing or scheduling a snapshot unless they can `customize_publish`. See [#74](https://github.com/xwp/wp-customize-snapshots/pull/74). * Fixed: Fix logic for when to show the snapshot publish error admin notice and show underlying error codes when there are validity errors. See [#79](https://github.com/xwp/wp-customize-snapshots/pull/79). -See full commit log: [`0.5.0...0.5.1`](https://github.com/xwp/wp-customize-posts/compare/0.5.0...0.5.1) +See full commit log: [`0.5.0...0.5.1`](https://github.com/xwp/wp-customize-snapshots/compare/0.5.0...0.5.1) Issues in milestone: [`milestone:0.5.1`](https://github.com/xwp/wp-customize-snapshots/issues?q=milestone%3A0.5.1) @@ -106,7 +106,7 @@ Removed: * The scope parameter has been removed, as has storing non-dirty settings in a snapshot. (#59) -See full commit log: [`0.4.0...0.5.0`](https://github.com/xwp/wp-customize-posts/compare/0.4.0...0.5.0) +See full commit log: [`0.4.0...0.5.0`](https://github.com/xwp/wp-customize-snapshots/compare/0.4.0...0.5.0) Issues in milestone: [`milestone:0.5.0`](https://github.com/xwp/wp-customize-snapshots/issues?q=milestone%3A0.5.0) From 32a38788e9428cf3df485c803a13805c918ab018 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 23 Aug 2016 15:04:30 -0700 Subject: [PATCH 3/6] Prevent enqueueing frontend JS in the customizer prevew This was erroneously causing the customize_snapshot_uuid param to get injected into links in the preview. --- php/class-customize-snapshot-manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-customize-snapshot-manager.php b/php/class-customize-snapshot-manager.php index 62596e52..9d151242 100644 --- a/php/class-customize-snapshot-manager.php +++ b/php/class-customize-snapshot-manager.php @@ -725,7 +725,7 @@ public function enqueue_preview_scripts() { * Enqueue Customizer frontend scripts. */ public function enqueue_frontend_scripts() { - if ( ! $this->snapshot ) { + if ( ! $this->snapshot || is_customize_preview() ) { return; } $handle = 'customize-snapshots-frontend'; From 62c065cab0301860190667d57000712d15406a36 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 23 Aug 2016 22:23:14 -0700 Subject: [PATCH 4/6] Ensure update button gets set to Save if there is not snapshot-exists Also use text() instead of html() --- js/customize-snapshots.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/customize-snapshots.js b/js/customize-snapshots.js index 4dda53b2..b40abdeb 100644 --- a/js/customize-snapshots.js +++ b/js/customize-snapshots.js @@ -765,9 +765,11 @@ // Change update button to schedule. if ( component.isFutureDate() ) { - save.html( component.data.i18n.scheduleButton ); + save.text( component.data.i18n.scheduleButton ); + } else if ( api.state( 'snapshot-exists' ).get() ) { + save.text( component.data.i18n.updateButton ); } else { - save.html( component.data.i18n.updateButton ); + save.text( component.data.i18n.saveButton ); } if ( scheduled || component.data.dirty ) { From 3e2690699c3afb3fb77ab7b4450c40fc93567dda Mon Sep 17 00:00:00 2001 From: Utkarsh Patel Date: Wed, 24 Aug 2016 11:48:24 +0530 Subject: [PATCH 5/6] Disable save button after publish --- js/customize-snapshots.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/customize-snapshots.js b/js/customize-snapshots.js index b40abdeb..c60a4d30 100644 --- a/js/customize-snapshots.js +++ b/js/customize-snapshots.js @@ -407,10 +407,10 @@ api.state( 'saved' ).bind( function( saved ) { if ( saved && ! _.isEmpty( component.schedule.container ) ) { + component.data.dirty = false; component.data.publishDate = component.getCurrentTime(); - component.updateSchedule(); component.scheduleContainerDisplayed.set( false ); - component.data.dirty = false; + component.updateSchedule(); } } ); From 6f38e4c054154de66612288a19c8da1d1b82258b Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sat, 27 Aug 2016 17:03:12 -0700 Subject: [PATCH 6/6] Bump version to 0.5.2 --- composer.json | 2 +- customize-snapshots.php | 2 +- readme.md | 12 +++++++++++- readme.txt | 13 ++++++++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 67510a21..a0390de4 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "xwp/wp-customize-snapshots", "description": "Allow Customizer states to be drafted, and previewed with a private URL.", - "version": "0.5.1", + "version": "0.5.2", "type": "wordpress-plugin", "homepage": "https://github.com/xwp/wp-customize-snapshots", "license": "GPL-2.0+", diff --git a/customize-snapshots.php b/customize-snapshots.php index 65c2bed3..bf0946fd 100644 --- a/customize-snapshots.php +++ b/customize-snapshots.php @@ -3,7 +3,7 @@ * Plugin Name: Customize Snapshots * Plugin URI: https://github.com/xwp/wp-customize-snapshots * Description: Allow Customizer states to be drafted, and previewed with a private URL. - * Version: 0.5.1 + * Version: 0.5.2 * Author: XWP * Author URI: https://xwp.co/ * License: GPLv2+ diff --git a/readme.md b/readme.md index 3cbb6f61..81f05728 100644 --- a/readme.md +++ b/readme.md @@ -8,7 +8,7 @@ Allow Customizer states to be drafted, and previewed with a private URL. **Tags:** [customizer](https://wordpress.org/plugins/tags/customizer), [customize](https://wordpress.org/plugins/tags/customize), [snapshots](https://wordpress.org/plugins/tags/snapshots) **Requires at least:** 4.5.3 **Tested up to:** 4.6 -**Stable tag:** 0.5.1 +**Stable tag:** 0.5.2 **License:** [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html) [![Build Status](https://travis-ci.org/xwp/wp-customize-snapshots.svg?branch=master)](https://travis-ci.org/xwp/wp-customize-snapshots) [![Coverage Status](https://coveralls.io/repos/xwp/wp-customize-snapshots/badge.svg?branch=master)](https://coveralls.io/github/xwp/wp-customize-snapshots) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com) [![devDependency Status](https://david-dm.org/xwp/wp-customize-snapshots/dev-status.svg)](https://david-dm.org/xwp/wp-customize-snapshots#info=devDependencies) @@ -87,6 +87,16 @@ if ( ! $bypass_object_cache ) { ## Changelog ## +### 0.5.2 - 2016-08-17 ### +* Fixed: Prevent enqueueing frontend JS in the customizer preview. This was erroneously causing the customize_snapshot_uuid param to get injected into links in the preview. See [#80](https://github.com/xwp/wp-customize-snapshots/pull/80). +* Fixed: Ensure that Update button gets disabled and reset to Save once changes have been published. See [#83](https://github.com/xwp/wp-customize-snapshots/pull/83). + +See full commit log: [`0.5.1...0.5.2`](https://github.com/xwp/wp-customize-snapshots/compare/0.5.0...0.5.1) + +Issues in milestone: [`milestone:0.5.2`](https://github.com/xwp/wp-customize-snapshots/issues?q=milestone%3A0.5.2) + +Props: Weston Ruter (@westonruter), Utkarsh Patel (@PatelUtkarsh) + ### 0.5.1 - 2016-08-23 ### * Added: Pass `Customize_Snapshot` instance as second param to `customize_snapshot_save` filter. See [#77](https://github.com/xwp/wp-customize-snapshots/pull/77). * Fixed: Restrict user from publishing or scheduling a snapshot unless they can `customize_publish`. See [#74](https://github.com/xwp/wp-customize-snapshots/pull/74). diff --git a/readme.txt b/readme.txt index ffabe589..b842ff7a 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: westonruter, valendesigns, xwp, newscorpau Requires at least: 4.5.3 Tested up to: 4.6 -Stable tag: 0.5.1 +Stable tag: 0.5.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: customizer, customize, snapshots @@ -64,6 +64,17 @@ if ( ! $bypass_object_cache ) { == Changelog == += 0.5.2 - 2016-08-17 = + +* Fixed: Prevent enqueueing frontend JS in the customizer preview. This was erroneously causing the customize_snapshot_uuid param to get injected into links in the preview. See [#80](https://github.com/xwp/wp-customize-snapshots/pull/80). +* Fixed: Ensure that Update button gets disabled and reset to Save once changes have been published. See [#83](https://github.com/xwp/wp-customize-snapshots/pull/83). + +See full commit log: [`0.5.1...0.5.2`](https://github.com/xwp/wp-customize-snapshots/compare/0.5.0...0.5.1) + +Issues in milestone: [`milestone:0.5.2`](https://github.com/xwp/wp-customize-snapshots/issues?q=milestone%3A0.5.2) + +Props: Weston Ruter (@westonruter), Utkarsh Patel (@PatelUtkarsh) + = 0.5.1 - 2016-08-23 = * Added: Pass `Customize_Snapshot` instance as second param to `customize_snapshot_save` filter. See [#77](https://github.com/xwp/wp-customize-snapshots/pull/77).