Tooltips for media buttons. Hat tip: azaozz.

git-svn-id: http://svn.automattic.com/wordpress/trunk@7311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2008-03-15 16:53:36 +00:00
parent fe5387bbbc
commit 44cb71faa1
6 changed files with 66 additions and 2 deletions

View File

@ -704,3 +704,8 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
#poststuff #titlewrap {
border-color: #ccc;
}
#tTips p#tTips_inside {
background-color: #ddd;
color: #333;
}

View File

@ -678,4 +678,9 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
.curtime {
color: #666;
}
}
#tTips p#tTips_inside {
background-color: #ddd;
color: #333;
}

BIN
wp-admin/images/tail.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

View File

@ -10,3 +10,36 @@ addLoadEvent( function() {
jQuery('form').submit( function() { return wpAjax.validateForm( jQuery(this) ); } );
}
});
(function(JQ) {
JQ.fn.tTips = function() {
JQ('body').append('<div id="tTips"><p id="tTips_inside"></p></div>');
var TT = JQ('#tTips');
this.each(function() {
var el = JQ(this), txt;
if ( txt = el.attr('title') ) el.attr('tip', txt).removeAttr('title');
else return;
el.find('img').removeAttr('alt');
el.mouseover(function(e) {
txt = el.attr('tip'), o = el.offset();;
clearTimeout(TT.sD);
TT.find('p').html(txt);
TT.css({'top': o.top - 43, 'left': o.left - 5});
TT.sD = setTimeout(function(){TT.fadeIn(150);}, 100);
});
el.mouseout(function() {
clearTimeout(TT.sD);
TT.css({display : 'none'});
})
});
}
}(jQuery));
jQuery(function(){jQuery('#media-buttons a').tTips();});

View File

@ -1364,3 +1364,24 @@ ul.view-switch li.current {
.tablenav .delete {
margin-right: 20px;
}
#tTips {
display: none;
position: absolute;
margin: 0;
padding: 0 0 8px 0;
background-image: url(images/tail.gif);
background-repeat: no-repeat;
background-position: 15px bottom;
background-color: thansparent;
}
#tTips p#tTips_inside {
margin: 0;
padding: 8px 12px;
text-align: center;
-moz-border-radius: 8px;
-khtml-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
}

View File

@ -11,7 +11,7 @@ class WP_Scripts {
}
function default_scripts() {
$this->add( 'common', '/wp-admin/js/common.js', false, '1.0' );
$this->add( 'common', '/wp-admin/js/common.js', array('jquery'), '1.0' );
$this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
$this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' );