diff --git a/wp-admin/js/link.js b/wp-admin/js/link.js index bf5e67ede6..0eb384e43d 100644 --- a/wp-admin/js/link.js +++ b/wp-admin/js/link.js @@ -1,3 +1,5 @@ +/* global postboxes, deleteUserSetting, setUserSetting, getUserSetting */ + jQuery(document).ready( function($) { var newCat, noSyncChecks = false, syncChecks, catAddAfter; @@ -22,7 +24,7 @@ jQuery(document).ready( function($) { $('#category-tabs a[href="#categories-pop"]').click(); // Ajax Cat - newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } ); + newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ); } ); $('#link-category-add-submit').click( function() { newCat.focus(); } ); syncChecks = function() { if ( noSyncChecks ) diff --git a/wp-admin/js/media.js b/wp-admin/js/media.js index b4ed0fb6ce..3c2aa69ae6 100644 --- a/wp-admin/js/media.js +++ b/wp-admin/js/media.js @@ -1,3 +1,4 @@ +/* global ajaxurl, wpAjax */ var findPosts; (function($){ @@ -6,7 +7,7 @@ var findPosts; var st = document.documentElement.scrollTop || $(document).scrollTop(), overlay = $( '.ui-find-overlay' ); - if ( overlay.length == 0 ) { + if ( overlay.length === 0 ) { $( 'body' ).append( '
' ); findPosts.overlay(); } @@ -98,7 +99,7 @@ var findPosts; $(document).ready(function() { $('#find-posts-submit').click(function(e) { - if ( '' == $('#find-posts-response').html() ) + if ( '' === $('#find-posts-response').html() ) e.preventDefault(); }); $( '#find-posts .find-box-search :input' ).keypress( function( event ) { diff --git a/wp-admin/js/media.min.js b/wp-admin/js/media.min.js index 063f24c36e..9d1a8345aa 100644 --- a/wp-admin/js/media.min.js +++ b/wp-admin/js/media.min.js @@ -1 +1 @@ -var findPosts;!function(a){findPosts={open:function(b,c){var d=document.documentElement.scrollTop||a(document).scrollTop(),e=a(".ui-find-overlay");return 0==e.length&&(a("body").append(''),findPosts.overlay()),e.show(),b&&c&&a("#affected").attr("name",b).val(c),a("#find-posts").show().draggable({handle:"#find-posts-head"}).css({top:d+50+"px",left:"50%",marginLeft:"-328px"}),a("#find-posts-input").focus().keyup(function(a){27==a.which&&findPosts.close()}),findPosts.send(),!1},close:function(){a("#find-posts-response").html(""),a("#find-posts").draggable("destroy").hide(),a(".ui-find-overlay").hide()},overlay:function(){a(".ui-find-overlay").css({"z-index":"999",width:a(document).width()+"px",height:a(document).height()+"px"}).on("click",function(){findPosts.close()})},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()},c=a(".find-box-search .spinner");c.show(),a.ajax({type:"POST",url:ajaxurl,data:b,success:function(a){findPosts.show(a),c.hide()},error:function(a){findPosts.error(a),c.hide()}})},show:function(b){if("string"==typeof b)return this.error({responseText:b}),void 0;var c=wpAjax.parseAjaxResponse(b);c.errors&&this.error({responseText:wpAjax.broken}),c=c.responses[0],a("#find-posts-response").html(c.data),a(".found-posts td").on("click",function(){a(this).parent().find(".found-radio input").prop("checked",!0)})},error:function(b){var c=b.statusText;b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#find-posts-response").html(c)}},a(document).ready(function(){a("#find-posts-submit").click(function(b){""==a("#find-posts-response").html()&&b.preventDefault()}),a("#find-posts .find-box-search :input").keypress(function(a){return 13==a.which?(findPosts.send(),!1):void 0}),a("#find-posts-search").click(findPosts.send),a("#find-posts-close").click(findPosts.close),a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){"attach"==a(this).val()&&(b.preventDefault(),findPosts.open())})})}),a(window).resize(function(){findPosts.overlay()})}(jQuery); \ No newline at end of file +var findPosts;!function(a){findPosts={open:function(b,c){var d=document.documentElement.scrollTop||a(document).scrollTop(),e=a(".ui-find-overlay");return 0===e.length&&(a("body").append(''),findPosts.overlay()),e.show(),b&&c&&a("#affected").attr("name",b).val(c),a("#find-posts").show().draggable({handle:"#find-posts-head"}).css({top:d+50+"px",left:"50%",marginLeft:"-328px"}),a("#find-posts-input").focus().keyup(function(a){27==a.which&&findPosts.close()}),findPosts.send(),!1},close:function(){a("#find-posts-response").html(""),a("#find-posts").draggable("destroy").hide(),a(".ui-find-overlay").hide()},overlay:function(){a(".ui-find-overlay").css({"z-index":"999",width:a(document).width()+"px",height:a(document).height()+"px"}).on("click",function(){findPosts.close()})},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()},c=a(".find-box-search .spinner");c.show(),a.ajax({type:"POST",url:ajaxurl,data:b,success:function(a){findPosts.show(a),c.hide()},error:function(a){findPosts.error(a),c.hide()}})},show:function(b){if("string"==typeof b)return this.error({responseText:b}),void 0;var c=wpAjax.parseAjaxResponse(b);c.errors&&this.error({responseText:wpAjax.broken}),c=c.responses[0],a("#find-posts-response").html(c.data),a(".found-posts td").on("click",function(){a(this).parent().find(".found-radio input").prop("checked",!0)})},error:function(b){var c=b.statusText;b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#find-posts-response").html(c)}},a(document).ready(function(){a("#find-posts-submit").click(function(b){""===a("#find-posts-response").html()&&b.preventDefault()}),a("#find-posts .find-box-search :input").keypress(function(a){return 13==a.which?(findPosts.send(),!1):void 0}),a("#find-posts-search").click(findPosts.send),a("#find-posts-close").click(findPosts.close),a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){"attach"==a(this).val()&&(b.preventDefault(),findPosts.open())})})}),a(window).resize(function(){findPosts.overlay()})}(jQuery); \ No newline at end of file diff --git a/wp-includes/js/customize-preview.js b/wp-includes/js/customize-preview.js index caefe653a9..5f81ec7564 100644 --- a/wp-includes/js/customize-preview.js +++ b/wp-includes/js/customize-preview.js @@ -90,10 +90,10 @@ preview.send( 'synced' ); }); - preview.bind( 'active', function() { - if ( api.settings.nonce ) - preview.send( 'nonce', api.settings.nonce ); - }); + preview.bind( 'active', function() { + if ( api.settings.nonce ) + preview.send( 'nonce', api.settings.nonce ); + }); preview.send( 'ready' ); diff --git a/wp-includes/js/jquery/jquery.table-hotkeys.js b/wp-includes/js/jquery/jquery.table-hotkeys.js index f8b17602e3..bc7835e954 100644 --- a/wp-includes/js/jquery/jquery.table-hotkeys.js +++ b/wp-includes/js/jquery/jquery.table-hotkeys.js @@ -8,7 +8,7 @@ p = p.parent(); } return true; - } + }; return this.filter(is_visible); }; $.table_hotkeys = function(table, keys, opts) { @@ -16,7 +16,7 @@ var selected_class, destructive_class, set_current_row, adjacent_row_callback, get_adjacent_row, adjacent_row, prev_row, next_row, check, get_first_row, get_last_row, make_key_callback, first_row; selected_class = opts.class_prefix + opts.selected_suffix; - destructive_class = opts.class_prefix + opts.destructive_suffix + destructive_class = opts.class_prefix + opts.destructive_suffix; set_current_row = function (tr) { if ($.table_hotkeys.current_row) $.table_hotkeys.current_row.removeClass(selected_class); tr.addClass(selected_class); @@ -66,7 +66,7 @@ if (!clickable.length) return false; if (clickable.is('.'+destructive_class)) next_row() || prev_row(); clickable.click(); - } + }; }; first_row = get_first_row(); if (!first_row.length) return; @@ -74,8 +74,8 @@ set_current_row(first_row); else if (opts.highlight_last) set_current_row(get_last_row()); - $.hotkeys.add(opts.prev_key, opts.hotkeys_opts, function() {return adjacent_row_callback('prev')}); - $.hotkeys.add(opts.next_key, opts.hotkeys_opts, function() {return adjacent_row_callback('next')}); + $.hotkeys.add(opts.prev_key, opts.hotkeys_opts, function() {return adjacent_row_callback('prev');}); + $.hotkeys.add(opts.next_key, opts.hotkeys_opts, function() {return adjacent_row_callback('next');}); $.hotkeys.add(opts.mark_key, opts.hotkeys_opts, check); $.each(keys, function() { var callback, key; diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js index 5e2a5fa629..75b1c570d9 100644 --- a/wp-includes/js/media-editor.js +++ b/wp-includes/js/media-editor.js @@ -1,3 +1,5 @@ +/* global getUserSetting, tinymce, QTags, wpActiveEditor */ + // WordPress, TinyMCE, and Media // ----------------------------- (function($){ @@ -524,7 +526,7 @@ var display = state.display( attachment ).toJSON(); return this.send.attachment( display, attachment.toJSON() ); }, this ) ).done( function() { - wp.media.editor.insert( _.toArray( arguments ).join("\n\n") ); + wp.media.editor.insert( _.toArray( arguments ).join('\n\n') ); }); }, this );