2014-12-16 20:43:22 +01:00
|
|
|
window.wp = window.wp || {};
|
2015-09-25 23:01:46 +02:00
|
|
|
window.wp.customize = window.wp.customize || { get: function() {} };
|
2014-12-16 20:43:22 +01:00
|
|
|
|
|
|
|
var customizerRootElement;
|
|
|
|
customizerRootElement = jQuery( '<div id="customize-theme-controls"><ul></ul></div>' );
|
2015-09-25 23:01:46 +02:00
|
|
|
customizerRootElement.css( { position: 'absolute', left: -10000, top: -10000 } ); // Remove from view.
|
2014-12-16 20:43:22 +01:00
|
|
|
jQuery( document.body ).append( customizerRootElement );
|
|
|
|
|
|
|
|
window._wpCustomizeSettings = {
|
|
|
|
'autofocus': {},
|
|
|
|
'browser': {
|
|
|
|
'ios': false,
|
|
|
|
'mobile': false
|
|
|
|
},
|
|
|
|
'controls': {
|
|
|
|
'fixture-control': {
|
|
|
|
'active': true,
|
2015-05-30 02:02:13 +02:00
|
|
|
'content': '<li id="accordion-section-fixture-section" class="accordion-section control-section control-section-default"> <h3 class="accordion-section-title" tabindex="0"> Section Fixture <span class="screen-reader-text">Press return or enter to open</span> </h3> <ul class="accordion-section-content"> <li class="customize-section-description-container"> <div class="customize-section-title"> <button class="customize-section-back" tabindex="-1"> <span class="screen-reader-text">Back</span> </button> <h3> <span class="customize-action">Customizing ▸ Fixture Panel</span> Section Fixture </h3> </div> </li> </ul> </li>',
|
2014-12-16 20:43:22 +01:00
|
|
|
'description': '',
|
|
|
|
'instanceNumber': 8,
|
|
|
|
'label': 'Fixture Control',
|
|
|
|
'priority': 10,
|
|
|
|
'section': 'fixture-section',
|
|
|
|
'settings': {
|
|
|
|
'default': 'fixture-setting'
|
|
|
|
},
|
|
|
|
'type': 'text'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'documentTitleTmpl': 'Customize: %s',
|
|
|
|
'nonce': {
|
|
|
|
'preview': '',
|
|
|
|
'save': ''
|
|
|
|
},
|
|
|
|
'panels': {
|
|
|
|
'fixture-panel': {
|
|
|
|
'active': true,
|
2015-05-30 02:02:13 +02:00
|
|
|
'content': '<li id="accordion-panel-fixture-panel" class="accordion-section control-section control-panel control-panel-default"> <h3 class="accordion-section-title" tabindex="0"> Fixture Panel <span class="screen-reader-text">Press return or enter to open this panel</span> </h3> <ul class="accordion-sub-container control-panel-content"> <li class="panel-meta customize-info accordion-section cannot-expand"> <button class="customize-panel-back" tabindex="-1"><span class="screen-reader-text">Back</span></button> <div class="accordion-section-title"> <span class="preview-notice">You are customizing <strong class="panel-title">Fixture Panel</strong></span> <button class="customize-help-toggle dashicons dashicons-editor-help" tabindex="0" aria-expanded="false"><span class="screen-reader-text">Help</span></button> </div> </li> </ul> </li>',
|
2014-12-16 20:43:22 +01:00
|
|
|
'description': 'Lorem ipsum',
|
|
|
|
'instanceNumber': 1,
|
|
|
|
'priority': 110,
|
2015-05-30 02:02:13 +02:00
|
|
|
'title': 'Fixture panel with content',
|
2014-12-16 20:43:22 +01:00
|
|
|
'type': 'default'
|
2015-05-30 02:02:13 +02:00
|
|
|
},
|
|
|
|
'fixture-panel-default-templated': {
|
|
|
|
'active': true,
|
|
|
|
'description': 'Lorem ipsum',
|
|
|
|
'instanceNumber': 2,
|
|
|
|
'priority': 110,
|
|
|
|
'title': 'Fixture default panel using template',
|
|
|
|
'type': 'default'
|
|
|
|
},
|
|
|
|
'fixture-panel-titleless-templated': {
|
|
|
|
'active': true,
|
|
|
|
'description': 'Lorem ipsum',
|
|
|
|
'instanceNumber': 3,
|
|
|
|
'priority': 110,
|
|
|
|
'title': 'Fixture titleless panel using template',
|
|
|
|
'type': 'titleless'
|
2015-06-02 00:46:56 +02:00
|
|
|
},
|
|
|
|
'fixture-panel-reusing-default-template': {
|
|
|
|
'active': true,
|
|
|
|
'description': 'Lorem ipsum',
|
|
|
|
'instanceNumber': 3,
|
|
|
|
'priority': 110,
|
|
|
|
'title': 'Fixture panel of custom type re-using default template',
|
|
|
|
'type': 'reusing-default-template'
|
|
|
|
},
|
|
|
|
'fixture-panel-without-params': {}
|
2014-12-16 20:43:22 +01:00
|
|
|
},
|
|
|
|
'sections': {
|
|
|
|
'fixture-section': {
|
|
|
|
'active': true,
|
2015-05-30 02:02:13 +02:00
|
|
|
'content': '<li id="accordion-section-fixture-section" class="accordion-section control-section control-section-default"> <h3 class="accordion-section-title" tabindex="0"> Section Fixture <span class="screen-reader-text">Press return or enter to open</span> </h3> <ul class="accordion-section-content"> <li class="customize-section-description-container"> <div class="customize-section-title"> <button class="customize-section-back" tabindex="-1"> <span class="screen-reader-text">Back</span> </button> <h3> <span class="customize-action">Customizing ▸ Fixture Panel</span> Section Fixture </h3> </div> </li> </ul> </li>',
|
2014-12-16 20:43:22 +01:00
|
|
|
'description': '',
|
|
|
|
'instanceNumber': 2,
|
|
|
|
'panel': 'fixture-panel',
|
|
|
|
'priority': 20,
|
|
|
|
'title': 'Fixture Section',
|
|
|
|
'type': 'default'
|
2015-05-30 02:02:13 +02:00
|
|
|
},
|
|
|
|
'fixture-section-default-templated': {
|
|
|
|
'active': true,
|
|
|
|
'description': '',
|
|
|
|
'instanceNumber': 3,
|
|
|
|
'panel': 'fixture-panel',
|
|
|
|
'priority': 20,
|
|
|
|
'title': 'Fixture default section using template',
|
|
|
|
'type': 'default'
|
|
|
|
},
|
|
|
|
'fixture-section-titleless-templated': {
|
|
|
|
'active': true,
|
|
|
|
'description': '',
|
|
|
|
'instanceNumber': 4,
|
|
|
|
'panel': 'fixture-panel',
|
|
|
|
'priority': 20,
|
|
|
|
'title': 'Fixture titleless section using template',
|
|
|
|
'type': 'titleless'
|
2015-06-02 00:46:56 +02:00
|
|
|
},
|
|
|
|
'fixture-section-reusing-default-template': {
|
|
|
|
'active': true,
|
|
|
|
'description': '',
|
|
|
|
'instanceNumber': 4,
|
|
|
|
'panel': 'fixture-panel',
|
|
|
|
'priority': 20,
|
|
|
|
'title': 'Fixture section of custom type re-using default template',
|
|
|
|
'type': 'reusing-default-template'
|
|
|
|
},
|
Customize: Introduce drafting and scheduling for Customizer changesets.
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.
Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.
git-svn-id: https://develop.svn.wordpress.org/trunk@41626 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 00:24:37 +02:00
|
|
|
'publish_settings': {
|
|
|
|
'active': true,
|
|
|
|
'description': '',
|
|
|
|
'instanceNumber': 6,
|
|
|
|
'priority': 20,
|
|
|
|
'title': 'Fixture section of custom type re-using default template',
|
|
|
|
'type': 'outer'
|
|
|
|
},
|
2015-06-02 00:46:56 +02:00
|
|
|
'fixture-section-without-params': {}
|
2014-12-16 20:43:22 +01:00
|
|
|
},
|
|
|
|
'settings': {
|
|
|
|
'fixture-setting': {
|
|
|
|
'transport': 'postMessage',
|
|
|
|
'value': 'Lorem Ipsum'
|
Customize: Add setting validation model and control notifications to augment setting sanitization.
When a setting is invalid, not only will it be blocked from being saved but all other settings will be blocked as well. This ensures that Customizer saves aren't partial but are more transactional. User will be displayed the error in a notification so that they can fix and re-attempt saving.
PHP changes:
* Introduces `WP_Customize_Setting::validate()`, `WP_Customize_Setting::$validate_callback`, and the `customize_validate_{$setting_id}` filter.
* Introduces `WP_Customize_Manager::validate_setting_values()` to do validation (and sanitization) for the setting values supplied, returning a list of `WP_Error` instances for invalid settings.
* Attempting to save settings that are invalid will result in the save being blocked entirely, with the errors being sent in the `customize_save_response`. Modifies `WP_Customize_Manager::save()` to check all settings for validity issues prior to calling their `save` methods.
* Introduces `WP_Customize_Setting::json()` for parity with the other Customizer classes. This includes exporting of the `type`.
* Modifies `WP_Customize_Manager::post_value()` to apply `validate` after `sanitize`, and if validation fails, to return the `$default`.
* Introduces `customize_save_validation_before` action which fires right before the validation checks are made prior to saving.
JS changes:
* Introduces `wp.customize.Notification` in JS which to represent `WP_Error` instances returned from the server when setting validation fails.
* Introduces `wp.customize.Setting.prototype.notifications`.
* Introduces `wp.customize.Control.prototype.notifications`, which are synced with a control's settings' notifications.
* Introduces `wp.customize.Control.prototype.renderNotifications()` to re-render a control's notifications in its notification area. This is called automatically when the notifications collection changes.
* Introduces `wp.customize.settingConstructor`, allowing custom setting types to be used in the same way that custom controls, panels, and sections can be made.
* Injects a notification area into existing controls which is populated in response to the control's `notifications` collection changing. A custom control can customize the placement of the notification area by overriding the new `getNotificationsContainerElement` method.
* When a save fails due to setting invalidity, the invalidity errors will be added to the settings to then populate in the controls' notification areas, and the first such invalid control will be focused.
Props westonruter, celloexpressions, mrahmadawais.
See #35210.
See #30937.
Fixes #34893.
git-svn-id: https://develop.svn.wordpress.org/trunk@37476 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-20 23:09:40 +02:00
|
|
|
},
|
|
|
|
'fixture-setting-abbr': {
|
|
|
|
'transport': 'postMessage',
|
|
|
|
'value': 'NASA',
|
|
|
|
'type': 'abbreviation'
|
2014-12-16 20:43:22 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
'theme': {
|
|
|
|
'active': true,
|
|
|
|
'stylesheet': 'twentyfifteen'
|
|
|
|
},
|
|
|
|
'url': {
|
|
|
|
'activated': 'http://example.org/wp-admin/themes.php?activated=true&previewed',
|
|
|
|
'ajax': '/wp-admin/admin-ajax.php',
|
|
|
|
'allowed': [
|
|
|
|
'http://example.org/'
|
|
|
|
],
|
|
|
|
'fallback': 'http://example.org/?preview=1&template=twentyfifteen&stylesheet=twentyfifteen&preview_iframe=1&TB_iframe=true',
|
|
|
|
'home': 'http://example.org/',
|
|
|
|
'isCrossDomain': false,
|
|
|
|
'login': 'http://example.org/wp-login.php?interim-login=1&customize-login=1',
|
|
|
|
'parent': 'http://example.org/wp-admin/',
|
|
|
|
'preview': 'http://example.org/'
|
2016-02-16 02:56:13 +01:00
|
|
|
},
|
|
|
|
'previewableDevices': {
|
|
|
|
'desktop': {
|
|
|
|
'label': 'Enter desktop preview mode',
|
|
|
|
'default': true
|
|
|
|
},
|
|
|
|
'tablet': {
|
|
|
|
'label': 'Enter tablet preview mode'
|
|
|
|
},
|
|
|
|
'mobile': {
|
|
|
|
'label': 'Enter mobile preview mode'
|
|
|
|
}
|
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
git-svn-id: https://develop.svn.wordpress.org/trunk@38810 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-18 22:04:36 +02:00
|
|
|
},
|
Customize: Introduce drafting and scheduling for Customizer changesets.
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.
Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.
git-svn-id: https://develop.svn.wordpress.org/trunk@41626 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 00:24:37 +02:00
|
|
|
initialClientTimestamp: 1506510531595,
|
|
|
|
initialServerDate: '2017-09-27 16:38:49',
|
|
|
|
initialServerTimestamp: 1506510529913,
|
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
git-svn-id: https://develop.svn.wordpress.org/trunk@38810 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-18 22:04:36 +02:00
|
|
|
changeset: {
|
|
|
|
status: '',
|
Customize: Introduce drafting and scheduling for Customizer changesets.
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.
Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.
git-svn-id: https://develop.svn.wordpress.org/trunk@41626 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 00:24:37 +02:00
|
|
|
uuid: '0c674ff4-c159-4e7a-beb4-cb830ae73979',
|
|
|
|
autosaved: false,
|
|
|
|
branching: false,
|
|
|
|
currentUserCanPublish: false,
|
|
|
|
hasAutosaveRevision: false,
|
|
|
|
latestAutoDraftUuid: '341b06f6-3c1f-454f-96df-3cf197f3e347',
|
2017-10-12 06:00:15 +02:00
|
|
|
publishDate: '',
|
|
|
|
locked: false
|
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
git-svn-id: https://develop.svn.wordpress.org/trunk@38810 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-18 22:04:36 +02:00
|
|
|
},
|
|
|
|
timeouts: {
|
|
|
|
windowRefresh: 250,
|
|
|
|
changesetAutoSave: 60000,
|
|
|
|
keepAliveCheck: 2500,
|
|
|
|
reflowPaneContents: 100,
|
|
|
|
previewFrameSensitivity: 2000
|
2014-12-16 20:43:22 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
window._wpCustomizeControlsL10n = {};
|
2015-07-08 07:37:37 +02:00
|
|
|
|
|
|
|
jQuery.ajaxSetup( {
|
|
|
|
beforeSend: function( e, data ) {
|
2015-08-03 21:27:27 +02:00
|
|
|
if ( data.url.indexOf( '//example.org' ) !== -1 ) {
|
2015-07-08 07:37:37 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} );
|