Plugin Directory

Changeset 1528300

Timestamp:
11/04/2016 04:58:17 PM (8 years ago)
Author:
derekspringer
Message:

Moved inline JavaScript in the header to an external JavaScript

Location:
radcontrol/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • radcontrol/trunk/adcontrol.php

    r1507629 r1528300  
    66Description: Harness WordPress.com's advertising partners for your own website. Requires <a href="http://jetpack.me/" target="_blank">Jetpack</a> to be installed and connected.
    77Author: Automattic
    8 Version: 1.1.2
     8Version: 1.1.
    99Author URI: http://automattic.com
    1010Text Domain: adcontrol
     
    2828*/
    2929
    30 define( 'ADCONTROL_VERSION', '1.1.2' );
     30define( 'ADCONTROL_VERSION', '1.1.' );
    3131define( 'ADCONTROL_ROOT', dirname( __FILE__ ) );
    3232define( 'ADCONTROL_BASENAME', plugin_basename( __FILE__ ) );
     
    183183    /**
    184184     * IPONWEB metadata used by the various scripts
    185      * @return [type] [description]
     185     * @return
    186186     */
    187187    function insert_head_meta() {
     
    210210        $data_tags = ( $this->params->cloudflare ) ? ' data-cfasync="false"' : '';
    211211        echo <<<HTML
    212         <!-- IPONWEB header script -->
    213         <script$data_tags type="text/javascript">
    214             window.__ATA = {
    215                 scriptSrc: '//s.pubmine.com/showad.js',
    216                 slotPrefix: 'automattic-id-',
    217                 customParams: _ipw_custom,
    218                 initAd: function(o) {
    219                     var o = o || {},
    220                         g = window,
    221                         d = g.document,
    222                         wr = d.write,
    223                         id = g.__ATA.id();
    224                     wr.call(d, '<div id="' + id + '" data-section="' + (o.sectionId || 0) + '"' + (o.type ? ('data-type="' + o.type + '"') : '') + ' ' + (o.forcedUrl ? ('data-forcedurl="' + o.forcedUrl + '"') : '') + ' style="width:' + (o.width || 0) + 'px; height:' + (o.height || 0) + 'px;">');
    225                     g.__ATA.displayAd(id);
    226                     wr.call(d, '</div>');
    227                 },
    228                 displayAd: function(id) {
    229                     window.__ATA.ids = window.__ATA.ids || {};
    230                     window.__ATA.ids[id] = 1;
    231                 },
    232                 id: function() {
    233                     return window.__ATA.slotPrefix + (parseInt(Math.random() * 10000, 10) + 1 + (new Date()).getMilliseconds());
    234                 }
    235             };
    236             (function(d, ata) {
    237                 var pr = "https:" === d.location.protocol ? "https:" : "http:",
    238                     src = pr + ata.scriptSrc,
    239                     st = "text/javascript";
    240                 d.write('<scr' + 'ipt type="' + st + '" src="' + src + '"><\/scr' + 'ipt>');
    241             })(window.document, window.__ATA);
    242         </script>
     212        <script$data_tags type="text/javascript" src="//s.pubmine.com/head.js"></script>
    243213HTML;
    244214    }
     
    321291        <div class="wpcnt">
    322292            <div class="wpa">
    323                 <a class="wpa-about" href="http://en.wordpress.com/about-these-ads/" rel="nofollow">$about</a>
     293                <a class="wpa-about" href="http://en.wordpress.com/about-these-ads/" rel="nofollow">$about</a>
    324294                <div id="ac-$spot" class="u $spot">
    325295                    $snippet
  • radcontrol/trunk/php/widgets.php

    r1507629 r1528300  
    1111    private static $allowed_tags = array( 'mrec', 'wideskyscraper' );
    1212
    13     private $options = array();
    14 
    1513    function __construct() {
    1614        parent::__construct(
     
    1917            array( 'description' => __( 'Insert an AdControl ad wherever you can place a widget.', 'adcontrol' ) )
    2018        );
    21 
    22         $this->options = array_merge(
    23             get_option( 'adcontrol_settings',  array() )
    24         );
    25     }
    26 
    27     /**
    28      * Convenience function for grabbing options from params->options
    29      * @param  string $option the option to grab
    30      * @param  mixed  $default (optional)
    31      * @return option or $default if not set
    32      *
    33      * @since 0.1
    34      */
    35     function option( $option, $default = false ) {
    36         if ( ! isset( $this->options[$option] ) )
    37             return $default;
    38 
    39         return $this->options[$option];
    4019    }
    4120
     
    5433        <div class="wpcnt">
    5534            <div class="wpa">
    56                 <a class="wpa-about" href="http://en.wordpress.com/about-these-ads/" rel="nofollow">$about</a>
     35                <a class="wpa-about" href="http://en.wordpress.com/about-these-ads/" rel="nofollow">$about</a>
    5736                <div class="u {$instance['unit']}">
    5837                    <script$data_tags type='text/javascript'>
  • radcontrol/trunk/readme.txt

    r1507629 r1528300  
    33Tags: advertising, ad codes, ads
    44Requires at least: 3.4
    5 Tested up to: 4.6.1
    6 Stable tag: 1.1.2
     5Tested up to: 4.
     6Stable tag: 1.1.
    77
    88Harness WordPress.com's advertising partners for your own website.
     
    1818Requires [Jetpack](http://jetpack.me/) to be installed and connected. [Help getting started.](http://jetpack.me/support/getting-started-with-jetpack/)
    1919
    20 New in version 1.1.1! Developers can use the following constant on wp-config to enable support for CloudFlare's Rocket Loader (if the automatic detection isn't working for them):
    21 
    22 `define( 'ADCONTROL_CLOUDFLARE', true );` prevents the ad scripts from being processed by CloudFlare's Rocket Loader.
     20New in version 1.1.3 Moved inline JavaScript in the header to an external JavaScript.
    2321
    2422== Installation ==
     
    3735
    3836== Changelog ==
     37
     38
     39
    3940
    4041= 1.1.2 =
Note: See TracChangeset for help on using the changeset viewer.