From a87fec46169babea077157a77a42aaab61f24cc5 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 15 Nov 2013 04:42:09 +0000 Subject: [PATCH] Fix JSHint errors in six files. props mdbitz. fixes ##26011, #26012, #26013, #26014, #26038, #26039. Built from https://develop.svn.wordpress.org/trunk@26195 git-svn-id: http://core.svn.wordpress.org/trunk@26103 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/comment-reply.js | 7 +++--- wp-includes/js/comment-reply.min.js | 2 +- wp-includes/js/customize-base.js | 8 +++---- wp-includes/js/tinymce/mark_loaded_src.js | 3 ++- wp-includes/js/wp-auth-check.js | 11 +++++---- wp-includes/js/wp-lists.js | 1 + wp-includes/js/wp-pointer.js | 29 ++++++++++++----------- 7 files changed, 32 insertions(+), 29 deletions(-) diff --git a/wp-includes/js/comment-reply.js b/wp-includes/js/comment-reply.js index 20154253a4..2f2e3b34e4 100644 --- a/wp-includes/js/comment-reply.js +++ b/wp-includes/js/comment-reply.js @@ -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); } -} +}; diff --git a/wp-includes/js/comment-reply.min.js b/wp-includes/js/comment-reply.min.js index 3fc19fcfd8..11af308f3b 100644 --- a/wp-includes/js/comment-reply.min.js +++ b/wp-includes/js/comment-reply.min.js @@ -1 +1 @@ -addComment={moveForm:function(a,b,c,d){var e,f=this,g=f.I(a),h=f.I(c),i=f.I("cancel-comment-reply-link"),j=f.I("comment_parent"),k=f.I("comment_post_ID");if(g&&h&&i&&j){f.respondId=c,d=d||!1,f.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",h.parentNode.insertBefore(e,h)),g.parentNode.insertBefore(h,g.nextSibling),k&&d&&(k.value=d),j.value=b,i.style.display="",i.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{f.I("comment").focus()}catch(l){}return!1}},I:function(a){return document.getElementById(a)}}; \ No newline at end of file +var addComment={moveForm:function(a,b,c,d){var e,f=this,g=f.I(a),h=f.I(c),i=f.I("cancel-comment-reply-link"),j=f.I("comment_parent"),k=f.I("comment_post_ID");if(g&&h&&i&&j){f.respondId=c,d=d||!1,f.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",h.parentNode.insertBefore(e,h)),g.parentNode.insertBefore(h,g.nextSibling),k&&d&&(k.value=d),j.value=b,i.style.display="",i.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{f.I("comment").focus()}catch(l){}return!1}},I:function(a){return document.getElementById(a)}}; \ No newline at end of file diff --git a/wp-includes/js/customize-base.js b/wp-includes/js/customize-base.js index 81d37716e6..534cf3cf13 100644 --- a/wp-includes/js/customize-base.js +++ b/wp-includes/js/customize-base.js @@ -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; }, diff --git a/wp-includes/js/tinymce/mark_loaded_src.js b/wp-includes/js/tinymce/mark_loaded_src.js index 2b53192671..a2d08cd8b2 100644 --- a/wp-includes/js/tinymce/mark_loaded_src.js +++ b/wp-includes/js/tinymce/mark_loaded_src.js @@ -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' ); } }); })(); diff --git a/wp-includes/js/wp-auth-check.js b/wp-includes/js/wp-auth-check.js index 667143de5d..e0c16ca652 100644 --- a/wp-includes/js/wp-auth-check.js +++ b/wp-includes/js/wp-auth-check.js @@ -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 = $('