Plugin Directory

Changeset 2399700


Ignore:
Timestamp:
10/14/2020 06:41:35 PM (5 years ago)
Author:
Content.ad
Message:

v1.3.6 fixes activate/pause widget functions

Location:
contentad
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • contentad/tags/1.3.4/js/admin.js

    r1987350 r2399700  
    8181       
    8282    // 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){
    8484        e.preventDefault();
    8585        tb_show("Confirm Delete","#TB_inline?inlineId=deleteConfirmation_"+$(this).attr('data-postid'),null);
     
    115115
    116116    // AJAX call to pause ad widget
    117     $('.row-actions .pause a').live('click', function(e){
     117    $('.row-actions .pause a').on('click', function(e){
    118118        e.preventDefault();
    119119        var tableRow = $(this).closest('tr');
     
    138138
    139139    // AJAX call to pause ad widget
    140     $('span.contentad-active-state').live('click', function(e){
     140    $('span.contentad-active-state').on('click', function(e){
    141141        var tableRow = $(this).closest('tr');
    142142        var activeColumn = $( 'td.column-widget_active', tableRow );
     
    161161
    162162    // AJAX call to activate ad widget
    163     $('.row-actions .activate a').live('click', function(e){
     163    $('.row-actions .activate a').on('click', function(e){
    164164        e.preventDefault();
    165165        var tableRow = $(this).closest('tr');
     
    185185
    186186    // AJAX call to activate ad widget
    187     $('span.contentad-inactive-state').live('click', function(e){
     187    $('span.contentad-inactive-state').on('click', function(e){
    188188        var tableRow = $(this).closest('tr');
    189189        var activeColumn = $( 'td.column-widget_active', tableRow );
     
    214214   
    215215    if ($( '.jquery_version_good' ).text() == false) {
    216         $('a.editinline').live('click', function() {
     216        $('a.editinline').on('click', function() {
    217217            placementClick($(this));
    218218        } );
  • contentad/tags/1.3.5/js/admin.js

    r2395744 r2399700  
    8181       
    8282    // 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){
    8484        e.preventDefault();
    8585        tb_show("Confirm Delete","#TB_inline?inlineId=deleteConfirmation_"+$(this).attr('data-postid'),null);
     
    115115
    116116    // AJAX call to pause ad widget
    117     $('.row-actions .pause a').live('click', function(e){
     117    $('.row-actions .pause a').on('click', function(e){
    118118        e.preventDefault();
    119119        var tableRow = $(this).closest('tr');
     
    138138
    139139    // AJAX call to pause ad widget
    140     $('span.contentad-active-state').live('click', function(e){
     140    $('span.contentad-active-state').on('click', function(e){
    141141        var tableRow = $(this).closest('tr');
    142142        var activeColumn = $( 'td.column-widget_active', tableRow );
     
    161161
    162162    // AJAX call to activate ad widget
    163     $('.row-actions .activate a').live('click', function(e){
     163    $('.row-actions .activate a').on('click', function(e){
    164164        e.preventDefault();
    165165        var tableRow = $(this).closest('tr');
     
    185185
    186186    // AJAX call to activate ad widget
    187     $('span.contentad-inactive-state').live('click', function(e){
     187    $('span.contentad-inactive-state').on('click', function(e){
    188188        var tableRow = $(this).closest('tr');
    189189        var activeColumn = $( 'td.column-widget_active', tableRow );
     
    214214   
    215215    if ($( '.jquery_version_good' ).text() == false) {
    216         $('a.editinline').live('click', function() {
     216        $('a.editinline').on('click', function() {
    217217            placementClick($(this));
    218218        } );
  • contentad/trunk/contentad.php

    r2395741 r2399700  
    55 * Plugin URI: https://wordpress.org/plugins/contentad/
    66 * 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
    88 * Author: Content.ad
    99 * Author URI: https://www.content.ad
     
    4242}
    4343
    44 define( 'CONTENTAD_VERSION', '1.3.5' );
     44define( 'CONTENTAD_VERSION', '1.3.6' );
    4545define( 'CONTENTAD_FILE', get_contentad_file() );
    4646define( 'CONTENTAD_PATH', plugin_dir_path( CONTENTAD_FILE ) );
  • contentad/trunk/includes/admin/admin.class.php

    r1983456 r2399700  
    9898                        'action' => 'edit_contentad_widget',
    9999                        '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' ),
    102104                        'newWidgetCall' => $add_widget_url,
    103105                        'reportName' => __('View Statistics', 'contentad' ),
  • contentad/trunk/includes/post-type.class.php

    r1777920 r2399700  
    101101                    if( get_post_meta( $post_id, '_ca_widget_inactive', true ) ) {
    102102                        $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>";
    104104                    } else {
    105105                        $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>";
    107107                    }
    108108
     
    224224                case 'widget_active':
    225225                    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>';
    227227                    } 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>';
    229229                    }
    230230                    break;
  • contentad/trunk/js/admin.js

    r1987350 r2399700  
    8181       
    8282    // 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){
    8484        e.preventDefault();
    8585        tb_show("Confirm Delete","#TB_inline?inlineId=deleteConfirmation_"+$(this).attr('data-postid'),null);
     
    114114    });
    115115
    116     // AJAX call to pause ad widget
    117     $('.row-actions .pause a').live('click', function(e){
     116    // AJAX call to activate/pause ad widget
     117    $('.toggle-status').on('click', function(e){
    118118        e.preventDefault();
     119        var isActive = $(this).hasClass('active');
     120        var task = (isActive)?'pause':'activate';
    119121        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');
    122125        $.post(
    123126            ajaxurl,
     
    125128                action  : ContentAd.action,
    126129                nonce   : ContentAd.nonce,
    127                 task    : 'pause',
    128                 post_id : $(this).attr('data-postid')
     130                task    : task,
     131                post_id : post_id
    129132            },
    130133            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                }
    134147            },
    135148            'json'
    136149        );
    137150    });
    138 
    139     // AJAX call to pause ad widget
    140     $('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_id
    152             },
    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 widget
    163     $('.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 widget
    187     $('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_id
    199             },
    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     });
    208151   
    209152    $( 'tr.inline-edit-row' ).removeClass( 'inline-edit-row-page' ).addClass( 'inline-edit-row-post' );
     
    214157   
    215158    if ($( '.jquery_version_good' ).text() == false) {
    216         $('a.editinline').live('click', function() {
     159        $('a.editinline').on('click', function() {
    217160            placementClick($(this));
    218161        } );
  • contentad/trunk/readme.txt

    r2395741 r2399700  
    33Tags: 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
    44Requires at least: 3.0.6
    5 Tested up to: 5.0
    6 Stable tag: 1.3.5
     5Tested up to: 5.5.1
     6Stable tag: 1.3.6
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8888
    8989== Changelog ==
     90
     91= 1.3.6 =
     92* Fixed JS error by replacing deprecated .live() with .on()
     93* Fixed active/paused bug
    9094
    9195= 1.3.5 =
  • contentad/trunk/wp-package.json

    r2395741 r2399700  
    55  "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.",
    66  "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",
    88  "url": "https://wordpress.org/plugins/contentad/",
    99  "copyright": "Copyright 2014 Content.ad (info@content.ad)",
    1010  "requires_wp": "3.0.6",
    11   "tested_with": "5.0",
     11  "tested_with": "5.5.1",
    1212  "requires_php": "5.2.4",
    1313  "text_domain": "contentad",
Note: See TracChangeset for help on using the changeset viewer.