Commit Graph

25 Commits

Author SHA1 Message Date
koopersmith 2f2cb0926f 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: http://svn.automattic.com/wordpress/trunk@20645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-30 15:46:17 +00:00
koopersmith 863a458165 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: http://svn.automattic.com/wordpress/trunk@20585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-25 16:04:51 +00:00
nacin 9df0620d89 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: http://svn.automattic.com/wordpress/trunk@20496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-17 21:43:47 +00:00
koopersmith 565300e1cd Theme Customizer: Display 'Save and Activate' when switching themes. Add and properties to the WP_Customize class. see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-17 20:49:39 +00:00
koopersmith a5dacf7da5 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: http://svn.automattic.com/wordpress/trunk@20476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-16 14:02:28 +00:00
koopersmith 5a8121fc8f 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: http://svn.automattic.com/wordpress/trunk@20404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-08 21:17:46 +00:00
koopersmith d1b815f87f Theme Customizer: Remove small screenshot from theme title bar. see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-07 00:33:36 +00:00
koopersmith 79f8b89fbc 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: http://svn.automattic.com/wordpress/trunk@20319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-29 06:35:54 +00:00
koopersmith 30d798ec8d 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: http://svn.automattic.com/wordpress/trunk@20295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-28 04:14:09 +00:00
koopersmith cca689308c 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: http://svn.automattic.com/wordpress/trunk@20276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-24 01:02:29 +00:00
koopersmith 7ce012ef87 Theme Customizer: Use a more complex name for the save parameter to prevent the customizer from clashing with plugins. see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-23 00:16:46 +00:00
koopersmith b6e48e5d81 Theme Customizer: Add background repeat, position, and attachment settings. Change visibility parameter to accept a string or array( , ). see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-22 08:07:44 +00:00
koopersmith 5443bec597 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: http://svn.automattic.com/wordpress/trunk@20260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-22 07:17:26 +00:00
koopersmith dbd50b0972 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: http://svn.automattic.com/wordpress/trunk@20248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-21 22:55:43 +00:00
koopersmith d4f20e47b7 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: http://svn.automattic.com/wordpress/trunk@20133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-07 03:19:35 +00:00
koopersmith e9652cf3fd 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: http://svn.automattic.com/wordpress/trunk@20128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-06 22:48:07 +00:00
koopersmith efafcf2fc9 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: http://svn.automattic.com/wordpress/trunk@20110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-04 04:57:24 +00:00
koopersmith 125a02a3c5 Theme Customizer: Add mini screenshot and description to theme info section. see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-04 02:40:18 +00:00
koopersmith 9523a9037c Theme Customizer: Improve form markup. Make the theme title/author a section. Prevent section arrows from blocking clicks. see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-04 02:06:11 +00:00
koopersmith ea9d2e26af Theme Customizer: Use home_url instead of get_home_url. props nacin, fixes #20137, see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-29 23:28:13 +00:00
koopersmith cba9bc1cfb 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: http://svn.automattic.com/wordpress/trunk@20051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-29 22:43:12 +00:00
nacin 8ba92a52f8 Have WP_Theme::get_screenshot() default to an absolute URI. Allow 'relative' to be requested. see #20103, see #19816.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-29 20:31:56 +00:00
koopersmith cc9b31a388 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: http://svn.automattic.com/wordpress/trunk@20031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-29 01:17:21 +00:00
koopersmith abd1d5e599 Update customize-controls.php to use new WP_Theme API. see #19910, [20029].
git-svn-id: http://svn.automattic.com/wordpress/trunk@20030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-28 21:41:19 +00:00
koopersmith c832f904ae 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: http://svn.automattic.com/wordpress/trunk@19995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-25 04:12:43 +00:00