WordPress.org

Plugin Directory

Changeset 553499


Ignore:
Timestamp:
06/05/12 18:49:55 (23 months ago)
Author:
eddiemoya
Message:

bug fix, added javascript for multiple metaboxes

Location:
media-categories-2
Files:
4 edited
3 copied

Legend:

Unmodified
Added
Removed
  • media-categories-2/tags/1.4.1/media-categories-script.js

    r541444 r553499  
    88 
    99jQuery(document).ready(function($){ 
    10     $('.media-upload-form tr.post_tag').hide(); 
    11     $('.media-upload-form tr.category_metabox input').live('click', function(){ 
    12          
    13         var form_fields = $(this).closest("tbody"); 
     10     
     11    $.each(taxonomy, function(index, tax){ 
    1412 
    15         var checked = form_fields.find(".category_metabox input:checked"); 
    16         var slug_list = ''; 
    17          
    18         checked.each(function(index){ 
    19              
    20             if(slug_list.length > 0)  
    21                 slug_list += ',' + $(this).val(); 
    22             else  
    23                 slug_list += $(this).val(); 
     13        $('.media-upload-form tr.'+ tax + '').hide(); 
     14        $('.media-upload-form tr.' + tax + '_metabox input').live('click', function(){ 
     15 
     16            var form_fields = $(this).closest("tbody"); 
     17 
     18            var checked = form_fields.find("." + tax + "_metabox input:checked"); 
     19            var slug_list = ''; 
     20 
     21            checked.each(function(index){ 
     22 
     23                if(slug_list.length > 0)  
     24                    slug_list += ',' + $(this).val(); 
     25                else  
     26                    slug_list += $(this).val(); 
     27            }); 
     28 
     29            form_fields.find("tr."+ tax +" > td.field > input.text").val(slug_list); 
     30        }) 
     31 
     32        $.extend($.expr[":"], { 
     33            "icontains": function(elem, i, match, array) { 
     34                return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; 
     35            } 
    2436        }); 
    25          
    26         form_fields.find("tr."+tax.name+" > td.field > input.text").val(slug_list); 
    27     }) 
    28      
    29     $.extend($.expr[":"], { 
    30         "icontains": function(elem, i, match, array) { 
    31             return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; 
    32         } 
     37        /** 
     38        * The following javascript is borrowed (with few modifications) from Jason Corradino's  
     39        * 'Searchable Categories' plugin. It allows the category metabox to be filtered  
     40        * as the user types. To do this with your category meta boxes on pages and posts,  
     41        * download his plugin. 
     42        *  
     43        * http://wordpress.org/extend/plugins/searchable-categories/ 
     44        */ 
     45 
     46        $('#' + tax + '-search').keyup(function() { 
     47            var val = $('#' + tax + '-search').val();  
     48            var lis = $("#"+ tax +"checklist li"); 
     49            lis.hide(); 
     50 
     51            // find li labels's containing term, then back to parent li 
     52            var containingLabels = $("#"+ tax +"checklist label:icontains('" + val + "')"); 
     53            containingLabels.closest('li').find('li').andSelf().show(); 
     54            containingLabels.parents('#'+ tax +'checklist li').show(); 
     55        }); 
    3356    }); 
    34     /** 
    35      * The following javascript is borrowed (with few modifications) from Jason Corradino's  
    36      * 'Searchable Categories' plugin. It allows the category metabox to be filtered  
    37      * as the user types. To do this with your category meta boxes on pages and posts,  
    38      * download his plugin. 
    39      *  
    40      * http://wordpress.org/extend/plugins/searchable-categories/ 
    41      */ 
    42      
    43     $('#catsearch').keyup(function() { 
    44         var val = $('#catsearch').val(), lis = $("#"+tax.name+"checklist li"); 
    45         lis.hide(); 
    46          
    47         // find li labels's containing term, then back to parent li 
    48         var containingLabels = $("#"+tax.name+"checklist label:icontains('" + val + "')"); 
    49         containingLabels.closest('li').find('li').andSelf().show(); 
    50         containingLabels.parents('#'+tax.name+'checklist li').show(); 
    51     }); 
    52      
    5357}) 
  • media-categories-2/tags/1.4.1/media-categories.php

    r553443 r553499  
    33Plugin URI: http://wordpress.org/extend/plugins/media-categories-2 
    44Description:  Allows users to assign categories to media with a clean and simplified, filterable category meta box and use shortcodes to display category galleries 
    5 Version: 1.4 
     5Version: 1.4.1 
    66Author: Eddie Moya 
    77Author URL: http://eddiemoya.com 
  • media-categories-2/tags/1.4.1/readme.txt

    r553443 r553499  
    55Requires at least: 3.0 
    66Tested up to: 3.3.2 
    7 Stable tag: 1.4 
     7Stable tag: 1.4.1 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    175175== Changelog == 
    176176 
     177= 1.4.1 = 
     178* Missing javascript update for the 1.4 update. 
     179 
    177180= 1.4 = 
    178181* New feature! Add multiple metaboxes for media, one for any desired taxonomy by a developer. 
     
    200203== Upgrade Notice == 
    201204 
     205= 1.4.1 = 
     206Bug Fix! Fixed javascript when using multiple taxonomy metaboxes. 
     207 
    202208= 1.4 =  
    203209New Feature! Developers can now generate metaboxes for media for any number of desired taxonomies 
  • media-categories-2/trunk/media-categories-script.js

    r541444 r553499  
    88 
    99jQuery(document).ready(function($){ 
    10     $('.media-upload-form tr.post_tag').hide(); 
    11     $('.media-upload-form tr.category_metabox input').live('click', function(){ 
    12          
    13         var form_fields = $(this).closest("tbody"); 
     10     
     11    $.each(taxonomy, function(index, tax){ 
    1412 
    15         var checked = form_fields.find(".category_metabox input:checked"); 
    16         var slug_list = ''; 
    17          
    18         checked.each(function(index){ 
    19              
    20             if(slug_list.length > 0)  
    21                 slug_list += ',' + $(this).val(); 
    22             else  
    23                 slug_list += $(this).val(); 
     13        $('.media-upload-form tr.'+ tax + '').hide(); 
     14        $('.media-upload-form tr.' + tax + '_metabox input').live('click', function(){ 
     15 
     16            var form_fields = $(this).closest("tbody"); 
     17 
     18            var checked = form_fields.find("." + tax + "_metabox input:checked"); 
     19            var slug_list = ''; 
     20 
     21            checked.each(function(index){ 
     22 
     23                if(slug_list.length > 0)  
     24                    slug_list += ',' + $(this).val(); 
     25                else  
     26                    slug_list += $(this).val(); 
     27            }); 
     28 
     29            form_fields.find("tr."+ tax +" > td.field > input.text").val(slug_list); 
     30        }) 
     31 
     32        $.extend($.expr[":"], { 
     33            "icontains": function(elem, i, match, array) { 
     34                return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; 
     35            } 
    2436        }); 
    25          
    26         form_fields.find("tr."+tax.name+" > td.field > input.text").val(slug_list); 
    27     }) 
    28      
    29     $.extend($.expr[":"], { 
    30         "icontains": function(elem, i, match, array) { 
    31             return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; 
    32         } 
     37        /** 
     38        * The following javascript is borrowed (with few modifications) from Jason Corradino's  
     39        * 'Searchable Categories' plugin. It allows the category metabox to be filtered  
     40        * as the user types. To do this with your category meta boxes on pages and posts,  
     41        * download his plugin. 
     42        *  
     43        * http://wordpress.org/extend/plugins/searchable-categories/ 
     44        */ 
     45 
     46        $('#' + tax + '-search').keyup(function() { 
     47            var val = $('#' + tax + '-search').val();  
     48            var lis = $("#"+ tax +"checklist li"); 
     49            lis.hide(); 
     50 
     51            // find li labels's containing term, then back to parent li 
     52            var containingLabels = $("#"+ tax +"checklist label:icontains('" + val + "')"); 
     53            containingLabels.closest('li').find('li').andSelf().show(); 
     54            containingLabels.parents('#'+ tax +'checklist li').show(); 
     55        }); 
    3356    }); 
    34     /** 
    35      * The following javascript is borrowed (with few modifications) from Jason Corradino's  
    36      * 'Searchable Categories' plugin. It allows the category metabox to be filtered  
    37      * as the user types. To do this with your category meta boxes on pages and posts,  
    38      * download his plugin. 
    39      *  
    40      * http://wordpress.org/extend/plugins/searchable-categories/ 
    41      */ 
    42      
    43     $('#catsearch').keyup(function() { 
    44         var val = $('#catsearch').val(), lis = $("#"+tax.name+"checklist li"); 
    45         lis.hide(); 
    46          
    47         // find li labels's containing term, then back to parent li 
    48         var containingLabels = $("#"+tax.name+"checklist label:icontains('" + val + "')"); 
    49         containingLabels.closest('li').find('li').andSelf().show(); 
    50         containingLabels.parents('#'+tax.name+'checklist li').show(); 
    51     }); 
    52      
    5357}) 
  • media-categories-2/trunk/media-categories.php

    r553443 r553499  
    33Plugin URI: http://wordpress.org/extend/plugins/media-categories-2 
    44Description:  Allows users to assign categories to media with a clean and simplified, filterable category meta box and use shortcodes to display category galleries 
    5 Version: 1.4 
     5Version: 1.4.1 
    66Author: Eddie Moya 
    77Author URL: http://eddiemoya.com 
  • media-categories-2/trunk/readme.txt

    r553443 r553499  
    55Requires at least: 3.0 
    66Tested up to: 3.3.2 
    7 Stable tag: 1.4 
     7Stable tag: 1.4.1 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    175175== Changelog == 
    176176 
     177= 1.4.1 = 
     178* Missing javascript update for the 1.4 update. 
     179 
    177180= 1.4 = 
    178181* New feature! Add multiple metaboxes for media, one for any desired taxonomy by a developer. 
     
    200203== Upgrade Notice == 
    201204 
     205= 1.4.1 = 
     206Bug Fix! Fixed javascript when using multiple taxonomy metaboxes. 
     207 
    202208= 1.4 =  
    203209New Feature! Developers can now generate metaboxes for media for any number of desired taxonomies 
Note: See TracChangeset for help on using the changeset viewer.