From 6a29b9ad42bbce965c7b1756f1c91eef3cac204a Mon Sep 17 00:00:00 2001 From: koopersmith Date: Fri, 14 Oct 2011 03:58:27 +0000 Subject: [PATCH] Tweak pointer styles. see #18693. git-svn-id: http://svn.automattic.com/wordpress/trunk@18971 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/css/wp-pointer.css | 2 +- wp-includes/css/wp-pointer.dev.css | 24 +++++++++++++++++++----- wp-includes/js/wp-pointer.dev.js | 2 +- wp-includes/js/wp-pointer.js | 2 +- wp-includes/script-loader.php | 4 ++-- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/wp-includes/css/wp-pointer.css b/wp-includes/css/wp-pointer.css index 6ae161c7a1..40ca283659 100644 --- a/wp-includes/css/wp-pointer.css +++ b/wp-includes/css/wp-pointer.css @@ -1 +1 @@ -.wp-pointer-content{padding:0 10px;background:white;border:1px solid #aaa;-moz-box-shadow:0 0 16px rgba(0,0,0,0.1);-webkit-box-shadow:0 0 16px rgba(0,0,0,0.1);box-shadow:0 0 16px rgba(0,0,0,0.1);}.wp-pointer-buttons{padding:0 0 10px 0;overflow:auto;}.wp-pointer-buttons a{float:right;display:inline-block;}.wp-pointer-arrow,.wp-pointer-arrow-inner{position:absolute;width:0;height:0;}.wp-pointer-arrow{z-index:10;}.wp-pointer-arrow-inner{z-index:20;}.wp-pointer-left{margin-left:10px;}.wp-pointer-right{margin-left:-10px;}.wp-pointer-top{margin-top:10px;}.wp-pointer-bottom{margin-top:-10px;}.wp-pointer-left .wp-pointer-arrow,.wp-pointer-right .wp-pointer-arrow,.wp-pointer-top .wp-pointer-arrow,.wp-pointer-bottom .wp-pointer-arrow{border:solid 10px transparent;}.wp-pointer-left .wp-pointer-arrow{border-right-color:#aaa;border-left-width:0;}.wp-pointer-right .wp-pointer-arrow{border-left-color:#aaa;border-right-width:0;}.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#aaa;border-top-width:0;}.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#aaa;border-bottom-width:0;}.wp-pointer-left .wp-pointer-arrow-inner,.wp-pointer-right .wp-pointer-arrow-inner,.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer-bottom .wp-pointer-arrow-inner{border:solid 9px transparent;}.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fff;border-left-width:0;top:-9px;left:2px;}.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fff;border-right-width:0;top:-9px;right:2px;}.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fff;border-top-width:0;top:2px;left:-9px;}.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fff;border-bottom-width:0;bottom:2px;left:-9px;} \ No newline at end of file +.wp-pointer-content{padding:0 15px;background:white;border:1px solid #aaa;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:1px 1px 2px rgba(0,0,0,0.4);-webkit-box-shadow:1px 1px 2px rgba(0,0,0,0.4);box-shadow:1px 1px 2px rgba(0,0,0,0.4);}.wp-pointer-buttons{margin:0 -15px;padding:1em 15px;overflow:auto;background:#f5f5f5;border-top:1px solid #ccc;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;}.wp-pointer-buttons a{float:right;display:inline-block;text-decoration:none;}.wp-pointer-arrow,.wp-pointer-arrow-inner{position:absolute;width:0;height:0;}.wp-pointer-arrow{z-index:10;}.wp-pointer-arrow-inner{z-index:20;}.wp-pointer-left{margin-left:10px;}.wp-pointer-right{margin-left:-10px;}.wp-pointer-top{margin-top:10px;}.wp-pointer-bottom{margin-top:-10px;}.wp-pointer-left .wp-pointer-arrow,.wp-pointer-right .wp-pointer-arrow,.wp-pointer-top .wp-pointer-arrow,.wp-pointer-bottom .wp-pointer-arrow{border:solid 10px transparent;}.wp-pointer-left .wp-pointer-arrow{border-right-color:#aaa;border-left-width:0;}.wp-pointer-right .wp-pointer-arrow{border-left-color:#aaa;border-right-width:0;}.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#aaa;border-top-width:0;}.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#aaa;border-bottom-width:0;}.wp-pointer-left .wp-pointer-arrow-inner,.wp-pointer-right .wp-pointer-arrow-inner,.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer-bottom .wp-pointer-arrow-inner{border:solid 9px transparent;}.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fff;border-left-width:0;top:-9px;left:2px;}.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fff;border-right-width:0;top:-9px;right:2px;}.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fff;border-top-width:0;top:2px;left:-9px;}.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fff;border-bottom-width:0;bottom:2px;left:-9px;} \ No newline at end of file diff --git a/wp-includes/css/wp-pointer.dev.css b/wp-includes/css/wp-pointer.dev.css index 6f94190d3f..c7965b57b0 100644 --- a/wp-includes/css/wp-pointer.dev.css +++ b/wp-includes/css/wp-pointer.dev.css @@ -1,18 +1,32 @@ .wp-pointer-content { - padding: 0 10px; + padding: 0 15px; background: white; border: 1px solid #aaa; - -moz-box-shadow: 0 0 16px rgba( 0, 0, 0, 0.1 ); - -webkit-box-shadow: 0 0 16px rgba( 0, 0, 0, 0.1 ); - box-shadow: 0 0 16px rgba( 0, 0, 0, 0.1 ); + + -webkit-border-radius: 3px; + border-radius: 3px; + + -moz-box-shadow: 1px 1px 2px rgba( 0, 0, 0, 0.4 ); + -webkit-box-shadow: 1px 1px 2px rgba( 0, 0, 0, 0.4 ); + box-shadow: 1px 1px 2px rgba( 0, 0, 0, 0.4 ); } .wp-pointer-buttons { - padding: 0 0 10px 0; + margin: 0 -15px; + padding: 1em 15px; overflow: auto; + background: #f5f5f5; + border-top: 1px solid #ccc; + + -webkit-border-bottom-right-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + } .wp-pointer-buttons a { float: right; display: inline-block; + text-decoration: none; } /* The arrow base class must take up no space, even with transparent borders. */ .wp-pointer-arrow, diff --git a/wp-includes/js/wp-pointer.dev.js b/wp-includes/js/wp-pointer.dev.js index 1fe30615bf..2ebfbb4258 100644 --- a/wp-includes/js/wp-pointer.dev.js +++ b/wp-includes/js/wp-pointer.dev.js @@ -13,7 +13,7 @@ }, buttons: function( event, t ) { var close = ( wpPointerL10n ) ? wpPointerL10n.close : 'Close', - button = $('' + close + ''); + button = $('' + close + ''); return button.bind( 'click.pointer', function() { t.element.pointer('close'); diff --git a/wp-includes/js/wp-pointer.js b/wp-includes/js/wp-pointer.js index 03cd440bb8..511ba4fa98 100644 --- a/wp-includes/js/wp-pointer.js +++ b/wp-includes/js/wp-pointer.js @@ -1 +1 @@ -(function(c){var a=0,b=9999;c.widget("wp.pointer",{options:{pointerClass:"wp-pointer",content:function(f,e,d){return c(this).text()},buttons:function(f,e){var g=(wpPointerL10n)?wpPointerL10n.close:"Close",d=c(''+g+"");return d.bind("click.pointer",function(){e.element.pointer("close")})},position:"top",show:function(e,d){d.pointer.show();d.opened()},hide:function(e,d){d.pointer.hide();d.closed()},document:document},_create:function(){var e,d;this.content=c('
');this.arrow=c('
');d=this.element.parents().add(this.element);e="absolute";if(d.filter(function(){return"fixed"===c(this).css("position")}).length){e="fixed"}this.pointer=c("
").append(this.content).append(this.arrow).attr("id","wp-pointer-"+a++).addClass(this.options.pointerClass).css("position",e).hide().appendTo(this.options.document.body)},_setOption:function(d,f){var g=this.options,e=this.pointer;if(d==="document"&&f!==g.document){e.detach().appendTo(f.body)}else{if(d==="pointerClass"){e.removeClass(g.pointerClass).addClass(f)}}c.Widget.prototype._setOption.apply(this,arguments);if(d==="position"){this.reposition()}else{if(d==="content"&&this.active){this.update()}}},destroy:function(){this.pointer.remove();c.Widget.prototype.destroy.call(this)},widget:function(){return this.pointer},update:function(g){var e=this,h=this.options,d=c.Deferred(),f;if(h.disabled){return}d.done(function(i){e._update(g,i)});if(typeof h.content==="string"){f=h.content}else{f=h.content.call(this.element[0],d.resolve,g,this._handoff())}if(f){d.resolve(f)}return d.promise()},_update:function(f,e){var d,g=this.options;if(!e){return}this.pointer.stop();this.content.html(e);d=g.buttons.call(this.element[0],f,this._handoff());if(d){d.wrap('
').parent().appendTo(this.content)}this.reposition()},reposition:function(){var d;if(this.options.disabled){return}d=this._processPosition(this.options.position);this.pointer.css({top:0,left:0,zIndex:b++}).show().position(c.extend({of:this.element},d));this.repoint()},repoint:function(){var f=this.options,e,d;if(f.disabled){return}e=c.extend(this._processPosition(f.position),{of:this.pointer,offset:""});d=e.at+"";e.at=e.my;e.my=d;if(e.align!="center"){e.offset=(e.align=="top"||e.align=="left")?15:-15;if(e.align=="top"||e.align=="bottom"){e.offset="0 "+e.offset}else{e.offset=e.offset+" 0"}}this.pointer[0].className=this.pointer[0].className.replace(/wp-pointer-[^\s'"]*/,"");this.pointer.addClass("wp-pointer-"+e.edge);this.arrow.position(e)},_processPosition:function(e){var f={top:"bottom",bottom:"top",left:"right",right:"left"},d;if(typeof e=="string"){d={edge:e+""}}else{d=c.extend({},e)}if(!d.edge){return d}if(d.edge=="top"||d.edge=="bottom"){d.align=d.align||"left";d.at=d.at||d.align+" "+f[d.edge];d.my=d.my||d.align+" "+d.edge}else{d.align=d.align||"top";d.at=d.at||f[d.edge]+" "+d.align;d.my=d.my||d.edge+" "+d.align}return d},open:function(e){var d=this,f=this.options;if(this.active||f.disabled){return}this.update().done(function(){d._open(e)})},_open:function(e){var d=this,f=this.options;if(this.active||f.disabled){return}this.active=true;this._trigger("open",e,this._handoff());this._trigger("show",e,this._handoff({opened:function(){d._trigger("opened",e,d._handoff())}}))},close:function(e){if(!this.active||this.options.disabled){return}var d=this;this.active=false;this._trigger("close",e,this._handoff());this._trigger("hide",e,this._handoff({closed:function(){d._trigger("closed",e,d._handoff())}}))},sendToTop:function(d){if(this.active){this.pointer.css("z-index",b++)}},toggle:function(d){if(this.pointer.is(":hidden")){this.open(d)}else{this.close(d)}},_handoff:function(d){return c.extend({pointer:this.pointer,element:this.element},d)}})})(jQuery); \ No newline at end of file +(function(c){var a=0,b=9999;c.widget("wp.pointer",{options:{pointerClass:"wp-pointer",content:function(f,e,d){return c(this).text()},buttons:function(f,e){var g=(wpPointerL10n)?wpPointerL10n.close:"Close",d=c(""+g+"");return d.bind("click.pointer",function(){e.element.pointer("close")})},position:"top",show:function(e,d){d.pointer.show();d.opened()},hide:function(e,d){d.pointer.hide();d.closed()},document:document},_create:function(){var e,d;this.content=c('
');this.arrow=c('
');d=this.element.parents().add(this.element);e="absolute";if(d.filter(function(){return"fixed"===c(this).css("position")}).length){e="fixed"}this.pointer=c("
").append(this.content).append(this.arrow).attr("id","wp-pointer-"+a++).addClass(this.options.pointerClass).css("position",e).hide().appendTo(this.options.document.body)},_setOption:function(d,f){var g=this.options,e=this.pointer;if(d==="document"&&f!==g.document){e.detach().appendTo(f.body)}else{if(d==="pointerClass"){e.removeClass(g.pointerClass).addClass(f)}}c.Widget.prototype._setOption.apply(this,arguments);if(d==="position"){this.reposition()}else{if(d==="content"&&this.active){this.update()}}},destroy:function(){this.pointer.remove();c.Widget.prototype.destroy.call(this)},widget:function(){return this.pointer},update:function(g){var e=this,h=this.options,d=c.Deferred(),f;if(h.disabled){return}d.done(function(i){e._update(g,i)});if(typeof h.content==="string"){f=h.content}else{f=h.content.call(this.element[0],d.resolve,g,this._handoff())}if(f){d.resolve(f)}return d.promise()},_update:function(f,e){var d,g=this.options;if(!e){return}this.pointer.stop();this.content.html(e);d=g.buttons.call(this.element[0],f,this._handoff());if(d){d.wrap('
').parent().appendTo(this.content)}this.reposition()},reposition:function(){var d;if(this.options.disabled){return}d=this._processPosition(this.options.position);this.pointer.css({top:0,left:0,zIndex:b++}).show().position(c.extend({of:this.element},d));this.repoint()},repoint:function(){var f=this.options,e,d;if(f.disabled){return}e=c.extend(this._processPosition(f.position),{of:this.pointer,offset:""});d=e.at+"";e.at=e.my;e.my=d;if(e.align!="center"){e.offset=(e.align=="top"||e.align=="left")?15:-15;if(e.align=="top"||e.align=="bottom"){e.offset="0 "+e.offset}else{e.offset=e.offset+" 0"}}this.pointer[0].className=this.pointer[0].className.replace(/wp-pointer-[^\s'"]*/,"");this.pointer.addClass("wp-pointer-"+e.edge);this.arrow.position(e)},_processPosition:function(e){var f={top:"bottom",bottom:"top",left:"right",right:"left"},d;if(typeof e=="string"){d={edge:e+""}}else{d=c.extend({},e)}if(!d.edge){return d}if(d.edge=="top"||d.edge=="bottom"){d.align=d.align||"left";d.at=d.at||d.align+" "+f[d.edge];d.my=d.my||d.align+" "+d.edge}else{d.align=d.align||"top";d.at=d.at||f[d.edge]+" "+d.align;d.my=d.my||d.edge+" "+d.align}return d},open:function(e){var d=this,f=this.options;if(this.active||f.disabled){return}this.update().done(function(){d._open(e)})},_open:function(e){var d=this,f=this.options;if(this.active||f.disabled){return}this.active=true;this._trigger("open",e,this._handoff());this._trigger("show",e,this._handoff({opened:function(){d._trigger("opened",e,d._handoff())}}))},close:function(e){if(!this.active||this.options.disabled){return}var d=this;this.active=false;this._trigger("close",e,this._handoff());this._trigger("hide",e,this._handoff({closed:function(){d._trigger("closed",e,d._handoff())}}))},sendToTop:function(d){if(this.active){this.pointer.css("z-index",b++)}},toggle:function(d){if(this.pointer.is(":hidden")){this.open(d)}else{this.close(d)}},_handoff:function(d){return c.extend({pointer:this.pointer,element:this.element},d)}})})(jQuery); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index eadb5f601f..1b37d2d669 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -96,7 +96,7 @@ function wp_default_scripts( &$scripts ) { 'broken' => __('An unidentified error has occurred.') ) ); - $scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111013a', 1 ); + $scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111013b', 1 ); $scripts->add_script_data( 'wp-pointer', 'wpPointerL10n', array( 'close' => __('Close'), ) ); @@ -455,7 +455,7 @@ function wp_default_styles( &$styles ) { $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20111010' ); $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101224' ); $styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20111010' ); - $styles->add( 'wp-pointer', "/wp-includes/css/wp-pointer$suffix.css", array(), '20111013' ); + $styles->add( 'wp-pointer', "/wp-includes/css/wp-pointer$suffix.css", array(), '20111013a' ); foreach ( $rtl_styles as $rtl_style ) { $styles->add_data( $rtl_style, 'rtl', true );