Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
splitting out js and css for 3.4 and below and 3.5 and above.
- Loading branch information
Showing
3 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* jQuery for Media Categories plugin | ||
* | ||
* @author Eddie Moya | ||
* @since 1.1 | ||
* | ||
*/ | ||
|
||
jQuery(document).ready(function($){ | ||
console.log('test'); | ||
$.each(taxonomy, function(index, tax){ | ||
|
||
$('.media-upload-form tr.'+ tax + '').hide(); | ||
$('.media-upload-form tr.' + tax + '_metabox input').live('click', function(){ | ||
|
||
var form_fields = $(this).closest("tbody"); | ||
|
||
var checked = form_fields.find("." + tax + "_metabox input:checked"); | ||
var slug_list = ''; | ||
|
||
checked.each(function(index){ | ||
|
||
if(slug_list.length > 0) | ||
slug_list += ',' + $(this).val(); | ||
else | ||
slug_list += $(this).val(); | ||
}); | ||
|
||
form_fields.find("tr."+ tax +" > td.field > input.text").val(slug_list); | ||
}) | ||
|
||
$.extend($.expr[":"], { | ||
"icontains": function(elem, i, match, array) { | ||
return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; | ||
} | ||
}); | ||
/** | ||
* The following javascript is borrowed (with few modifications) from Jason Corradino's | ||
* 'Searchable Categories' plugin. It allows the category metabox to be filtered | ||
* as the user types. To do this with your category meta boxes on pages and posts, | ||
* download his plugin. | ||
* | ||
* http://wordpress.org/extend/plugins/searchable-categories/ | ||
*/ | ||
|
||
$('#' + tax + '-search').keyup(function() { | ||
var val = $('#' + tax + '-search').val(); | ||
var lis = $("#"+ tax +"checklist li"); | ||
lis.hide(); | ||
|
||
// find li labels's containing term, then back to parent li | ||
var containingLabels = $("#"+ tax +"checklist label:icontains('" + val + "')"); | ||
containingLabels.closest('li').find('li').andSelf().show(); | ||
containingLabels.parents('#'+ tax +'checklist li').show(); | ||
}); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.media-upload-form .category-tabs, | ||
.media-upload-form tr.category, | ||
.media-upload-form #category-adder, | ||
.media-upload-form .wp-hidden-children{ | ||
display:none; | ||
} | ||
|
||
.media-upload-form .category-filter { | ||
font-size: 12px; | ||
font-style: italic; | ||
font-family: sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters