Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20960] trunk: Move customize-controls CSS and JS to wp-admin. Date:Wed, 30 May 2012 20:11:04 +0000 (UTC)
 

Diff

Copied: trunk/wp-admin/css/customize-controls.css (from rev 20957, trunk/wp-includes/css/customize-controls.css) (0 => 20960)


--- trunk/wp-admin/css/customize-controls.css	                        (rev 0)
+++ trunk/wp-admin/css/customize-controls.css	2012-05-30 20:11:04 UTC (rev 20960)
@@ -0,0 +1 @@
+body{overflow:hidden}#customize-controls a{text-decoration:none}.customize-section{border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;margin:0}.customize-section:last-child{box-shadow:0 1px 0 0 #fff}.customize-section-title{margin:0;padding:15px 20px;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cannot-expand .customize-section-title{cursor:auto}.customize-section-content{display:none;padding:10px 20px 15px;overflow:hidden}.control-section .customize-section-title{padding:10px 20px;font-size:15px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-weight:normal;text-shadow:0 1px 0 #fff;background-color:#f5f5f5;background-image:-webkit-linear-gradient(top,#f5f5f5,#eee);background-image:-moz-linear-gradient(top,#f5f5f5,#eee);background-image:-ms-linear-gradient(top,#f5f5f5,#eee);background-image:-o-linear-gradient(top,#f5f5f5,#eee);background-image:linear-gradient(
 top,#f5f5f5,#eee)}.control-section .customize-section-title:hover{color:#222;background-color:#f9f9f9;background-image:-webkit-linear-gradient(top,#f9f9f9,#f1f1f1);background-image:-moz-linear-gradient(top,#f9f9f9,#f1f1f1);background-image:-ms-linear-gradient(top,#f9f9f9,#f1f1f1);background-image:-o-linear-gradient(top,#f9f9f9,#f1f1f1);background-image:linear-gradient(top,#f9f9f9,#f1f1f1)}.control-section.open .customize-section-title{border-bottom:1px solid #e5e5e5}.control-section.open .customize-section-title:hover{border-bottom:1px solid #dfdfdf}.customize-section.open .customize-section-content{display:block}.customize-section-title:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:6px 6px 0;position:absolute;top:25px;right:20px;z-index:1}.cannot-expand .customize-section-title:after{display:none}.customize-section.open .customize-section-title:after{margin-top:-1px;border-width:0 6px 6px}.customize-section-title:hover:after
 {border-color:#aaa transparent}.control-section .customize-section-title:after{top:15px}#customize-info .preview-notice{font-size:13px;line-height:24px;color:#999}#customize-info .theme-name{font-size:20px;font-weight:200;line-height:24px;color:#333;display:block;text-shadow:0 1px 0 #fff}#customize-info .theme-screenshot{width:258px;border:1px solid #ccc}#customize-info .theme-description{margin-top:1em;color:#777;line-height:20px}#customize-controls .submit{text-align:center}#customize-theme-controls>ul,#customize-theme-controls .customize-section-content{margin:0}#customize-header-actions .button-primary{float:right;margin-top:11px}#customize-header-actions img{display:none;float:right;margin-top:13px;margin-right:4px}.saving #customize-header-actions img{display:block}.customize-control{width:100%;float:left;clear:both;margin-bottom:8px}.customize-control-title{display:block;line-height:24px;font-weight:bold}.customize-control select,.customize-control input[type="
 ;text"],.customize-control input[type="radio"],.customize-control input[type="checkbox"],.customize-control-color .color-picker,.customize-control-checkbox label,.customize-control-upload div{line-height:28px}.customize-control input[type="text"]{width:98%;line-height:18px;margin:0}.customize-control select{min-width:50%;max-width:100%;height:28px;line-height:28px}.customize-control-checkbox input{margin-right:5px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:22px}.customize-control-radio label{line-height:20px}.customize-control-radio input{margin-right:5px}#customize-preview iframe{width:100%;height:100%}.customize-section .dropdown{float:left;display:block;position:relative;cursor:pointer;-webkit-border-radius:3px;border-radius:3px}.customize-section .dropdown-content{overflow:hidden;float:left;min-width:30px;height:16px;line-height:16px;margin-right:16px;padding
 :4px 5px;background-color:#eee;border:1px solid #ccc;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;right:0;width:15px;border-color:#ccc;border-style:solid;border-width:1px 1px 1px 0;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:4px 4px 0 4px;position:absolute;top:50%;margin-top:-1px;right:4px;z-index:1}.customize-control.open .dropdown-arrow:after{border-width:0 4px 4px 4px;margin-top:-2px}.customize-section .dropdown:hover .dropdown-content,.customize-control .dropdown:hover .dropdown-arrow{border-color:#aaa}.customize-section .dropdown:hover .dropdown-arrow:after{border-color:#aaa transparent}.customize-control .dropdown-status{display:none;max-width:112px;color:#999}.customize-control-c
 olor .color-picker-hex,.customize-control-color .farbtastic-placeholder{display:none}.customize-control-color.open .color-picker-hex,.customize-control-color.open .farbtastic-placeholder{display:block}.customize-control-color .dropdown{margin-right:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#fff;border:1px solid rgba(0,0,0,0.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,0.25)}.customize-section input[type="text"].color-picker-hex{float:left;width:85px;font-family:monospace;text-align:center}.customize-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder{color:transparent}.customize-section input[type="text"].color-picker-hex:-moz-placeholder{color:#999}.customize-control-color .farbtastic-placeholder{width:100%;margin:5px 0 10px;float:left}.customize-control-color .farbtastic{margin:0 auto}.customize-control-image .library,.customize
 -control-image .actions{display:none;float:left;width:100%}.customize-control-image.open .library,.customize-control-image.open .actions{display:block}.customize-section .customize-control-image .dropdown-content{height:auto;min-height:24px;min-width:40px;padding:0}.customize-section .customize-control-image .dropdown-status{padding:4px 5px}.customize-section .customize-control-image .preview-thumbnail img{display:block;width:100%;max-width:122px;max-height:98px;margin:0 auto}.customize-section .customize-control-image .actions{text-align:right}.customize-section .customize-control-image .actions a{display:block}.customize-section .customize-control-image .library ul{border-bottom:1px solid #dfdfdf;float:left;width:100%;margin:10px 0 0}.customize-section .customize-control-image .library li{color:#999;float:left;padding:3px 5px;margin:0;border-style:solid;border-color:transparent;border-width:1px 1px 0 1px}.customize-section .customize-control-image .library li.library-selec
 ted{margin-bottom:-1px;padding-bottom:4px;color:#777;background:#f5f5f5;border-color:#dfdfdf;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.customize-section .customize-control-image .library-content{display:none;width:100%;float:left;padding:10px 0}.customize-section .customize-control-image .library-content.library-selected{display:block}.customize-section .customize-control-image .library .thumbnail{display:block;width:100%}.customize-section .customize-control-image .library .thumbnail:hover img{border-color:#21759b}.customize-section .customize-control-image .library .thumbnail img{display:block;max-width:220px;max-height:80px;margin:5px auto;padding:4px;background:#fff;border:1px solid #dfdfdf}.customize-section .customize-control-upload .upload-fallback,.customize-section .customize-control-image .upload-fallback{display:none}.customize-section .customize-control-upload .upload-dropzone,.customize-section .customize-control-image .upload-dropzone{display
 :none;padding:15px 10px;border:3px dashed #dfdfdf;margin:5px auto;text-align:center;color:#777;position:relative}.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,.customize-section .customize-control-image .upload-dropzone.supports-drag-drop{display:block;-webkit-transition:border-color .1s;-moz-transition:border-color .1s;-ms-transition:border-color .1s;-o-transition:border-color .1s;transition:border-color .1s}.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over{border-color:#83b4d8}
\ No newline at end of file

Copied: trunk/wp-admin/css/customize-controls.dev.css (from rev 20957, trunk/wp-includes/css/customize-controls.dev.css) (0 => 20960)


--- trunk/wp-admin/css/customize-controls.dev.css	                        (rev 0)
+++ trunk/wp-admin/css/customize-controls.dev.css	2012-05-30 20:11:04 UTC (rev 20960)
@@ -0,0 +1,486 @@
+body {
+	overflow: hidden;
+}
+
+#customize-controls a {
+	text-decoration: none;
+}
+
+.customize-section {
+	border-top: 1px solid #fff;
+	border-bottom: 1px solid #dfdfdf;
+	margin: 0;
+}
+
+.customize-section:last-child {
+	box-shadow: 0 1px 0 0px #fff;
+}
+
+.customize-section-title {
+	margin: 0;
+	padding: 15px 20px;
+	position: relative;
+
+	cursor: pointer;
+
+	-webkit-user-select: none;
+	-moz-user-select: none;
+	user-select: none;
+}
+
+.cannot-expand .customize-section-title {
+	cursor: auto;
+}
+
+.customize-section-content {
+	display: none;
+	padding: 10px 20px 15px;
+	overflow: hidden;
+}
+
+.control-section .customize-section-title {
+	padding: 10px 20px;
+	font-size: 15px;
+	font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+	font-weight: normal;
+	text-shadow: 0 1px 0 #fff;
+
+	background-color: #f5f5f5;
+	background-image: -webkit-linear-gradient( top, #f5f5f5, #eee );
+	background-image:    -moz-linear-gradient( top, #f5f5f5, #eee );
+	background-image:     -ms-linear-gradient( top, #f5f5f5, #eee );
+	background-image:      -o-linear-gradient( top, #f5f5f5, #eee );
+	background-image:         linear-gradient( top, #f5f5f5, #eee );
+}
+
+.control-section .customize-section-title:hover {
+	color: #222;
+	background-color: #f9f9f9;
+	background-image: -webkit-linear-gradient( top, #f9f9f9, #f1f1f1 );
+	background-image:    -moz-linear-gradient( top, #f9f9f9, #f1f1f1 );
+	background-image:     -ms-linear-gradient( top, #f9f9f9, #f1f1f1 );
+	background-image:      -o-linear-gradient( top, #f9f9f9, #f1f1f1 );
+	background-image:         linear-gradient( top, #f9f9f9, #f1f1f1 );
+}
+
+.control-section.open .customize-section-title {
+	border-bottom: 1px solid #e5e5e5;
+}
+
+.control-section.open .customize-section-title:hover {
+	border-bottom: 1px solid #dfdfdf;
+}
+
+.customize-section.open .customize-section-content {
+	display: block;
+}
+
+.customize-section-title:after {
+	content: '';
+	width: 0;
+	height: 0;
+	border-color: #ccc transparent;
+	border-style: solid;
+	border-width: 6px 6px 0;
+	position: absolute;
+	top: 25px;
+	right: 20px;
+	z-index: 1;
+}
+
+.cannot-expand .customize-section-title:after {
+	display: none;
+}
+
+.customize-section.open .customize-section-title:after {
+	margin-top: -1px;
+	border-width: 0 6px 6px;
+}
+
+.customize-section-title:hover:after {
+	border-color: #aaa transparent;
+}
+
+.control-section .customize-section-title:after {
+	top: 15px;
+}
+
+#customize-info .preview-notice {
+	font-size: 13px;
+	line-height: 24px;
+	color: #999;
+}
+
+#customize-info .theme-name {
+	font-size: 20px;
+	font-weight: 200;
+	line-height: 24px;
+	color: #333;
+	display: block;
+	text-shadow: 0 1px 0 #fff;
+}
+
+#customize-info .theme-screenshot {
+	width: 258px;
+	border: 1px solid #ccc;
+}
+
+#customize-info .theme-description {
+	margin-top: 1em;
+	color: #777;
+	line-height: 20px;
+}
+
+#customize-controls .submit {
+	text-align: center;
+}
+
+#customize-theme-controls > ul,
+#customize-theme-controls .customize-section-content {
+	margin: 0;
+}
+
+#customize-header-actions .button-primary {
+	float: right;
+	margin-top: 11px;
+}
+
+#customize-header-actions img {
+	display: none;
+	float: right;
+	margin-top: 13px;
+	margin-right: 4px;
+}
+
+.saving #customize-header-actions img {
+	display: block;
+}
+
+.customize-control {
+	width: 100%;
+	float: left;
+	clear: both;
+	margin-bottom: 8px;
+}
+
+.customize-control-title {
+	display: block;
+	line-height: 24px;
+	font-weight: bold;
+}
+
+.customize-control select,
+.customize-control input[type="text"],
+.customize-control input[type="radio"],
+.customize-control input[type="checkbox"],
+.customize-control-color .color-picker,
+.customize-control-checkbox label,
+.customize-control-upload div {
+	line-height: 28px;
+}
+
+.customize-control input[type="text"] {
+	width: 98%;
+	line-height: 18px;
+	margin: 0;
+}
+
+.customize-control select {
+	min-width: 50%;
+	max-width: 100%;
+	height: 28px;
+	line-height: 28px;
+}
+
+.customize-control-checkbox input {
+	margin-right: 5px;
+}
+
+.customize-control-radio {
+	padding: 5px 0 10px;
+}
+
+.customize-control-radio .customize-control-title {
+	margin-bottom: 0;
+	line-height: 22px;
+}
+
+.customize-control-radio label {
+	line-height: 20px;
+}
+
+.customize-control-radio input {
+	margin-right: 5px;
+}
+
+#customize-preview iframe {
+	width: 100%;
+	height: 100%;
+}
+
+/*
+ * Style for custom settings
+ */
+
+/*
+ * Dropdowns
+ */
+.customize-section .dropdown {
+	float: left;
+	display: block;
+	position: relative;
+	cursor: pointer;
+
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+}
+
+.customize-section .dropdown-content {
+	overflow: hidden;
+	float: left;
+	min-width: 30px;
+	height: 16px;
+	line-height: 16px;
+	margin-right: 16px;
+	padding: 4px 5px;
+	background-color: #eee;
+	border: 1px solid #ccc;
+	-webkit-border-radius: 3px 0 0 3px;
+	border-radius: 3px 0 0 3px;
+
+	-webkit-user-select: none;
+	-moz-user-select: none;
+	user-select: none;
+}
+
+.customize-control .dropdown-arrow {
+	position: absolute;
+	top: 0;
+	bottom: 0;
+	right: 0;
+	width: 15px;
+
+	border-color: #ccc;
+	border-style: solid;
+	border-width: 1px 1px 1px 0;
+	-webkit-border-radius: 0 3px 3px 0;
+	border-radius: 0 3px 3px 0;
+}
+
+.customize-control .dropdown-arrow:after {
+	content: '';
+	width: 0;
+	height: 0;
+	border-color: #ccc transparent;
+	border-style: solid;
+	border-width: 4px 4px 0 4px;
+	position: absolute;
+	top: 50%;
+	margin-top: -1px;
+	right: 4px;
+	z-index: 1;
+}
+
+.customize-control.open .dropdown-arrow:after {
+	border-width: 0 4px 4px 4px;
+	margin-top: -2px;
+}
+
+.customize-section .dropdown:hover .dropdown-content,
+.customize-control .dropdown:hover .dropdown-arrow {
+	border-color: #aaa;
+}
+
+.customize-section .dropdown:hover .dropdown-arrow:after {
+	border-color: #aaa transparent;
+}
+
+.customize-control .dropdown-status {
+	display: none;
+	max-width: 112px;
+	color: #999;
+}
+
+/*
+ * Color Picker
+ */
+.customize-control-color .color-picker-hex,
+.customize-control-color .farbtastic-placeholder {
+	display: none;
+}
+
+.customize-control-color.open .color-picker-hex,
+.customize-control-color.open .farbtastic-placeholder {
+	display: block;
+}
+
+.customize-control-color .dropdown {
+	margin-right: 5px;
+	margin-bottom: 5px;
+}
+
+.customize-control-color .dropdown .dropdown-content {
+	background-color: #fff;
+	border: 1px solid rgba( 0, 0, 0, 0.15 );
+}
+
+.customize-control-color .dropdown:hover .dropdown-content {
+	border-color: rgba( 0, 0, 0, 0.25 );
+}
+
+.customize-section input[type="text"].color-picker-hex {
+	float: left;
+	width: 85px;
+	font-family: monospace;
+	text-align: center;
+}
+
+/* The centered cursor overlaps the placeholder in webkit. Hide it when selected. */
+.customize-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder {
+	color: transparent;
+}
+.customize-section input[type="text"].color-picker-hex:-moz-placeholder {
+	color: #999;
+}
+
+.customize-control-color .farbtastic-placeholder {
+	width: 100%;
+	margin: 5px 0 10px;
+	float: left;
+}
+
+.customize-control-color .farbtastic {
+	margin: 0 auto;
+}
+
+/*
+ * Image Picker
+ */
+.customize-control-image .library,
+.customize-control-image .actions {
+	display: none;
+	float: left;
+	width: 100%;
+}
+
+.customize-control-image.open .library,
+.customize-control-image.open .actions {
+	display: block;
+}
+
+.customize-section .customize-control-image .dropdown-content {
+	height: auto;
+	min-height: 24px;
+	min-width: 40px;
+	padding: 0;
+}
+
+.customize-section .customize-control-image .dropdown-status {
+	padding: 4px 5px;
+}
+
+.customize-section .customize-control-image .preview-thumbnail img {
+	display: block;
+	width: 100%;
+	max-width: 122px;
+	max-height: 98px;
+	margin: 0 auto;
+}
+
+.customize-section .customize-control-image .actions {
+	text-align: right;
+}
+
+.customize-section .customize-control-image .actions a {
+	display: block;
+}
+
+.customize-section .customize-control-image .library ul {
+	border-bottom: 1px solid #dfdfdf;
+	float: left;
+	width: 100%;
+	margin: 10px 0 0;
+}
+
+.customize-section .customize-control-image .library li {
+	color: #999;
+	float: left;
+	padding: 3px 5px;
+	margin: 0;
+	border-style: solid;
+	border-color: transparent;
+	border-width: 1px 1px 0 1px;
+}
+
+.customize-section .customize-control-image .library li.library-selected {
+	margin-bottom: -1px;
+	padding-bottom: 4px;
+
+	color: #777;
+	background: #f5f5f5;
+	border-color: #dfdfdf;
+	-webkit-border-radius: 3px 3px 0 0;
+	border-radius: 3px 3px 0 0 ;
+}
+
+.customize-section .customize-control-image .library-content {
+	display: none;
+	width: 100%;
+	float: left;
+	padding: 10px 0;
+}
+
+.customize-section .customize-control-image .library-content.library-selected {
+	display: block;
+}
+
+.customize-section .customize-control-image .library .thumbnail {
+	display: block;
+	width: 100%;
+}
+
+.customize-section .customize-control-image .library .thumbnail:hover img {
+	border-color: #21759b;
+}
+
+.customize-section .customize-control-image .library .thumbnail img {
+	display: block;
+	max-width: 220px;
+	max-height: 80px;
+
+	margin: 5px auto;
+	padding: 4px;
+	background: #fff;
+	border: 1px solid #dfdfdf;
+}
+
+.customize-section .customize-control-upload .upload-fallback,
+.customize-section .customize-control-image .upload-fallback {
+	display: none;
+}
+
+.customize-section .customize-control-upload .upload-dropzone,
+.customize-section .customize-control-image .upload-dropzone {
+	display: none;
+	padding: 15px 10px;
+	border: 3px dashed #dfdfdf;
+	margin: 5px auto;
+	text-align: center;
+	color: #777;
+	position: relative;
+}
+
+.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,
+.customize-section .customize-control-image .upload-dropzone.supports-drag-drop {
+	display: block;
+	-webkit-transition: border-color 0.1s;
+	-moz-transition:    border-color 0.1s;
+	-ms-transition:     border-color 0.1s;
+	-o-transition:      border-color 0.1s;
+	transition:         border-color 0.1s;
+}
+
+.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,
+.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over {
+	border-color: #83b4d8;
+}
\ No newline at end of file

Copied: trunk/wp-admin/js/customize-controls.dev.js (from rev 20957, trunk/wp-includes/js/customize-controls.dev.js) (0 => 20960)


--- trunk/wp-admin/js/customize-controls.dev.js	                        (rev 0)
+++ trunk/wp-admin/js/customize-controls.dev.js	2012-05-30 20:11:04 UTC (rev 20960)
@@ -0,0 +1,694 @@
+(function( exports, $ ){
+	var api = wp.customize;
+
+	/*
+	 * @param options
+	 * - previewer - The Previewer instance to sync with.
+	 * - transport - The transport to use for previewing. Supports 'refresh' and 'postMessage'.
+	 */
+	api.Setting = api.Value.extend({
+		initialize: function( id, value, options ) {
+			var element;
+
+			api.Value.prototype.initialize.call( this, value, options );
+
+			this.id = id;
+			this.transport = this.transport || 'refresh';
+
+			this.bind( this.preview );
+		},
+		preview: function() {
+			switch ( this.transport ) {
+				case 'refresh':
+					return this.previewer.refresh();
+				case 'postMessage':
+					return this.previewer.send( 'setting', [ this.id, this() ] );
+			}
+		}
+	});
+
+	api.Control = api.Class.extend({
+		initialize: function( id, options ) {
+			var control = this,
+				nodes, radios, settings;
+
+			this.params = {};
+			$.extend( this, options || {} );
+
+			this.id = id;
+			this.selector = '#customize-control-' + id.replace( ']', '' ).replace( '[', '-' );
+			this.container = $( this.selector );
+
+			settings = $.map( this.params.settings, function( value ) {
+				return value;
+			});
+
+			api.apply( api, settings.concat( function() {
+				var key;
+
+				control.settings = {};
+				for ( key in control.params.settings ) {
+					control.settings[ key ] = api( control.params.settings[ key ] );
+				}
+
+				control.setting = control.settings['default'] || null;
+				control.ready();
+			}) );
+
+			control.elements = [];
+
+			nodes  = this.container.find('[data-customize-setting-link]');
+			radios = {};
+
+			nodes.each( function() {
+				var node = $(this),
+					name;
+
+				if ( node.is(':radio') ) {
+					name = node.prop('name');
+					if ( radios[ name ] )
+						return;
+
+					radios[ name ] = true;
+					node = nodes.filter( '[name="' + name + '"]' );
+				}
+
+				api( node.data('customizeSettingLink'), function( setting ) {
+					var element = new api.Element( node );
+					control.elements.push( element );
+					element.sync( setting );
+					element.set( setting() );
+				});
+			});
+		},
+
+		ready: function() {},
+
+		dropdownInit: function() {
+			var control  = this,
+				statuses = this.container.find('.dropdown-status'),
+				params   = this.params,
+				update   = function( to ) {
+					if ( typeof	to === 'string' && params.statuses && params.statuses[ to ] )
+						statuses.html( params.statuses[ to ] ).show();
+					else
+						statuses.hide();
+				};
+
+			// Support the .dropdown class to open/close complex elements
+			this.container.on( 'click', '.dropdown', function( event ) {
+				event.preventDefault();
+				control.container.toggleClass('open');
+			});
+
+			this.setting.bind( update );
+			update( this.setting() );
+		}
+	});
+
+	api.ColorControl = api.Control.extend({
+		ready: function() {
+			var control = this,
+				rhex, spot, input, text, update;
+
+			rhex   = /^#([A-Fa-f0-9]{3}){0,2}$/;
+			spot   = this.container.find('.dropdown-content');
+			input  = new api.Element( this.container.find('.color-picker-hex') );
+			update = function( color ) {
+				spot.css( 'background', color );
+				control.farbtastic.setColor( color );
+			};
+
+			this.farbtastic = $.farbtastic( this.container.find('.farbtastic-placeholder'), control.setting.set );
+
+			// Only pass through values that are valid hexes/empty.
+			input.link( this.setting ).validate = function( to ) {
+				return rhex.test( to ) ? to : null;
+			};
+
+			this.setting.bind( update );
+			update( this.setting() );
+
+			this.dropdownInit();
+		}
+	});
+
+	api.UploadControl = api.Control.extend({
+		ready: function() {
+			var control = this;
+
+			this.params.removed = this.params.removed || '';
+
+			this.success = $.proxy( this.success, this );
+
+			this.uploader = $.extend({
+				container: this.container,
+				browser:   this.container.find('.upload'),
+				dropzone:  this.container.find('.upload-dropzone'),
+				success:   this.success
+			}, this.uploader || {} );
+
+			this.uploader = new wp.Uploader( this.uploader );
+
+			this.remover = this.container.find('.remove');
+			this.remover.click( function( event ) {
+				control.setting.set( control.params.removed );
+				event.preventDefault();
+			});
+
+			this.removerVisibility = $.proxy( this.removerVisibility, this );
+			this.setting.bind( this.removerVisibility );
+			this.removerVisibility( this.setting.get() );
+
+			if ( this.params.context )
+				control.uploader.param( 'post_data[context]', this.params.context );
+
+			control.uploader.param( 'post_data[theme]', api.settings.theme.stylesheet );
+		},
+		success: function( attachment ) {
+			this.setting.set( attachment.url );
+		},
+		removerVisibility: function( to ) {
+			this.remover.toggle( to != this.params.removed );
+		}
+	});
+
+	api.ImageControl = api.UploadControl.extend({
+		ready: function() {
+			var control = this,
+				panels;
+
+			this.uploader = {
+				init: function( up ) {
+					var fallback, button;
+
+					if ( up.features.dragdrop )
+						return;
+
+					// Maintain references while wrapping the fallback button.
+					fallback = control.container.find( '.upload-fallback' );
+					button   = fallback.children().detach();
+
+					this.browser.detach().empty().append( button );
+					fallback.append( this.browser ).show();
+				}
+			};
+
+			api.UploadControl.prototype.ready.call( this );
+
+			this.thumbnail    = this.container.find('.preview-thumbnail img');
+			this.thumbnailSrc = $.proxy( this.thumbnailSrc, this );
+			this.setting.bind( this.thumbnailSrc );
+
+			this.library = this.container.find('.library');
+
+			// Generate tab objects
+			this.tabs = {};
+			panels    = this.library.find('.library-content');
+
+			this.library.children('ul').children('li').each( function() {
+				var link  = $(this),
+					id    = link.data('customizeTab'),
+					panel = panels.filter('[data-customize-tab="' + id + '"]');
+
+				control.tabs[ id ] = {
+					both:  link.add( panel ),
+					link:  link,
+					panel: panel
+				};
+			});
+
+			// Select a tab
+			this.selected = this.tabs[ panels.first().data('customizeTab') ];
+			this.selected.both.addClass('library-selected');
+
+			// Bind tab switch events
+			this.library.children('ul').on( 'click', 'li', function( event ) {
+				var id  = $(this).data('customizeTab'),
+					tab = control.tabs[ id ];
+
+				event.preventDefault();
+
+				if ( tab.link.hasClass('library-selected') )
+					return;
+
+				control.selected.both.removeClass('library-selected');
+				control.selected = tab;
+				control.selected.both.addClass('library-selected');
+			});
+
+			this.library.on( 'click', 'a', function( event ) {
+				var value = $(this).data('customizeImageValue');
+
+				if ( value ) {
+					control.setting.set( value );
+					event.preventDefault();
+				}
+			});
+
+			if ( this.tabs.uploaded ) {
+				this.tabs.uploaded.target = this.library.find('.uploaded-target');
+				if ( ! this.tabs.uploaded.panel.find('.thumbnail').length )
+					this.tabs.uploaded.both.addClass('hidden');
+			}
+
+			this.dropdownInit();
+		},
+		success: function( attachment ) {
+			api.UploadControl.prototype.success.call( this, attachment );
+
+			// Add the uploaded image to the uploaded tab.
+			if ( this.tabs.uploaded && this.tabs.uploaded.target.length ) {
+				this.tabs.uploaded.both.removeClass('hidden');
+
+				$( '<a href="#" class="thumbnail"></a>' )
+					.data( 'customizeImageValue', attachment.url )
+					.append( '<img src="' +  attachment.url+ '" />' )
+					.appendTo( this.tabs.uploaded.target );
+			}
+		},
+		thumbnailSrc: function( to ) {
+			if ( /^(https?:)?\/\//.test( to ) )
+				this.thumbnail.prop( 'src', to ).show();
+			else
+				this.thumbnail.hide();
+		}
+	});
+
+	// Change objects contained within the main customize object to Settings.
+	api.defaultConstructor = api.Setting;
+
+	// Create the collection of Control objects.
+	api.control = new api.Values({ defaultConstructor: api.Control });
+
+	api.Previewer = api.Messenger.extend({
+		refreshBuffer: 250,
+
+		/**
+		 * Requires params:
+		 *  - container - a selector or jQuery element
+		 *  - url       - the URL of preview frame
+		 */
+		initialize: function( params, options ) {
+			var self = this,
+				rscheme = /^https?/;
+
+			$.extend( this, options || {} );
+
+			this.loaded = $.proxy( this.loaded, this );
+
+			/*
+			 * Wrap this.refresh to prevent it from hammering the servers:
+			 *
+			 * If refresh is called once and no other refresh requests are
+			 * loading, trigger the request immediately.
+			 *
+			 * If refresh is called while another refresh request is loading,
+			 * debounce the refresh requests:
+			 * 1. Stop the loading request (as it is instantly outdated).
+			 * 2. Trigger the new request once refresh hasn't been called for
+			 *    self.refreshBuffer milliseconds.
+			 */
+			this.refresh = (function( self ) {
+				var refresh  = self.refresh,
+					callback = function() {
+						timeout = null;
+						refresh.call( self );
+					},
+					timeout;
+
+				return function() {
+					if ( typeof timeout !== 'number' ) {
+						if ( self.loading ) {
+							self.loading.remove();
+							delete self.loading;
+							self.loader();
+						} else {
+							return callback();
+						}
+					}
+
+					clearTimeout( timeout );
+					timeout = setTimeout( callback, self.refreshBuffer );
+				};
+			})( this );
+
+			this.container   = api.ensure( params.container );
+			this.allowedUrls = params.allowedUrls;
+
+			api.Messenger.prototype.initialize.call( this, params.url );
+
+			// We're dynamically generating the iframe, so the origin is set
+			// to the current window's location, not the url's.
+			this.origin.unlink( this.url ).set( window.location.href );
+
+			this.add( 'scheme', this.origin() ).link( this.origin ).setter( function( to ) {
+				var match = to.match( rscheme );
+				return match ? match[0] : '';
+			});
+
+			// Limit the URL to internal, front-end links.
+			//
+			// If the frontend and the admin are served from the same domain, load the
+			// preview over ssl if the customizer is being loaded over ssl. This avoids
+			// insecure content warnings. This is not attempted if the admin and frontend
+			// are on different domains to avoid the case where the frontend doesn't have
+			// ssl certs.
+
+			this.url.setter( function( to ) {
+				var result;
+
+				// Check for URLs that include "/wp-admin/" or end in "/wp-admin".
+				// Strip hashes and query strings before testing.
+				if ( /\/wp-admin(\/|$)/.test( to.replace(/[#?].*$/, '') ) )
+					return null;
+
+				// Attempt to match the URL to the control frame's scheme
+				// and check if it's allowed. If not, try the original URL.
+				$.each([ to.replace( rscheme, self.scheme() ), to ], function( i, url ) {
+					$.each( self.allowedUrls, function( i, allowed ) {
+						if ( 0 === url.indexOf( allowed ) ) {
+							result = url;
+							return false;
+						}
+					});
+					if ( result )
+						return false;
+				});
+
+				// If we found a matching result, return it. If not, bail.
+				return result ? result : null;
+			});
+
+			// Refresh the preview when the URL is changed.
+			this.url.bind( this.refresh );
+
+			this.scroll = 0;
+			this.bind( 'scroll', function( distance ) {
+				this.scroll = distance;
+			});
+
+			// Update the URL when the iframe sends a URL message.
+			this.bind( 'url', this.url );
+		},
+		loader: function() {
+			if ( this.loading )
+				return this.loading;
+
+			this.loading = $('<iframe />').appendTo( this.container );
+
+			return this.loading;
+		},
+		loaded: function() {
+			if ( this.iframe )
+				this.iframe.remove();
+
+			this.iframe = this.loading;
+			delete this.loading;
+
+			this.targetWindow( this.iframe[0].contentWindow );
+			this.send( 'scroll', this.scroll );
+		},
+		query: function() {},
+		refresh: function() {
+			var self = this;
+
+			if ( this.request )
+				this.request.abort();
+
+			this.request = $.ajax( this.url(), {
+				type: 'POST',
+				data: this.query() || {},
+				success: function( response ) {
+					var iframe = self.loader()[0].contentWindow,
+						location = self.request.getResponseHeader('Location'),
+						signature = 'WP_CUSTOMIZER_SIGNATURE',
+						index;
+
+					// Check if the location response header differs from the current URL.
+					// If so, the request was redirected; try loading the requested page.
+					if ( location && location != self.url() ) {
+						self.url( location );
+						return;
+					}
+
+					// Check for a signature in the request.
+					index = response.lastIndexOf( signature );
+					if ( -1 === index || index < response.lastIndexOf('</html>') )
+						return;
+
+					// Strip the signature from the request.
+					response = response.slice( 0, index ) + response.slice( index + signature.length );
+
+					self.loader().one( 'load', self.loaded );
+
+					iframe.document.open();
+					iframe.document.write( response );
+					iframe.document.close();
+				},
+				xhrFields: {
+					withCredentials: true
+				}
+			} );
+		}
+	});
+
+	/* =====================================================================
+	 * Ready.
+	 * ===================================================================== */
+
+	api.controlConstructor = {
+		color:  api.ColorControl,
+		upload: api.UploadControl,
+		image:  api.ImageControl
+	};
+
+	$( function() {
+		api.settings = window._wpCustomizeSettings;
+		api.l10n = window._wpCustomizeControlsL10n;
+
+		// Check if we can run the customizer.
+		if ( ! api.settings )
+			return;
+
+		// Redirect to the fallback preview if any incompatibilities are found.
+		if ( ! $.support.postMessage || ( ! $.support.cors && api.settings.isCrossDomain ) )
+			return window.location = api.settings.url.fallback;
+
+		var body = $( document.body ),
+			query, previewer, parent;
+
+		// Prevent the form from saving when enter is pressed.
+		$('#customize-controls').on( 'keydown', function( e ) {
+			if ( 13 === e.which ) // Enter
+				e.preventDefault();
+		});
+
+		// Initialize Previewer
+		previewer = new api.Previewer({
+			container:   '#customize-preview',
+			form:        '#customize-controls',
+			url:         api.settings.url.preview,
+			allowedUrls: api.settings.url.allowed
+		}, {
+			query: function() {
+				return {
+					customize:  'on',
+					theme:      api.settings.theme.stylesheet,
+					customized: JSON.stringify( api.get() )
+				};
+			},
+
+			nonce: $('#_wpnonce').val(),
+
+			save: function() {
+				var query = $.extend( this.query(), {
+						action: 'customize_save',
+						nonce:  this.nonce
+					}),
+					request = $.post( api.settings.url.ajax, query );
+
+				api.trigger( 'save', request );
+
+				body.addClass('saving');
+
+				request.always( function() {
+					body.removeClass('saving');
+				});
+
+				request.done( function() {
+					api.trigger( 'saved' );
+				});
+			}
+		});
+
+		$.each( api.settings.settings, function( id, data ) {
+			api.create( id, id, data.value, {
+				transport: data.transport,
+				previewer: previewer
+			} );
+		});
+
+		$.each( api.settings.controls, function( id, data ) {
+			var constructor = api.controlConstructor[ data.type ] || api.Control,
+				control;
+
+			control = api.control.add( id, new constructor( id, {
+				params: data,
+				previewer: previewer
+			} ) );
+		});
+
+		// Load the preview frame.
+		previewer.refresh();
+
+		// Save and activated states
+		(function() {
+			var state = new api.Values(),
+				saved = state.create('saved'),
+				activated = state.create('activated');
+
+			state.bind( 'change', function() {
+				var save = $('#save'),
+					back = $('.back');
+
+				if ( ! activated() ) {
+					save.val( api.l10n.activate ).prop( 'disabled', false );
+					back.text( api.l10n.cancel );
+
+				} else if ( saved() ) {
+					save.val( api.l10n.saved ).prop( 'disabled', true );
+					back.text( api.l10n.close );
+
+				} else {
+					save.val( api.l10n.save ).prop( 'disabled', false );
+					back.text( api.l10n.cancel );
+				}
+			});
+
+			// Set default states.
+			saved( true );
+			activated( api.settings.theme.active );
+
+			api.bind( 'change', function() {
+				state('saved').set( false );
+			});
+
+			api.bind( 'saved', function() {
+				state('saved').set( true );
+				state('activated').set( true );
+			});
+
+			activated.bind( function( to ) {
+				if ( to )
+					api.trigger( 'activated' );
+			});
+
+			// Expose states to the API.
+			api.state = state;
+		}());
+
+		api.bind( 'activated', function() {
+			if ( api.settings.url.activated )
+				window.location = api.settings.url.activated;
+		});
+
+		// Temporary accordion code.
+		$('.customize-section-title').click( function( event ) {
+			var clicked = $( this ).parents( '.customize-section' );
+
+			if ( clicked.hasClass('cannot-expand') )
+				return;
+
+			$( '.customize-section' ).not( clicked ).removeClass( 'open' );
+			clicked.toggleClass( 'open' );
+			event.preventDefault();
+		});
+
+		// Button bindings.
+		$('#save').click( function( event ) {
+			previewer.save();
+			event.preventDefault();
+		});
+
+		$('.collapse-sidebar').click( function( event ) {
+			body.toggleClass( 'collapsed' );
+			event.preventDefault();
+		});
+
+		// Create a potential postMessage connection with the parent frame.
+		parent = new api.Messenger( api.settings.url.parent );
+
+		// If we receive a 'back' event, we're inside an iframe.
+		// Send any clicks to the 'Return' link to the parent page.
+		parent.bind( 'back', function() {
+			$('.back').on( 'click.back', function( event ) {
+				event.preventDefault();
+				parent.send( 'close' );
+			});
+		});
+
+		// Pass events through to the parent.
+		$.each([ 'saved', 'activated' ], function( i, id ) {
+			api.bind( id, function() {
+				parent.send( id );
+			});
+		});
+
+		// Initialize the connection with the parent frame.
+		parent.send( 'ready' );
+
+		// Control visibility for default controls
+		$.each({
+			'background_image': {
+				controls: [ 'background_repeat', 'background_position_x', 'background_attachment' ],
+				callback: function( to ) { return !! to }
+			},
+			'show_on_front': {
+				controls: [ 'page_on_front', 'page_for_posts' ],
+				callback: function( to ) { return 'page' === to }
+			},
+			'header_textcolor': {
+				controls: [ 'header_textcolor' ],
+				callback: function( to ) { return 'blank' !== to }
+			}
+		}, function( settingId, o ) {
+			api( settingId, function( setting ) {
+				$.each( o.controls, function( i, controlId ) {
+					api.control( controlId, function( control ) {
+						var visibility = function( to ) {
+							control.container.toggle( o.callback( to ) );
+						};
+
+						visibility( setting.get() );
+						setting.bind( visibility );
+					});
+				});
+			});
+		});
+
+		// Juggle the two controls that use header_textcolor
+		api.control( 'display_header_text', function( control ) {
+			var last = '';
+
+			control.elements[0].unsync( api( 'header_textcolor' ) );
+
+			control.element = new api.Element( control.container.find('input') );
+			control.element.set( 'blank' !== control.setting() );
+
+			control.element.bind( function( to ) {
+				if ( ! to )
+					last = api( 'header_textcolor' ).get();
+
+				control.setting.set( to ? last : 'blank' );
+			});
+
+			control.setting.bind( function( to ) {
+				control.element.set( 'blank' !== to );
+			});
+		});
+
+		api.trigger( 'ready' );
+	});
+
+})( wp, jQuery );
\ No newline at end of file

Copied: trunk/wp-admin/js/customize-controls.js (from rev 20957, trunk/wp-includes/js/customize-controls.js) (0 => 20960)


--- trunk/wp-admin/js/customize-controls.js	                        (rev 0)
+++ trunk/wp-admin/js/customize-controls.js	2012-05-30 20:11:04 UTC (rev 20960)
@@ -0,0 +1 @@
+(function(a,c){var b=wp.customize;b.Setting=b.Value.extend({initialize:function(g,f,d){var e;b.Value.prototype.initialize.call(this,f,d);this.id=g;this.transport=this.transport||"refresh";this.bind(this.preview)},preview:function(){switch(this.transport){case"refresh":return this.previewer.refresh();case"postMessage":return this.previewer.send("setting",[this.id,this()])}}});b.Control=b.Class.extend({initialize:function(i,e){var g=this,d,h,f;this.params={};c.extend(this,e||{});this.id=i;this.selector="#customize-control-"+i.replace("]","").replace("[","-");this.container=c(this.selector);f=c.map(this.params.settings,function(j){return j});b.apply(b,f.concat(function(){var j;g.settings={};for(j in g.params.settings){g.settings[j]=b(g.params.settings[j])}g.setting=g.settings["default"]||null;g.ready()}));g.elements=[];d=this.container.find("[data-customize-setti
 ng-link]");h={};d.each(function(){var k=c(this),j;if(k.is(":radio")){j=k.prop("name");if(h[j]){return}h[j]=true;k=d.filter('[name="'+j+'"]')}b(k.data("customizeSettingLink"),function(m){var l=new b.Element(k);g.elements.push(l);l.sync(m);l.set(m())})})},ready:function(){},dropdownInit:function(){var e=this,d=this.container.find(".dropdown-status"),f=this.params,g=function(h){if(typeof h==="string"&&f.statuses&&f.statuses[h]){d.html(f.statuses[h]).show()}else{d.hide()}};this.container.on("click",".dropdown",function(h){h.preventDefault();e.container.toggleClass("open")});this.setting.bind(g);g(this.setting())}});b.ColorControl=b.Control.extend({ready:function(){var g=this,f,e,d,h,i;f=/^#([A-Fa-f0-9]{3}){0,2}$/;e=this.container.find(".dropdown-content");d=new b.Element(this.container.find(".color-picker-hex"));i=function(j){e.css("background&q
 uot;,j);g.farbtastic.setColor(j)};this.farbtastic=c.farbtastic(this.container.find(".farbtastic-placeholder"),g.setting.set);d.link(this.setting).validate=function(j){return f.test(j)?j:null};this.setting.bind(i);i(this.setting());this.dropdownInit()}});b.UploadControl=b.Control.extend({ready:function(){var d=this;this.params.removed=this.params.removed||"";this.success=c.proxy(this.success,this);this.uploader=c.extend({container:this.container,browser:this.container.find(".upload"),dropzone:this.container.find(".upload-dropzone"),success:this.success},this.uploader||{});this.uploader=new wp.Uploader(this.uploader);this.remover=this.container.find(".remove");this.remover.click(function(e){d.setting.set(d.params.removed);e.preventDefault()});this.removerVisibility=c.proxy(this.removerVisibility,this);this.setting.bind(this.removerVisibility);this.removerVisibility(this.setting.get());if(this.params.context){d.uploader.param(&q
 uot;post_data[context]",this.params.context)}d.uploader.param("post_data[theme]",b.settings.theme.stylesheet)},success:function(d){this.setting.set(d.url)},removerVisibility:function(d){this.remover.toggle(d!=this.params.removed)}});b.ImageControl=b.UploadControl.extend({ready:function(){var e=this,d;this.uploader={init:function(f){var h,g;if(f.features.dragdrop){return}h=e.container.find(".upload-fallback");g=h.children().detach();this.browser.detach().empty().append(g);h.append(this.browser).show()}};b.UploadControl.prototype.ready.call(this);this.thumbnail=this.container.find(".preview-thumbnail img");this.thumbnailSrc=c.proxy(this.thumbnailSrc,this);this.setting.bind(this.thumbnailSrc);this.library=this.container.find(".library");this.tabs={};d=this.library.find(".library-content");this.library.children("ul").children("li").each(function(){var g=c(this),h=g.data("customizeTab"),f=d.filte
 r('[data-customize-tab="'+h+'"]');e.tabs[h]={both:g.add(f),link:g,panel:f}});this.selected=this.tabs[d.first().data("customizeTab")];this.selected.both.addClass("library-selected");this.library.children("ul").on("click","li",function(g){var h=c(this).data("customizeTab"),f=e.tabs[h];g.preventDefault();if(f.link.hasClass("library-selected")){return}e.selected.both.removeClass("library-selected");e.selected=f;e.selected.both.addClass("library-selected")});this.library.on("click","a",function(f){var g=c(this).data("customizeImageValue");if(g){e.setting.set(g);f.preventDefault()}});if(this.tabs.uploaded){this.tabs.uploaded.target=this.library.find(".uploaded-target");if(!this.tabs.uploaded.panel.find(".thumbnail").length){this.tabs.uploaded.both.addClass("hidden")}}this.dropdownInit()},success:function(d){b.UploadControl.
 prototype.success.call(this,d);if(this.tabs.uploaded&&this.tabs.uploaded.target.length){this.tabs.uploaded.both.removeClass("hidden");c('<a href="#" class="thumbnail"></a>').data("customizeImageValue",d.url).append('<img src="'+d.url+'" />').appendTo(this.tabs.uploaded.target)}},thumbnailSrc:function(d){if(/^(https?:)?\/\//.test(d)){this.thumbnail.prop("src",d).show()}else{this.thumbnail.hide()}}});b.defaultConstructor=b.Setting;b.control=new b.Values({defaultConstructor:b.Control});b.Previewer=b.Messenger.extend({refreshBuffer:250,initialize:function(g,e){var d=this,f=/^https?/;c.extend(this,e||{});this.loaded=c.proxy(this.loaded,this);this.refresh=(function(h){var i=h.refresh,k=function(){j=null;i.call(h)},j;return function(){if(typeof j!=="number"){if(h.loading){h.loading.remove();delete h.loading;h.loader()}else{return k()}}clearTimeout(j);j=setTimeout(k,h.refreshBuffer)}})(th
 is);this.container=b.ensure(g.container);this.allowedUrls=g.allowedUrls;b.Messenger.prototype.initialize.call(this,g.url);this.origin.unlink(this.url).set(window.location.href);this.add("scheme",this.origin()).link(this.origin).setter(function(i){var h=i.match(f);return h?h[0]:""});this.url.setter(function(i){var h;if(/\/wp-admin(\/|$)/.test(i.replace(/[#?].*$/,""))){return null}c.each([i.replace(f,d.scheme()),i],function(k,j){c.each(d.allowedUrls,function(l,m){if(0===j.indexOf(m)){h=j;return false}});if(h){return false}});return h?h:null});this.url.bind(this.refresh);this.scroll=0;this.bind("scroll",function(h){this.scroll=h});this.bind("url",this.url)},loader:function(){if(this.loading){return this.loading}this.loading=c("<iframe />").appendTo(this.container);return this.loading},loaded:function(){if(this.iframe){this.iframe.remove()}this.iframe=this.loading;delete this.loading;this.targetWindow(this.iframe[
 0].contentWindow);this.send("scroll",this.scroll)},query:function(){},refresh:function(){var d=this;if(this.request){this.request.abort()}this.request=c.ajax(this.url(),{type:"POST",data:this.query()||{},success:function(g){var i=d.loader()[0].contentWindow,f=d.request.getResponseHeader("Location"),e="WP_CUSTOMIZER_SIGNATURE",h;if(f&&f!=d.url()){d.url(f);return}h=g.lastIndexOf(e);if(-1===h||h<g.lastIndexOf("</html>")){return}g=g.slice(0,h)+g.slice(h+e.length);d.loader().one("load",d.loaded);i.document.open();i.document.write(g);i.document.close()},xhrFields:{withCredentials:true}})}});b.controlConstructor={color:b.ColorControl,upload:b.UploadControl,image:b.ImageControl};c(function(){b.settings=window._wpCustomizeSettings;b.l10n=window._wpCustomizeControlsL10n;if(!b.settings){return}if(!c.support.postMessage||(!c.support.cors&&b.settings.isCrossDomain)){return window.location=b.settings.url.
 fallback}var d=c(document.body),f,g,e;c("#customize-controls").on("keydown",function(h){if(13===h.which){h.preventDefault()}});g=new b.Previewer({container:"#customize-preview",form:"#customize-controls",url:b.settings.url.preview,allowedUrls:b.settings.url.allowed},{query:function(){return{customize:"on",theme:b.settings.theme.stylesheet,customized:JSON.stringify(b.get())}},nonce:c("#_wpnonce").val(),save:function(){var i=c.extend(this.query(),{action:"customize_save",nonce:this.nonce}),h=c.post(b.settings.url.ajax,i);b.trigger("save",h);d.addClass("saving");h.always(function(){d.removeClass("saving")});h.done(function(){b.trigger("saved")})}});c.each(b.settings.settings,function(i,h){b.create(i,i,h.value,{transport:h.transport,previewer:g})});c.each(b.settings.controls,function(k,i){var h=b.controlConstructor[i.type]||b.Control,j;j=b.control.add(k,new h(k,{params:i
 ,previewer:g}))});g.refresh();(function(){var j=new b.Values(),i=j.create("saved"),h=j.create("activated");j.bind("change",function(){var l=c("#save"),k=c(".back");if(!h()){l.val(b.l10n.activate).prop("disabled",false);k.text(b.l10n.cancel)}else{if(i()){l.val(b.l10n.saved).prop("disabled",true);k.text(b.l10n.close)}else{l.val(b.l10n.save).prop("disabled",false);k.text(b.l10n.cancel)}}});i(true);h(b.settings.theme.active);b.bind("change",function(){j("saved").set(false)});b.bind("saved",function(){j("saved").set(true);j("activated").set(true)});h.bind(function(k){if(k){b.trigger("activated")}});b.state=j}());b.bind("activated",function(){if(b.settings.url.activated){window.location=b.settings.url.activated}});c(".customize-section-title").click(function(i){var h=c(this).parents(".customize-section");if(h.hasC
 lass("cannot-expand")){return}c(".customize-section").not(h).removeClass("open");h.toggleClass("open");i.preventDefault()});c("#save").click(function(h){g.save();h.preventDefault()});c(".collapse-sidebar").click(function(h){d.toggleClass("collapsed");h.preventDefault()});e=new b.Messenger(b.settings.url.parent);e.bind("back",function(){c(".back").on("click.back",function(h){h.preventDefault();e.send("close")})});c.each(["saved","activated"],function(h,j){b.bind(j,function(){e.send(j)})});e.send("ready");c.each({background_image:{controls:["background_repeat","background_position_x","background_attachment"],callback:function(h){return !!h}},show_on_front:{controls:["page_on_front","page_for_posts"],callback:function(h){return"page"===h}},header_textcolor:{controls:["header_t
 extcolor"],callback:function(h){return"blank"!==h}}},function(h,i){b(h,function(j){c.each(i.controls,function(k,l){b.control(l,function(n){var m=function(o){n.container.toggle(i.callback(o))};m(j.get());j.bind(m)})})})});b.control("display_header_text",function(i){var h="";i.elements[0].unsync(b("header_textcolor"));i.element=new b.Element(i.container.find("input"));i.element.set("blank"!==i.setting());i.element.bind(function(j){if(!j){h=b("header_textcolor").get()}i.setting.set(j?h:"blank")});i.setting.bind(function(j){i.element.set("blank"!==j)})});b.trigger("ready")})})(wp,jQuery);
\ No newline at end of file

Deleted: trunk/wp-includes/css/customize-controls.css (20959 => 20960)


--- trunk/wp-includes/css/customize-controls.css	2012-05-30 19:12:45 UTC (rev 20959)
+++ trunk/wp-includes/css/customize-controls.css	2012-05-30 20:11:04 UTC (rev 20960)
@@ -1 +0,0 @@
-body{overflow:hidden}#customize-controls a{text-decoration:none}.customize-section{border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;margin:0}.customize-section:last-child{box-shadow:0 1px 0 0 #fff}.customize-section-title{margin:0;padding:15px 20px;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cannot-expand .customize-section-title{cursor:auto}.customize-section-content{display:none;padding:10px 20px 15px;overflow:hidden}.control-section .customize-section-title{padding:10px 20px;font-size:15px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-weight:normal;text-shadow:0 1px 0 #fff;background-color:#f5f5f5;background-image:-webkit-linear-gradient(top,#f5f5f5,#eee);background-image:-moz-linear-gradient(top,#f5f5f5,#eee);background-image:-ms-linear-gradient(top,#f5f5f5,#eee);background-image:-o-linear-gradient(top,#f5f5f5,#eee);background-image:linear-gradient(
 top,#f5f5f5,#eee)}.control-section .customize-section-title:hover{color:#222;background-color:#f9f9f9;background-image:-webkit-linear-gradient(top,#f9f9f9,#f1f1f1);background-image:-moz-linear-gradient(top,#f9f9f9,#f1f1f1);background-image:-ms-linear-gradient(top,#f9f9f9,#f1f1f1);background-image:-o-linear-gradient(top,#f9f9f9,#f1f1f1);background-image:linear-gradient(top,#f9f9f9,#f1f1f1)}.control-section.open .customize-section-title{border-bottom:1px solid #e5e5e5}.control-section.open .customize-section-title:hover{border-bottom:1px solid #dfdfdf}.customize-section.open .customize-section-content{display:block}.customize-section-title:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:6px 6px 0;position:absolute;top:25px;right:20px;z-index:1}.cannot-expand .customize-section-title:after{display:none}.customize-section.open .customize-section-title:after{margin-top:-1px;border-width:0 6px 6px}.customize-section-title:hover:after
 {border-color:#aaa transparent}.control-section .customize-section-title:after{top:15px}#customize-info .preview-notice{font-size:13px;line-height:24px;color:#999}#customize-info .theme-name{font-size:20px;font-weight:200;line-height:24px;color:#333;display:block;text-shadow:0 1px 0 #fff}#customize-info .theme-screenshot{width:258px;border:1px solid #ccc}#customize-info .theme-description{margin-top:1em;color:#777;line-height:20px}#customize-controls .submit{text-align:center}#customize-theme-controls>ul,#customize-theme-controls .customize-section-content{margin:0}#customize-header-actions .button-primary{float:right;margin-top:11px}#customize-header-actions img{display:none;float:right;margin-top:13px;margin-right:4px}.saving #customize-header-actions img{display:block}.customize-control{width:100%;float:left;clear:both;margin-bottom:8px}.customize-control-title{display:block;line-height:24px;font-weight:bold}.customize-control select,.customize-control input[type="
 ;text"],.customize-control input[type="radio"],.customize-control input[type="checkbox"],.customize-control-color .color-picker,.customize-control-checkbox label,.customize-control-upload div{line-height:28px}.customize-control input[type="text"]{width:98%;line-height:18px;margin:0}.customize-control select{min-width:50%;max-width:100%;height:28px;line-height:28px}.customize-control-checkbox input{margin-right:5px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:22px}.customize-control-radio label{line-height:20px}.customize-control-radio input{margin-right:5px}#customize-preview iframe{width:100%;height:100%}.customize-section .dropdown{float:left;display:block;position:relative;cursor:pointer;-webkit-border-radius:3px;border-radius:3px}.customize-section .dropdown-content{overflow:hidden;float:left;min-width:30px;height:16px;line-height:16px;margin-right:16px;padding
 :4px 5px;background-color:#eee;border:1px solid #ccc;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;right:0;width:15px;border-color:#ccc;border-style:solid;border-width:1px 1px 1px 0;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:4px 4px 0 4px;position:absolute;top:50%;margin-top:-1px;right:4px;z-index:1}.customize-control.open .dropdown-arrow:after{border-width:0 4px 4px 4px;margin-top:-2px}.customize-section .dropdown:hover .dropdown-content,.customize-control .dropdown:hover .dropdown-arrow{border-color:#aaa}.customize-section .dropdown:hover .dropdown-arrow:after{border-color:#aaa transparent}.customize-control .dropdown-status{display:none;max-width:112px;color:#999}.customize-control-c
 olor .color-picker-hex,.customize-control-color .farbtastic-placeholder{display:none}.customize-control-color.open .color-picker-hex,.customize-control-color.open .farbtastic-placeholder{display:block}.customize-control-color .dropdown{margin-right:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#fff;border:1px solid rgba(0,0,0,0.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,0.25)}.customize-section input[type="text"].color-picker-hex{float:left;width:85px;font-family:monospace;text-align:center}.customize-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder{color:transparent}.customize-section input[type="text"].color-picker-hex:-moz-placeholder{color:#999}.customize-control-color .farbtastic-placeholder{width:100%;margin:5px 0 10px;float:left}.customize-control-color .farbtastic{margin:0 auto}.customize-control-image .library,.customize
 -control-image .actions{display:none;float:left;width:100%}.customize-control-image.open .library,.customize-control-image.open .actions{display:block}.customize-section .customize-control-image .dropdown-content{height:auto;min-height:24px;min-width:40px;padding:0}.customize-section .customize-control-image .dropdown-status{padding:4px 5px}.customize-section .customize-control-image .preview-thumbnail img{display:block;width:100%;max-width:122px;max-height:98px;margin:0 auto}.customize-section .customize-control-image .actions{text-align:right}.customize-section .customize-control-image .actions a{display:block}.customize-section .customize-control-image .library ul{border-bottom:1px solid #dfdfdf;float:left;width:100%;margin:10px 0 0}.customize-section .customize-control-image .library li{color:#999;float:left;padding:3px 5px;margin:0;border-style:solid;border-color:transparent;border-width:1px 1px 0 1px}.customize-section .customize-control-image .library li.library-selec
 ted{margin-bottom:-1px;padding-bottom:4px;color:#777;background:#f5f5f5;border-color:#dfdfdf;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.customize-section .customize-control-image .library-content{display:none;width:100%;float:left;padding:10px 0}.customize-section .customize-control-image .library-content.library-selected{display:block}.customize-section .customize-control-image .library .thumbnail{display:block;width:100%}.customize-section .customize-control-image .library .thumbnail:hover img{border-color:#21759b}.customize-section .customize-control-image .library .thumbnail img{display:block;max-width:220px;max-height:80px;margin:5px auto;padding:4px;background:#fff;border:1px solid #dfdfdf}.customize-section .customize-control-upload .upload-fallback,.customize-section .customize-control-image .upload-fallback{display:none}.customize-section .customize-control-upload .upload-dropzone,.customize-section .customize-control-image .upload-dropzone{display
 :none;padding:15px 10px;border:3px dashed #dfdfdf;margin:5px auto;text-align:center;color:#777;position:relative}.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,.customize-section .customize-control-image .upload-dropzone.supports-drag-drop{display:block;-webkit-transition:border-color .1s;-moz-transition:border-color .1s;-ms-transition:border-color .1s;-o-transition:border-color .1s;transition:border-color .1s}.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over{border-color:#83b4d8}
\ No newline at end of file

Deleted: trunk/wp-includes/css/customize-controls.dev.css (20959 => 20960)


--- trunk/wp-includes/css/customize-controls.dev.css	2012-05-30 19:12:45 UTC (rev 20959)
+++ trunk/wp-includes/css/customize-controls.dev.css	2012-05-30 20:11:04 UTC (rev 20960)
@@ -1,486 +0,0 @@
-body {
-	overflow: hidden;
-}
-
-#customize-controls a {
-	text-decoration: none;
-}
-
-.customize-section {
-	border-top: 1px solid #fff;
-	border-bottom: 1px solid #dfdfdf;
-	margin: 0;
-}
-
-.customize-section:last-child {
-	box-shadow: 0 1px 0 0px #fff;
-}
-
-.customize-section-title {
-	margin: 0;
-	padding: 15px 20px;
-	position: relative;
-
-	cursor: pointer;
-
-	-webkit-user-select: none;
-	-moz-user-select: none;
-	user-select: none;
-}
-
-.cannot-expand .customize-section-title {
-	cursor: auto;
-}
-
-.customize-section-content {
-	display: none;
-	padding: 10px 20px 15px;
-	overflow: hidden;
-}
-
-.control-section .customize-section-title {
-	padding: 10px 20px;
-	font-size: 15px;
-	font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
-	font-weight: normal;
-	text-shadow: 0 1px 0 #fff;
-
-	background-color: #f5f5f5;
-	background-image: -webkit-linear-gradient( top, #f5f5f5, #eee );
-	background-image:    -moz-linear-gradient( top, #f5f5f5, #eee );
-	background-image:     -ms-linear-gradient( top, #f5f5f5, #eee );
-	background-image:      -o-linear-gradient( top, #f5f5f5, #eee );
-	background-image:         linear-gradient( top, #f5f5f5, #eee );
-}
-
-.control-section .customize-section-title:hover {
-	color: #222;
-	background-color: #f9f9f9;
-	background-image: -webkit-linear-gradient( top, #f9f9f9, #f1f1f1 );
-	background-image:    -moz-linear-gradient( top, #f9f9f9, #f1f1f1 );
-	background-image:     -ms-linear-gradient( top, #f9f9f9, #f1f1f1 );
-	background-image:      -o-linear-gradient( top, #f9f9f9, #f1f1f1 );
-	background-image:         linear-gradient( top, #f9f9f9, #f1f1f1 );
-}
-
-.control-section.open .customize-section-title {
-	border-bottom: 1px solid #e5e5e5;
-}
-
-.control-section.open .customize-section-title:hover {
-	border-bottom: 1px solid #dfdfdf;
-}
-
-.customize-section.open .customize-section-content {
-	display: block;
-}
-
-.customize-section-title:after {
-	content: '';
-	width: 0;
-	height: 0;
-	border-color: #ccc transparent;
-	border-style: solid;
-	border-width: 6px 6px 0;
-	position: absolute;
-	top: 25px;
-	right: 20px;
-	z-index: 1;
-}
-
-.cannot-expand .customize-section-title:after {
-	display: none;
-}
-
-.customize-section.open .customize-section-title:after {
-	margin-top: -1px;
-	border-width: 0 6px 6px;
-}
-
-.customize-section-title:hover:after {
-	border-color: #aaa transparent;
-}
-
-.control-section .customize-section-title:after {
-	top: 15px;
-}
-
-#customize-info .preview-notice {
-	font-size: 13px;
-	line-height: 24px;
-	color: #999;
-}
-
-#customize-info .theme-name {
-	font-size: 20px;
-	font-weight: 200;
-	line-height: 24px;
-	color: #333;
-	display: block;
-	text-shadow: 0 1px 0 #fff;
-}
-
-#customize-info .theme-screenshot {
-	width: 258px;
-	border: 1px solid #ccc;
-}
-
-#customize-info .theme-description {
-	margin-top: 1em;
-	color: #777;
-	line-height: 20px;
-}
-
-#customize-controls .submit {
-	text-align: center;
-}
-
-#customize-theme-controls > ul,
-#customize-theme-controls .customize-section-content {
-	margin: 0;
-}
-
-#customize-header-actions .button-primary {
-	float: right;
-	margin-top: 11px;
-}
-
-#customize-header-actions img {
-	display: none;
-	float: right;
-	margin-top: 13px;
-	margin-right: 4px;
-}
-
-.saving #customize-header-actions img {
-	display: block;
-}
-
-.customize-control {
-	width: 100%;
-	float: left;
-	clear: both;
-	margin-bottom: 8px;
-}
-
-.customize-control-title {
-	display: block;
-	line-height: 24px;
-	font-weight: bold;
-}
-
-.customize-control select,
-.customize-control input[type="text"],
-.customize-control input[type="radio"],
-.customize-control input[type="checkbox"],
-.customize-control-color .color-picker,
-.customize-control-checkbox label,
-.customize-control-upload div {
-	line-height: 28px;
-}
-
-.customize-control input[type="text"] {
-	width: 98%;
-	line-height: 18px;
-	margin: 0;
-}
-
-.customize-control select {
-	min-width: 50%;
-	max-width: 100%;
-	height: 28px;
-	line-height: 28px;
-}
-
-.customize-control-checkbox input {
-	margin-right: 5px;
-}
-
-.customize-control-radio {
-	padding: 5px 0 10px;
-}
-
-.customize-control-radio .customize-control-title {
-	margin-bottom: 0;
-	line-height: 22px;
-}
-
-.customize-control-radio label {
-	line-height: 20px;
-}
-
-.customize-control-radio input {
-	margin-right: 5px;
-}
-
-#customize-preview iframe {
-	width: 100%;
-	height: 100%;
-}
-
-/*
- * Style for custom settings
- */
-
-/*
- * Dropdowns
- */
-.customize-section .dropdown {
-	float: left;
-	display: block;
-	position: relative;
-	cursor: pointer;
-
-	-webkit-border-radius: 3px;
-	border-radius: 3px;
-}
-
-.customize-section .dropdown-content {
-	overflow: hidden;
-	float: left;
-	min-width: 30px;
-	height: 16px;
-	line-height: 16px;
-	margin-right: 16px;
-	padding: 4px 5px;
-	background-color: #eee;
-	border: 1px solid #ccc;
-	-webkit-border-radius: 3px 0 0 3px;
-	border-radius: 3px 0 0 3px;
-
-	-webkit-user-select: none;
-	-moz-user-select: none;
-	user-select: none;
-}
-
-.customize-control .dropdown-arrow {
-	position: absolute;
-	top: 0;
-	bottom: 0;
-	right: 0;
-	width: 15px;
-
-	border-color: #ccc;
-	border-style: solid;
-	border-width: 1px 1px 1px 0;
-	-webkit-border-radius: 0 3px 3px 0;
-	border-radius: 0 3px 3px 0;
-}
-
-.customize-control .dropdown-arrow:after {
-	content: '';
-	width: 0;
-	height: 0;
-	border-color: #ccc transparent;
-	border-style: solid;
-	border-width: 4px 4px 0 4px;
-	position: absolute;
-	top: 50%;
-	margin-top: -1px;
-	right: 4px;
-	z-index: 1;
-}
-
-.customize-control.open .dropdown-arrow:after {
-	border-width: 0 4px 4px 4px;
-	margin-top: -2px;
-}
-
-.customize-section .dropdown:hover .dropdown-content,
-.customize-control .dropdown:hover .dropdown-arrow {
-	border-color: #aaa;
-}
-
-.customize-section .dropdown:hover .dropdown-arrow:after {
-	border-color: #aaa transparent;
-}
-
-.customize-control .dropdown-status {
-	display: none;
-	max-width: 112px;
-	color: #999;
-}
-
-/*
- * Color Picker
- */
-.customize-control-color .color-picker-hex,
-.customize-control-color .farbtastic-placeholder {
-	display: none;
-}
-
-.customize-control-color.open .color-picker-hex,
-.customize-control-color.open .farbtastic-placeholder {
-	display: block;
-}
-
-.customize-control-color .dropdown {
-	margin-right: 5px;
-	margin-bottom: 5px;
-}
-
-.customize-control-color .dropdown .dropdown-content {
-	background-color: #fff;
-	border: 1px solid rgba( 0, 0, 0, 0.15 );
-}
-
-.customize-control-color .dropdown:hover .dropdown-content {
-	border-color: rgba( 0, 0, 0, 0.25 );
-}
-
-.customize-section input[type="text"].color-picker-hex {
-	float: left;
-	width: 85px;
-	font-family: monospace;
-	text-align: center;
-}
-
-/* The centered cursor overlaps the placeholder in webkit. Hide it when selected. */
-.customize-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder {
-	color: transparent;
-}
-.customize-section input[type="text"].color-picker-hex:-moz-placeholder {
-	color: #999;
-}
-
-.customize-control-color .farbtastic-placeholder {
-	width: 100%;
-	margin: 5px 0 10px;
-	float: left;
-}
-
-.customize-control-color .farbtastic {
-	margin: 0 auto;
-}
-
-/*
- * Image Picker
- */
-.customize-control-image .library,
-.customize-control-image .actions {
-	display: none;
-	float: left;
-	width: 100%;
-}
-
-.customize-control-image.open .library,
-.customize-control-image.open .actions {
-	display: block;
-}
-
-.customize-section .customize-control-image .dropdown-content {
-	height: auto;
-	min-height: 24px;
-	min-width: 40px;
-	padding: 0;
-}
-
-.customize-section .customize-control-image .dropdown-status {
-	padding: 4px 5px;
-}
-
-.customize-section .customize-control-image .preview-thumbnail img {
-	display: block;
-	width: 100%;
-	max-width: 122px;
-	max-height: 98px;
-	margin: 0 auto;
-}
-
-.customize-section .customize-control-image .actions {
-	text-align: right;
-}
-
-.customize-section .customize-control-image .actions a {
-	display: block;
-}
-
-.customize-section .customize-control-image .library ul {
-	border-bottom: 1px solid #dfdfdf;
-	float: left;
-	width: 100%;
-	margin: 10px 0 0;
-}
-
-.customize-section .customize-control-image .library li {
-	color: #999;
-	float: left;
-	padding: 3px 5px;
-	margin: 0;
-	border-style: solid;
-	border-color: transparent;
-	border-width: 1px 1px 0 1px;
-}
-
-.customize-section .customize-control-image .library li.library-selected {
-	margin-bottom: -1px;
-	padding-bottom: 4px;
-
-	color: #777;
-	background: #f5f5f5;
-	border-color: #dfdfdf;
-	-webkit-border-radius: 3px 3px 0 0;
-	border-radius: 3px 3px 0 0 ;
-}
-
-.customize-section .customize-control-image .library-content {
-	display: none;
-	width: 100%;
-	float: left;
-	padding: 10px 0;
-}
-
-.customize-section .customize-control-image .library-content.library-selected {
-	display: block;
-}
-
-.customize-section .customize-control-image .library .thumbnail {
-	display: block;
-	width: 100%;
-}
-
-.customize-section .customize-control-image .library .thumbnail:hover img {
-	border-color: #21759b;
-}
-
-.customize-section .customize-control-image .library .thumbnail img {
-	display: block;
-	max-width: 220px;
-	max-height: 80px;
-
-	margin: 5px auto;
-	padding: 4px;
-	background: #fff;
-	border: 1px solid #dfdfdf;
-}
-
-.customize-section .customize-control-upload .upload-fallback,
-.customize-section .customize-control-image .upload-fallback {
-	display: none;
-}
-
-.customize-section .customize-control-upload .upload-dropzone,
-.customize-section .customize-control-image .upload-dropzone {
-	display: none;
-	padding: 15px 10px;
-	border: 3px dashed #dfdfdf;
-	margin: 5px auto;
-	text-align: center;
-	color: #777;
-	position: relative;
-}
-
-.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,
-.customize-section .customize-control-image .upload-dropzone.supports-drag-drop {
-	display: block;
-	-webkit-transition: border-color 0.1s;
-	-moz-transition:    border-color 0.1s;
-	-ms-transition:     border-color 0.1s;
-	-o-transition:      border-color 0.1s;
-	transition:         border-color 0.1s;
-}
-
-.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,
-.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over {
-	border-color: #83b4d8;
-}
\ No newline at end of file

Deleted: trunk/wp-includes/js/customize-controls.dev.js (20959 => 20960)


--- trunk/wp-includes/js/customize-controls.dev.js	2012-05-30 19:12:45 UTC (rev 20959)
+++ trunk/wp-includes/js/customize-controls.dev.js	2012-05-30 20:11:04 UTC (rev 20960)
@@ -1,694 +0,0 @@
-(function( exports, $ ){
-	var api = wp.customize;
-
-	/*
-	 * @param options
-	 * - previewer - The Previewer instance to sync with.
-	 * - transport - The transport to use for previewing. Supports 'refresh' and 'postMessage'.
-	 */
-	api.Setting = api.Value.extend({
-		initialize: function( id, value, options ) {
-			var element;
-
-			api.Value.prototype.initialize.call( this, value, options );
-
-			this.id = id;
-			this.transport = this.transport || 'refresh';
-
-			this.bind( this.preview );
-		},
-		preview: function() {
-			switch ( this.transport ) {
-				case 'refresh':
-					return this.previewer.refresh();
-				case 'postMessage':
-					return this.previewer.send( 'setting', [ this.id, this() ] );
-			}
-		}
-	});
-
-	api.Control = api.Class.extend({
-		initialize: function( id, options ) {
-			var control = this,
-				nodes, radios, settings;
-
-			this.params = {};
-			$.extend( this, options || {} );
-
-			this.id = id;
-			this.selector = '#customize-control-' + id.replace( ']', '' ).replace( '[', '-' );
-			this.container = $( this.selector );
-
-			settings = $.map( this.params.settings, function( value ) {
-				return value;
-			});
-
-			api.apply( api, settings.concat( function() {
-				var key;
-
-				control.settings = {};
-				for ( key in control.params.settings ) {
-					control.settings[ key ] = api( control.params.settings[ key ] );
-				}
-
-				control.setting = control.settings['default'] || null;
-				control.ready();
-			}) );
-
-			control.elements = [];
-
-			nodes  = this.container.find('[data-customize-setting-link]');
-			radios = {};
-
-			nodes.each( function() {
-				var node = $(this),
-					name;
-
-				if ( node.is(':radio') ) {
-					name = node.prop('name');
-					if ( radios[ name ] )
-						return;
-
-					radios[ name ] = true;
-					node = nodes.filter( '[name="' + name + '"]' );
-				}
-
-				api( node.data('customizeSettingLink'), function( setting ) {
-					var element = new api.Element( node );
-					control.elements.push( element );
-					element.sync( setting );
-					element.set( setting() );
-				});
-			});
-		},
-
-		ready: function() {},
-
-		dropdownInit: function() {
-			var control  = this,
-				statuses = this.container.find('.dropdown-status'),
-				params   = this.params,
-				update   = function( to ) {
-					if ( typeof	to === 'string' && params.statuses && params.statuses[ to ] )
-						statuses.html( params.statuses[ to ] ).show();
-					else
-						statuses.hide();
-				};
-
-			// Support the .dropdown class to open/close complex elements
-			this.container.on( 'click', '.dropdown', function( event ) {
-				event.preventDefault();
-				control.container.toggleClass('open');
-			});
-
-			this.setting.bind( update );
-			update( this.setting() );
-		}
-	});
-
-	api.ColorControl = api.Control.extend({
-		ready: function() {
-			var control = this,
-				rhex, spot, input, text, update;
-
-			rhex   = /^#([A-Fa-f0-9]{3}){0,2}$/;
-			spot   = this.container.find('.dropdown-content');
-			input  = new api.Element( this.container.find('.color-picker-hex') );
-			update = function( color ) {
-				spot.css( 'background', color );
-				control.farbtastic.setColor( color );
-			};
-
-			this.farbtastic = $.farbtastic( this.container.find('.farbtastic-placeholder'), control.setting.set );
-
-			// Only pass through values that are valid hexes/empty.
-			input.link( this.setting ).validate = function( to ) {
-				return rhex.test( to ) ? to : null;
-			};
-
-			this.setting.bind( update );
-			update( this.setting() );
-
-			this.dropdownInit();
-		}
-	});
-
-	api.UploadControl = api.Control.extend({
-		ready: function() {
-			var control = this;
-
-			this.params.removed = this.params.removed || '';
-
-			this.success = $.proxy( this.success, this );
-
-			this.uploader = $.extend({
-				container: this.container,
-				browser:   this.container.find('.upload'),
-				dropzone:  this.container.find('.upload-dropzone'),
-				success:   this.success
-			}, this.uploader || {} );
-
-			this.uploader = new wp.Uploader( this.uploader );
-
-			this.remover = this.container.find('.remove');
-			this.remover.click( function( event ) {
-				control.setting.set( control.params.removed );
-				event.preventDefault();
-			});
-
-			this.removerVisibility = $.proxy( this.removerVisibility, this );
-			this.setting.bind( this.removerVisibility );
-			this.removerVisibility( this.setting.get() );
-
-			if ( this.params.context )
-				control.uploader.param( 'post_data[context]', this.params.context );
-
-			control.uploader.param( 'post_data[theme]', api.settings.theme.stylesheet );
-		},
-		success: function( attachment ) {
-			this.setting.set( attachment.url );
-		},
-		removerVisibility: function( to ) {
-			this.remover.toggle( to != this.params.removed );
-		}
-	});
-
-	api.ImageControl = api.UploadControl.extend({
-		ready: function() {
-			var control = this,
-				panels;
-
-			this.uploader = {
-				init: function( up ) {
-					var fallback, button;
-
-					if ( up.features.dragdrop )
-						return;
-
-					// Maintain references while wrapping the fallback button.
-					fallback = control.container.find( '.upload-fallback' );
-					button   = fallback.children().detach();
-
-					this.browser.detach().empty().append( button );
-					fallback.append( this.browser ).show();
-				}
-			};
-
-			api.UploadControl.prototype.ready.call( this );
-
-			this.thumbnail    = this.container.find('.preview-thumbnail img');
-			this.thumbnailSrc = $.proxy( this.thumbnailSrc, this );
-			this.setting.bind( this.thumbnailSrc );
-
-			this.library = this.container.find('.library');
-
-			// Generate tab objects
-			this.tabs = {};
-			panels    = this.library.find('.library-content');
-
-			this.library.children('ul').children('li').each( function() {
-				var link  = $(this),
-					id    = link.data('customizeTab'),
-					panel = panels.filter('[data-customize-tab="' + id + '"]');
-
-				control.tabs[ id ] = {
-					both:  link.add( panel ),
-					link:  link,
-					panel: panel
-				};
-			});
-
-			// Select a tab
-			this.selected = this.tabs[ panels.first().data('customizeTab') ];
-			this.selected.both.addClass('library-selected');
-
-			// Bind tab switch events
-			this.library.children('ul').on( 'click', 'li', function( event ) {
-				var id  = $(this).data('customizeTab'),
-					tab = control.tabs[ id ];
-
-				event.preventDefault();
-
-				if ( tab.link.hasClass('library-selected') )
-					return;
-
-				control.selected.both.removeClass('library-selected');
-				control.selected = tab;
-				control.selected.both.addClass('library-selected');
-			});
-
-			this.library.on( 'click', 'a', function( event ) {
-				var value = $(this).data('customizeImageValue');
-
-				if ( value ) {
-					control.setting.set( value );
-					event.preventDefault();
-				}
-			});
-
-			if ( this.tabs.uploaded ) {
-				this.tabs.uploaded.target = this.library.find('.uploaded-target');
-				if ( ! this.tabs.uploaded.panel.find('.thumbnail').length )
-					this.tabs.uploaded.both.addClass('hidden');
-			}
-
-			this.dropdownInit();
-		},
-		success: function( attachment ) {
-			api.UploadControl.prototype.success.call( this, attachment );
-
-			// Add the uploaded image to the uploaded tab.
-			if ( this.tabs.uploaded && this.tabs.uploaded.target.length ) {
-				this.tabs.uploaded.both.removeClass('hidden');
-
-				$( '<a href="#" class="thumbnail"></a>' )
-					.data( 'customizeImageValue', attachment.url )
-					.append( '<img src="' +  attachment.url+ '" />' )
-					.appendTo( this.tabs.uploaded.target );
-			}
-		},
-		thumbnailSrc: function( to ) {
-			if ( /^(https?:)?\/\//.test( to ) )
-				this.thumbnail.prop( 'src', to ).show();
-			else
-				this.thumbnail.hide();
-		}
-	});
-
-	// Change objects contained within the main customize object to Settings.
-	api.defaultConstructor = api.Setting;
-
-	// Create the collection of Control objects.
-	api.control = new api.Values({ defaultConstructor: api.Control });
-
-	api.Previewer = api.Messenger.extend({
-		refreshBuffer: 250,
-
-		/**
-		 * Requires params:
-		 *  - container - a selector or jQuery element
-		 *  - url       - the URL of preview frame
-		 */
-		initialize: function( params, options ) {
-			var self = this,
-				rscheme = /^https?/;
-
-			$.extend( this, options || {} );
-
-			this.loaded = $.proxy( this.loaded, this );
-
-			/*
-			 * Wrap this.refresh to prevent it from hammering the servers:
-			 *
-			 * If refresh is called once and no other refresh requests are
-			 * loading, trigger the request immediately.
-			 *
-			 * If refresh is called while another refresh request is loading,
-			 * debounce the refresh requests:
-			 * 1. Stop the loading request (as it is instantly outdated).
-			 * 2. Trigger the new request once refresh hasn't been called for
-			 *    self.refreshBuffer milliseconds.
-			 */
-			this.refresh = (function( self ) {
-				var refresh  = self.refresh,
-					callback = function() {
-						timeout = null;
-						refresh.call( self );
-					},
-					timeout;
-
-				return function() {
-					if ( typeof timeout !== 'number' ) {
-						if ( self.loading ) {
-							self.loading.remove();
-							delete self.loading;
-							self.loader();
-						} else {
-							return callback();
-						}
-					}
-
-					clearTimeout( timeout );
-					timeout = setTimeout( callback, self.refreshBuffer );
-				};
-			})( this );
-
-			this.container   = api.ensure( params.container );
-			this.allowedUrls = params.allowedUrls;
-
-			api.Messenger.prototype.initialize.call( this, params.url );
-
-			// We're dynamically generating the iframe, so the origin is set
-			// to the current window's location, not the url's.
-			this.origin.unlink( this.url ).set( window.location.href );
-
-			this.add( 'scheme', this.origin() ).link( this.origin ).setter( function( to ) {
-				var match = to.match( rscheme );
-				return match ? match[0] : '';
-			});
-
-			// Limit the URL to internal, front-end links.
-			//
-			// If the frontend and the admin are served from the same domain, load the
-			// preview over ssl if the customizer is being loaded over ssl. This avoids
-			// insecure content warnings. This is not attempted if the admin and frontend
-			// are on different domains to avoid the case where the frontend doesn't have
-			// ssl certs.
-
-			this.url.setter( function( to ) {
-				var result;
-
-				// Check for URLs that include "/wp-admin/" or end in "/wp-admin".
-				// Strip hashes and query strings before testing.
-				if ( /\/wp-admin(\/|$)/.test( to.replace(/[#?].*$/, '') ) )
-					return null;
-
-				// Attempt to match the URL to the control frame's scheme
-				// and check if it's allowed. If not, try the original URL.
-				$.each([ to.replace( rscheme, self.scheme() ), to ], function( i, url ) {
-					$.each( self.allowedUrls, function( i, allowed ) {
-						if ( 0 === url.indexOf( allowed ) ) {
-							result = url;
-							return false;
-						}
-					});
-					if ( result )
-						return false;
-				});
-
-				// If we found a matching result, return it. If not, bail.
-				return result ? result : null;
-			});
-
-			// Refresh the preview when the URL is changed.
-			this.url.bind( this.refresh );
-
-			this.scroll = 0;
-			this.bind( 'scroll', function( distance ) {
-				this.scroll = distance;
-			});
-
-			// Update the URL when the iframe sends a URL message.
-			this.bind( 'url', this.url );
-		},
-		loader: function() {
-			if ( this.loading )
-				return this.loading;
-
-			this.loading = $('<iframe />').appendTo( this.container );
-
-			return this.loading;
-		},
-		loaded: function() {
-			if ( this.iframe )
-				this.iframe.remove();
-
-			this.iframe = this.loading;
-			delete this.loading;
-
-			this.targetWindow( this.iframe[0].contentWindow );
-			this.send( 'scroll', this.scroll );
-		},
-		query: function() {},
-		refresh: function() {
-			var self = this;
-
-			if ( this.request )
-				this.request.abort();
-
-			this.request = $.ajax( this.url(), {
-				type: 'POST',
-				data: this.query() || {},
-				success: function( response ) {
-					var iframe = self.loader()[0].contentWindow,
-						location = self.request.getResponseHeader('Location'),
-						signature = 'WP_CUSTOMIZER_SIGNATURE',
-						index;
-
-					// Check if the location response header differs from the current URL.
-					// If so, the request was redirected; try loading the requested page.
-					if ( location && location != self.url() ) {
-						self.url( location );
-						return;
-					}
-
-					// Check for a signature in the request.
-					index = response.lastIndexOf( signature );
-					if ( -1 === index || index < response.lastIndexOf('</html>') )
-						return;
-
-					// Strip the signature from the request.
-					response = response.slice( 0, index ) + response.slice( index + signature.length );
-
-					self.loader().one( 'load', self.loaded );
-
-					iframe.document.open();
-					iframe.document.write( response );
-					iframe.document.close();
-				},
-				xhrFields: {
-					withCredentials: true
-				}
-			} );
-		}
-	});
-
-	/* =====================================================================
-	 * Ready.
-	 * ===================================================================== */
-
-	api.controlConstructor = {
-		color:  api.ColorControl,
-		upload: api.UploadControl,
-		image:  api.ImageControl
-	};
-
-	$( function() {
-		api.settings = window._wpCustomizeSettings;
-		api.l10n = window._wpCustomizeControlsL10n;
-
-		// Check if we can run the customizer.
-		if ( ! api.settings )
-			return;
-
-		// Redirect to the fallback preview if any incompatibilities are found.
-		if ( ! $.support.postMessage || ( ! $.support.cors && api.settings.isCrossDomain ) )
-			return window.location = api.settings.url.fallback;
-
-		var body = $( document.body ),
-			query, previewer, parent;
-
-		// Prevent the form from saving when enter is pressed.
-		$('#customize-controls').on( 'keydown', function( e ) {
-			if ( 13 === e.which ) // Enter
-				e.preventDefault();
-		});
-
-		// Initialize Previewer
-		previewer = new api.Previewer({
-			container:   '#customize-preview',
-			form:        '#customize-controls',
-			url:         api.settings.url.preview,
-			allowedUrls: api.settings.url.allowed
-		}, {
-			query: function() {
-				return {
-					customize:  'on',
-					theme:      api.settings.theme.stylesheet,
-					customized: JSON.stringify( api.get() )
-				};
-			},
-
-			nonce: $('#_wpnonce').val(),
-
-			save: function() {
-				var query = $.extend( this.query(), {
-						action: 'customize_save',
-						nonce:  this.nonce
-					}),
-					request = $.post( api.settings.url.ajax, query );
-
-				api.trigger( 'save', request );
-
-				body.addClass('saving');
-
-				request.always( function() {
-					body.removeClass('saving');
-				});
-
-				request.done( function() {
-					api.trigger( 'saved' );
-				});
-			}
-		});
-
-		$.each( api.settings.settings, function( id, data ) {
-			api.create( id, id, data.value, {
-				transport: data.transport,
-				previewer: previewer
-			} );
-		});
-
-		$.each( api.settings.controls, function( id, data ) {
-			var constructor = api.controlConstructor[ data.type ] || api.Control,
-				control;
-
-			control = api.control.add( id, new constructor( id, {
-				params: data,
-				previewer: previewer
-			} ) );
-		});
-
-		// Load the preview frame.
-		previewer.refresh();
-
-		// Save and activated states
-		(function() {
-			var state = new api.Values(),
-				saved = state.create('saved'),
-				activated = state.create('activated');
-
-			state.bind( 'change', function() {
-				var save = $('#save'),
-					back = $('.back');
-
-				if ( ! activated() ) {
-					save.val( api.l10n.activate ).prop( 'disabled', false );
-					back.text( api.l10n.cancel );
-
-				} else if ( saved() ) {
-					save.val( api.l10n.saved ).prop( 'disabled', true );
-					back.text( api.l10n.close );
-
-				} else {
-					save.val( api.l10n.save ).prop( 'disabled', false );
-					back.text( api.l10n.cancel );
-				}
-			});
-
-			// Set default states.
-			saved( true );
-			activated( api.settings.theme.active );
-
-			api.bind( 'change', function() {
-				state('saved').set( false );
-			});
-
-			api.bind( 'saved', function() {
-				state('saved').set( true );
-				state('activated').set( true );
-			});
-
-			activated.bind( function( to ) {
-				if ( to )
-					api.trigger( 'activated' );
-			});
-
-			// Expose states to the API.
-			api.state = state;
-		}());
-
-		api.bind( 'activated', function() {
-			if ( api.settings.url.activated )
-				window.location = api.settings.url.activated;
-		});
-
-		// Temporary accordion code.
-		$('.customize-section-title').click( function( event ) {
-			var clicked = $( this ).parents( '.customize-section' );
-
-			if ( clicked.hasClass('cannot-expand') )
-				return;
-
-			$( '.customize-section' ).not( clicked ).removeClass( 'open' );
-			clicked.toggleClass( 'open' );
-			event.preventDefault();
-		});
-
-		// Button bindings.
-		$('#save').click( function( event ) {
-			previewer.save();
-			event.preventDefault();
-		});
-
-		$('.collapse-sidebar').click( function( event ) {
-			body.toggleClass( 'collapsed' );
-			event.preventDefault();
-		});
-
-		// Create a potential postMessage connection with the parent frame.
-		parent = new api.Messenger( api.settings.url.parent );
-
-		// If we receive a 'back' event, we're inside an iframe.
-		// Send any clicks to the 'Return' link to the parent page.
-		parent.bind( 'back', function() {
-			$('.back').on( 'click.back', function( event ) {
-				event.preventDefault();
-				parent.send( 'close' );
-			});
-		});
-
-		// Pass events through to the parent.
-		$.each([ 'saved', 'activated' ], function( i, id ) {
-			api.bind( id, function() {
-				parent.send( id );
-			});
-		});
-
-		// Initialize the connection with the parent frame.
-		parent.send( 'ready' );
-
-		// Control visibility for default controls
-		$.each({
-			'background_image': {
-				controls: [ 'background_repeat', 'background_position_x', 'background_attachment' ],
-				callback: function( to ) { return !! to }
-			},
-			'show_on_front': {
-				controls: [ 'page_on_front', 'page_for_posts' ],
-				callback: function( to ) { return 'page' === to }
-			},
-			'header_textcolor': {
-				controls: [ 'header_textcolor' ],
-				callback: function( to ) { return 'blank' !== to }
-			}
-		}, function( settingId, o ) {
-			api( settingId, function( setting ) {
-				$.each( o.controls, function( i, controlId ) {
-					api.control( controlId, function( control ) {
-						var visibility = function( to ) {
-							control.container.toggle( o.callback( to ) );
-						};
-
-						visibility( setting.get() );
-						setting.bind( visibility );
-					});
-				});
-			});
-		});
-
-		// Juggle the two controls that use header_textcolor
-		api.control( 'display_header_text', function( control ) {
-			var last = '';
-
-			control.elements[0].unsync( api( 'header_textcolor' ) );
-
-			control.element = new api.Element( control.container.find('input') );
-			control.element.set( 'blank' !== control.setting() );
-
-			control.element.bind( function( to ) {
-				if ( ! to )
-					last = api( 'header_textcolor' ).get();
-
-				control.setting.set( to ? last : 'blank' );
-			});
-
-			control.setting.bind( function( to ) {
-				control.element.set( 'blank' !== to );
-			});
-		});
-
-		api.trigger( 'ready' );
-	});
-
-})( wp, jQuery );
\ No newline at end of file

Deleted: trunk/wp-includes/js/customize-controls.js (20959 => 20960)


--- trunk/wp-includes/js/customize-controls.js	2012-05-30 19:12:45 UTC (rev 20959)
+++ trunk/wp-includes/js/customize-controls.js	2012-05-30 20:11:04 UTC (rev 20960)
@@ -1 +0,0 @@
-(function(a,c){var b=wp.customize;b.Setting=b.Value.extend({initialize:function(g,f,d){var e;b.Value.prototype.initialize.call(this,f,d);this.id=g;this.transport=this.transport||"refresh";this.bind(this.preview)},preview:function(){switch(this.transport){case"refresh":return this.previewer.refresh();case"postMessage":return this.previewer.send("setting",[this.id,this()])}}});b.Control=b.Class.extend({initialize:function(i,e){var g=this,d,h,f;this.params={};c.extend(this,e||{});this.id=i;this.selector="#customize-control-"+i.replace("]","").replace("[","-");this.container=c(this.selector);f=c.map(this.params.settings,function(j){return j});b.apply(b,f.concat(function(){var j;g.settings={};for(j in g.params.settings){g.settings[j]=b(g.params.settings[j])}g.setting=g.settings["default"]||null;g.ready()}));g.elements=[];d=this.container.find("[data-customize-setti
 ng-link]");h={};d.each(function(){var k=c(this),j;if(k.is(":radio")){j=k.prop("name");if(h[j]){return}h[j]=true;k=d.filter('[name="'+j+'"]')}b(k.data("customizeSettingLink"),function(m){var l=new b.Element(k);g.elements.push(l);l.sync(m);l.set(m())})})},ready:function(){},dropdownInit:function(){var e=this,d=this.container.find(".dropdown-status"),f=this.params,g=function(h){if(typeof h==="string"&&f.statuses&&f.statuses[h]){d.html(f.statuses[h]).show()}else{d.hide()}};this.container.on("click",".dropdown",function(h){h.preventDefault();e.container.toggleClass("open")});this.setting.bind(g);g(this.setting())}});b.ColorControl=b.Control.extend({ready:function(){var g=this,f,e,d,h,i;f=/^#([A-Fa-f0-9]{3}){0,2}$/;e=this.container.find(".dropdown-content");d=new b.Element(this.container.find(".color-picker-hex"));i=function(j){e.css("background&q
 uot;,j);g.farbtastic.setColor(j)};this.farbtastic=c.farbtastic(this.container.find(".farbtastic-placeholder"),g.setting.set);d.link(this.setting).validate=function(j){return f.test(j)?j:null};this.setting.bind(i);i(this.setting());this.dropdownInit()}});b.UploadControl=b.Control.extend({ready:function(){var d=this;this.params.removed=this.params.removed||"";this.success=c.proxy(this.success,this);this.uploader=c.extend({container:this.container,browser:this.container.find(".upload"),dropzone:this.container.find(".upload-dropzone"),success:this.success},this.uploader||{});this.uploader=new wp.Uploader(this.uploader);this.remover=this.container.find(".remove");this.remover.click(function(e){d.setting.set(d.params.removed);e.preventDefault()});this.removerVisibility=c.proxy(this.removerVisibility,this);this.setting.bind(this.removerVisibility);this.removerVisibility(this.setting.get());if(this.params.context){d.uploader.param(&q
 uot;post_data[context]",this.params.context)}d.uploader.param("post_data[theme]",b.settings.theme.stylesheet)},success:function(d){this.setting.set(d.url)},removerVisibility:function(d){this.remover.toggle(d!=this.params.removed)}});b.ImageControl=b.UploadControl.extend({ready:function(){var e=this,d;this.uploader={init:function(f){var h,g;if(f.features.dragdrop){return}h=e.container.find(".upload-fallback");g=h.children().detach();this.browser.detach().empty().append(g);h.append(this.browser).show()}};b.UploadControl.prototype.ready.call(this);this.thumbnail=this.container.find(".preview-thumbnail img");this.thumbnailSrc=c.proxy(this.thumbnailSrc,this);this.setting.bind(this.thumbnailSrc);this.library=this.container.find(".library");this.tabs={};d=this.library.find(".library-content");this.library.children("ul").children("li").each(function(){var g=c(this),h=g.data("customizeTab"),f=d.filte
 r('[data-customize-tab="'+h+'"]');e.tabs[h]={both:g.add(f),link:g,panel:f}});this.selected=this.tabs[d.first().data("customizeTab")];this.selected.both.addClass("library-selected");this.library.children("ul").on("click","li",function(g){var h=c(this).data("customizeTab"),f=e.tabs[h];g.preventDefault();if(f.link.hasClass("library-selected")){return}e.selected.both.removeClass("library-selected");e.selected=f;e.selected.both.addClass("library-selected")});this.library.on("click","a",function(f){var g=c(this).data("customizeImageValue");if(g){e.setting.set(g);f.preventDefault()}});if(this.tabs.uploaded){this.tabs.uploaded.target=this.library.find(".uploaded-target");if(!this.tabs.uploaded.panel.find(".thumbnail").length){this.tabs.uploaded.both.addClass("hidden")}}this.dropdownInit()},success:function(d){b.UploadControl.
 prototype.success.call(this,d);if(this.tabs.uploaded&&this.tabs.uploaded.target.length){this.tabs.uploaded.both.removeClass("hidden");c('<a href="#" class="thumbnail"></a>').data("customizeImageValue",d.url).append('<img src="'+d.url+'" />').appendTo(this.tabs.uploaded.target)}},thumbnailSrc:function(d){if(/^(https?:)?\/\//.test(d)){this.thumbnail.prop("src",d).show()}else{this.thumbnail.hide()}}});b.defaultConstructor=b.Setting;b.control=new b.Values({defaultConstructor:b.Control});b.Previewer=b.Messenger.extend({refreshBuffer:250,initialize:function(g,e){var d=this,f=/^https?/;c.extend(this,e||{});this.loaded=c.proxy(this.loaded,this);this.refresh=(function(h){var i=h.refresh,k=function(){j=null;i.call(h)},j;return function(){if(typeof j!=="number"){if(h.loading){h.loading.remove();delete h.loading;h.loader()}else{return k()}}clearTimeout(j);j=setTimeout(k,h.refreshBuffer)}})(th
 is);this.container=b.ensure(g.container);this.allowedUrls=g.allowedUrls;b.Messenger.prototype.initialize.call(this,g.url);this.origin.unlink(this.url).set(window.location.href);this.add("scheme",this.origin()).link(this.origin).setter(function(i){var h=i.match(f);return h?h[0]:""});this.url.setter(function(i){var h;if(/\/wp-admin(\/|$)/.test(i.replace(/[#?].*$/,""))){return null}c.each([i.replace(f,d.scheme()),i],function(k,j){c.each(d.allowedUrls,function(l,m){if(0===j.indexOf(m)){h=j;return false}});if(h){return false}});return h?h:null});this.url.bind(this.refresh);this.scroll=0;this.bind("scroll",function(h){this.scroll=h});this.bind("url",this.url)},loader:function(){if(this.loading){return this.loading}this.loading=c("<iframe />").appendTo(this.container);return this.loading},loaded:function(){if(this.iframe){this.iframe.remove()}this.iframe=this.loading;delete this.loading;this.targetWindow(this.iframe[
 0].contentWindow);this.send("scroll",this.scroll)},query:function(){},refresh:function(){var d=this;if(this.request){this.request.abort()}this.request=c.ajax(this.url(),{type:"POST",data:this.query()||{},success:function(g){var i=d.loader()[0].contentWindow,f=d.request.getResponseHeader("Location"),e="WP_CUSTOMIZER_SIGNATURE",h;if(f&&f!=d.url()){d.url(f);return}h=g.lastIndexOf(e);if(-1===h||h<g.lastIndexOf("</html>")){return}g=g.slice(0,h)+g.slice(h+e.length);d.loader().one("load",d.loaded);i.document.open();i.document.write(g);i.document.close()},xhrFields:{withCredentials:true}})}});b.controlConstructor={color:b.ColorControl,upload:b.UploadControl,image:b.ImageControl};c(function(){b.settings=window._wpCustomizeSettings;b.l10n=window._wpCustomizeControlsL10n;if(!b.settings){return}if(!c.support.postMessage||(!c.support.cors&&b.settings.isCrossDomain)){return window.location=b.settings.url.
 fallback}var d=c(document.body),f,g,e;c("#customize-controls").on("keydown",function(h){if(13===h.which){h.preventDefault()}});g=new b.Previewer({container:"#customize-preview",form:"#customize-controls",url:b.settings.url.preview,allowedUrls:b.settings.url.allowed},{query:function(){return{customize:"on",theme:b.settings.theme.stylesheet,customized:JSON.stringify(b.get())}},nonce:c("#_wpnonce").val(),save:function(){var i=c.extend(this.query(),{action:"customize_save",nonce:this.nonce}),h=c.post(b.settings.url.ajax,i);b.trigger("save",h);d.addClass("saving");h.always(function(){d.removeClass("saving")});h.done(function(){b.trigger("saved")})}});c.each(b.settings.settings,function(i,h){b.create(i,i,h.value,{transport:h.transport,previewer:g})});c.each(b.settings.controls,function(k,i){var h=b.controlConstructor[i.type]||b.Control,j;j=b.control.add(k,new h(k,{params:i
 ,previewer:g}))});g.refresh();(function(){var j=new b.Values(),i=j.create("saved"),h=j.create("activated");j.bind("change",function(){var l=c("#save"),k=c(".back");if(!h()){l.val(b.l10n.activate).prop("disabled",false);k.text(b.l10n.cancel)}else{if(i()){l.val(b.l10n.saved).prop("disabled",true);k.text(b.l10n.close)}else{l.val(b.l10n.save).prop("disabled",false);k.text(b.l10n.cancel)}}});i(true);h(b.settings.theme.active);b.bind("change",function(){j("saved").set(false)});b.bind("saved",function(){j("saved").set(true);j("activated").set(true)});h.bind(function(k){if(k){b.trigger("activated")}});b.state=j}());b.bind("activated",function(){if(b.settings.url.activated){window.location=b.settings.url.activated}});c(".customize-section-title").click(function(i){var h=c(this).parents(".customize-section");if(h.hasC
 lass("cannot-expand")){return}c(".customize-section").not(h).removeClass("open");h.toggleClass("open");i.preventDefault()});c("#save").click(function(h){g.save();h.preventDefault()});c(".collapse-sidebar").click(function(h){d.toggleClass("collapsed");h.preventDefault()});e=new b.Messenger(b.settings.url.parent);e.bind("back",function(){c(".back").on("click.back",function(h){h.preventDefault();e.send("close")})});c.each(["saved","activated"],function(h,j){b.bind(j,function(){e.send(j)})});e.send("ready");c.each({background_image:{controls:["background_repeat","background_position_x","background_attachment"],callback:function(h){return !!h}},show_on_front:{controls:["page_on_front","page_for_posts"],callback:function(h){return"page"===h}},header_textcolor:{controls:["header_t
 extcolor"],callback:function(h){return"blank"!==h}}},function(h,i){b(h,function(j){c.each(i.controls,function(k,l){b.control(l,function(n){var m=function(o){n.container.toggle(i.callback(o))};m(j.get());j.bind(m)})})})});b.control("display_header_text",function(i){var h="";i.elements[0].unsync(b("header_textcolor"));i.element=new b.Element(i.container.find("input"));i.element.set("blank"!==i.setting());i.element.bind(function(j){if(!j){h=b("header_textcolor").get()}i.setting.set(j?h:"blank")});i.setting.bind(function(j){i.element.set("blank"!==j)})});b.trigger("ready")})})(wp,jQuery);
\ No newline at end of file

Modified: trunk/wp-includes/script-loader.php (20959 => 20960)


--- trunk/wp-includes/script-loader.php	2012-05-30 19:12:45 UTC (rev 20959)
+++ trunk/wp-includes/script-loader.php	2012-05-30 20:11:04 UTC (rev 20960)
@@ -300,7 +300,7 @@
 	$scripts->add( 'customize-base',     "/wp-includes/js/customize-base$suffix.js",     array( 'jquery', 'json2' ), false, 1 );
 	$scripts->add( 'customize-loader',   "/wp-includes/js/customize-loader$suffix.js",   array( 'customize-base' ), false, 1 );
 	$scripts->add( 'customize-preview',  "/wp-includes/js/customize-preview$suffix.js",  array( 'customize-base' ), false, 1 );
-	$scripts->add( 'customize-controls', "/wp-includes/js/customize-controls$suffix.js", array( 'customize-base' ), false, 1 );
+	$scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base' ), false, 1 );
 	$scripts->localize( 'customize-controls', '_wpCustomizeControlsL10n', array(
 		'activate'  => __( 'Save &amp; Activate' ),
 		'save'      => __( 'Save &amp; Publish' ),
@@ -486,7 +486,7 @@
 	$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css" );
 	$styles->add( 'editor-buttons', "/wp-includes/css/editor$suffix.css" );
 	$styles->add( 'wp-pointer', "/wp-includes/css/wp-pointer$suffix.css" );
-	$styles->add( 'customize-controls', "/wp-includes/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie' ) );
+	$styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie' ) );
 
 	foreach ( $rtl_styles as $rtl_style ) {
 		$styles->add_data( $rtl_style, 'rtl', true );