Changeset 2399700
- Timestamp:
- 10/14/2020 06:41:35 PM (5 years ago)
- Location:
- contentad
- Files:
-
- 8 edited
-
tags/1.3.4/js/admin.js (modified) (6 diffs)
-
tags/1.3.5/js/admin.js (modified) (6 diffs)
-
trunk/contentad.php (modified) (2 diffs)
-
trunk/includes/admin/admin.class.php (modified) (1 diff)
-
trunk/includes/post-type.class.php (modified) (2 diffs)
-
trunk/js/admin.js (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-package.json (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
contentad/tags/1.3.4/js/admin.js
r1987350 r2399700 81 81 82 82 // Delete widget confirmation dialog box 83 $('.row-actions .trash a.submitdelete'). live('click', function(e){83 $('.row-actions .trash a.submitdelete').on('click', function(e){ 84 84 e.preventDefault(); 85 85 tb_show("Confirm Delete","#TB_inline?inlineId=deleteConfirmation_"+$(this).attr('data-postid'),null); … … 115 115 116 116 // AJAX call to pause ad widget 117 $('.row-actions .pause a'). live('click', function(e){117 $('.row-actions .pause a').on('click', function(e){ 118 118 e.preventDefault(); 119 119 var tableRow = $(this).closest('tr'); … … 138 138 139 139 // AJAX call to pause ad widget 140 $('span.contentad-active-state'). live('click', function(e){140 $('span.contentad-active-state').on('click', function(e){ 141 141 var tableRow = $(this).closest('tr'); 142 142 var activeColumn = $( 'td.column-widget_active', tableRow ); … … 161 161 162 162 // AJAX call to activate ad widget 163 $('.row-actions .activate a'). live('click', function(e){163 $('.row-actions .activate a').on('click', function(e){ 164 164 e.preventDefault(); 165 165 var tableRow = $(this).closest('tr'); … … 185 185 186 186 // AJAX call to activate ad widget 187 $('span.contentad-inactive-state'). live('click', function(e){187 $('span.contentad-inactive-state').on('click', function(e){ 188 188 var tableRow = $(this).closest('tr'); 189 189 var activeColumn = $( 'td.column-widget_active', tableRow ); … … 214 214 215 215 if ($( '.jquery_version_good' ).text() == false) { 216 $('a.editinline'). live('click', function() {216 $('a.editinline').on('click', function() { 217 217 placementClick($(this)); 218 218 } ); -
contentad/tags/1.3.5/js/admin.js
r2395744 r2399700 81 81 82 82 // Delete widget confirmation dialog box 83 $('.row-actions .trash a.submitdelete'). live('click', function(e){83 $('.row-actions .trash a.submitdelete').on('click', function(e){ 84 84 e.preventDefault(); 85 85 tb_show("Confirm Delete","#TB_inline?inlineId=deleteConfirmation_"+$(this).attr('data-postid'),null); … … 115 115 116 116 // AJAX call to pause ad widget 117 $('.row-actions .pause a'). live('click', function(e){117 $('.row-actions .pause a').on('click', function(e){ 118 118 e.preventDefault(); 119 119 var tableRow = $(this).closest('tr'); … … 138 138 139 139 // AJAX call to pause ad widget 140 $('span.contentad-active-state'). live('click', function(e){140 $('span.contentad-active-state').on('click', function(e){ 141 141 var tableRow = $(this).closest('tr'); 142 142 var activeColumn = $( 'td.column-widget_active', tableRow ); … … 161 161 162 162 // AJAX call to activate ad widget 163 $('.row-actions .activate a'). live('click', function(e){163 $('.row-actions .activate a').on('click', function(e){ 164 164 e.preventDefault(); 165 165 var tableRow = $(this).closest('tr'); … … 185 185 186 186 // AJAX call to activate ad widget 187 $('span.contentad-inactive-state'). live('click', function(e){187 $('span.contentad-inactive-state').on('click', function(e){ 188 188 var tableRow = $(this).closest('tr'); 189 189 var activeColumn = $( 'td.column-widget_active', tableRow ); … … 214 214 215 215 if ($( '.jquery_version_good' ).text() == false) { 216 $('a.editinline'). live('click', function() {216 $('a.editinline').on('click', function() { 217 217 placementClick($(this)); 218 218 } ); -
contentad/trunk/contentad.php
r2395741 r2399700 5 5 * Plugin URI: https://wordpress.org/plugins/contentad/ 6 6 * Description: Content.ad enables blog owners to display ads or related blog posts (from their own blog) in a "lead me to more content" section. The ads are sourced dynamically from the Content.ad system and can be a source of revenue for the blog owner. 7 * Version: 1.3. 57 * Version: 1.3.6 8 8 * Author: Content.ad 9 9 * Author URI: https://www.content.ad … … 42 42 } 43 43 44 define( 'CONTENTAD_VERSION', '1.3. 5' );44 define( 'CONTENTAD_VERSION', '1.3.6' ); 45 45 define( 'CONTENTAD_FILE', get_contentad_file() ); 46 46 define( 'CONTENTAD_PATH', plugin_dir_path( CONTENTAD_FILE ) ); -
contentad/trunk/includes/admin/admin.class.php
r1983456 r2399700 98 98 'action' => 'edit_contentad_widget', 99 99 'nonce' => wp_create_nonce( 'edit_contentad_widget' ), 100 'pauseTranslation' => __( 'Pause', 'contentad' ), 101 'activateTranslation' => __( 'Activate', 'contentad' ), 100 'pauseLinkTranslation' => __( 'Pause this widget', 'contentad' ), 101 'activateLinkTranslation' => __( 'Activate this widget', 'contentad' ), 102 'pauseButtonTranslation' => __( 'Paused', 'contentad' ), 103 'activateButtonTranslation' => __( 'Active', 'contentad' ), 102 104 'newWidgetCall' => $add_widget_url, 103 105 'reportName' => __('View Statistics', 'contentad' ), -
contentad/trunk/includes/post-type.class.php
r1777920 r2399700 101 101 if( get_post_meta( $post_id, '_ca_widget_inactive', true ) ) { 102 102 $text = __( 'Activate this widget', 'contentad' ); 103 $actions['activate'] = "<a href=\"#\" title=\"{$text}\" data-postid=\"{$post->ID}\">{$text}</a>";103 $actions['activate'] = "<a href=\"#\" class=\"paused toggle-status\" title=\"{$text}\" data-postid=\"{$post->ID}\">{$text}</a>"; 104 104 } else { 105 105 $text = __( 'Pause this widget', 'contentad' ); 106 $actions['pause'] = "<a href=\"#\" title=\"{$text}\" data-postid=\"{$post->ID}\">{$text}</a>";106 $actions['pause'] = "<a href=\"#\" class=\"active toggle-status\" title=\"{$text}\" data-postid=\"{$post->ID}\">{$text}</a>"; 107 107 } 108 108 … … 224 224 case 'widget_active': 225 225 if( get_post_meta( $post_id, '_ca_widget_inactive', true ) ) { 226 echo '<span class="contentad-inactive-state ">Paused</span>';226 echo '<span class="contentad-inactive-state paused toggle-status" data-postid="'.$post_id.'">Paused</span>'; 227 227 } else { 228 echo '<span class="contentad-active-state ">Active</span>';228 echo '<span class="contentad-active-state active toggle-status" data-postid="'.$post_id.'">Active</span>'; 229 229 } 230 230 break; -
contentad/trunk/js/admin.js
r1987350 r2399700 81 81 82 82 // Delete widget confirmation dialog box 83 $('.row-actions .trash a.submitdelete'). live('click', function(e){83 $('.row-actions .trash a.submitdelete').on('click', function(e){ 84 84 e.preventDefault(); 85 85 tb_show("Confirm Delete","#TB_inline?inlineId=deleteConfirmation_"+$(this).attr('data-postid'),null); … … 114 114 }); 115 115 116 // AJAX call to pause ad widget117 $('. row-actions .pause a').live('click', function(e){116 // AJAX call to activate/pause ad widget 117 $('.toggle-status').on('click', function(e){ 118 118 e.preventDefault(); 119 var isActive = $(this).hasClass('active'); 120 var task = (isActive)?'pause':'activate'; 119 121 var tableRow = $(this).closest('tr'); 120 var activeColumn = $( 'td.column-widget_active', tableRow ); 121 var link = $(this); 122 var activeButton = $( 'td.column-widget_active span', tableRow ); 123 var link = $('.row-actions a.toggle-status', tableRow); 124 var post_id = $(this).data('postid'); 122 125 $.post( 123 126 ajaxurl, … … 125 128 action : ContentAd.action, 126 129 nonce : ContentAd.nonce, 127 task : 'pause',128 post_id : $(this).attr('data-postid')130 task : task, 131 post_id : post_id 129 132 }, 130 133 function( response ){ 131 var text = ContentAd.activateTranslation; 132 link.text( text ).attr( 'title', text).closest('span').attr( 'class', text.toLowerCase() ); 133 activeColumn.html( '<span class="contentad-inactive-state">Paused</span>' ); 134 var linkText = (isActive)?ContentAd.activateLinkTranslation:ContentAd.pauseLinkTranslation; 135 var buttonText = (isActive)?ContentAd.pauseButtonTranslation:ContentAd.activateButtonTranslation; 136 link.text( linkText ).attr( 'title', linkText).closest('span').attr( 'class', (isActive?'activate':'pause') ); 137 activeButton.text(buttonText); 138 if(isActive) { 139 // Pause 140 link.removeClass('active contentad-active-state').addClass('paused contentad-inactive-state'); 141 activeButton.removeClass('active contentad-active-state').addClass('paused contentad-inactive-state'); 142 } else { 143 // Activate 144 link.removeClass('paused contentad-inactive-state').addClass('active contentad-active-state'); 145 activeButton.removeClass('paused contentad-inactive-state').addClass('active contentad-active-state'); 146 } 134 147 }, 135 148 'json' 136 149 ); 137 150 }); 138 139 // AJAX call to pause ad widget140 $('span.contentad-active-state').live('click', function(e){141 var tableRow = $(this).closest('tr');142 var activeColumn = $( 'td.column-widget_active', tableRow );143 var link = $('.row-actions .pause a', tableRow);144 var post_id = tableRow.attr( 'id').replace( 'post-', '' );145 $.post(146 ajaxurl,147 {148 action : ContentAd.action,149 nonce : ContentAd.nonce,150 task : 'pause',151 post_id : post_id152 },153 function( response ){154 var text = ContentAd.activateTranslation;155 link.text( text ).attr( 'title', text).closest('span').attr( 'class', text.toLowerCase() );156 activeColumn.html( '<span class="contentad-inactive-state">Paused</span>' );157 },158 'json'159 );160 });161 162 // AJAX call to activate ad widget163 $('.row-actions .activate a').live('click', function(e){164 e.preventDefault();165 var tableRow = $(this).closest('tr');166 var activeColumn = $( 'td.column-widget_active', tableRow );167 var link = $(this);168 $.post(169 ajaxurl,170 {171 action : ContentAd.action,172 nonce : ContentAd.nonce,173 task : 'activate',174 post_id : $(this).attr('data-postid')175 },176 function( response ){177 var text = ContentAd.pauseTranslation;178 link.text( text ).attr( 'title', text).closest('span').attr( 'class', text.toLowerCase() );179 activeColumn.html( '<span class="contentad-active-state">Active</span>' );180 },181 'json'182 );183 184 });185 186 // AJAX call to activate ad widget187 $('span.contentad-inactive-state').live('click', function(e){188 var tableRow = $(this).closest('tr');189 var activeColumn = $( 'td.column-widget_active', tableRow );190 var link = $('.row-actions .activate a', tableRow);191 var post_id = tableRow.attr( 'id').replace( 'post-', '' );192 $.post(193 ajaxurl,194 {195 action : ContentAd.action,196 nonce : ContentAd.nonce,197 task : 'activate',198 post_id : post_id199 },200 function( response ){201 var text = ContentAd.pauseTranslation;202 link.text( text ).attr( 'title', text).closest('span').attr( 'class', text.toLowerCase() );203 activeColumn.html( '<span class="contentad-active-state">Active</span>' );204 },205 'json'206 );207 });208 151 209 152 $( 'tr.inline-edit-row' ).removeClass( 'inline-edit-row-page' ).addClass( 'inline-edit-row-post' ); … … 214 157 215 158 if ($( '.jquery_version_good' ).text() == false) { 216 $('a.editinline'). live('click', function() {159 $('a.editinline').on('click', function() { 217 160 placementClick($(this)); 218 161 } ); -
contentad/trunk/readme.txt
r2395741 r2399700 3 3 Tags: related content, engagement, ads, advertising, revenue, posts, montize, monetization, affiliate, contextual ads, contextual advertising, pay per click, ppc, ad networks, relevent ads, text ads, content ads, income, related posts, widgets, related, similar posts, related post thumbnails, popular posts 4 4 Requires at least: 3.0.6 5 Tested up to: 5. 06 Stable tag: 1.3. 55 Tested up to: 5.5.1 6 Stable tag: 1.3.6 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 88 88 89 89 == Changelog == 90 91 = 1.3.6 = 92 * Fixed JS error by replacing deprecated .live() with .on() 93 * Fixed active/paused bug 90 94 91 95 = 1.3.5 = -
contentad/trunk/wp-package.json
r2395741 r2399700 5 5 "readme_description": "Display popular content to your users from your own site and/or from our sponsored partners, increasing visitor engagement and earning revenue at the same time.", 6 6 "plugin_description": "Content.ad enables blog owners to display ads or related blog posts (from their own blog) in a \"lead me to more content\" section. The ads are sourced dynamically from the Content.ad system and can be a source of revenue for the blog owner.", 7 "version": "1.3. 5",7 "version": "1.3.6", 8 8 "url": "https://wordpress.org/plugins/contentad/", 9 9 "copyright": "Copyright 2014 Content.ad (info@content.ad)", 10 10 "requires_wp": "3.0.6", 11 "tested_with": "5. 0",11 "tested_with": "5.5.1", 12 12 "requires_php": "5.2.4", 13 13 "text_domain": "contentad",
Note: See TracChangeset
for help on using the changeset viewer.