Commit Graph

17 Commits

Author SHA1 Message Date
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