Commit Graph

31 Commits

Author SHA1 Message Date
Ryan Boren 9c2fe1c948 Load the customize preview over ssl if the customize admin page is loaded over ssl and the frontend and admin are on the same domain. This avoids insecure content warnings and allows a more complete preview in browsers such as Chrome that block loading of css until user confirmation allows mixed content loading. see #20702
git-svn-id: https://develop.svn.wordpress.org/trunk@20829 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-18 20:09:53 +00:00
Daryl Koopersmith 621e3c1fc6 Theme Customizer: Properly escape customize settings when sending values to JS. Add WP_Customize_Setting->js_value(). fixes #20687, see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20809 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-16 20:59:02 +00:00
Daryl Koopersmith 5c77fcc30b Theme Customizer: Properly change state when theme is switched. fixes #20610, see #19910.
* Causes the Manage Themes page to refresh if the customizer is closed after the active theme is switched.
* Changes the text of the 'Save and Activate' button once the theme has been activated.
* Improves the naming of the customize control settings.
* Add events to customize.Loader and make callbacks more flexible.
* Makes the customize-loader l10n compatible with non-admin settings.
* Adds WP_Customize->is_current_theme_active().
* Minor style corrections, including jQuery.attr/prop changes.



git-svn-id: https://develop.svn.wordpress.org/trunk@20802 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-16 05:55:54 +00:00
Ryan Boren b5156f1b47 Don't force frontend scheme to match backend. This fails if the frontend doesn't have proper SSL certs. Access-Control-Allow-Origin handles this without the need to make the schemes match. see #20507
git-svn-id: https://develop.svn.wordpress.org/trunk@20793 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-15 15:45:40 +00:00
Daryl Koopersmith ecf6940ffb Theme Customizer: Prevent sidebar scrollbar from overlapping sidebar header or footer. fixes #20649, #20650, see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20791 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-15 01:03:31 +00:00
Daryl Koopersmith 7fde7c1904 Theme Customizer: Use a internal global _wpCustomizeSettings object for wp.customize.settings to prevent script race conditions in IE (which blocked interaction with the preview). see #20582, #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20737 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-07 20:03:39 +00:00
Daryl Koopersmith 3540b301af Theme Customizer: Migrate to an ajax-based solution for refreshing the preview and saving. see #20507, #19910.
* Use ajax-based saving, add saving indicator.
* Use ajax-based refreshing instead of form targets.
* Instead of using hidden inputs with prefixed names to track the canonical data, use the values stored in wp.customize. Encode the values as JSON before sending to avoid bugs with ids that contain square brackets (PHP mangles POST values with nested brackets).
* Use wp.customize.Previewer solely for the purpose of previewing; move the postMessage connection with the parent frame and other unrelated code snippets into the 'ready' handler.


git-svn-id: https://develop.svn.wordpress.org/trunk@20645 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-30 15:46:17 +00:00
Daryl Koopersmith dfd80ddc57 Theme Customizer: For clarity, wp.customize.Setting.method to wp.customize.Setting.transport. Add WP_Customize_Setting->transport to allow setting the transport method via PHP. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20585 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-25 16:04:51 +00:00
Andrew Nacin bfae415dd9 Move to admin.php?customize=on&theme=$stylesheet, rather than juggling both template and stylesheet values. see #19910.
Combine the setup_theme() and customize_previewing() methods. Remove the set_template() and set_stylesheet() methods. Add set_theme() method to WP_Customize to store the working WP_Theme object. We will use this for the stylesheet and template.

Use the WP_Theme display() method when preparing headers for display, not get() or the deprecate properties.



git-svn-id: https://develop.svn.wordpress.org/trunk@20496 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-17 21:43:47 +00:00
Daryl Koopersmith d6dc48bb27 Theme Customizer: Display 'Save and Activate' when switching themes. Add and properties to the WP_Customize class. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20495 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-17 20:49:39 +00:00
Daryl Koopersmith a43958baeb Theme Customizer: Allow the customize iframe to be accessed directly (with full feature support). see #19910.
* Move the 'Return to Manage Themes' and 'Collapse Sidebar' actions from themes.php to customize-controls.php.
* Create a postMessage connection between themes.php and customize-controls.php.
* Allow the theme customizer to be accessed directly (independent of themes.php and the customize loader).
* Add wp_customize_href() and wp_customize_url().
* Remove wp_customize_loader(). To include the loader, use wp_enqueue_script( 'customize-loader' ).
* The theme customizer now requires postMessage browser support.
* Add .hide-if-customize and .hide-if-no-customize CSS classes.
* Clean up customize-preview.js.

git-svn-id: https://develop.svn.wordpress.org/trunk@20476 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-16 14:02:28 +00:00
Daryl Koopersmith bfa86223dd Theme Customizer: Add a 'previewing' notice by the theme name. Reduce padding and size on section titles, add a border between section titles and content to better indicate the title as a click target. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20404 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-08 21:17:46 +00:00
Daryl Koopersmith dfe7dd824e Theme Customizer: Remove small screenshot from theme title bar. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20393 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-07 00:33:36 +00:00
Daryl Koopersmith bdee6c8e15 Theme Customizer: Move upload and image controls to subclasses. see #19910.
Instead of grouping together every control parameter into a single  array and passing them all to the JS, use subclasses with custom parameters to implement additional PHP functionality and the  parameter to send only the necessary variables to the JavaScript control.

Replaces WP_Customize_Control->control_params with WP_Customize_Control->json and WP_Customize_Control->to_json(). The to_json() method refreshes the json array passed to the JavaScript control (set to control.param by default).

