Fix JSHint errors in six files.

props mdbitz.
fixes ##26011, #26012, #26013, #26014, #26038, #26039.


git-svn-id: https://develop.svn.wordpress.org/trunk@26195 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-11-15 04:41:51 +00:00
parent 895e8edada
commit caf4f48e31
6 changed files with 31 additions and 28 deletions

View File

@ -1,5 +1,4 @@
addComment = {
var addComment = {
moveForm : function(commId, parentId, respondId, postId) {
var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent'), post = t.I('comment_post_ID');
@ -34,7 +33,7 @@ addComment = {
this.style.display = 'none';
this.onclick = null;
return false;
}
};
try { t.I('comment').focus(); }
catch(e) {}
@ -45,4 +44,4 @@ addComment = {
I : function(e) {
return document.getElementById(e);
}
}
};

View File

@ -129,14 +129,14 @@ window.wp = window.wp || {};
return this;
},
bind: function( id, callback ) {
bind: function( id ) {
this.topics = this.topics || {};
this.topics[ id ] = this.topics[ id ] || $.Callbacks();
this.topics[ id ].add.apply( this.topics[ id ], slice.call( arguments, 1 ) );
return this;
},
unbind: function( id, callback ) {
unbind: function( id ) {
if ( this.topics && this.topics[ id ] )
this.topics[ id ].remove.apply( this.topics[ id ], slice.call( arguments, 1 ) );
return this;
@ -209,12 +209,12 @@ window.wp = window.wp || {};
return value;
},
bind: function( callback ) {
bind: function() {
this.callbacks.add.apply( this.callbacks, arguments );
return this;
},
unbind: function( callback ) {
unbind: function() {
this.callbacks.remove.apply( this.callbacks, arguments );
return this;
},

View File

@ -1,3 +1,4 @@
/* global tinyMCEPreInit, tinymce */
(function(){
if ( typeof tinyMCEPreInit === 'undefined' )
return;
@ -14,7 +15,7 @@
if ( plugin && plugin.charAt(0) != '-' ) {
markDone( baseurl+'/plugins/'+plugin+'/editor_plugin'+suffix+'.js' );
markDone( baseurl+'/plugins/'+plugin+'/langs/'+lang+'.js' );
markDone( baseurl+'/plugins/'+plugin+'/langs/'+lang+'_dlg.js' )
markDone( baseurl+'/plugins/'+plugin+'/langs/'+lang+'_dlg.js' );
}
});
})();

View File

@ -1,6 +1,7 @@
/* global adminpage */
// Interim login dialog
(function($){
var wrap, check, next;
var wrap, next;
function show() {
var parent = $('#wp-auth-check'), form = $('#wp-auth-check-form'), noframe = wrap.find('.wp-auth-fallback-expired'), frame, loaded = false;
@ -12,7 +13,7 @@
});
frame = $('<iframe id="wp-auth-check-frame" frameborder="0">').attr( 'title', noframe.text() );
frame.load( function(e) {
frame.load( function() {
var height, body;
loaded = true;
@ -67,8 +68,8 @@
$(window).off( 'beforeunload.wp-auth-check' );
// When on the Edit Post screen, speed up heartbeat after the user logs in to quickly refresh nonces
if ( typeof adminpage != 'undefined' && ( adminpage == 'post-php' || adminpage == 'post-new-php' )
&& typeof wp != 'undefined' && wp.heartbeat ) {
if ( typeof adminpage != 'undefined' && ( adminpage == 'post-php' || adminpage == 'post-new-php' ) &&
typeof wp != 'undefined' && wp.heartbeat ) {
wp.heartbeat.interval( 'fast', 1 );
}
@ -98,7 +99,7 @@
}).ready( function() {
schedule();
wrap = $('#wp-auth-check-wrap');
wrap.find('.wp-auth-check-close').on( 'click', function(e) {
wrap.find('.wp-auth-check-close').on( 'click', function() {
hide();
});
});

View File

@ -1,3 +1,4 @@
/* global ajaxurl, wpAjax */
(function($) {
var fs = {add:'ajaxAdd',del:'ajaxDel',dim:'ajaxDim',process:'process',recolor:'recolor'}, wpList;

View File

@ -1,3 +1,4 @@
/* global wpPointerL10n */
/**
* Pointer jQuery widget.
*/
@ -5,11 +6,11 @@
var identifier = 0,
zindex = 9999;
$.widget("wp.pointer", {
$.widget('wp.pointer', {
options: {
pointerClass: 'wp-pointer',
pointerWidth: 320,
content: function( respond, event, t ) {
content: function() {
return $(this).text();
},
buttons: function( event, t ) {
@ -60,11 +61,11 @@
tip = this.pointer;
// Handle document transfer
if ( key === "document" && value !== o.document ) {
if ( key === 'document' && value !== o.document ) {
tip.detach().appendTo( value.body );
// Handle class change
} else if ( key === "pointerClass" ) {
} else if ( key === 'pointerClass' ) {
tip.removeClass( o.pointerClass ).addClass( value );
}
@ -72,11 +73,11 @@
$.Widget.prototype._setOption.apply( this, arguments );
// Reposition automatically
if ( key === "position" ) {
if ( key === 'position' ) {
this.reposition();
// Update content automatically if pointer is open
} else if ( key === "content" && this.active ) {
} else if ( key === 'content' && this.active ) {
this.update();
}
},
@ -101,7 +102,7 @@
dfd.done( function( content ) {
self._update( event, content );
})
});
// Either o.content is a string...
if ( typeof o.content === 'string' ) {
@ -235,11 +236,11 @@
this.active = true;
this._trigger( "open", event, this._handoff() );
this._trigger( 'open', event, this._handoff() );
this._trigger( "show", event, this._handoff({
this._trigger( 'show', event, this._handoff({
opened: function() {
self._trigger( "opened", event, self._handoff() );
self._trigger( 'opened', event, self._handoff() );
}
}));
},
@ -251,15 +252,15 @@
var self = this;
this.active = false;
this._trigger( "close", event, this._handoff() );
this._trigger( "hide", event, this._handoff({
this._trigger( 'close', event, this._handoff() );
this._trigger( 'hide', event, this._handoff({
closed: function() {
self._trigger( "closed", event, self._handoff() );
self._trigger( 'closed', event, self._handoff() );
}
}));
},
sendToTop: function( event ) {
sendToTop: function() {
if ( this.active )
this.pointer.css( 'z-index', zindex++ );
},