From fcb00b75e2ce941c84d0495d307aa4ad7a941e0a Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Mon, 15 Dec 2014 23:28:23 +0000 Subject: [PATCH] Customizer: Add `_wp_attachment_is_custom_background` meta to uploaded background images. Adds `$type` property to `WP_Customize_Background_Image_Control` (PHP) and introduces `wp.customize.BackgroundControl` (JS). see #30707. Built from https://develop.svn.wordpress.org/trunk@30885 git-svn-id: http://core.svn.wordpress.org/trunk@30873 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/css/customize-controls-rtl.css | 15 ++++++++ wp-admin/css/customize-controls-rtl.min.css | 2 +- wp-admin/css/customize-controls.css | 15 ++++++++ wp-admin/css/customize-controls.min.css | 2 +- wp-admin/custom-background.php | 38 ++++++++++++++++++-- wp-admin/js/customize-controls.js | 39 +++++++++++++++++++-- wp-admin/js/customize-controls.min.js | 2 +- wp-includes/class-wp-customize-control.php | 17 ++++++++- wp-includes/class-wp-customize-manager.php | 1 + 9 files changed, 123 insertions(+), 8 deletions(-) diff --git a/wp-admin/css/customize-controls-rtl.css b/wp-admin/css/customize-controls-rtl.css index 3340f4bf28..10861ce74d 100644 --- a/wp-admin/css/customize-controls-rtl.css +++ b/wp-admin/css/customize-controls-rtl.css @@ -581,6 +581,7 @@ p.customize-section-description { .customize-control-upload .current, .customize-control-image .current, +.customize-control-background .current, .customize-control-header .current { margin-bottom: 8px; } @@ -610,6 +611,9 @@ p.customize-section-description { .customize-control-image .remove-button, .customize-control-image .default-button, .customize-control-image .upload-button, +.customize-control-background .remove-button, +.customize-control-background .default-button, +.customize-control-background .upload-button, .customize-control-header button.new, .customize-control-header button.remove { white-space: normal; @@ -619,6 +623,7 @@ p.customize-section-description { .customize-control-upload .current .container, .customize-control-image .current .container, +.customize-control-background .current .container, .customize-control-header .current .container { overflow: hidden; -webkit-border-radius: 2px; @@ -628,12 +633,14 @@ p.customize-section-description { } .customize-control-upload .current .container, +.customize-control-background .current .container, .customize-control-image .current .container { min-height: 40px; } .customize-control-upload .placeholder, .customize-control-image .placeholder, +.customize-control-background .placeholder, .customize-control-header .placeholder { width: 100%; position: relative; @@ -643,6 +650,7 @@ p.customize-section-description { .customize-control-upload .inner, .customize-control-image .inner, +.customize-control-background .inner, .customize-control-header .inner { display: none; position: absolute; @@ -654,6 +662,7 @@ p.customize-section-description { } .customize-control-upload .inner, +.customize-control-background .inner, .customize-control-image .inner { display: block; min-height: 40px; @@ -661,6 +670,7 @@ p.customize-section-description { .customize-control-upload .inner, .customize-control-image .inner, +.customize-control-background .inner, .customize-control-header .inner, .customize-control-header .inner .dashicons { line-height: 20px; @@ -777,6 +787,7 @@ p.customize-section-description { .customize-control-upload .actions, .customize-control-image .actions, +.customize-control-background .actions, .customize-control-header .actions { margin-bottom: 32px; } @@ -793,6 +804,7 @@ p.customize-section-description { .customize-control-upload img, .customize-control-image img, +.customize-control-background img, .customize-control-header img { width: 100%; -webkit-border-radius: 2px; @@ -803,6 +815,8 @@ p.customize-section-description { .customize-control-upload .default-button, .customize-control-image .remove-button, .customize-control-image .default-button, +.customize-control-background .remove-button, +.customize-control-background .default-button, .customize-control-header .remove { float: right; margin-left: 3px; @@ -810,6 +824,7 @@ p.customize-section-description { .customize-control-upload .upload-button, .customize-control-image .upload-button, +.customize-control-background .upload-button, .customize-control-header .new { float: left; } diff --git a/wp-admin/css/customize-controls-rtl.min.css b/wp-admin/css/customize-controls-rtl.min.css index 4b41174067..1227e07bfd 100644 --- a/wp-admin/css/customize-controls-rtl.min.css +++ b/wp-admin/css/customize-controls-rtl.min.css @@ -1 +1 @@ -body{overflow:hidden}#customize-controls a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls .description{color:#666}#customize-header-actions .button-primary{float:left;margin-top:9px}#customize-header-actions .spinner{margin-top:16px;margin-left:4px}.saving #customize-header-actions .spinner{display:block}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}#customize-info{border:none;border-top:1px solid #ddd}#customize-info .accordion-section-title{background-color:#fff;color:#666;border-right:none;border-left:none;border-bottom:1px solid #eee}#customize-info .accordion-section-title:focus:after,#customize-info .accordion-section-title:hover:after,#customize-info.open .accordion-section-title:after{color:#555}#customize-info .preview-notice{font-size:13px;line-height:24px}#customize-info .theme-name{font-size:20px;font-weight:200;line-height:24px;display:block}#customize-info .theme-screenshot{width:258px}#customize-info .theme-description{margin-top:1em;color:#666;line-height:20px}#customize-theme-controls .control-section{border:none}#customize-theme-controls .accordion-section-title{color:#555;background-color:#fff;border-bottom:1px solid #eee}#customize-theme-controls .accordion-section-content{color:#555;background:#fff}#customize-info .accordion-section-title:focus,#customize-info .accordion-section-title:hover,#customize-info.open .accordion-section-title,#customize-theme-controls .control-section .accordion-section-title:focus,#customize-theme-controls .control-section .accordion-section-title:hover,#customize-theme-controls .control-section.open .accordion-section-title,#customize-theme-controls .control-section:hover>.accordion-section-title{color:#222;background:#f5f5f5}.js .control-section .accordion-section-title:focus,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section:hover .accordion-section-title{background:#f5f5f5}#customize-theme-controls .control-section .accordion-section-title:focus:after,#customize-theme-controls .control-section .accordion-section-title:hover:after,#customize-theme-controls .control-section.open .accordion-section-title:after,#customize-theme-controls .control-section:hover>.accordion-section-title:after{color:#555}#customize-info.open,#customize-theme-controls .control-section.open{border-bottom:1px solid #eee}#customize-theme-controls .control-section.open .accordion-section-title{border-bottom-color:#eee!important}#customize-theme-controls .control-section:last-of-type.open,#customize-theme-controls .control-section:last-of-type>.accordion-section-title{border-bottom-color:#ddd}#customize-theme-controls .accordion-section-content,#customize-theme-controls>ul{margin:0}.control-section.control-panel>.accordion-section-title{padding-left:54px}.control-section.control-panel>.accordion-section-title:after{content:"\f345";background:#f5f5f5;color:#555;width:38px;height:100%;margin:-11px 0 -11px -10px;line-height:45px;padding-right:5px;border-right:1px solid #eee;z-index:0}.rtl .control-section.control-panel>.accordion-section-title:after{content:"\f341"}#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after{background:#ddd;color:#000;border:1px solid #d9d9d9;border-left:none;margin-top:-12px;line-height:44px;z-index:1}.accordion-sub-container.control-panel-content{display:none;position:absolute;right:300px;top:0;width:300px;border-top:1px solid #ddd;-webkit-transition:right ease-in-out .18s;transition:right ease-in-out .18s}.accordion-sub-container.control-panel-content.animating{display:block}.current-panel .accordion-sub-container.control-panel-content{width:100%}.customize-controls-close{display:block;position:absolute;top:0;right:0;width:45px;height:45px;padding-left:2px;background:#eee;border-left:1px solid #ddd;color:#444;cursor:pointer;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.control-panel-back{display:block;position:fixed;top:0;z-index:99;right:-48px;width:45px;height:45px;padding-left:2px;background:#eee;border-left:1px solid #ddd;cursor:pointer;-webkit-transition:right .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;transition:right .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out}.collapsed .control-panel-back{display:none}.control-panel-back:focus,.control-panel-back:hover,.customize-controls-close:focus,.customize-controls-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;-webkit-box-shadow:none;box-shadow:none}.customize-controls-close:before{font:400 22px/1 dashicons;content:"\f335";position:relative;top:7px;right:13px}.control-panel-back:before{font:400 20px/1 dashicons;content:"\f341";position:relative;top:7px;right:13px}.rtl .control-panel-back:before{content:"\f345"}.in-sub-panel .control-panel-back{right:0}.current-panel>.accordion-section-title{height:22px}.wp-full-overlay-sidebar .wp-full-overlay-header{-webkit-transition:padding ease-in-out .18s;transition:padding ease-in-out .18s}.in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding-right:62px}#customize-info,#customize-theme-controls>ul>.accordion-section{position:relative;right:0;-webkit-transition:right ease-in-out .18s;transition:right ease-in-out .18s}.in-sub-panel #customize-info,.in-sub-panel #customize-theme-controls>ul>.accordion-section{right:-300px;width:300px}.in-sub-panel #customize-theme-controls .accordion-section.current-panel{width:100%}#customize-theme-controls .control-section.current-panel{padding:0}#customize-theme-controls .control-section>h3.accordion-section-title{position:relative;right:0}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-300px;-webkit-transition:right ease-in-out .18s;transition:right ease-in-out .18s}.control-section.control-panel .accordion-section-title .panel-title{font-size:20px;font-weight:200;line-height:24px;display:block;border:none}.control-section.control-panel .preview-notice{font-size:13px;line-height:24px}p.customize-section-description{font-style:normal}.customize-control{width:100%;float:right;clear:both;margin-bottom:8px}.customize-control input[type=checkbox],.customize-control input[type=radio],.customize-control select{line-height:28px}.customize-control input[type=email],.customize-control input[type=number],.customize-control input[type=password],.customize-control input[type=search],.customize-control input[type=tel],.customize-control input[type=text],.customize-control input[type=url]{width:98%;line-height:18px;margin:0}.customize-control-textarea textarea{width:100%;resize:vertical}.customize-control select{min-width:50%;max-width:100%;height:28px;line-height:28px}.customize-control select[multiple]{height:auto}.customize-control-title{display:block;font-size:14px;line-height:24px;font-weight:600;margin-bottom:5px}.customize-control-description{display:block;font-style:italic;line-height:18px;margin-bottom:5px}.customize-control-checkbox label,.customize-control-color .color-picker,.customize-control-upload div{line-height:28px}.customize-control-checkbox input{margin-left:5px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:22px}.customize-control-radio .customize-control-title+.customize-control-description{margin-top:7px}.customize-control-radio label{line-height:32px}.customize-control-radio input{margin-left:5px}.customize-control .attachment-thumb.type-icon{float:right;margin:10px;width:auto}.customize-control .attachment-title{font-weight:700;margin:0;padding:5px 10px}.customize-control .attachment-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:5px 10px 0}.customize-control .attachment-meta-title{padding-top:7px}.customize-control .thumbnail-image{line-height:0}.customize-control .thumbnail-image img{cursor:pointer}#customize-preview iframe{width:100%;height:100%}.wp-full-overlay-sidebar{background:#eee;border-left:1px solid #ddd}.collapse-sidebar{background-color:transparent!important;border:none!important;-webkit-box-shadow:none!important;box-shadow:none!important;-webkit-border-radius:0!important;border-radius:0!important}.collapse-sidebar:active,.collapse-sidebar:active .collapse-sidebar-arrow:before,.collapse-sidebar:active .collapse-sidebar-label{text-shadow:none}.collapsed .collapse-sidebar-arrow:before{color:#888}.accordion-section .dropdown{float:right;display:block;position:relative;cursor:pointer}.accordion-section .dropdown-content{overflow:hidden;float:right;min-width:30px;height:16px;line-height:16px;margin-left:16px;padding:4px 5px;border:2px solid #eee;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;left:0;width:20px;background:#eee}.customize-control .dropdown-arrow:after{content:"\f140";font:400 20px/1 dashicons;speak:none;display:block;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#333}.customize-control .dropdown-status{color:#333;background:#eee;display:none;max-width:112px}.customize-control-color .color-picker-hex{display:none}.customize-control-color.open .color-picker-hex{display:block}.customize-control-color .dropdown{margin-left:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#555;border:1px solid rgba(0,0,0,.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,.25)}.ios #customize-preview,.ios .wp-full-overlay{position:relative}.ios #customize-controls .wp-full-overlay-sidebar-content{-webkit-overflow-scrolling:touch}.customize-control-header .current,.customize-control-image .current,.customize-control-upload .current{margin-bottom:8px}.customize-control-header .uploaded{margin-bottom:18px}.customize-control-header .default button:not(.random),.customize-control-header .uploaded button:not(.random){width:100%;padding:0;margin:0;background:0 0;border:none;color:inherit;cursor:pointer}.customize-control-header button img{display:block}.customize-control-header button.new,.customize-control-header button.remove,.customize-control-image .default-button,.customize-control-image .remove-button,.customize-control-image .upload-button,.customize-control-upload .default-button,.customize-control-upload .remove-button,.customize-control-upload .upload-button{white-space:normal;width:48%;height:auto}.customize-control-header .current .container,.customize-control-image .current .container,.customize-control-upload .current .container{overflow:hidden;border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px}.customize-control-image .current .container,.customize-control-upload .current .container{min-height:40px}.customize-control-header .placeholder,.customize-control-image .placeholder,.customize-control-upload .placeholder{width:100%;position:relative;text-align:center;cursor:default}.customize-control-header .inner,.customize-control-image .inner,.customize-control-upload .inner{display:none;position:absolute;width:100%;color:#555;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.customize-control-image .inner,.customize-control-upload .inner{display:block;min-height:40px}.customize-control-header .inner,.customize-control-header .inner .dashicons,.customize-control-image .inner,.customize-control-upload .inner{line-height:20px;top:10px}.customize-control-header .list .inner,.customize-control-header .list .inner .dashicons{top:9px}.customize-control-header .header-view{position:relative;width:100%;margin-bottom:5px}.customize-control-header .header-view:last-child{margin-bottom:0}.customize-control-header .header-view:after{border:0}.customize-control-header .header-view.selected:after{content:'';position:absolute;height:auto;top:0;right:0;bottom:0;left:0;border:4px solid #2ea2cc;-webkit-border-radius:2px;border-radius:2px}.customize-control-header .header-view.button.selected{border:0}.customize-control-header .uploaded .header-view .close{font-size:2em;color:grey;position:absolute;visibility:hidden;top:10px;left:10px;z-index:1;width:20px;height:20px;cursor:pointer}.customize-control-header .uploaded .header-view .close:hover{color:#000;text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff}.customize-control-header .header-view:hover .close{visibility:visible}.customize-control-header .random.placeholder{cursor:pointer;-webkit-border-radius:2px;border-radius:2px;height:40px}.customize-control-header button.random{width:100%;height:auto;min-height:40px;white-space:normal}.customize-control-header button.random .dice{margin-top:4px}.customize-control-header .header-view:hover>button.random .dice,.customize-control-header .placeholder:hover .dice{-webkit-animation:dice-color-change 3s infinite;-ms-animation:dice-color-change 3s infinite;animation:dice-color-change 3s infinite}@-webkit-keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}@-ms-keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}@keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}.customize-control-header .actions,.customize-control-image .actions,.customize-control-upload .actions{margin-bottom:32px}.customize-control-header .choice{position:relative;display:block;margin-bottom:9px}.customize-control-header .uploaded div:last-child>.choice{margin-bottom:0}.customize-control-header img,.customize-control-image img,.customize-control-upload img{width:100%;-webkit-border-radius:2px;border-radius:2px}.customize-control-header .remove,.customize-control-image .default-button,.customize-control-image .remove-button,.customize-control-upload .default-button,.customize-control-upload .remove-button{float:right;margin-left:3px}.customize-control-header .new,.customize-control-image .upload-button,.customize-control-upload .upload-button{float:left}body.cheatin{font-size:medium;height:auto;background:#fff;margin:50px auto 2em;padding:1em 2em;max-width:700px;min-width:0;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13)}body.cheatin p{font-size:14px;line-height:1.5;margin:25px 0 20px} \ No newline at end of file +body{overflow:hidden}#customize-controls a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls .description{color:#666}#customize-header-actions .button-primary{float:left;margin-top:9px}#customize-header-actions .spinner{margin-top:16px;margin-left:4px}.saving #customize-header-actions .spinner{display:block}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}#customize-info{border:none;border-top:1px solid #ddd}#customize-info .accordion-section-title{background-color:#fff;color:#666;border-right:none;border-left:none;border-bottom:1px solid #eee}#customize-info .accordion-section-title:focus:after,#customize-info .accordion-section-title:hover:after,#customize-info.open .accordion-section-title:after{color:#555}#customize-info .preview-notice{font-size:13px;line-height:24px}#customize-info .theme-name{font-size:20px;font-weight:200;line-height:24px;display:block}#customize-info .theme-screenshot{width:258px}#customize-info .theme-description{margin-top:1em;color:#666;line-height:20px}#customize-theme-controls .control-section{border:none}#customize-theme-controls .accordion-section-title{color:#555;background-color:#fff;border-bottom:1px solid #eee}#customize-theme-controls .accordion-section-content{color:#555;background:#fff}#customize-info .accordion-section-title:focus,#customize-info .accordion-section-title:hover,#customize-info.open .accordion-section-title,#customize-theme-controls .control-section .accordion-section-title:focus,#customize-theme-controls .control-section .accordion-section-title:hover,#customize-theme-controls .control-section.open .accordion-section-title,#customize-theme-controls .control-section:hover>.accordion-section-title{color:#222;background:#f5f5f5}.js .control-section .accordion-section-title:focus,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section:hover .accordion-section-title{background:#f5f5f5}#customize-theme-controls .control-section .accordion-section-title:focus:after,#customize-theme-controls .control-section .accordion-section-title:hover:after,#customize-theme-controls .control-section.open .accordion-section-title:after,#customize-theme-controls .control-section:hover>.accordion-section-title:after{color:#555}#customize-info.open,#customize-theme-controls .control-section.open{border-bottom:1px solid #eee}#customize-theme-controls .control-section.open .accordion-section-title{border-bottom-color:#eee!important}#customize-theme-controls .control-section:last-of-type.open,#customize-theme-controls .control-section:last-of-type>.accordion-section-title{border-bottom-color:#ddd}#customize-theme-controls .accordion-section-content,#customize-theme-controls>ul{margin:0}.control-section.control-panel>.accordion-section-title{padding-left:54px}.control-section.control-panel>.accordion-section-title:after{content:"\f345";background:#f5f5f5;color:#555;width:38px;height:100%;margin:-11px 0 -11px -10px;line-height:45px;padding-right:5px;border-right:1px solid #eee;z-index:0}.rtl .control-section.control-panel>.accordion-section-title:after{content:"\f341"}#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after{background:#ddd;color:#000;border:1px solid #d9d9d9;border-left:none;margin-top:-12px;line-height:44px;z-index:1}.accordion-sub-container.control-panel-content{display:none;position:absolute;right:300px;top:0;width:300px;border-top:1px solid #ddd;-webkit-transition:right ease-in-out .18s;transition:right ease-in-out .18s}.accordion-sub-container.control-panel-content.animating{display:block}.current-panel .accordion-sub-container.control-panel-content{width:100%}.customize-controls-close{display:block;position:absolute;top:0;right:0;width:45px;height:45px;padding-left:2px;background:#eee;border-left:1px solid #ddd;color:#444;cursor:pointer;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.control-panel-back{display:block;position:fixed;top:0;z-index:99;right:-48px;width:45px;height:45px;padding-left:2px;background:#eee;border-left:1px solid #ddd;cursor:pointer;-webkit-transition:right .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;transition:right .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out}.collapsed .control-panel-back{display:none}.control-panel-back:focus,.control-panel-back:hover,.customize-controls-close:focus,.customize-controls-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;-webkit-box-shadow:none;box-shadow:none}.customize-controls-close:before{font:400 22px/1 dashicons;content:"\f335";position:relative;top:7px;right:13px}.control-panel-back:before{font:400 20px/1 dashicons;content:"\f341";position:relative;top:7px;right:13px}.rtl .control-panel-back:before{content:"\f345"}.in-sub-panel .control-panel-back{right:0}.current-panel>.accordion-section-title{height:22px}.wp-full-overlay-sidebar .wp-full-overlay-header{-webkit-transition:padding ease-in-out .18s;transition:padding ease-in-out .18s}.in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding-right:62px}#customize-info,#customize-theme-controls>ul>.accordion-section{position:relative;right:0;-webkit-transition:right ease-in-out .18s;transition:right ease-in-out .18s}.in-sub-panel #customize-info,.in-sub-panel #customize-theme-controls>ul>.accordion-section{right:-300px;width:300px}.in-sub-panel #customize-theme-controls .accordion-section.current-panel{width:100%}#customize-theme-controls .control-section.current-panel{padding:0}#customize-theme-controls .control-section>h3.accordion-section-title{position:relative;right:0}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-300px;-webkit-transition:right ease-in-out .18s;transition:right ease-in-out .18s}.control-section.control-panel .accordion-section-title .panel-title{font-size:20px;font-weight:200;line-height:24px;display:block;border:none}.control-section.control-panel .preview-notice{font-size:13px;line-height:24px}p.customize-section-description{font-style:normal}.customize-control{width:100%;float:right;clear:both;margin-bottom:8px}.customize-control input[type=checkbox],.customize-control input[type=radio],.customize-control select{line-height:28px}.customize-control input[type=email],.customize-control input[type=number],.customize-control input[type=password],.customize-control input[type=search],.customize-control input[type=tel],.customize-control input[type=text],.customize-control input[type=url]{width:98%;line-height:18px;margin:0}.customize-control-textarea textarea{width:100%;resize:vertical}.customize-control select{min-width:50%;max-width:100%;height:28px;line-height:28px}.customize-control select[multiple]{height:auto}.customize-control-title{display:block;font-size:14px;line-height:24px;font-weight:600;margin-bottom:5px}.customize-control-description{display:block;font-style:italic;line-height:18px;margin-bottom:5px}.customize-control-checkbox label,.customize-control-color .color-picker,.customize-control-upload div{line-height:28px}.customize-control-checkbox input{margin-left:5px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:22px}.customize-control-radio .customize-control-title+.customize-control-description{margin-top:7px}.customize-control-radio label{line-height:32px}.customize-control-radio input{margin-left:5px}.customize-control .attachment-thumb.type-icon{float:right;margin:10px;width:auto}.customize-control .attachment-title{font-weight:700;margin:0;padding:5px 10px}.customize-control .attachment-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:5px 10px 0}.customize-control .attachment-meta-title{padding-top:7px}.customize-control .thumbnail-image{line-height:0}.customize-control .thumbnail-image img{cursor:pointer}#customize-preview iframe{width:100%;height:100%}.wp-full-overlay-sidebar{background:#eee;border-left:1px solid #ddd}.collapse-sidebar{background-color:transparent!important;border:none!important;-webkit-box-shadow:none!important;box-shadow:none!important;-webkit-border-radius:0!important;border-radius:0!important}.collapse-sidebar:active,.collapse-sidebar:active .collapse-sidebar-arrow:before,.collapse-sidebar:active .collapse-sidebar-label{text-shadow:none}.collapsed .collapse-sidebar-arrow:before{color:#888}.accordion-section .dropdown{float:right;display:block;position:relative;cursor:pointer}.accordion-section .dropdown-content{overflow:hidden;float:right;min-width:30px;height:16px;line-height:16px;margin-left:16px;padding:4px 5px;border:2px solid #eee;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;left:0;width:20px;background:#eee}.customize-control .dropdown-arrow:after{content:"\f140";font:400 20px/1 dashicons;speak:none;display:block;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#333}.customize-control .dropdown-status{color:#333;background:#eee;display:none;max-width:112px}.customize-control-color .color-picker-hex{display:none}.customize-control-color.open .color-picker-hex{display:block}.customize-control-color .dropdown{margin-left:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#555;border:1px solid rgba(0,0,0,.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,.25)}.ios #customize-preview,.ios .wp-full-overlay{position:relative}.ios #customize-controls .wp-full-overlay-sidebar-content{-webkit-overflow-scrolling:touch}.customize-control-background .current,.customize-control-header .current,.customize-control-image .current,.customize-control-upload .current{margin-bottom:8px}.customize-control-header .uploaded{margin-bottom:18px}.customize-control-header .default button:not(.random),.customize-control-header .uploaded button:not(.random){width:100%;padding:0;margin:0;background:0 0;border:none;color:inherit;cursor:pointer}.customize-control-header button img{display:block}.customize-control-background .default-button,.customize-control-background .remove-button,.customize-control-background .upload-button,.customize-control-header button.new,.customize-control-header button.remove,.customize-control-image .default-button,.customize-control-image .remove-button,.customize-control-image .upload-button,.customize-control-upload .default-button,.customize-control-upload .remove-button,.customize-control-upload .upload-button{white-space:normal;width:48%;height:auto}.customize-control-background .current .container,.customize-control-header .current .container,.customize-control-image .current .container,.customize-control-upload .current .container{overflow:hidden;border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px}.customize-control-background .current .container,.customize-control-image .current .container,.customize-control-upload .current .container{min-height:40px}.customize-control-background .placeholder,.customize-control-header .placeholder,.customize-control-image .placeholder,.customize-control-upload .placeholder{width:100%;position:relative;text-align:center;cursor:default}.customize-control-background .inner,.customize-control-header .inner,.customize-control-image .inner,.customize-control-upload .inner{display:none;position:absolute;width:100%;color:#555;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.customize-control-background .inner,.customize-control-image .inner,.customize-control-upload .inner{display:block;min-height:40px}.customize-control-background .inner,.customize-control-header .inner,.customize-control-header .inner .dashicons,.customize-control-image .inner,.customize-control-upload .inner{line-height:20px;top:10px}.customize-control-header .list .inner,.customize-control-header .list .inner .dashicons{top:9px}.customize-control-header .header-view{position:relative;width:100%;margin-bottom:5px}.customize-control-header .header-view:last-child{margin-bottom:0}.customize-control-header .header-view:after{border:0}.customize-control-header .header-view.selected:after{content:'';position:absolute;height:auto;top:0;right:0;bottom:0;left:0;border:4px solid #2ea2cc;-webkit-border-radius:2px;border-radius:2px}.customize-control-header .header-view.button.selected{border:0}.customize-control-header .uploaded .header-view .close{font-size:2em;color:grey;position:absolute;visibility:hidden;top:10px;left:10px;z-index:1;width:20px;height:20px;cursor:pointer}.customize-control-header .uploaded .header-view .close:hover{color:#000;text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff}.customize-control-header .header-view:hover .close{visibility:visible}.customize-control-header .random.placeholder{cursor:pointer;-webkit-border-radius:2px;border-radius:2px;height:40px}.customize-control-header button.random{width:100%;height:auto;min-height:40px;white-space:normal}.customize-control-header button.random .dice{margin-top:4px}.customize-control-header .header-view:hover>button.random .dice,.customize-control-header .placeholder:hover .dice{-webkit-animation:dice-color-change 3s infinite;-ms-animation:dice-color-change 3s infinite;animation:dice-color-change 3s infinite}@-webkit-keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}@-ms-keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}@keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}.customize-control-background .actions,.customize-control-header .actions,.customize-control-image .actions,.customize-control-upload .actions{margin-bottom:32px}.customize-control-header .choice{position:relative;display:block;margin-bottom:9px}.customize-control-header .uploaded div:last-child>.choice{margin-bottom:0}.customize-control-background img,.customize-control-header img,.customize-control-image img,.customize-control-upload img{width:100%;-webkit-border-radius:2px;border-radius:2px}.customize-control-background .default-button,.customize-control-background .remove-button,.customize-control-header .remove,.customize-control-image .default-button,.customize-control-image .remove-button,.customize-control-upload .default-button,.customize-control-upload .remove-button{float:right;margin-left:3px}.customize-control-background .upload-button,.customize-control-header .new,.customize-control-image .upload-button,.customize-control-upload .upload-button{float:left}body.cheatin{font-size:medium;height:auto;background:#fff;margin:50px auto 2em;padding:1em 2em;max-width:700px;min-width:0;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13)}body.cheatin p{font-size:14px;line-height:1.5;margin:25px 0 20px} \ No newline at end of file diff --git a/wp-admin/css/customize-controls.css b/wp-admin/css/customize-controls.css index d58c632b5a..599fdac310 100644 --- a/wp-admin/css/customize-controls.css +++ b/wp-admin/css/customize-controls.css @@ -581,6 +581,7 @@ p.customize-section-description { .customize-control-upload .current, .customize-control-image .current, +.customize-control-background .current, .customize-control-header .current { margin-bottom: 8px; } @@ -610,6 +611,9 @@ p.customize-section-description { .customize-control-image .remove-button, .customize-control-image .default-button, .customize-control-image .upload-button, +.customize-control-background .remove-button, +.customize-control-background .default-button, +.customize-control-background .upload-button, .customize-control-header button.new, .customize-control-header button.remove { white-space: normal; @@ -619,6 +623,7 @@ p.customize-section-description { .customize-control-upload .current .container, .customize-control-image .current .container, +.customize-control-background .current .container, .customize-control-header .current .container { overflow: hidden; -webkit-border-radius: 2px; @@ -628,12 +633,14 @@ p.customize-section-description { } .customize-control-upload .current .container, +.customize-control-background .current .container, .customize-control-image .current .container { min-height: 40px; } .customize-control-upload .placeholder, .customize-control-image .placeholder, +.customize-control-background .placeholder, .customize-control-header .placeholder { width: 100%; position: relative; @@ -643,6 +650,7 @@ p.customize-section-description { .customize-control-upload .inner, .customize-control-image .inner, +.customize-control-background .inner, .customize-control-header .inner { display: none; position: absolute; @@ -654,6 +662,7 @@ p.customize-section-description { } .customize-control-upload .inner, +.customize-control-background .inner, .customize-control-image .inner { display: block; min-height: 40px; @@ -661,6 +670,7 @@ p.customize-section-description { .customize-control-upload .inner, .customize-control-image .inner, +.customize-control-background .inner, .customize-control-header .inner, .customize-control-header .inner .dashicons { line-height: 20px; @@ -777,6 +787,7 @@ p.customize-section-description { .customize-control-upload .actions, .customize-control-image .actions, +.customize-control-background .actions, .customize-control-header .actions { margin-bottom: 32px; } @@ -793,6 +804,7 @@ p.customize-section-description { .customize-control-upload img, .customize-control-image img, +.customize-control-background img, .customize-control-header img { width: 100%; -webkit-border-radius: 2px; @@ -803,6 +815,8 @@ p.customize-section-description { .customize-control-upload .default-button, .customize-control-image .remove-button, .customize-control-image .default-button, +.customize-control-background .remove-button, +.customize-control-background .default-button, .customize-control-header .remove { float: left; margin-right: 3px; @@ -810,6 +824,7 @@ p.customize-section-description { .customize-control-upload .upload-button, .customize-control-image .upload-button, +.customize-control-background .upload-button, .customize-control-header .new { float: right; } diff --git a/wp-admin/css/customize-controls.min.css b/wp-admin/css/customize-controls.min.css index 3e9db98a3a..483c49a98e 100644 --- a/wp-admin/css/customize-controls.min.css +++ b/wp-admin/css/customize-controls.min.css @@ -1 +1 @@ -body{overflow:hidden}#customize-controls a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls .description{color:#666}#customize-header-actions .button-primary{float:right;margin-top:9px}#customize-header-actions .spinner{margin-top:16px;margin-right:4px}.saving #customize-header-actions .spinner{display:block}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}#customize-info{border:none;border-top:1px solid #ddd}#customize-info .accordion-section-title{background-color:#fff;color:#666;border-left:none;border-right:none;border-bottom:1px solid #eee}#customize-info .accordion-section-title:focus:after,#customize-info .accordion-section-title:hover:after,#customize-info.open .accordion-section-title:after{color:#555}#customize-info .preview-notice{font-size:13px;line-height:24px}#customize-info .theme-name{font-size:20px;font-weight:200;line-height:24px;display:block}#customize-info .theme-screenshot{width:258px}#customize-info .theme-description{margin-top:1em;color:#666;line-height:20px}#customize-theme-controls .control-section{border:none}#customize-theme-controls .accordion-section-title{color:#555;background-color:#fff;border-bottom:1px solid #eee}#customize-theme-controls .accordion-section-content{color:#555;background:#fff}#customize-info .accordion-section-title:focus,#customize-info .accordion-section-title:hover,#customize-info.open .accordion-section-title,#customize-theme-controls .control-section .accordion-section-title:focus,#customize-theme-controls .control-section .accordion-section-title:hover,#customize-theme-controls .control-section.open .accordion-section-title,#customize-theme-controls .control-section:hover>.accordion-section-title{color:#222;background:#f5f5f5}.js .control-section .accordion-section-title:focus,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section:hover .accordion-section-title{background:#f5f5f5}#customize-theme-controls .control-section .accordion-section-title:focus:after,#customize-theme-controls .control-section .accordion-section-title:hover:after,#customize-theme-controls .control-section.open .accordion-section-title:after,#customize-theme-controls .control-section:hover>.accordion-section-title:after{color:#555}#customize-info.open,#customize-theme-controls .control-section.open{border-bottom:1px solid #eee}#customize-theme-controls .control-section.open .accordion-section-title{border-bottom-color:#eee!important}#customize-theme-controls .control-section:last-of-type.open,#customize-theme-controls .control-section:last-of-type>.accordion-section-title{border-bottom-color:#ddd}#customize-theme-controls .accordion-section-content,#customize-theme-controls>ul{margin:0}.control-section.control-panel>.accordion-section-title{padding-right:54px}.control-section.control-panel>.accordion-section-title:after{content:"\f345";background:#f5f5f5;color:#555;width:38px;height:100%;margin:-11px -10px -11px 0;line-height:45px;padding-left:5px;border-left:1px solid #eee;z-index:0}.rtl .control-section.control-panel>.accordion-section-title:after{content:"\f341"}#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after{background:#ddd;color:#000;border:1px solid #d9d9d9;border-right:none;margin-top:-12px;line-height:44px;z-index:1}.accordion-sub-container.control-panel-content{display:none;position:absolute;left:300px;top:0;width:300px;border-top:1px solid #ddd;-webkit-transition:left ease-in-out .18s;transition:left ease-in-out .18s}.accordion-sub-container.control-panel-content.animating{display:block}.current-panel .accordion-sub-container.control-panel-content{width:100%}.customize-controls-close{display:block;position:absolute;top:0;left:0;width:45px;height:45px;padding-right:2px;background:#eee;border-right:1px solid #ddd;color:#444;cursor:pointer;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.control-panel-back{display:block;position:fixed;top:0;z-index:99;left:-48px;width:45px;height:45px;padding-right:2px;background:#eee;border-right:1px solid #ddd;cursor:pointer;-webkit-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out}.collapsed .control-panel-back{display:none}.control-panel-back:focus,.control-panel-back:hover,.customize-controls-close:focus,.customize-controls-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;-webkit-box-shadow:none;box-shadow:none}.customize-controls-close:before{font:400 22px/1 dashicons;content:"\f335";position:relative;top:7px;left:13px}.control-panel-back:before{font:400 20px/1 dashicons;content:"\f341";position:relative;top:7px;left:13px}.rtl .control-panel-back:before{content:"\f345"}.in-sub-panel .control-panel-back{left:0}.current-panel>.accordion-section-title{height:22px}.wp-full-overlay-sidebar .wp-full-overlay-header{-webkit-transition:padding ease-in-out .18s;transition:padding ease-in-out .18s}.in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding-left:62px}#customize-info,#customize-theme-controls>ul>.accordion-section{position:relative;left:0;-webkit-transition:left ease-in-out .18s;transition:left ease-in-out .18s}.in-sub-panel #customize-info,.in-sub-panel #customize-theme-controls>ul>.accordion-section{left:-300px;width:300px}.in-sub-panel #customize-theme-controls .accordion-section.current-panel{width:100%}#customize-theme-controls .control-section.current-panel{padding:0}#customize-theme-controls .control-section>h3.accordion-section-title{position:relative;left:0}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-300px;-webkit-transition:left ease-in-out .18s;transition:left ease-in-out .18s}.control-section.control-panel .accordion-section-title .panel-title{font-size:20px;font-weight:200;line-height:24px;display:block;border:none}.control-section.control-panel .preview-notice{font-size:13px;line-height:24px}p.customize-section-description{font-style:normal}.customize-control{width:100%;float:left;clear:both;margin-bottom:8px}.customize-control input[type=checkbox],.customize-control input[type=radio],.customize-control select{line-height:28px}.customize-control input[type=email],.customize-control input[type=number],.customize-control input[type=password],.customize-control input[type=search],.customize-control input[type=tel],.customize-control input[type=text],.customize-control input[type=url]{width:98%;line-height:18px;margin:0}.customize-control-textarea textarea{width:100%;resize:vertical}.customize-control select{min-width:50%;max-width:100%;height:28px;line-height:28px}.customize-control select[multiple]{height:auto}.customize-control-title{display:block;font-size:14px;line-height:24px;font-weight:600;margin-bottom:5px}.customize-control-description{display:block;font-style:italic;line-height:18px;margin-bottom:5px}.customize-control-checkbox label,.customize-control-color .color-picker,.customize-control-upload div{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 .customize-control-title+.customize-control-description{margin-top:7px}.customize-control-radio label{line-height:32px}.customize-control-radio input{margin-right:5px}.customize-control .attachment-thumb.type-icon{float:left;margin:10px;width:auto}.customize-control .attachment-title{font-weight:700;margin:0;padding:5px 10px}.customize-control .attachment-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:5px 10px 0}.customize-control .attachment-meta-title{padding-top:7px}.customize-control .thumbnail-image{line-height:0}.customize-control .thumbnail-image img{cursor:pointer}#customize-preview iframe{width:100%;height:100%}.wp-full-overlay-sidebar{background:#eee;border-right:1px solid #ddd}.collapse-sidebar{background-color:transparent!important;border:none!important;-webkit-box-shadow:none!important;box-shadow:none!important;-webkit-border-radius:0!important;border-radius:0!important}.collapse-sidebar:active,.collapse-sidebar:active .collapse-sidebar-arrow:before,.collapse-sidebar:active .collapse-sidebar-label{text-shadow:none}.collapsed .collapse-sidebar-arrow:before{color:#888}.accordion-section .dropdown{float:left;display:block;position:relative;cursor:pointer}.accordion-section .dropdown-content{overflow:hidden;float:left;min-width:30px;height:16px;line-height:16px;margin-right:16px;padding:4px 5px;border:2px solid #eee;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;right:0;width:20px;background:#eee}.customize-control .dropdown-arrow:after{content:"\f140";font:400 20px/1 dashicons;speak:none;display:block;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#333}.customize-control .dropdown-status{color:#333;background:#eee;display:none;max-width:112px}.customize-control-color .color-picker-hex{display:none}.customize-control-color.open .color-picker-hex{display:block}.customize-control-color .dropdown{margin-right:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#555;border:1px solid rgba(0,0,0,.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,.25)}.ios #customize-preview,.ios .wp-full-overlay{position:relative}.ios #customize-controls .wp-full-overlay-sidebar-content{-webkit-overflow-scrolling:touch}.customize-control-header .current,.customize-control-image .current,.customize-control-upload .current{margin-bottom:8px}.customize-control-header .uploaded{margin-bottom:18px}.customize-control-header .default button:not(.random),.customize-control-header .uploaded button:not(.random){width:100%;padding:0;margin:0;background:0 0;border:none;color:inherit;cursor:pointer}.customize-control-header button img{display:block}.customize-control-header button.new,.customize-control-header button.remove,.customize-control-image .default-button,.customize-control-image .remove-button,.customize-control-image .upload-button,.customize-control-upload .default-button,.customize-control-upload .remove-button,.customize-control-upload .upload-button{white-space:normal;width:48%;height:auto}.customize-control-header .current .container,.customize-control-image .current .container,.customize-control-upload .current .container{overflow:hidden;border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px}.customize-control-image .current .container,.customize-control-upload .current .container{min-height:40px}.customize-control-header .placeholder,.customize-control-image .placeholder,.customize-control-upload .placeholder{width:100%;position:relative;text-align:center;cursor:default}.customize-control-header .inner,.customize-control-image .inner,.customize-control-upload .inner{display:none;position:absolute;width:100%;color:#555;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.customize-control-image .inner,.customize-control-upload .inner{display:block;min-height:40px}.customize-control-header .inner,.customize-control-header .inner .dashicons,.customize-control-image .inner,.customize-control-upload .inner{line-height:20px;top:10px}.customize-control-header .list .inner,.customize-control-header .list .inner .dashicons{top:9px}.customize-control-header .header-view{position:relative;width:100%;margin-bottom:5px}.customize-control-header .header-view:last-child{margin-bottom:0}.customize-control-header .header-view:after{border:0}.customize-control-header .header-view.selected:after{content:'';position:absolute;height:auto;top:0;left:0;bottom:0;right:0;border:4px solid #2ea2cc;-webkit-border-radius:2px;border-radius:2px}.customize-control-header .header-view.button.selected{border:0}.customize-control-header .uploaded .header-view .close{font-size:2em;color:grey;position:absolute;visibility:hidden;top:10px;right:10px;z-index:1;width:20px;height:20px;cursor:pointer}.customize-control-header .uploaded .header-view .close:hover{color:#000;text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff}.customize-control-header .header-view:hover .close{visibility:visible}.customize-control-header .random.placeholder{cursor:pointer;-webkit-border-radius:2px;border-radius:2px;height:40px}.customize-control-header button.random{width:100%;height:auto;min-height:40px;white-space:normal}.customize-control-header button.random .dice{margin-top:4px}.customize-control-header .header-view:hover>button.random .dice,.customize-control-header .placeholder:hover .dice{-webkit-animation:dice-color-change 3s infinite;-ms-animation:dice-color-change 3s infinite;animation:dice-color-change 3s infinite}@-webkit-keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}@-ms-keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}@keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}.customize-control-header .actions,.customize-control-image .actions,.customize-control-upload .actions{margin-bottom:32px}.customize-control-header .choice{position:relative;display:block;margin-bottom:9px}.customize-control-header .uploaded div:last-child>.choice{margin-bottom:0}.customize-control-header img,.customize-control-image img,.customize-control-upload img{width:100%;-webkit-border-radius:2px;border-radius:2px}.customize-control-header .remove,.customize-control-image .default-button,.customize-control-image .remove-button,.customize-control-upload .default-button,.customize-control-upload .remove-button{float:left;margin-right:3px}.customize-control-header .new,.customize-control-image .upload-button,.customize-control-upload .upload-button{float:right}body.cheatin{font-size:medium;height:auto;background:#fff;margin:50px auto 2em;padding:1em 2em;max-width:700px;min-width:0;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13)}body.cheatin p{font-size:14px;line-height:1.5;margin:25px 0 20px} \ No newline at end of file +body{overflow:hidden}#customize-controls a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls .description{color:#666}#customize-header-actions .button-primary{float:right;margin-top:9px}#customize-header-actions .spinner{margin-top:16px;margin-right:4px}.saving #customize-header-actions .spinner{display:block}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}#customize-info{border:none;border-top:1px solid #ddd}#customize-info .accordion-section-title{background-color:#fff;color:#666;border-left:none;border-right:none;border-bottom:1px solid #eee}#customize-info .accordion-section-title:focus:after,#customize-info .accordion-section-title:hover:after,#customize-info.open .accordion-section-title:after{color:#555}#customize-info .preview-notice{font-size:13px;line-height:24px}#customize-info .theme-name{font-size:20px;font-weight:200;line-height:24px;display:block}#customize-info .theme-screenshot{width:258px}#customize-info .theme-description{margin-top:1em;color:#666;line-height:20px}#customize-theme-controls .control-section{border:none}#customize-theme-controls .accordion-section-title{color:#555;background-color:#fff;border-bottom:1px solid #eee}#customize-theme-controls .accordion-section-content{color:#555;background:#fff}#customize-info .accordion-section-title:focus,#customize-info .accordion-section-title:hover,#customize-info.open .accordion-section-title,#customize-theme-controls .control-section .accordion-section-title:focus,#customize-theme-controls .control-section .accordion-section-title:hover,#customize-theme-controls .control-section.open .accordion-section-title,#customize-theme-controls .control-section:hover>.accordion-section-title{color:#222;background:#f5f5f5}.js .control-section .accordion-section-title:focus,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section:hover .accordion-section-title{background:#f5f5f5}#customize-theme-controls .control-section .accordion-section-title:focus:after,#customize-theme-controls .control-section .accordion-section-title:hover:after,#customize-theme-controls .control-section.open .accordion-section-title:after,#customize-theme-controls .control-section:hover>.accordion-section-title:after{color:#555}#customize-info.open,#customize-theme-controls .control-section.open{border-bottom:1px solid #eee}#customize-theme-controls .control-section.open .accordion-section-title{border-bottom-color:#eee!important}#customize-theme-controls .control-section:last-of-type.open,#customize-theme-controls .control-section:last-of-type>.accordion-section-title{border-bottom-color:#ddd}#customize-theme-controls .accordion-section-content,#customize-theme-controls>ul{margin:0}.control-section.control-panel>.accordion-section-title{padding-right:54px}.control-section.control-panel>.accordion-section-title:after{content:"\f345";background:#f5f5f5;color:#555;width:38px;height:100%;margin:-11px -10px -11px 0;line-height:45px;padding-left:5px;border-left:1px solid #eee;z-index:0}.rtl .control-section.control-panel>.accordion-section-title:after{content:"\f341"}#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after{background:#ddd;color:#000;border:1px solid #d9d9d9;border-right:none;margin-top:-12px;line-height:44px;z-index:1}.accordion-sub-container.control-panel-content{display:none;position:absolute;left:300px;top:0;width:300px;border-top:1px solid #ddd;-webkit-transition:left ease-in-out .18s;transition:left ease-in-out .18s}.accordion-sub-container.control-panel-content.animating{display:block}.current-panel .accordion-sub-container.control-panel-content{width:100%}.customize-controls-close{display:block;position:absolute;top:0;left:0;width:45px;height:45px;padding-right:2px;background:#eee;border-right:1px solid #ddd;color:#444;cursor:pointer;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.control-panel-back{display:block;position:fixed;top:0;z-index:99;left:-48px;width:45px;height:45px;padding-right:2px;background:#eee;border-right:1px solid #ddd;cursor:pointer;-webkit-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out}.collapsed .control-panel-back{display:none}.control-panel-back:focus,.control-panel-back:hover,.customize-controls-close:focus,.customize-controls-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;-webkit-box-shadow:none;box-shadow:none}.customize-controls-close:before{font:400 22px/1 dashicons;content:"\f335";position:relative;top:7px;left:13px}.control-panel-back:before{font:400 20px/1 dashicons;content:"\f341";position:relative;top:7px;left:13px}.rtl .control-panel-back:before{content:"\f345"}.in-sub-panel .control-panel-back{left:0}.current-panel>.accordion-section-title{height:22px}.wp-full-overlay-sidebar .wp-full-overlay-header{-webkit-transition:padding ease-in-out .18s;transition:padding ease-in-out .18s}.in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding-left:62px}#customize-info,#customize-theme-controls>ul>.accordion-section{position:relative;left:0;-webkit-transition:left ease-in-out .18s;transition:left ease-in-out .18s}.in-sub-panel #customize-info,.in-sub-panel #customize-theme-controls>ul>.accordion-section{left:-300px;width:300px}.in-sub-panel #customize-theme-controls .accordion-section.current-panel{width:100%}#customize-theme-controls .control-section.current-panel{padding:0}#customize-theme-controls .control-section>h3.accordion-section-title{position:relative;left:0}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-300px;-webkit-transition:left ease-in-out .18s;transition:left ease-in-out .18s}.control-section.control-panel .accordion-section-title .panel-title{font-size:20px;font-weight:200;line-height:24px;display:block;border:none}.control-section.control-panel .preview-notice{font-size:13px;line-height:24px}p.customize-section-description{font-style:normal}.customize-control{width:100%;float:left;clear:both;margin-bottom:8px}.customize-control input[type=checkbox],.customize-control input[type=radio],.customize-control select{line-height:28px}.customize-control input[type=email],.customize-control input[type=number],.customize-control input[type=password],.customize-control input[type=search],.customize-control input[type=tel],.customize-control input[type=text],.customize-control input[type=url]{width:98%;line-height:18px;margin:0}.customize-control-textarea textarea{width:100%;resize:vertical}.customize-control select{min-width:50%;max-width:100%;height:28px;line-height:28px}.customize-control select[multiple]{height:auto}.customize-control-title{display:block;font-size:14px;line-height:24px;font-weight:600;margin-bottom:5px}.customize-control-description{display:block;font-style:italic;line-height:18px;margin-bottom:5px}.customize-control-checkbox label,.customize-control-color .color-picker,.customize-control-upload div{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 .customize-control-title+.customize-control-description{margin-top:7px}.customize-control-radio label{line-height:32px}.customize-control-radio input{margin-right:5px}.customize-control .attachment-thumb.type-icon{float:left;margin:10px;width:auto}.customize-control .attachment-title{font-weight:700;margin:0;padding:5px 10px}.customize-control .attachment-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:5px 10px 0}.customize-control .attachment-meta-title{padding-top:7px}.customize-control .thumbnail-image{line-height:0}.customize-control .thumbnail-image img{cursor:pointer}#customize-preview iframe{width:100%;height:100%}.wp-full-overlay-sidebar{background:#eee;border-right:1px solid #ddd}.collapse-sidebar{background-color:transparent!important;border:none!important;-webkit-box-shadow:none!important;box-shadow:none!important;-webkit-border-radius:0!important;border-radius:0!important}.collapse-sidebar:active,.collapse-sidebar:active .collapse-sidebar-arrow:before,.collapse-sidebar:active .collapse-sidebar-label{text-shadow:none}.collapsed .collapse-sidebar-arrow:before{color:#888}.accordion-section .dropdown{float:left;display:block;position:relative;cursor:pointer}.accordion-section .dropdown-content{overflow:hidden;float:left;min-width:30px;height:16px;line-height:16px;margin-right:16px;padding:4px 5px;border:2px solid #eee;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;right:0;width:20px;background:#eee}.customize-control .dropdown-arrow:after{content:"\f140";font:400 20px/1 dashicons;speak:none;display:block;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#333}.customize-control .dropdown-status{color:#333;background:#eee;display:none;max-width:112px}.customize-control-color .color-picker-hex{display:none}.customize-control-color.open .color-picker-hex{display:block}.customize-control-color .dropdown{margin-right:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#555;border:1px solid rgba(0,0,0,.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,.25)}.ios #customize-preview,.ios .wp-full-overlay{position:relative}.ios #customize-controls .wp-full-overlay-sidebar-content{-webkit-overflow-scrolling:touch}.customize-control-background .current,.customize-control-header .current,.customize-control-image .current,.customize-control-upload .current{margin-bottom:8px}.customize-control-header .uploaded{margin-bottom:18px}.customize-control-header .default button:not(.random),.customize-control-header .uploaded button:not(.random){width:100%;padding:0;margin:0;background:0 0;border:none;color:inherit;cursor:pointer}.customize-control-header button img{display:block}.customize-control-background .default-button,.customize-control-background .remove-button,.customize-control-background .upload-button,.customize-control-header button.new,.customize-control-header button.remove,.customize-control-image .default-button,.customize-control-image .remove-button,.customize-control-image .upload-button,.customize-control-upload .default-button,.customize-control-upload .remove-button,.customize-control-upload .upload-button{white-space:normal;width:48%;height:auto}.customize-control-background .current .container,.customize-control-header .current .container,.customize-control-image .current .container,.customize-control-upload .current .container{overflow:hidden;border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px}.customize-control-background .current .container,.customize-control-image .current .container,.customize-control-upload .current .container{min-height:40px}.customize-control-background .placeholder,.customize-control-header .placeholder,.customize-control-image .placeholder,.customize-control-upload .placeholder{width:100%;position:relative;text-align:center;cursor:default}.customize-control-background .inner,.customize-control-header .inner,.customize-control-image .inner,.customize-control-upload .inner{display:none;position:absolute;width:100%;color:#555;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.customize-control-background .inner,.customize-control-image .inner,.customize-control-upload .inner{display:block;min-height:40px}.customize-control-background .inner,.customize-control-header .inner,.customize-control-header .inner .dashicons,.customize-control-image .inner,.customize-control-upload .inner{line-height:20px;top:10px}.customize-control-header .list .inner,.customize-control-header .list .inner .dashicons{top:9px}.customize-control-header .header-view{position:relative;width:100%;margin-bottom:5px}.customize-control-header .header-view:last-child{margin-bottom:0}.customize-control-header .header-view:after{border:0}.customize-control-header .header-view.selected:after{content:'';position:absolute;height:auto;top:0;left:0;bottom:0;right:0;border:4px solid #2ea2cc;-webkit-border-radius:2px;border-radius:2px}.customize-control-header .header-view.button.selected{border:0}.customize-control-header .uploaded .header-view .close{font-size:2em;color:grey;position:absolute;visibility:hidden;top:10px;right:10px;z-index:1;width:20px;height:20px;cursor:pointer}.customize-control-header .uploaded .header-view .close:hover{color:#000;text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff}.customize-control-header .header-view:hover .close{visibility:visible}.customize-control-header .random.placeholder{cursor:pointer;-webkit-border-radius:2px;border-radius:2px;height:40px}.customize-control-header button.random{width:100%;height:auto;min-height:40px;white-space:normal}.customize-control-header button.random .dice{margin-top:4px}.customize-control-header .header-view:hover>button.random .dice,.customize-control-header .placeholder:hover .dice{-webkit-animation:dice-color-change 3s infinite;-ms-animation:dice-color-change 3s infinite;animation:dice-color-change 3s infinite}@-webkit-keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}@-ms-keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}@keyframes dice-color-change{0%{color:#d4b146}50%{color:#ef54b0}75%{color:#7190d3}100%{color:#d4b146}}.customize-control-background .actions,.customize-control-header .actions,.customize-control-image .actions,.customize-control-upload .actions{margin-bottom:32px}.customize-control-header .choice{position:relative;display:block;margin-bottom:9px}.customize-control-header .uploaded div:last-child>.choice{margin-bottom:0}.customize-control-background img,.customize-control-header img,.customize-control-image img,.customize-control-upload img{width:100%;-webkit-border-radius:2px;border-radius:2px}.customize-control-background .default-button,.customize-control-background .remove-button,.customize-control-header .remove,.customize-control-image .default-button,.customize-control-image .remove-button,.customize-control-upload .default-button,.customize-control-upload .remove-button{float:left;margin-right:3px}.customize-control-background .upload-button,.customize-control-header .new,.customize-control-image .upload-button,.customize-control-upload .upload-button{float:right}body.cheatin{font-size:medium;height:auto;background:#fff;margin:50px auto 2em;padding:1em 2em;max-width:700px;min-width:0;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13)}body.cheatin p{font-size:14px;line-height:1.5;margin:25px 0 20px} \ No newline at end of file diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index 16bf27ad5c..8fb1901c25 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -60,6 +60,10 @@ class Custom_Background { $this->admin_image_div_callback = $admin_image_div_callback; add_action( 'admin_menu', array( $this, 'init' ) ); + + add_action( 'wp_ajax_custom-background-add', array( $this, 'ajax_background_add' ) ); + + // Unused since 3.5.0. add_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) ); } @@ -464,23 +468,53 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) ) } /** - * Unused since 3.5.0. + * AJAX handler for adding custom background context to an attachment. + * + * Triggered when the user adds a new background image from the + * Media Manager. + * + * @since 4.1.0 + */ + public function ajax_background_add() { + check_ajax_referer( 'background-add', 'nonce' ); + + if ( ! current_user_can( 'edit_theme_options' ) ) { + wp_send_json_error(); + } + + $attachment_id = absint( $_POST['attachment_id'] ); + if ( $attachment_id < 1 ) { + wp_send_json_error(); + } + + update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_stylesheet() ); + + wp_send_json_success(); + } + + /** * * @since 3.4.0 + * @deprecated 3.5.0 */ public function attachment_fields_to_edit( $form_fields ) { return $form_fields; } /** - * Unused since 3.5.0. * * @since 3.4.0 + * @deprecated 3.5.0 */ public function filter_upload_tabs( $tabs ) { return $tabs; } + /** + * + * @since 3.4.0 + * @deprecated 3.5.0 + */ public function wp_set_background_image() { if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit; $attachment_id = absint($_POST['attachment_id']); diff --git a/wp-admin/js/customize-controls.js b/wp-admin/js/customize-controls.js index db16114b15..880e5839a8 100644 --- a/wp-admin/js/customize-controls.js +++ b/wp-admin/js/customize-controls.js @@ -1,4 +1,4 @@ -/* globals _wpCustomizeHeader, _wpMediaViewsL10n */ +/* globals _wpCustomizeHeader, _wpCustomizeBackground, _wpMediaViewsL10n */ (function( exports, $ ){ var Container, focus, api = wp.customize; @@ -1143,6 +1143,40 @@ thumbnailSrc: function() {} }); + /** + * A control for uploading background images. + * + * @class + * @augments wp.customize.UploadControl + * @augments wp.customize.Control + * @augments wp.customize.Class + */ + api.BackgroundControl = api.UploadControl.extend({ + + /** + * When the control's DOM structure is ready, + * set up internal event bindings. + */ + ready: function() { + api.UploadControl.prototype.ready.apply( this, arguments ); + }, + + /** + * Callback handler for when an attachment is selected in the media modal. + * Does an additional AJAX request for setting the background context. + */ + select: function() { + api.UploadControl.prototype.select.apply( this, arguments ); + + wp.ajax.post( 'custom-background-add', { + nonce: _wpCustomizeBackground.nonces.add, + wp_customize: 'on', + theme: api.settings.theme.stylesheet, + attachment_id: this.params.attachment.id + } ); + } + }); + /** * @class * @augments wp.customize.Control @@ -1822,7 +1856,8 @@ color: api.ColorControl, upload: api.UploadControl, image: api.ImageControl, - header: api.HeaderControl + header: api.HeaderControl, + background: api.BackgroundControl }; api.panelConstructor = {}; api.sectionConstructor = {}; diff --git a/wp-admin/js/customize-controls.min.js b/wp-admin/js/customize-controls.min.js index c28979cf61..9179c74df4 100644 --- a/wp-admin/js/customize-controls.min.js +++ b/wp-admin/js/customize-controls.min.js @@ -1 +1 @@ -!function(a,b){var c,d,e=wp.customize;e.Setting=e.Value.extend({initialize:function(a,b,c){e.Value.prototype.initialize.call(this,b,c),this.id=a,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()])}}}),e.utils={},e.utils.bubbleChildValueChanges=function(a,c){b.each(c,function(b,c){a[c].bind(function(b,c){a.parent&&b!==c&&a.parent.trigger("change",a)})})},d=function(a){var b,c,d;b=this,a=a||{},d=function(){b.container.find(":focusable:first").focus(),b.container[0].scrollIntoView(!0)},a.completeCallback?(c=a.completeCallback,a.completeCallback=function(){d(),c()}):a.completeCallback=d,b.expand?b.expand(a):a.completeCallback()},e.utils.prioritySort=function(a,b){return a.priority()===b.priority()&&"number"==typeof a.params.instanceNumber&&"number"==typeof b.params.instanceNumber?a.params.instanceNumber-b.params.instanceNumber:a.priority()-b.priority()},e.utils.isKeydownButNotEnterEvent=function(a){return"keydown"===a.type&&13!==a.which},e.utils.areElementListsEqual=function(a,c){var d=a.length===c.length&&-1===_.map(_.zip(a,c),function(a){return b(a[0]).is(a[1])}).indexOf(!1);return d},c=e.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},initialize:function(a,c){var d=this;d.id=a,d.params={},b.extend(d,c||{}),d.container=b(d.params.content),d.deferred={embedded:new b.Deferred},d.priority=new e.Value,d.active=new e.Value,d.activeArgumentsQueue=[],d.expanded=new e.Value,d.expandedArgumentsQueue=[],d.active.bind(function(a){var c=d.activeArgumentsQueue.shift();c=b.extend({},d.defaultActiveArguments,c),a=a&&d.isContextuallyActive(),d.onChangeActive(a,c)}),d.expanded.bind(function(a){var c=d.expandedArgumentsQueue.shift();c=b.extend({},d.defaultExpandedArguments,c),d.onChangeExpanded(a,c)}),d.attachEvents(),e.utils.bubbleChildValueChanges(d,["priority","active"]),d.priority.set(isNaN(d.params.priority)?100:d.params.priority),d.active.set(d.params.active),d.expanded.set(!1)},ready:function(){},_children:function(a,b){var c=this,d=[];return e[b].each(function(b){b[a].get()===c.id&&d.push(b)}),d.sort(e.utils.prioritySort),d},isContextuallyActive:function(){throw new Error("Container.isContextuallyActive() must be overridden in a subclass.")},onChangeActive:function(a,c){var d="resolved"===e.previewer.deferred.active.state()?c.duration:0;b.contains(document,this.container)?a?this.container.stop(!0,!0).slideDown(d,c.completeCallback):this.container.stop(!0,!0).slideUp(d,c.completeCallback):(this.container.toggle(a),c.completeCallback&&c.completeCallback())},_toggleActive:function(a,b){var c=this;return b=b||{},a&&this.active.get()||!a&&!this.active.get()?(b.unchanged=!0,c.onChangeActive(c.active.get(),b),!1):(b.unchanged=!1,this.activeArgumentsQueue.push(b),this.active.set(a),!0)},activate:function(a){return this._toggleActive(!0,a)},deactivate:function(a){return this._toggleActive(!1,a)},onChangeExpanded:function(){throw new Error("Must override with subclass.")},_toggleExpanded:function(a,b){var c=this;return b=b||{},a&&this.expanded.get()||!a&&!this.expanded.get()?(b.unchanged=!0,c.onChangeExpanded(c.expanded.get(),b),!1):(b.unchanged=!1,this.expandedArgumentsQueue.push(b),this.expanded.set(a),!0)},expand:function(a){return this._toggleExpanded(!0,a)},collapse:function(a){return this._toggleExpanded(!1,a)},focus:d}),e.Section=c.extend({initialize:function(a,d){var f=this;c.prototype.initialize.call(f,a,d),f.id=a,f.panel=new e.Value,f.panel.bind(function(a){b(f.container).toggleClass("control-subsection",!!a)}),f.panel.set(f.params.panel||""),e.utils.bubbleChildValueChanges(f,["panel"]),f.embed(),f.deferred.embedded.done(function(){f.ready()})},embed:function(){var a,c=this;a=function(a){var d;a?e.panel(a,function(a){a.deferred.embedded.done(function(){d=a.container.find("ul:first"),c.container.parent().is(d)||d.append(c.container),c.deferred.embedded.resolve()})}):(d=b("#customize-theme-controls").children("ul"),c.container.parent().is(d)||d.append(c.container),c.deferred.embedded.resolve())},c.panel.bind(a),a(c.panel.get())},attachEvents:function(){var a=this;a.container.find(".accordion-section-title").on("click keydown",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),a.expanded()?a.collapse():a.expand())})},isContextuallyActive:function(){var a=this,b=a.controls(),c=0;return _(b).each(function(a){a.active()&&(c+=1)}),0!==c},controls:function(){return this._children("section","control")},onChangeExpanded:function(a,b){var c,d=this,f=d.container.find(".accordion-section-content");a?(c=b.unchanged?b.completeCallback:function(){f.stop().slideDown(b.duration,b.completeCallback),d.container.addClass("open")},b.allowMultiple||e.section.each(function(a){a!==d&&a.collapse({duration:b.duration})}),d.panel()?e.panel(d.panel()).expand({duration:b.duration,completeCallback:c}):c()):(d.container.removeClass("open"),f.slideUp(b.duration,b.completeCallback))}}),e.Panel=c.extend({initialize:function(a,b){var d=this;c.prototype.initialize.call(d,a,b),d.embed(),d.deferred.embedded.done(function(){d.ready()})},embed:function(){var a=this,c=b("#customize-theme-controls > ul");a.container.parent().is(c)||c.append(a.container),a.deferred.embedded.resolve()},attachEvents:function(){var a,b=this;b.container.find(".accordion-section-title").on("click keydown",function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),b.expanded()||b.expand())}),a=b.container.find(".panel-meta:first"),a.find("> .accordion-section-title").on("click keydown",function(c){if(!e.utils.isKeydownButNotEnterEvent(c)&&(c.preventDefault(),!a.hasClass("cannot-expand"))){var d=a.find(".accordion-section-content:first");a.hasClass("open")?(a.toggleClass("open"),d.slideUp(b.defaultExpandedArguments.duration)):(d.slideDown(b.defaultExpandedArguments.duration),a.toggleClass("open"))}})},sections:function(){return this._children("panel","section")},isContextuallyActive:function(){var a=this,b=a.sections(),c=0;return _(b).each(function(a){a.active()&&a.isContextuallyActive()&&(c+=1)}),0!==c},onChangeExpanded:function(a,b){if(b.unchanged)return void(b.completeCallback&&b.completeCallback());var c,d,f=this,g=f.container.closest(".accordion-section"),h=g.closest(".wp-full-overlay"),i=g.closest(".accordion-container"),j=i.find(".open"),k=h.find("#customize-theme-controls > ul > .accordion-section > .accordion-section-title").add("#customize-info > .accordion-section-title"),l=h.find(".control-panel-back"),m=g.find(".accordion-section-title").first(),n=g.find(".control-panel-content");a?(e.section.each(function(a){a.panel()||a.collapse({duration:0})}),e.panel.each(function(a){f!==a&&a.collapse({duration:0})}),n.show(0,function(){c=n.offset().top,d=i.scrollTop(),n.css("margin-top",45-c-d),g.addClass("current-panel"),h.addClass("in-sub-panel"),i.scrollTop(0),b.completeCallback&&b.completeCallback()}),k.attr("tabindex","-1"),l.attr("tabindex","0"),l.focus()):(j.removeClass("open"),g.removeClass("current-panel"),h.removeClass("in-sub-panel"),n.delay(180).hide(0,function(){n.css("margin-top","inherit"),b.completeCallback&&b.completeCallback()}),k.attr("tabindex","0"),l.attr("tabindex","-1"),m.focus(),i.scrollTop(0))}}),e.Control=e.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},initialize:function(a,c){var d,f,g,h=this;h.params={},b.extend(h,c||{}),h.id=a,h.selector="#customize-control-"+a.replace(/\]/g,"").replace(/\[/g,"-"),h.templateSelector="customize-control-"+h.params.type+"-content",h.container=b(h.params.content?h.params.content:h.selector),h.deferred={embedded:new b.Deferred},h.section=new e.Value,h.priority=new e.Value,h.active=new e.Value,h.activeArgumentsQueue=[],h.elements=[],d=h.container.find("[data-customize-setting-link]"),f={},d.each(function(){var a,c=b(this);if(c.is(":radio")){if(a=c.prop("name"),f[a])return;f[a]=!0,c=d.filter('[name="'+a+'"]')}e(c.data("customizeSettingLink"),function(a){var b=new e.Element(c);h.elements.push(b),b.sync(a),b.set(a())})}),h.active.bind(function(a){var c=h.activeArgumentsQueue.shift();c=b.extend({},h.defaultActiveArguments,c),h.onChangeActive(a,c)}),h.section.set(h.params.section),h.priority.set(isNaN(h.params.priority)?10:h.params.priority),h.active.set(h.params.active),e.utils.bubbleChildValueChanges(h,["section","priority","active"]),g=b.map(h.params.settings,function(a){return a}),e.apply(e,g.concat(function(){var a;h.settings={};for(a in h.params.settings)h.settings[a]=e(h.params.settings[a]);h.setting=h.settings["default"]||null,h.embed()})),h.deferred.embedded.done(function(){h.ready()})},embed:function(){var a,b=this;a=function(a){var c;a&&e.section(a,function(a){a.deferred.embedded.done(function(){c=a.container.find("ul:first"),b.container.parent().is(c)||(c.append(b.container),b.renderContent()),b.deferred.embedded.resolve()})})},b.section.bind(a),a(b.section.get())},ready:function(){},expand:function(a){e.section(this.section()).expand(a)},focus:d,onChangeActive:function(a,c){b.contains(document,this.container)?a?this.container.slideDown(c.duration,c.completeCallback):this.container.slideUp(c.duration,c.completeCallback):(this.container.toggle(a),c.completeCallback&&c.completeCallback())},toggle:function(a){return this.onChangeActive(a,this.defaultActiveArguments)},activate:c.prototype.activate,deactivate:c.prototype.deactivate,_toggleActive:c.prototype._toggleActive,dropdownInit:function(){var a=this,b=this.container.find(".dropdown-status"),c=this.params,d=!1,f=function(a){"string"==typeof a&&c.statuses&&c.statuses[a]?b.html(c.statuses[a]).show():b.hide()};this.container.on("click keydown",".dropdown",function(b){e.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),d||a.container.toggleClass("open"),a.container.hasClass("open")&&a.container.parent().parent().find("li.library-selected").focus(),d=!0,setTimeout(function(){d=!1},400))}),this.setting.bind(f),f(this.setting())},renderContent:function(){var a,c=this;0!==b("#tmpl-"+c.templateSelector).length&&(a=wp.template(c.templateSelector),a&&c.container&&c.container.html(a(c.params)))}}),e.ColorControl=e.Control.extend({ready:function(){var a=this,b=this.container.find(".color-picker-hex");b.val(a.setting()).wpColorPicker({change:function(){a.setting.set(b.wpColorPicker("color"))},clear:function(){a.setting.set(!1)}}),this.setting.bind(function(a){b.val(a),b.wpColorPicker("color",a)})}}),e.UploadControl=e.Control.extend({ready:function(){var a=this;_.bindAll(a,"restoreDefault","removeFile","openFrame","select"),a.container.on("click keydown",".upload-button",a.openFrame),a.container.on("click keydown",".thumbnail-image img",a.openFrame),a.container.on("click keydown",".default-button",a.restoreDefault),a.container.on("click keydown",".remove-button",a.removeFile),a.setting.bind(function(){a.renderContent()})},openFrame:function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.frame||this.initFrame(),this.frame.open())},initFrame:function(){this.frame=wp.media({button:{text:this.params.button_labels.frame_button},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:this.params.mime_type}),multiple:!1,date:!1})]}),this.frame.on("select",this.select)},select:function(){var a=this.frame.state().get("selection").first().toJSON();this.params.attachment=a,this.setting(a.url)},restoreDefault:function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment=this.params.defaultAttachment,this.setting(this.params.defaultAttachment.url))},removeFile:function(a){e.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment={},this.setting(""),this.renderContent())},success:function(){},removerVisibility:function(){}}),e.ImageControl=e.UploadControl.extend({thumbnailSrc:function(){}}),e.HeaderControl=e.Control.extend({ready:function(){this.btnRemove=b("#customize-control-header_image .actions .remove"),this.btnNew=b("#customize-control-header_image .actions .new"),_.bindAll(this,"openMedia","removeImage"),this.btnNew.on("click",this.openMedia),this.btnRemove.on("click",this.removeImage),e.HeaderTool.currentHeader=new e.HeaderTool.ImageModel,new e.HeaderTool.CurrentView({model:e.HeaderTool.currentHeader,el:"#customize-control-header_image .current .container"}),new e.HeaderTool.ChoiceListView({collection:e.HeaderTool.UploadsList=new e.HeaderTool.ChoiceList,el:"#customize-control-header_image .choices .uploaded .list"}),new e.HeaderTool.ChoiceListView({collection:e.HeaderTool.DefaultsList=new e.HeaderTool.DefaultsList,el:"#customize-control-header_image .choices .default .list"}),e.HeaderTool.combinedList=e.HeaderTool.CombinedList=new e.HeaderTool.CombinedList([e.HeaderTool.UploadsList,e.HeaderTool.DefaultsList])},calculateImageSelectOptions:function(a,b){var c,d,f,g,h,i,j=parseInt(_wpCustomizeHeader.data.width,10),k=parseInt(_wpCustomizeHeader.data.height,10),l=!!parseInt(_wpCustomizeHeader.data["flex-width"],10),m=!!parseInt(_wpCustomizeHeader.data["flex-height"],10);return h=a.get("width"),g=a.get("height"),this.headerImage=new e.HeaderTool.ImageModel,this.headerImage.set({themeWidth:j,themeHeight:k,themeFlexWidth:l,themeFlexHeight:m,imageWidth:h,imageHeight:g}),b.set("canSkipCrop",!this.headerImage.shouldBeCropped()),c=j/k,d=h,f=g,d/f>c?(k=f,j=k*c):(j=d,k=j/c),i={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:h,imageHeight:g,x1:0,y1:0,x2:j,y2:k},m===!1&&l===!1&&(i.aspectRatio=j+":"+k),m===!1&&(i.maxHeight=k),l===!1&&(i.maxWidth=j),i},openMedia:function(a){var b=_wpMediaViewsL10n;a.preventDefault(),this.frame=wp.media({button:{text:b.selectAndCrop,close:!1},states:[new wp.media.controller.Library({title:b.chooseImage,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:_wpCustomizeHeader.data.width,suggestedHeight:_wpCustomizeHeader.data.height}),new wp.media.controller.Cropper({imgSelectOptions:this.calculateImageSelectOptions})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this),this.frame.open()},onSelect:function(){this.frame.setState("cropper")},onCropped:function(a){var b=a.post_content,c=a.attachment_id,d=a.width,e=a.height;this.setImageFromURL(b,c,d,e)},onSkippedCrop:function(a){var b=a.get("url"),c=a.get("width"),d=a.get("height");this.setImageFromURL(b,a.id,c,d)},setImageFromURL:function(a,b,c,d){var f,g={};g.url=a,g.thumbnail_url=a,g.timestamp=_.now(),b&&(g.attachment_id=b),c&&(g.width=c),d&&(g.height=d),f=new e.HeaderTool.ImageModel({header:g,choice:a.split("/").pop()}),e.HeaderTool.UploadsList.add(f),e.HeaderTool.currentHeader.set(f.toJSON()),f.save(),f.importImage()},removeImage:function(){e.HeaderTool.currentHeader.trigger("hide"),e.HeaderTool.CombinedList.trigger("control:removeImage")}}),e.defaultConstructor=e.Setting,e.control=new e.Values({defaultConstructor:e.Control}),e.section=new e.Values({defaultConstructor:e.Section}),e.panel=new e.Values({defaultConstructor:e.Panel}),e.PreviewFrame=e.Messenger.extend({sensitivity:2e3,initialize:function(a,c){var d=b.Deferred();d.promise(this),this.container=a.container,this.signature=a.signature,b.extend(a,{channel:e.PreviewFrame.uuid()}),e.Messenger.prototype.initialize.call(this,a,c),this.add("previewUrl",a.previewUrl),this.query=b.extend(a.query||{},{customize_messenger_channel:this.channel()}),this.run(d)},run:function(a){var c=this,d=!1,f=!1;this._ready&&this.unbind("ready",this._ready),this._ready=function(){f=!0,d&&a.resolveWith(c)},this.bind("ready",this._ready),this.bind("ready",function(a){if(a){var b={panel:a.activePanels,section:a.activeSections,control:a.activeControls};_(b).each(function(a,b){e[b].each(function(b,c){var d=!(!a||!a[c]);b.active(d)})})}}),this.request=b.ajax(this.previewUrl(),{type:"POST",data:this.query,xhrFields:{withCredentials:!0}}),this.request.fail(function(){a.rejectWith(c,["request failure"])}),this.request.done(function(e){var g,h=c.request.getResponseHeader("Location"),i=c.signature;return h&&h!==c.previewUrl()?void a.rejectWith(c,["redirect",h]):"0"===e?void c.login(a):"-1"===e?void a.rejectWith(c,["cheatin"]):(g=e.lastIndexOf(i),-1===g||g")?void a.rejectWith(c,["unsigned"]):(e=e.slice(0,g)+e.slice(g+i.length),c.iframe=b("