Plugin Directory

Changeset 971157


Ignore:
Timestamp:
08/23/2014 02:39:14 AM (11 years ago)
Author:
ThemeBoy
Message:

tagging version 0.9.1

Location:
ajax-dropdowns
Files:
2 added
8 edited
7 copied

Legend:

Unmodified
Added
Removed
  • ajax-dropdowns/tags/0.9.1/ajax-dropdowns.php

    r970773 r971157  
    22/**
    33 * @package Ajax_Dropdowns
    4  * @version 0.9
     4 * @version 0.9.1
    55 */
    66/*
     
    99Description: Display a group of posts that can be switched using dropdowns.
    1010Author: ThemeBoy
    11 Version: 0.9
     11Version: 0.9.1
    1212Author URI: http://themeboy.com/
    1313*/
     
    1919 * Plugin setup
    2020 *
    21  * @since 0.9
     21 * @since 0.9.1
    2222*/
    2323class Ajax_Dropdowns {
     
    5252    private function define_constants() {
    5353        if ( !defined( 'AJAX_DROPDOWNS_VERSION' ) )
    54             define( 'AJAX_DROPDOWNS_VERSION', '0.9' );
     54            define( 'AJAX_DROPDOWNS_VERSION', '0.9.1' );
    5555
    5656        if ( !defined( 'AJAX_DROPDOWNS_URL' ) )
     
    193193                    if ( 'attachment' == $post_type ) continue;
    194194                    $object = get_post_type_object( $post_type );
    195                     $posts = get_posts( array( 'post_type' => $post_type ) );
    196                     if ( $posts ):
     195                    $posts = get_posts( array( 'post_type' => $post_type, 'posts_per_page' => -1 ) );
     196                    if ( $posts && is_array( $posts ) ):
    197197                        ?>
    198                         <optgroup label="<?php echo $object->labels->name; ?>">
     198                        <optgroup label="<?php echo $object->labels->name; ?> (<?php echo sizeof( $posts ); ?>)">
    199199                            <?php
    200200                            foreach ( $posts as $post ):
    201                                 printf( '<option value="%s" data-post-type="%s" %s>%s</option>', $post->ID, $object->labels->singular_name, in_array( $post->ID, $selected ) ? 'selected' : '', $post->post_title );
     201                                printf( '<option value="%s" data-post-type="%s">%s</option>', $post->ID, $object->labels->singular_name, $post->post_title );
    202202                            endforeach;
    203203                            ?>
  • ajax-dropdowns/tags/0.9.1/assets/js/ajaxd-admin.js

    r970773 r971157  
    55        allow_single_deselect: true,
    66        single_backstroke_delete: false
     7    });
     8
     9    // Apply chosen class for each post in dropdown
     10    $(".ajaxd-posts-table input[name=\"ajax_post[]\"]").each(function() {
     11        $(".ajaxd-posts option[value=\""+$(this).val()+"\"]").prop("disabled", true);
     12        $(".ajaxd-posts").trigger("chosen:updated");
    713    });
    814
     
    1420        $table.find(" > tbody tr.ajaxd-placeholder").hide();
    1521        $table.find(" > tbody:last").append("<tr><td class=\"icon\"><span class=\"dashicons dashicons-menu post-state-format\"></span></td><td><input type=\"hidden\" name=\"ajax_post[]\" value=\""+post_id+"\">"+$selected.text()+"</td><td>"+$selected.data("post-type")+"</td><td><a href=\"#\" class=\"dashicons dashicons-no-alt ajaxd-delete\"></a></td></tr>");
     22        $selected.prop("disabled", true);
    1623        $(this).val("").trigger("chosen:updated");
    1724    });
     
    2128        axis: "y"
    2229    }).on("click", ".ajaxd-delete", function() {
    23         $(this).closest("tr").remove();
     30        $row = $(this).closest("tr");
     31        $id = $row.find("input[name=\"ajax_post[]\"]").val();
     32        $(".ajaxd-posts option[value=\""+$id+"\"]").prop("disabled", false);
     33        $(".ajaxd-posts").trigger("chosen:updated");
     34        $row.remove();
    2435        $table = $(".ajaxd-posts-table");
    2536        if ( $table.find(" > tbody tr:visible").length == 0 ) $table.find(" > tbody tr.ajaxd-placeholder").show();
  • ajax-dropdowns/tags/0.9.1/languages/ajax-dropdowns-en_US.po

    r970773 r971157  
    99msgstr ""
    1010"Project-Id-Version: AJAX Dropdowns\n"
    11 "POT-Creation-Date: 2014-08-23 01:11+1000\n"
    12 "PO-Revision-Date: 2014-08-23 01:11+1000\n"
     11"POT-Creation-Date: 2014-08-17 21:56+1000\n"
     12"PO-Revision-Date: 2014-08-17 21:56+1000\n"
    1313"Last-Translator: ThemeBoy <support@themeboy.com>\n"
    1414"Language-Team: \n"
     
    102102msgstr ""
    103103
    104 #: ajax-dropdowns.php:242
    105 msgid ""
    106 "Love Ajax Dropdowns? Help spread the word by rating us 5★ on WordPress.org"
    107 msgstr ""
    108 
    109 #: ajax-dropdowns.php:254
     104#: ajax-dropdowns.php:249
    110105msgid ""
    111106"Copy this code and paste it into your post, page or text widget content."
    112107msgstr ""
    113108
    114 #: ajax-dropdowns.php:266
     109#: ajax-dropdowns.php:261
    115110msgid "Ajax"
    116111msgstr ""
    117112
    118 #: ajax-dropdowns.php:266
     113#: ajax-dropdowns.php:261
    119114msgid "Inline"
    120115msgstr ""
    121116
    122 #: ajax-dropdowns.php:266
     117#: ajax-dropdowns.php:261
    123118msgid "Redirect"
    124119msgstr ""
    125120
    126 #: ajax-dropdowns.php:269
     121#: ajax-dropdowns.php:264
    127122msgid "Select the method to query posts."
    128123msgstr ""
    129124
    130 #: ajax-dropdowns.php:318
     125#: ajax-dropdowns.php:313
    131126msgid "Settings saved."
    132127msgstr ""
  • ajax-dropdowns/tags/0.9.1/readme.txt

    r970787 r971157  
    44Requires at least: 3.0
    55Tested up to: 3.9
    6 Stable tag: 0.9
     6Stable tag: 0.9.1
    77License: GPLv2 or later
    88
     
    6363== Changelog ==
    6464
     65= 0.9.1 =
     66* Feature - Grey out duplicate posts in dropdown.
     67* Feature - Display number of posts available in each post type.
     68* Fix - Posts limited to 5 per post type in dropdown.
     69
    6570= 0.9 =
    6671* Beta release.
  • ajax-dropdowns/trunk/ajax-dropdowns.php

    r970773 r971157  
    22/**
    33 * @package Ajax_Dropdowns
    4  * @version 0.9
     4 * @version 0.9.1
    55 */
    66/*
     
    99Description: Display a group of posts that can be switched using dropdowns.
    1010Author: ThemeBoy
    11 Version: 0.9
     11Version: 0.9.1
    1212Author URI: http://themeboy.com/
    1313*/
     
    1919 * Plugin setup
    2020 *
    21  * @since 0.9
     21 * @since 0.9.1
    2222*/
    2323class Ajax_Dropdowns {
     
    5252    private function define_constants() {
    5353        if ( !defined( 'AJAX_DROPDOWNS_VERSION' ) )
    54             define( 'AJAX_DROPDOWNS_VERSION', '0.9' );
     54            define( 'AJAX_DROPDOWNS_VERSION', '0.9.1' );
    5555
    5656        if ( !defined( 'AJAX_DROPDOWNS_URL' ) )
     
    193193                    if ( 'attachment' == $post_type ) continue;
    194194                    $object = get_post_type_object( $post_type );
    195                     $posts = get_posts( array( 'post_type' => $post_type ) );
    196                     if ( $posts ):
     195                    $posts = get_posts( array( 'post_type' => $post_type, 'posts_per_page' => -1 ) );
     196                    if ( $posts && is_array( $posts ) ):
    197197                        ?>
    198                         <optgroup label="<?php echo $object->labels->name; ?>">
     198                        <optgroup label="<?php echo $object->labels->name; ?> (<?php echo sizeof( $posts ); ?>)">
    199199                            <?php
    200200                            foreach ( $posts as $post ):
    201                                 printf( '<option value="%s" data-post-type="%s" %s>%s</option>', $post->ID, $object->labels->singular_name, in_array( $post->ID, $selected ) ? 'selected' : '', $post->post_title );
     201                                printf( '<option value="%s" data-post-type="%s">%s</option>', $post->ID, $object->labels->singular_name, $post->post_title );
    202202                            endforeach;
    203203                            ?>
  • ajax-dropdowns/trunk/assets/js/ajaxd-admin.js

    r970773 r971157  
    55        allow_single_deselect: true,
    66        single_backstroke_delete: false
     7    });
     8
     9    // Apply chosen class for each post in dropdown
     10    $(".ajaxd-posts-table input[name=\"ajax_post[]\"]").each(function() {
     11        $(".ajaxd-posts option[value=\""+$(this).val()+"\"]").prop("disabled", true);
     12        $(".ajaxd-posts").trigger("chosen:updated");
    713    });
    814
     
    1420        $table.find(" > tbody tr.ajaxd-placeholder").hide();
    1521        $table.find(" > tbody:last").append("<tr><td class=\"icon\"><span class=\"dashicons dashicons-menu post-state-format\"></span></td><td><input type=\"hidden\" name=\"ajax_post[]\" value=\""+post_id+"\">"+$selected.text()+"</td><td>"+$selected.data("post-type")+"</td><td><a href=\"#\" class=\"dashicons dashicons-no-alt ajaxd-delete\"></a></td></tr>");
     22        $selected.prop("disabled", true);
    1623        $(this).val("").trigger("chosen:updated");
    1724    });
     
    2128        axis: "y"
    2229    }).on("click", ".ajaxd-delete", function() {
    23         $(this).closest("tr").remove();
     30        $row = $(this).closest("tr");
     31        $id = $row.find("input[name=\"ajax_post[]\"]").val();
     32        $(".ajaxd-posts option[value=\""+$id+"\"]").prop("disabled", false);
     33        $(".ajaxd-posts").trigger("chosen:updated");
     34        $row.remove();
    2435        $table = $(".ajaxd-posts-table");
    2536        if ( $table.find(" > tbody tr:visible").length == 0 ) $table.find(" > tbody tr.ajaxd-placeholder").show();
  • ajax-dropdowns/trunk/languages/ajax-dropdowns-en_US.po

    r970773 r971157  
    99msgstr ""
    1010"Project-Id-Version: AJAX Dropdowns\n"
    11 "POT-Creation-Date: 2014-08-23 01:11+1000\n"
    12 "PO-Revision-Date: 2014-08-23 01:11+1000\n"
     11"POT-Creation-Date: 2014-08-17 21:56+1000\n"
     12"PO-Revision-Date: 2014-08-17 21:56+1000\n"
    1313"Last-Translator: ThemeBoy <support@themeboy.com>\n"
    1414"Language-Team: \n"
     
    102102msgstr ""
    103103
    104 #: ajax-dropdowns.php:242
    105 msgid ""
    106 "Love Ajax Dropdowns? Help spread the word by rating us 5★ on WordPress.org"
    107 msgstr ""
    108 
    109 #: ajax-dropdowns.php:254
     104#: ajax-dropdowns.php:249
    110105msgid ""
    111106"Copy this code and paste it into your post, page or text widget content."
    112107msgstr ""
    113108
    114 #: ajax-dropdowns.php:266
     109#: ajax-dropdowns.php:261
    115110msgid "Ajax"
    116111msgstr ""
    117112
    118 #: ajax-dropdowns.php:266
     113#: ajax-dropdowns.php:261
    119114msgid "Inline"
    120115msgstr ""
    121116
    122 #: ajax-dropdowns.php:266
     117#: ajax-dropdowns.php:261
    123118msgid "Redirect"
    124119msgstr ""
    125120
    126 #: ajax-dropdowns.php:269
     121#: ajax-dropdowns.php:264
    127122msgid "Select the method to query posts."
    128123msgstr ""
    129124
    130 #: ajax-dropdowns.php:318
     125#: ajax-dropdowns.php:313
    131126msgid "Settings saved."
    132127msgstr ""
  • ajax-dropdowns/trunk/readme.txt

    r970787 r971157  
    44Requires at least: 3.0
    55Tested up to: 3.9
    6 Stable tag: 0.9
     6Stable tag: 0.9.1
    77License: GPLv2 or later
    88
     
    6363== Changelog ==
    6464
     65= 0.9.1 =
     66* Feature - Grey out duplicate posts in dropdown.
     67* Feature - Display number of posts available in each post type.
     68* Fix - Posts limited to 5 per post type in dropdown.
     69
    6570= 0.9 =
    6671* Beta release.
Note: See TracChangeset for help on using the changeset viewer.