File Editor
Directories:
.. (Back)
Files:
accordion.js
accordion.min.js
bookmarklet.js
bookmarklet.min.js
color-picker.js
color-picker.min.js
comment.js
comment.min.js
common.js
common.min.js
custom-background.js
custom-background.min.js
custom-header.js
customize-controls.js
customize-controls.min.js
customize-nav-menus.js
customize-nav-menus.min.js
customize-widgets.js
customize-widgets.min.js
dashboard.js
dashboard.min.js
edit-comments.js
edit-comments.min.js
editor-expand.js
editor-expand.min.js
editor.js
editor.min.js
farbtastic.js
gallery.js
gallery.min.js
image-edit.js
image-edit.min.js
inline-edit-post.js
inline-edit-post.min.js
inline-edit-tax.js
inline-edit-tax.min.js
iris.min.js
language-chooser.js
language-chooser.min.js
link.js
link.min.js
media-gallery.js
media-gallery.min.js
media-upload.js
media-upload.min.js
media.js
media.min.js
nav-menu.js
nav-menu.min.js
password-strength-meter.js
password-strength-meter.min.js
plugin-install.js
plugin-install.min.js
post.js
post.min.js
postbox.js
postbox.min.js
press-this.js
press-this.min.js
revisions.js
revisions.min.js
set-post-thumbnail.js
set-post-thumbnail.min.js
svg-painter.js
svg-painter.min.js
tags-box.js
tags-box.min.js
tags.js
tags.min.js
theme.js
theme.min.js
updates.js
updates.min.js
user-profile.js
user-profile.min.js
user-suggest.js
user-suggest.min.js
widgets.js
widgets.min.js
word-count.js
word-count.min.js
wp-fullscreen-stub.js
wp-fullscreen-stub.min.js
xfn.js
xfn.min.js
Create New File
Create
Edit File: link.js
/* global postboxes, deleteUserSetting, setUserSetting, getUserSetting */ jQuery(document).ready( function($) { var newCat, noSyncChecks = false, syncChecks, catAddAfter; $('#link_name').focus(); // postboxes postboxes.add_postbox_toggles('link'); // category tabs $('#category-tabs a').click(function(){ var t = $(this).attr('href'); $(this).parent().addClass('tabs').siblings('li').removeClass('tabs'); $('.tabs-panel').hide(); $(t).show(); if ( '#categories-all' == t ) deleteUserSetting('cats'); else setUserSetting('cats','pop'); return false; }); if ( getUserSetting('cats') ) $('#category-tabs a[href="#categories-pop"]').click(); // Ajax Cat newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ); } ); $('#link-category-add-submit').click( function() { newCat.focus(); } ); syncChecks = function() { if ( noSyncChecks ) return; noSyncChecks = true; var th = $(this), c = th.is(':checked'), id = th.val().toString(); $('#in-link-category-' + id + ', #in-popular-link_category-' + id).prop( 'checked', c ); noSyncChecks = false; }; catAddAfter = function( r, s ) { $(s.what + ' response_data', r).each( function() { var t = $($(this).text()); t.find( 'label' ).each( function() { var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name = $.trim( th.text() ), o; $('#' + id).change( syncChecks ); o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name ); } ); } ); }; $('#categorychecklist').wpList( { alt: '', what: 'link-category', response: 'category-ajax-response', addAfter: catAddAfter } ); $('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');}); $('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');}); if ( 'pop' == getUserSetting('cats') ) $('a[href="#categories-pop"]').click(); $('#category-add-toggle').click( function() { $(this).parents('div:first').toggleClass( 'wp-hidden-children' ); $('#category-tabs a[href="#categories-all"]').click(); $('#newcategory').focus(); return false; } ); $('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change(); });
Save Changes
Rename File
Rename