Plugin Directory

Changeset 2422830


Ignore:
Timestamp:
11/21/2020 05:02:25 PM (4 years ago)
Author:
janosver
Message:

v2.4

  • Bugfix: a number of odd behaviours and console errors fixed by updating the deprecated .live() jQuery method to use the .on() method instead
Location:
wp-jv-post-reading-groups/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-jv-post-reading-groups/trunk/Readme.txt

    r2245041 r2422830  
    33Tags: access, login, permission, permissions, post, posts, privacy, private, restrict, simple, user, users, member, members, membership, page, pages
    44Requires at least: 3.9.2
    5 Tested up to: 5.3.2
    6 Stable tag: 2.3
     5Tested up to: 5.5.3
     6Stable tag: 2.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6969
    7070== Changelog ==
     71
     72= 2.4 =
     73Release date: November 21, 2020
     74
     75* Bugfix: a number of odd behaviours and console errors fixed by updating the deprecated .live() jQuery method to use the .on() method instead
    7176
    7277= 2.3 =
  • wp-jv-post-reading-groups/trunk/uninstall.php

    r2245041 r2422830  
    44 *
    55 * WP JV Post Reading Groups Settings Uninstaller
    6  * @version 2.3
     6 * @version 2.4
    77 */
    88
  • wp-jv-post-reading-groups/trunk/wp-jv-post-reading-groups.css

    r2245041 r2422830  
    11/*
    22// CSS for WP JV Post Reading Groups
    3 // @version: 2.3
     3// @version: 2.4
    44*/
    55
  • wp-jv-post-reading-groups/trunk/wp-jv-post-reading-groups.js

    r2245041 r2422830  
    11// Scripts for WP JV Post Reading Groups
    2 // @version: 2.3
     2// @version: 2.4
    33
    44jQuery(document).ready(function($){
     
    66    /* Refresh WP_JV_PRG_List_Table whenever a change occur */
    77    /************************************************************************************************************/
    8     function wp_jv_prg_refresh_rg_list() {
    9 
     8    function wp_jv_prg_refresh_rg_list() {
    109        data = {
    1110                action      : 'wp_jv_prg_refresh_rg_list',
     
    1817
    1918            // Add the requested rows
    20             if ( response.rows.length )
    21             $('#the-list').html( response.rows );
     19            if ( response.rows.length ) {
     20                $('#the-list').html( response.rows );
     21            }
    2222        });
    23     };
     23
     24    };
    2425
    2526    /************************************************************************************************************/
    2627    /* Add new RG */
    2728    /************************************************************************************************************/
    28     $('#btnAddNewRG').click(function(){
     29    $('#btnAddNewRG').on('click',function(event){
     30        event.preventDefault();
    2931        //Disable button and show loading icon
    3032        $('#btnAddNewRG').attr('disabled', true);
     
    6769    /* Edit RG */
    6870    /************************************************************************************************************/
    69     $('.lnkEdit').live('click',function(event){
     71    $('#the-list').on('click','.lnkEdit',function(event){
     72       
    7073        event.preventDefault();
    7174
    7275        //Clean up any other open Edit input - no save
    73         $.ajaxSetup({async:false});
     76        $.ajaxSetup({async:false});
    7477        wp_jv_prg_refresh_rg_list();
    75         $.ajaxSetup({async:true});
    76 
     78        $.ajaxSetup({async:true});   
     79       
    7780        //Find out which RG we need to edit
    7881        var editRG = $(this).attr('data-RG');
     
    8083        //Display an edit "form"
    8184        $('.RenameDiv-'+editRG).html('<input type="text" id="renamed-reading-group-text" style="width:100%" value="'+$('div.ItemDiv-'+editRG).text()+'">'+
    82         '<br><button class="btnCancel button-secondary">Cancel</button>'+
    83         '<button style="float:right" class="btnSave button-primary" data-rename-RG="'+editRG+'">Save</button>'
     85        '<br><button class="btnCancelRG button-secondary">Cancel</button>'+
     86        '<button style="float:right" class="btnSaveRG button-primary" data-rename-RG="'+editRG+'">Save</button>'
    8487        );
    8588    });
    8689
    8790    //Edit RG - Cancel button pressed
    88     $('.btnCancel').live('click',function(event){
     91    $('#the-list').on('click','.btnCancelRG',function(event){
    8992        event.preventDefault();
    9093        wp_jv_prg_refresh_rg_list();
     
    9295
    9396    //Edit RG - Save button pressed
    94     $('.btnSave').live('click',function(event){
     97    $('#the-list').on('click','.btnSaveRG',function(event){
    9598        event.preventDefault();
    9699
     
    127130        //enable button
    128131        $('.btnSave').attr('disabled', false);
     132       
    129133    });
    130134
     
    132136    /* Delete RG */
    133137    /************************************************************************************************************/
    134     $('.lnkDelete').live('click',function(event){
     138    $('#the-list').on('click','.lnkDelete',function(event){
    135139        event.preventDefault();
    136140        var delurl = jQuery(this).attr('href');
  • wp-jv-post-reading-groups/trunk/wp-jv-post-reading-groups.min.js

    r2245041 r2422830  
    11// Scripts for WP JV Post Reading Groups
    2 // @version: 2.3
    3 jQuery(document).ready(function(t){function e(){data={action:"wp_jv_prg_refresh_rg_list",url:ajaxurl,type:"POST"},t.post(ajaxurl,data,function(e){(e=t.parseJSON(e)).rows.length&&t("#the-list").html(e.rows)})}t("#btnAddNewRG").click(function(){t("#btnAddNewRG").attr("disabled",!0),t("#spnAddRG").show();var a=document.getElementById("jv-new-reading-group-text").value;data={action:"wp_jv_prg_add_new_rg_to_db",url:ajaxurl,type:"POST",dataType:"text",newrg:a,wp_jv_rg_nonce:wp_jv_prg_obj.wp_jv_rg_nonce},t.post(ajaxurl,data,function(a){a.error?alert(a.error_msg+"\n\n[Error: "+a.error_code+"]"):e(),t("#spnAddRG").hide(),t("#btnAddNewRG").attr("disabled",!1),document.getElementById("jv-new-reading-group-text").value=""})}),t(".lnkEdit").live("click",function(a){a.preventDefault(),t.ajaxSetup({async:!1}),e(),t.ajaxSetup({async:!0});var r=t(this).attr("data-RG");t(".RenameDiv-"+r).html('<input type="text" id="renamed-reading-group-text" style="width:100%" value="'+t("div.ItemDiv-"+r).text()+'"><br><button class="btnCancel button-secondary">Cancel</button><button style="float:right" class="btnSave button-primary" data-rename-RG="'+r+'">Save</button>')}),t(".btnCancel").live("click",function(t){t.preventDefault(),e()}),t(".btnSave").live("click",function(a){a.preventDefault(),t(".btnSave").attr("disabled",!0);var r=document.getElementById("renamed-reading-group-text").value,n=t(this).attr("data-rename-RG");data={action:"wp_jv_prg_save_renamed_rg_to_db",url:ajaxurl,type:"POST",dataType:"text",RGToRename:n,NewRGName:r},t.post(ajaxurl,data,function(t){t.error?alert(t.error_msg+"\n\n[Error: "+t.error_code+"]"):e()}),t(".btnSave").attr("disabled",!1)}),t(".lnkDelete").live("click",function(a){a.preventDefault();var r=jQuery(this).attr("href");data={action:"wp_jv_prg_delete_rg",url:ajaxurl,type:"POST",delurl:r},t.post(ajaxurl,data,function(t){t.error?alert(t.error_msg+"\n\n[Error: "+t.error_code+"]"):e()})})});
     2// @version: 2.4
     3jQuery(document).ready(function($){function wp_jv_prg_refresh_rg_list(){data={action:'wp_jv_prg_refresh_rg_list',url:ajaxurl,type:'POST'};$.post(ajaxurl,data,function(response){var response=$.parseJSON(response);if(response.rows.length){$('#the-list').html(response.rows)}})};$('#btnAddNewRG').on('click',function(event){event.preventDefault();$('#btnAddNewRG').attr('disabled',!0);$('#spnAddRG').show();var newrg=document.getElementById("jv-new-reading-group-text").value;data={action:'wp_jv_prg_add_new_rg_to_db',url:ajaxurl,type:'POST',dataType:'text','newrg':newrg,wp_jv_rg_nonce:wp_jv_prg_obj.wp_jv_rg_nonce};$.post(ajaxurl,data,function(response){if(response.error){alert(response.error_msg+'\n\n[Error: '+response.error_code+']')}else{wp_jv_prg_refresh_rg_list()}
     4$('#spnAddRG').hide();$('#btnAddNewRG').attr('disabled',!1);document.getElementById("jv-new-reading-group-text").value=''})});$('#the-list').on('click','.lnkEdit',function(event){event.preventDefault();$.ajaxSetup({async:!1});wp_jv_prg_refresh_rg_list();$.ajaxSetup({async:!0});var editRG=$(this).attr('data-RG');$('.RenameDiv-'+editRG).html('<input type="text" id="renamed-reading-group-text" style="width:100%" value="'+$('div.ItemDiv-'+editRG).text()+'">'+'<br><button class="btnCancelRG button-secondary">Cancel</button>'+'<button style="float:right" class="btnSaveRG button-primary" data-rename-RG="'+editRG+'">Save</button>')});$('#the-list').on('click','.btnCancelRG',function(event){event.preventDefault();wp_jv_prg_refresh_rg_list()});$('#the-list').on('click','.btnSaveRG',function(event){event.preventDefault();$('.btnSave').attr('disabled',!0);var NewRGName=document.getElementById("renamed-reading-group-text").value;var RGToRename=$(this).attr('data-rename-RG');data={action:'wp_jv_prg_save_renamed_rg_to_db',url:ajaxurl,type:'POST',dataType:'text','RGToRename':RGToRename,'NewRGName':NewRGName};$.post(ajaxurl,data,function(response){if(response.error){alert(response.error_msg+'\n\n[Error: '+response.error_code+']')}else{wp_jv_prg_refresh_rg_list()}});$('.btnSave').attr('disabled',!1)});$('#the-list').on('click','.lnkDelete',function(event){event.preventDefault();var delurl=jQuery(this).attr('href');data={action:'wp_jv_prg_delete_rg',url:ajaxurl,type:'POST','delurl':delurl};$.post(ajaxurl,data,function(response){if(response.error){alert(response.error_msg+'\n\n[Error: '+response.error_code+']')}else{wp_jv_prg_refresh_rg_list()}})})})
  • wp-jv-post-reading-groups/trunk/wp-jv-post-reading-groups.php

    r2245041 r2422830  
    44 * Plugin URI: http://janosver.com/projects/wordpress/wp-jv-post-reading-groups
    55 * Description: Grant read-only permission for selected users (with no administrator role) on selected private posts
    6  * Version: 2.3
     6 * Version: 2.4
    77 * Author: Janos Ver
    88 * Author URI: http://janosver.com
Note: See TracChangeset for help on using the changeset viewer.