Creates WP_Customize_Upload_Control and WP_Customize_Image_Control.

git-svn-id: https://develop.svn.wordpress.org/trunk@20319 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-29 06:35:54 +00:00
Daryl Koopersmith 2ca07cdf2a Create WP_Customize_Control to separate the process of rendering a control from fetching, previewing, and saving its values. see #19910.
Many-to-many mapping between settings and controls.
* Settings and controls have been separated in both the PHP (WP_Customize_Setting, WP_Customize_Control) and the JS (wp.customize.Setting, wp.customize.Control).
* While most settings are tied to a single control, some require multiple controls. The 'header_textcolor' control is a good example: to hide the header text, header_textcolor is set to 'blank'.

Add 'Display Header Text' control.

A handful of miscellaneous bugfixes along the way.

Notes:
* Controls should be separated out a bit more; juggling type-specific arguments in the switch statement is rather inelegant.
* Page dropdowns are currently inactive and need to be re-linked.

git-svn-id: https://develop.svn.wordpress.org/trunk@20295 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-28 04:14:09 +00:00
Daryl Koopersmith b0f973d884 Theme Customizer: Add WP_Customizer_Setting->control_params, and wp.customize.Control.params to allow settings to pass arbitrary parameters to controls. Add the 'context' parameter to wp.customize.UploadControl. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20276 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-24 01:02:29 +00:00
Daryl Koopersmith 844d95b6fb Theme Customizer: Use a more complex name for the save parameter to prevent the customizer from clashing with plugins. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20266 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-23 00:16:46 +00:00
Daryl Koopersmith 95ab797033 Theme Customizer: Add background repeat, position, and attachment settings. Change visibility parameter to accept a string or array( , ). see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20263 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-22 08:07:44 +00:00
Daryl Koopersmith 7dc476bd8b Theme Customizer: Add a WP_Customize_Setting->visibility parameter to show/hide a control based upon the value of another control. Also shifts rendering the setting wrapper element into WP_Customize_Setting->render() and adds WP_Customize_Setting->render_content(). see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20260 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-22 07:17:26 +00:00
Daryl Koopersmith ca4b8f3eac Theme Customizer: Numerous API refinements and bugfixes. Add a theme_supports check for header_textcolor. see #19910.
* prepare_controls() now removes any settings and sections that return false for check_capabilities().
* Added maybe_render() methods to both settings and sections that call the protected render() methods.
* Stop firing front-end preview functionality when rendering the controls.
* Merged the WP_Customize_Setting->_render_type() method into WP_Customize_Setting->render().
* Removed the 'customize_render_control-' hook; use 'customize_render_setting' instead.
* Added a  property to sections and settings so they no longer rely on the  global. Hooray for dependency injection.
* Shifted calls to WP_Customize_Setting->enqueue() to the 'customize_controls_enqueue_scripts' action.
* Added a theme_supports check for the header_textcolor setting.

git-svn-id: https://develop.svn.wordpress.org/trunk@20248 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-21 22:55:43 +00:00
Daryl Koopersmith f5b9beb8dd Theme Customizer: Move contents of customize.loader.css to wp-admin.css. Make markup/CSS for the full-screen overlay modular. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20133 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-07 03:19:35 +00:00
Daryl Koopersmith 21e5a2e69e Theme Customizer: Add a Control object to better encapsulate different UI elements and make it easy to switch between hard refreshes and postMessage. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20128 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-06 22:48:07 +00:00
Daryl Koopersmith 1747f1479e Theme Customizer: Improve markup and CSS for the return/collapse actions and the action bars within the customize controls form. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20110 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-04 04:57:24 +00:00
Daryl Koopersmith bba82422d0 Theme Customizer: Add mini screenshot and description to theme info section. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20108 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-04 02:40:18 +00:00
Daryl Koopersmith b908add2c2 Theme Customizer: Improve form markup. Make the theme title/author a section. Prevent section arrows from blocking clicks. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20106 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-04 02:06:11 +00:00
Daryl Koopersmith 82c8fbcf8e Theme Customizer: Use home_url instead of get_home_url. props nacin, fixes #20137, see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20057 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-29 23:28:13 +00:00
Daryl Koopersmith c3249b5f7f Theme Customizer: Load the preview iframe with the same scheme as the admin to prevent security warnings. props ocean90. fixes #20137, see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20051 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-29 22:43:12 +00:00
Andrew Nacin 47db4344b9 Have WP_Theme::get_screenshot() default to an absolute URI. Allow 'relative' to be requested. see #20103, see #19816.
git-svn-id: https://develop.svn.wordpress.org/trunk@20043 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-29 20:31:56 +00:00
Daryl Koopersmith 78bf972b68 Improve page loads in the theme customizer by layering loading iframes. Automate refreshing, but debounce multiple refresh events to prevent hammering the server with requests. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20031 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-29 01:17:21 +00:00
Daryl Koopersmith 1fd6d4bfd3 Update customize-controls.php to use new WP_Theme API. see #19910, [20029].
git-svn-id: https://develop.svn.wordpress.org/trunk@20030 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 21:41:19 +00:00
Daryl Koopersmith 9f29c06954 Introduce new theme customizer to replace theme preview. Rough first pass. props koopersmith, ocean90. see #19910.
Merges in http://plugins.svn.wordpress.org/gandalf/branches/dev/ rev 510148.

git-svn-id: https://develop.svn.wordpress.org/trunk@19995 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-25 04:12:43 +00:00