Collapse crazyhorse to trunk. Incoming! see #7552
git-svn-id: http://svn.automattic.com/wordpress/trunk@8691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
jQuery(document).ready( function() {
|
||||
add_postbox_toggles('comment');
|
||||
postboxes.add_postbox_toggles('comment');
|
||||
|
||||
// close postboxes that should be closed
|
||||
jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
|
||||
@@ -10,17 +10,31 @@ jQuery(document).ready( function() {
|
||||
|
||||
jQuery('.edit-timestamp').click(function () {
|
||||
if (jQuery('#timestampdiv').is(":hidden")) {
|
||||
jQuery('#curtime').slideUp("normal");
|
||||
jQuery('#timestampdiv').slideDown("normal");
|
||||
jQuery('.edit-timestamp').text(commentL10n.cancel);
|
||||
} else {
|
||||
jQuery('#timestampdiv').hide();
|
||||
jQuery('#timestampdiv').slideUp("normal");
|
||||
jQuery('#mm').val(jQuery('#hidden_mm').val());
|
||||
jQuery('#jj').val(jQuery('#hidden_jj').val());
|
||||
jQuery('#aa').val(jQuery('#hidden_aa').val());
|
||||
jQuery('#hh').val(jQuery('#hidden_hh').val());
|
||||
jQuery('#mn').val(jQuery('#hidden_mn').val());
|
||||
jQuery('.edit-timestamp').text(commentL10n.edit);
|
||||
jQuery('#curtime').slideDown("normal");
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
jQuery('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
|
||||
jQuery('#timestampdiv').hide();
|
||||
var link = jQuery('.timestamp a').clone( true );
|
||||
jQuery('.timestamp').show().html(
|
||||
jQuery( '#mm option[value=' + jQuery('#mm').val() + ']' ).text() + ' ' +
|
||||
jQuery('#jj').val() + ',' +
|
||||
jQuery('#aa').val() + '@' +
|
||||
jQuery('#hh').val() + ':' +
|
||||
jQuery('#mn').val() + ' '
|
||||
).append( link );
|
||||
jQuery('#curtime').slideDown("normal");
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,11 +4,20 @@ jQuery(document).ready( function() {
|
||||
|
||||
// Reveal
|
||||
jQuery('.wp-no-js-hidden').removeClass( 'wp-no-js-hidden' );
|
||||
|
||||
// show things that should be visible, hide what should be hidden
|
||||
jQuery('.hide-if-no-js').show();
|
||||
jQuery('.hide-if-js').hide();
|
||||
|
||||
// Basic form validation
|
||||
if ( ( 'undefined' != typeof wpAjax ) && jQuery.isFunction( wpAjax.validateForm ) ) {
|
||||
jQuery('form.validate').submit( function() { return wpAjax.validateForm( jQuery(this) ); } );
|
||||
}
|
||||
|
||||
jQuery('a.no-crazy').click( function() {
|
||||
alert( "This feature isn't enabled in this prototype." );
|
||||
return false;
|
||||
} );
|
||||
});
|
||||
|
||||
(function(JQ) {
|
||||
@@ -25,7 +34,7 @@ jQuery(document).ready( function() {
|
||||
el.find('img').removeAttr('alt');
|
||||
|
||||
el.mouseover(function(e) {
|
||||
txt = el.attr('tip'), o = el.offset();;
|
||||
txt = el.attr('tip'), o = el.offset();
|
||||
|
||||
clearTimeout(TT.sD);
|
||||
TT.find('p').html(txt);
|
||||
@@ -42,4 +51,28 @@ jQuery(document).ready( function() {
|
||||
}
|
||||
}(jQuery));
|
||||
|
||||
jQuery( function($) {
|
||||
var menuToggle = function(ul, effect) {
|
||||
if ( !effect ) {
|
||||
effect = 'slideToggle';
|
||||
}
|
||||
ul[effect]().parent().toggleClass( 'wp-menu-open' );
|
||||
return false;
|
||||
};
|
||||
|
||||
jQuery('#adminmenu li.wp-has-submenu > a').click( function() { return menuToggle( jQuery(this).siblings('ul') ); } );
|
||||
|
||||
jQuery('#dashmenu li.wp-has-submenu').bind( 'mouseenter mouseleave', function() { return menuToggle( jQuery(this).children('ul'), 'toggle' ); } );
|
||||
|
||||
// Temp
|
||||
if ( !$('#post-search, #widget-search').size() ) {
|
||||
$('#wphead').append( '<p id="post-search-prep"><input id="post-search-input" type="text" /><input class="button" type="button" value="Search" /></p>' );
|
||||
}
|
||||
|
||||
// Temp 2
|
||||
var minH = $(window).height()-185+"px"
|
||||
$('#wpbody-content').css("min-height", minH);
|
||||
|
||||
} );
|
||||
|
||||
jQuery(function(){jQuery('#media-buttons a').tTips();});
|
||||
|
||||
@@ -55,6 +55,17 @@ var delAfter = function( r, settings ) {
|
||||
var n = parseInt(a.html(),10) - 1;
|
||||
a.html( n.toString() );
|
||||
});
|
||||
$('li span.spam-comment-count' ).each( function() {
|
||||
var a = $(this);
|
||||
var n = parseInt(a.html(),10);
|
||||
if ( $(settings.target).parents( 'span.spam' ).size() ) { // we marked a comment as spam
|
||||
n = n + 1;
|
||||
} else if ( $('#' + settings.element).is('.spam') ) { // we approved or deleted a comment marked as spam
|
||||
n = n - 1;
|
||||
}
|
||||
if ( n < 0 ) { n = 0; }
|
||||
a.html( n.toString() );
|
||||
});
|
||||
|
||||
if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) {
|
||||
return;
|
||||
|
||||
@@ -4,7 +4,7 @@ jQuery(document).ready( function() {
|
||||
|
||||
jQuery('#link_name').focus();
|
||||
// postboxes
|
||||
add_postbox_toggles('link');
|
||||
postboxes.add_postbox_toggles('link');
|
||||
|
||||
// category tabs
|
||||
var categoryTabs = jQuery('#category-tabs').tabs();
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
jQuery(document).ready( function() {
|
||||
add_postbox_toggles('page');
|
||||
postboxes.add_postbox_toggles('page');
|
||||
make_slugedit_clickable();
|
||||
|
||||
// close postboxes that should be closed
|
||||
jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
|
||||
|
||||
// show things that should be visible, hide what should be hidden
|
||||
jQuery('.hide-if-no-js').show();
|
||||
jQuery('.hide-if-js').hide();
|
||||
|
||||
jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } );
|
||||
|
||||
// hide advanced slug field
|
||||
@@ -16,17 +12,31 @@ jQuery(document).ready( function() {
|
||||
|
||||
jQuery('.edit-timestamp').click(function () {
|
||||
if (jQuery('#timestampdiv').is(":hidden")) {
|
||||
jQuery('#curtime').slideUp("normal");
|
||||
jQuery('#timestampdiv').slideDown("normal");
|
||||
jQuery('.edit-timestamp').text(postL10n.cancel);
|
||||
} else {
|
||||
jQuery('#timestampdiv').hide();
|
||||
jQuery('#timestampdiv').slideUp("normal");
|
||||
jQuery('#mm').val(jQuery('#hidden_mm').val());
|
||||
jQuery('#jj').val(jQuery('#hidden_jj').val());
|
||||
jQuery('#aa').val(jQuery('#hidden_aa').val());
|
||||
jQuery('#hh').val(jQuery('#hidden_hh').val());
|
||||
jQuery('#mn').val(jQuery('#hidden_mn').val());
|
||||
jQuery('.edit-timestamp').text(postL10n.edit);
|
||||
jQuery('#curtime').slideDown("normal");
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
jQuery('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
|
||||
jQuery('#timestampdiv').hide();
|
||||
var link = jQuery('.timestamp a').clone( true );
|
||||
jQuery('.timestamp').show().html(
|
||||
jQuery( '#mm option[value=' + jQuery('#mm').val() + ']' ).text() + ' ' +
|
||||
jQuery('#jj').val() + ',' +
|
||||
jQuery('#aa').val() + '@' +
|
||||
jQuery('#hh').val() + ':' +
|
||||
jQuery('#mn').val() + ' '
|
||||
).append( link );
|
||||
jQuery('#curtime').slideDown("normal");
|
||||
return false;
|
||||
});
|
||||
});
|
||||
@@ -64,12 +64,8 @@ jQuery(document).ready( function() {
|
||||
// close postboxes that should be closed
|
||||
jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
|
||||
|
||||
// show things that should be visible, hide what should be hidden
|
||||
jQuery('.hide-if-no-js').show();
|
||||
jQuery('.hide-if-js').hide();
|
||||
|
||||
// postboxes
|
||||
add_postbox_toggles('post');
|
||||
postboxes.add_postbox_toggles('post');
|
||||
|
||||
// Editable slugs
|
||||
make_slugedit_clickable();
|
||||
@@ -161,19 +157,32 @@ jQuery(document).ready( function() {
|
||||
|
||||
jQuery('.edit-timestamp').click(function () {
|
||||
if (jQuery('#timestampdiv').is(":hidden")) {
|
||||
jQuery('#curtime').slideUp("normal");
|
||||
jQuery('#timestampdiv').slideDown("normal");
|
||||
jQuery('.edit-timestamp').text(postL10n.cancel);
|
||||
} else {
|
||||
jQuery('#timestampdiv').hide();
|
||||
jQuery('#timestampdiv').slideUp("normal");
|
||||
jQuery('#mm').val(jQuery('#hidden_mm').val());
|
||||
jQuery('#jj').val(jQuery('#hidden_jj').val());
|
||||
jQuery('#aa').val(jQuery('#hidden_aa').val());
|
||||
jQuery('#hh').val(jQuery('#hidden_hh').val());
|
||||
jQuery('#mn').val(jQuery('#hidden_mn').val());
|
||||
jQuery('.edit-timestamp').text(postL10n.edit);
|
||||
jQuery('#curtime').slideDown("normal");
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
jQuery('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
|
||||
jQuery('#timestampdiv').hide();
|
||||
var link = jQuery('.timestamp a').clone( true );
|
||||
jQuery('.timestamp').show().html(
|
||||
jQuery( '#mm option[value=' + jQuery('#mm').val() + ']' ).text() + ' ' +
|
||||
jQuery('#jj').val() + ',' +
|
||||
jQuery('#aa').val() + '@' +
|
||||
jQuery('#hh').val() + ':' +
|
||||
jQuery('#mn').val() + ' '
|
||||
).append( link );
|
||||
jQuery('#curtime').slideDown("normal");
|
||||
return false;
|
||||
});
|
||||
|
||||
// Custom Fields
|
||||
|
||||
@@ -1,7 +1,66 @@
|
||||
function add_postbox_toggles(page) {
|
||||
jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
|
||||
jQuery('.postbox h3').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } );
|
||||
}
|
||||
|
||||
(function($) {
|
||||
postboxes = {
|
||||
add_postbox_toggles : function(page) {
|
||||
$('.postbox h3').before('<a class="togbox">+</a> ');
|
||||
$('.postbox a.togbox').click( function() { $($(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } );
|
||||
|
||||
if ( $.browser.msie ) {
|
||||
$('#side-sortables').append( '<div id="make-it-tall"></div>' );
|
||||
} else {
|
||||
$('#side-sortables').append( '<div id="make-it-tall" style="margin-bottom: -2000px; padding-bottom: 2001px"></div>' );
|
||||
}
|
||||
$('#wpbody-content').css( 'overflow', 'hidden' );
|
||||
|
||||
this.init(page);
|
||||
},
|
||||
|
||||
expandSidebar : function( doIt ) {
|
||||
if ( doIt || $.trim( $( '#side-info-column' ).text() ) ) {
|
||||
$( '#post-body' ).addClass( 'has-sidebar' );
|
||||
$( '#side-sortables' ).css('z-index','0');
|
||||
} else {
|
||||
$( '#post-body' ).removeClass( 'has-sidebar' );
|
||||
$( '#side-sortables' ).css('z-index','-1');
|
||||
}
|
||||
},
|
||||
|
||||
init : function(page) {
|
||||
jQuery('.meta-box-sortables').sortable( {
|
||||
connectWith: [ '.meta-box-sortables' ],
|
||||
items: '> .postbox',
|
||||
handle: 'h3',
|
||||
stop: function() {
|
||||
if ( 'side-sortables' == this.id ) { // doing this with jQuery doesn't work for some reason: make-it-tall gets duplicated
|
||||
var makeItTall = document.getElementById( 'make-it-tall' );
|
||||
var sideSort = makeItTall.parentNode;
|
||||
sideSort.removeChild( makeItTall );
|
||||
sideSort.appendChild( makeItTall );
|
||||
|
||||
}
|
||||
var postVars = {
|
||||
action: 'meta-box-order',
|
||||
_ajax_nonce: jQuery('#meta-box-order-nonce').val(),
|
||||
page: page
|
||||
}
|
||||
jQuery('.meta-box-sortables').each( function() {
|
||||
postVars["order[" + this.id.split('-')[0] + "]"] = jQuery(this).sortable( 'toArray' ).join(',');
|
||||
} );
|
||||
jQuery.post( postboxL10n.requestFile, postVars, function() {
|
||||
postboxes.expandSidebar();
|
||||
} );
|
||||
},
|
||||
over: function(e, ui) {
|
||||
if ( !ui.element.is( '#side-sortables' ) )
|
||||
return;
|
||||
postboxes.expandSidebar( true );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
}(jQuery));
|
||||
|
||||
jQuery(document).ready(function(){postboxes.expandSidebar();});
|
||||
|
||||
function save_postboxes_state(page) {
|
||||
var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(',');
|
||||
|
||||
Reference in New Issue
Block a user