Plugin Directory

Changeset 1681129


Ignore:
Timestamp:
06/19/2017 12:44:16 PM (9 years ago)
Author:
plista
Message:

Add single page website option

Location:
plista/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • plista/trunk/lang/plista-de_DE.po

    r1331972 r1681129  
    5757msgstr "z.B."
    5858
     59msgid "Reinit"
     60msgstr "Widgets auf einer Seite werden neu geladen, wenn eine neue plista Platzierung eingefügt wird (z.B bei \"Infinite Scroll Websites\")."
     61
    5962#: ../plista_integration_admin.php:285
    6063msgid "Publickey"
  • plista/trunk/lang/plista-en_GB.po

    r1136037 r1681129  
    6767msgstr "e.g."
    6868
     69msgid "Reinit"
     70msgstr "This option makes widgets reload, whenever another plista script tag is inserted (needed for \"Infinite Scroll Websites\")."
     71
    6972#: ../plista_integration_admin.php:183
    7073msgid "Publickey"
  • plista/trunk/lang/plista.pot

    r1331972 r1681129  
    6161msgstr ""
    6262
     63msgid "Reinit"
     64msgstr ""
     65
    6366#: ../plista_integration_admin.php:285
    6467msgid "Publickey"
  • plista/trunk/plista_integration.php

    r1608738 r1681129  
    44    Plugin URI: http://www.plista.com
    55    Description: Plugin for displaying plista RecommendationAds
    6     Version: 1.5.8
     6    Version: 1.5.9
    77    Author: wordpress@plista.com
    88    Author URI: http://www.plista.com
     
    1111class plista {
    1212
    13     const VERSION = '1.5.8';
     13    const VERSION = '1.5.9';
    1414
    1515    /**
     
    8989    public static function plista_admin_actions() {
    9090        if( current_user_can('level_10')) {
    91             wp_enqueue_script( 'plista-admin', plugins_url('/js/plista-admin.js', __FILE__), array(), '1.5.8' );
    92             wp_enqueue_style( 'plista-admin', plugins_url('/css/plista-admin.css', __FILE__), array(), '1.5.8' );
     91            wp_enqueue_script( 'plista-admin', plugins_url('/js/plista-admin.js', __FILE__), array(), '1.5.9' );
     92            wp_enqueue_style( 'plista-admin', plugins_url('/css/plista-admin.css', __FILE__), array(), '1.5.9' );
    9393            add_options_page('plista', 'plista', 1, 'plista', array(__CLASS__, 'plista_admin'));
    9494        }
     
    245245        $publickey = get_option( 'plista_publickey' );
    246246        $origin = get_option( 'plista_origin' );
     247        $reinit = get_option( 'plista_reinit' );
    247248
    248249        $setblacklist = get_option( 'plista_setblacklist' );
     
    297298
    298299        if (!self::plista_ismobile()) {
    299             $plistapush = ',item:' . ($plista_data ? json_encode($plista_data) : '{}');
    300             if ($plistapush == ',item:') {
     300            $plistapush = '"item": ' . ($plista_data ? json_encode($plista_data) : '{}');
     301            if (trim($plistapush) == '"item":') {
    301302                $plistapush = '';
     303            }
     304            if ($plistapush) {
     305                $plistapush = ',' . "\n\t" . $plistapush;
    302306            }
    303307        }
     
    310314
    311315        if ($origin) {
    312             $origin = '-' . $origin;
    313         }
    314 
    315         $plistascript = '<script type="text/javascript">
    316                         if (!window.PLISTA || !PLISTA.publickey) {
    317                             window.PLISTA = {
    318                                 publickey: "'.$publickey.'"
    319                                 '.$plistapush.'
    320                             };
    321                         }
    322                         (function(){var n="script",d=document,s=d.createElement(n),s0=d.getElementsByTagName(n)[0];
    323                         s.async="async";s.type="text/javascript";s.src=(d.location.protocol==="https:"?"https:":"http:")+"//static' . $origin . '.plista.com/async.js";
    324                         s0.parentNode.insertBefore(s,s0)}());
    325                     </script>';
    326 
     316            $origin = ',' . "\n\t" . '"origin": "' . strtolower($origin) .'"';
     317        }
     318        if ($reinit) {
     319            $reinit = 'else{w[n].reset();w[n].item=c.item;w[n].init();}';
     320        }
     321
     322
     323        $plistascript = '
     324<script type="text/javascript">
     325(function(c){var g,s=\'script\',w=window,n=c.name||\'PLISTA\';if(!w[n]){w[n]=c;g=w.document.getElementsByTagName(s)[0];s=w.document.createElement(s);s.async=true;s.type=\'text/javascript\';s.src=(w.location.protocol===\'https:\'?\'https:\':\'http:\')+\'//static\'+(c.origin?\'-\'+c.origin:\'\')+\'.plista.com/async\'+(c.name?\'/\'+c.name:\'\')+\'.js\';g.parentNode.insertBefore(s,g);}' . $reinit . '
     326}({
     327    "publickey": "'.$publickey.'"' . $plistapush . $origin . '
     328}));
     329</script>
     330';
    327331        $plistacomment = '<!-- plista wp Version '.self::plista_version().' -->';
    328332
  • plista/trunk/plista_integration_admin.php

    r1600786 r1681129  
    109109    update_option('plista_origin', $origin);
    110110
     111    $reinit = isset($_POST['plista_reinit']) ? $_POST['plista_reinit'] : '';
     112    update_option('plista_reinit', $reinit);
     113    if (get_option('plista_reinit')) {
     114        $reinit = 'checked="checked"';
     115        update_option('plista_reinit', $reinit);
     116    } else {
     117        $reinit = '';
     118    }
     119
    111120    $autoinsert = isset($_POST['plista_autoinsert']) ? $_POST['plista_autoinsert'] : '';
    112121    update_option('plista_autoinsert', $autoinsert);
     
    229238    $publickey = get_option('plista_publickey');
    230239    $origin = get_option('plista_origin');
     240    $reinit = get_option('plista_reinit');
    231241    $autoinsert = get_option('plista_autoinsert');
    232242    $shorttag = get_option('plista_shorttag');
     
    296306                <input type="text" name="plista_origin" value="<?php echo $origin; ?>" size="2">
    297307                <span><?php _e('e.g.', 'plista'); ?> cn</span>
     308            </p>
     309            <p>
     310                <label class="textlabel" for="plista_reinit"><?php _e('Single page website', 'plista'); ?> <span class="optional">*<?php _e('optional', 'plista') ?></span></label>
     311                <input type="checkbox" id="plista_reinit" name="plista_reinit" value="1" <?php echo $reinit; ?>>
     312                <span><?php _e('Reinit', 'plista'); ?></span>
    298313            </p>
    299314        </div>
  • plista/trunk/readme.txt

    r1608738 r1681129  
    66Requires at least: 3.0.0
    77Tested up to: 4.7.1
    8 Stable tag: 1.5.8
     8Stable tag: 1.5.9
    99
    1010The plista Widget adds plista RecommendationAds to your Wordpress blog posts.
     
    6565== Upgrade Notice ==
    6666
    67 Please upgrade to Version 1.5.8
     67Please upgrade to Version 1.5.9
    6868
    6969== Screenshots ==
     
    1571571.5.8 @ 06-03-2017
    158158    * Add input for plista origin in the plugin settings
     159
     1601.5.9 @ 19-06-2017
     161    * Add single page website option
Note: See TracChangeset for help on using the changeset viewer.