diff --git a/wp-includes/css/customize-controls.css b/wp-includes/css/customize-controls.css index 2c68d79e69..fc6844f61c 100644 --- a/wp-includes/css/customize-controls.css +++ b/wp-includes/css/customize-controls.css @@ -1 +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}.customize-section-content{display:none;padding:10px 20px 15px;overflow:hidden}.control-section{border:0}.control-section .customize-section-title{padding:8px 20px;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;font-size:13px}.control-section .customize-section-title:hover{background:-webkit-linear-gradient(top,#f5f5f5,#eee);box-shadow:inset -11px 0 8px -8px rgba(0,0,0,0.1)}.control-section .customize-section-content{border-top:1px solid #fff;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 transparent transparent;border-style:solid;border-width:6px;position:absolute;top:25px;right:20px;z-index:1}.customize-section.open .customize-section-title:after{margin-top:-7px;border-color:transparent transparent #ccc transparent}.control-section .customize-section-title:after{top:13px}#customize-info{margin-top:45px}#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;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{padding-bottom:60px}#customize-theme-controls>ul,#customize-theme-controls .customize-section-content{margin:0}.customize-control{float:left;clear:both;margin-bottom:4px}.customize-control-title{clear:left;float:left;min-width:110px;margin-right:10px;line-height:28px}.customize-control-text input,.customize-control-select select,.customize-control-checkbox input,.customize-control-color .color-picker,.customize-control-upload div{float:left;clear:right;line-height:28px}.customize-control-text input{float:right;width:138px;line-height:18px;margin:1px}.customize-control-select select{width:138px;height:28px;line-height:28px}.customize-control-checkbox input{margin-top:8px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:22px}.customize-control-radio label{float:left;clear:both;line-height:20px}.customize-control-radio input{margin-right:5px}#customize-preview iframe{width:100%;height:100%}.customize-section select{max-width:150px}.customize-section .color-picker-toggle{float:left;display:block;-webkit-border-radius:3px;border-radius:3px}.customize-section .color-picker-spot,.customize-section .color-picker-dropdown{float:left;height:24px;line-height:24px}.customize-section .color-picker-spot{min-width:30px;padding:0 5px;background-color:#fff;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.customize-section .color-picker-dropdown{position:relative;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-section .color-picker-dropdown:after{content:'';width:0;height:0;border-color:#ccc transparent transparent transparent;border-style:solid;border-width:4px;position:absolute;top:11px;right:4px;z-index:1}.customize-section .color-picker-toggle.open .color-picker-dropdown:after{border-color:transparent transparent #ccc transparent;top:6px}.customize-section .color-picker-toggle:hover .color-picker-spot{border-color:rgba(0,0,0,0.25)}.customize-section .color-picker-toggle:hover .color-picker-dropdown{border-color:#aaa}.customize-section .color-picker-toggle:hover .color-picker-dropdown:after{border-color:#aaa transparent transparent transparent}.customize-section .color-picker-toggle.open:hover .color-picker-dropdown:after{border-color:transparent transparent #aaa transparent}.customize-section .color-picker-control{display:none}.customize-section .color-picker-hex{float:left;width:70px;margin-left:5px;font-family:monospace;background-color:#fff;color:#777;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px}.customize-section .color-picker-hex span{float:left;display:block;margin:1px -2px 0 0;line-height:16px;padding:3px 0 3px 8px;text-align:right;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.customize-section .color-picker-hex input[type="text"]{width:50px;line-height:16px;color:#777;background:transparent;border:0;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-section .color-picker-control.farbtastic-placeholder{width:235px;margin:5px 0 10px 25px;float:left}.customize-section .color-picker-control .farbtastic{margin:0 auto}.customize-section .customize-control-image .thumbnail{float:right;width:138px;min-height:25px;border:1px solid #ccc;margin-bottom:5px;background:#eee}.customize-section .customize-control-image .thumbnail img{display:block;max-width:138px;max-height:98px;margin:0 auto}.customize-section .customize-control-image .actions{width:140px;float:right}.customize-section .customize-control-image .actions a{display:block}.customize-section .customize-control-image .library{display:none}.customize-section .customize-control-image .library ul{border-bottom:1px solid #dfdfdf;float:left;width:100%;margin:5px 0}.customize-section .customize-control-image .library li{color:#999;float:left;padding:4px 6px;margin:0;border-style:solid;border-color:transparent;border-width:1px 1px 0 1px}.customize-section .customize-control-image .library li.library-selected{color:#777;border-color:#dfdfdf;background:#f5f5f5;margin-bottom:-1px;padding-bottom:5px}.customize-section .customize-control-image .library div{width:100%;float:left}.customize-section .customize-control-image .library a{display:block;max-width:220px;max-height:80px;margin:5px auto;padding:4px;background:#fff;border:1px solid #dfdfdf}.customize-section .customize-control-image .library a:hover{border-color:#21759b}.customize-section .customize-control-image .library img{display:block;max-width:220px;max-height:80px}.customize-section .customize-control-image .library-content{display:none} \ No newline at end of file +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}.customize-section-content{display:none;padding:10px 20px 15px;overflow:hidden}.control-section{border:0}.control-section .customize-section-title{padding:8px 20px;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;font-size:13px}.control-section .customize-section-title:hover{background:-webkit-linear-gradient(top,#f5f5f5,#eee);box-shadow:inset -11px 0 8px -8px rgba(0,0,0,0.1)}.control-section .customize-section-content{border-top:1px solid #fff;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 transparent transparent;border-style:solid;border-width:6px;position:absolute;top:25px;right:20px;z-index:1}.customize-section.open .customize-section-title:after{margin-top:-7px;border-color:transparent transparent #ccc transparent}.control-section .customize-section-title:after{top:13px}#customize-info{margin-top:45px}#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;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{padding-bottom:60px}#customize-theme-controls>ul,#customize-theme-controls .customize-section-content{margin:0}.customize-control{float:left;clear:both;margin-bottom:4px}.customize-control-title{clear:left;float:left;min-width:110px;margin-right:10px;line-height:28px}.customize-control-text input,.customize-control-select select,.customize-control-checkbox input,.customize-control-color .color-picker,.customize-control-upload div{float:left;clear:right;line-height:28px}.customize-control-text input{float:right;width:138px;line-height:18px;margin:1px}.customize-control-select select{width:138px;height:28px;line-height:28px}.customize-control-checkbox input{margin-top:8px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:22px}.customize-control-radio label{float:left;clear:both;line-height:20px}.customize-control-radio input{margin-right:5px}#customize-preview iframe{width:100%;height:100%}.customize-section select{max-width:150px}.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:24px;line-height:24px;margin-right:16px;padding:0 5px;background-color:#eee;border:1px solid #ccc;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.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 .color-picker-control{display:none}.customize-control.open .color-picker-control{display:block}.customize-control .dropdown .color-picker-spot{background-color:#fff;border:1px solid rgba(0,0,0,0.15)}.customize-section .dropdown:hover .color-picker-spot{border-color:rgba(0,0,0,0.25)}.customize-section .color-picker-hex{float:left;width:70px;margin-left:5px;font-family:monospace;background-color:#fff;color:#777;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px}.customize-section .color-picker-hex span{float:left;display:block;margin:1px -2px 0 0;line-height:16px;padding:3px 0 3px 8px;text-align:right;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.customize-section .color-picker-hex input[type="text"]{width:50px;line-height:16px;color:#777;background:transparent;border:0;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-section .color-picker-control.farbtastic-placeholder{width:235px;margin:5px 0 10px 25px;float:left}.customize-section .color-picker-control .farbtastic{margin:0 auto}.customize-control-image .library,.customize-control-image .actions{display:none}.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 .preview-thumbnail img{display:block;max-width:122px;max-height:98px;margin:0 auto}.customize-section .customize-control-image .actions{float: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:260px;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-dropzone,.customize-section .customize-control-image .upload-dropzone{padding:15px 10px;border:3px dashed #dfdfdf;margin:5px auto;text-align:center;color:#777;position:relative} \ No newline at end of file diff --git a/wp-includes/js/customize-controls.js b/wp-includes/js/customize-controls.js index 2e46e754ed..31ded99c9b 100644 --- a/wp-includes/js/customize-controls.js +++ b/wp-includes/js/customize-controls.js @@ -1 +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.method=this.method||"refresh";e=c("",{type:"hidden",value:this.get(),name:b.settings.prefix+g});e.appendTo(this.previewer.form);this.element=new b.Element(e);this.sync(this.element);this.bind(this.preview)},preview:function(){switch(this.method){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-setting-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(){}});b.ColorControl=b.Control.extend({ready:function(){var g=this,d,e,f,h,i;d=this.container.find(".color-picker-toggle");e=d.find(".color-picker-spot");f=this.container.find(".color-picker-control");i=function(j){j="#"+j;e.css("background",j);g.farbtastic.setColor(j)};d.on("click",function(j){f.toggle();d.toggleClass("open");j.preventDefault()});this.farbtastic=c.farbtastic(this.container.find(".farbtastic-placeholder"),function(j){g.setting.set(j.replace("#",""))});this.setting.bind(i);i(this.setting())}});b.UploadControl=b.Control.extend({ready:function(){var d=this;this.params.removed=this.params.removed||"";this.uploader=new wp.Uploader({browser:this.container.find(".upload"),success:function(e){d.setting.set(e.url)}});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("post_data[context]",this.params.context)}},removerVisibility:function(d){this.remover.toggle(d!=this.params.removed)}});b.ImageControl=b.UploadControl.extend({ready:function(){var d=this;b.UploadControl.prototype.ready.call(this);this.thumbnail=this.container.find(".thumbnail img");this.thumbnailSrc=c.proxy(this.thumbnailSrc,this);this.setting.bind(this.thumbnailSrc);this.library=this.container.find(".library");this.changer=this.container.find(".change");this.changer.click(function(e){d.library.toggle();e.preventDefault()});this.library.on("click","li",function(f){var e=c(this),g=e.data("customizeTab");f.preventDefault();if(e.hasClass("library-selected")){return}e.siblings(".library-selected").removeClass("library-selected");e.addClass("library-selected");d.library.find("div").hide().filter(function(){return c(this).data("customizeTab")===g}).show()});this.library.on("click","a",function(e){d.setting.set(c(this).attr("href"));e.preventDefault()})},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(f,e){var d=this;c.extend(this,e||{});this.loaded=c.proxy(this.loaded,this);this.loaderUuid=0;this.refresh=(function(g){var h=g.refresh,j=function(){i=null;h.call(g)},i;return function(){if(typeof i!=="number"){if(g.loading){g.loading.remove();delete g.loading;g.loader()}else{return j()}}clearTimeout(i);i=setTimeout(j,g.refreshBuffer)}})(this);this.iframe=b.ensure(f.iframe);this.form=b.ensure(f.form);this.name=this.iframe.prop("name");this.container=this.iframe.parent();b.Messenger.prototype.initialize.call(this,f.url,this.iframe[0].contentWindow);this._formOriginalProps={target:this.form.prop("target"),action:this.form.prop("action")};this.bind("url",function(g){if(this.url()==g||0!==g.indexOf(this.origin()+"/")||-1!==g.indexOf("wp-admin")){return}this.url(g);this.refresh()});this.refresh();this.form.on("keydown",function(g){if(13===g.which){g.preventDefault()}});this.parent=new b.Messenger(b.settings.parent);this.parent.bind("back",function(g){d.form.find(".back").text(g).click(function(h){h.preventDefault();d.parent.send("close")})});this.parent.send("ready")},loader:function(){if(this.loading){return this.loading}this.loading=c("