Changeset 2422830
- Timestamp:
- 11/21/2020 05:02:25 PM (4 years ago)
- Location:
- wp-jv-post-reading-groups/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-jv-post-reading-groups/trunk/Readme.txt
r2245041 r2422830 3 3 Tags: access, login, permission, permissions, post, posts, privacy, private, restrict, simple, user, users, member, members, membership, page, pages 4 4 Requires at least: 3.9.2 5 Tested up to: 5. 3.26 Stable tag: 2. 35 Tested up to: 5.5.3 6 Stable tag: 2.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 69 69 70 70 == Changelog == 71 72 = 2.4 = 73 Release 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 71 76 72 77 = 2.3 = -
wp-jv-post-reading-groups/trunk/uninstall.php
r2245041 r2422830 4 4 * 5 5 * WP JV Post Reading Groups Settings Uninstaller 6 * @version 2. 36 * @version 2.4 7 7 */ 8 8 -
wp-jv-post-reading-groups/trunk/wp-jv-post-reading-groups.css
r2245041 r2422830 1 1 /* 2 2 // CSS for WP JV Post Reading Groups 3 // @version: 2. 33 // @version: 2.4 4 4 */ 5 5 -
wp-jv-post-reading-groups/trunk/wp-jv-post-reading-groups.js
r2245041 r2422830 1 1 // Scripts for WP JV Post Reading Groups 2 // @version: 2. 32 // @version: 2.4 3 3 4 4 jQuery(document).ready(function($){ … … 6 6 /* Refresh WP_JV_PRG_List_Table whenever a change occur */ 7 7 /************************************************************************************************************/ 8 function wp_jv_prg_refresh_rg_list() { 9 8 function wp_jv_prg_refresh_rg_list() { 10 9 data = { 11 10 action : 'wp_jv_prg_refresh_rg_list', … … 18 17 19 18 // 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 } 22 22 }); 23 }; 23 24 }; 24 25 25 26 /************************************************************************************************************/ 26 27 /* Add new RG */ 27 28 /************************************************************************************************************/ 28 $('#btnAddNewRG').click(function(){ 29 $('#btnAddNewRG').on('click',function(event){ 30 event.preventDefault(); 29 31 //Disable button and show loading icon 30 32 $('#btnAddNewRG').attr('disabled', true); … … 67 69 /* Edit RG */ 68 70 /************************************************************************************************************/ 69 $('.lnkEdit').live('click',function(event){ 71 $('#the-list').on('click','.lnkEdit',function(event){ 72 70 73 event.preventDefault(); 71 74 72 75 //Clean up any other open Edit input - no save 73 $.ajaxSetup({async:false});76 $.ajaxSetup({async:false}); 74 77 wp_jv_prg_refresh_rg_list(); 75 $.ajaxSetup({async:true}); 76 78 $.ajaxSetup({async:true}); 79 77 80 //Find out which RG we need to edit 78 81 var editRG = $(this).attr('data-RG'); … … 80 83 //Display an edit "form" 81 84 $('.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>' 84 87 ); 85 88 }); 86 89 87 90 //Edit RG - Cancel button pressed 88 $(' .btnCancel').live('click',function(event){91 $('#the-list').on('click','.btnCancelRG',function(event){ 89 92 event.preventDefault(); 90 93 wp_jv_prg_refresh_rg_list(); … … 92 95 93 96 //Edit RG - Save button pressed 94 $(' .btnSave').live('click',function(event){97 $('#the-list').on('click','.btnSaveRG',function(event){ 95 98 event.preventDefault(); 96 99 … … 127 130 //enable button 128 131 $('.btnSave').attr('disabled', false); 132 129 133 }); 130 134 … … 132 136 /* Delete RG */ 133 137 /************************************************************************************************************/ 134 $(' .lnkDelete').live('click',function(event){138 $('#the-list').on('click','.lnkDelete',function(event){ 135 139 event.preventDefault(); 136 140 var delurl = jQuery(this).attr('href'); -
wp-jv-post-reading-groups/trunk/wp-jv-post-reading-groups.min.js
r2245041 r2422830 1 1 // 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 3 jQuery(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 4 4 * Plugin URI: http://janosver.com/projects/wordpress/wp-jv-post-reading-groups 5 5 * Description: Grant read-only permission for selected users (with no administrator role) on selected private posts 6 * Version: 2. 36 * Version: 2.4 7 7 * Author: Janos Ver 8 8 * Author URI: http://janosver.com
Note: See TracChangeset
for help on using the changeset viewer.