Plugin Directory

Changeset 2132258


Ignore:
Timestamp:
08/01/2019 05:22:30 PM (7 years ago)
Author:
sharpay
Message:

version 1.6

Location:
sharpay
Files:
22 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • sharpay/trunk/includes/class-sharpay-widget.php

    r1865952 r2132258  
    4141            'use_custom_markup' => false,
    4242            'custom_markup' => 'Sharpay multishare button',
    43             'image' => ''
     43            'image' => '',
     44            'modal' => true
    4445        );
    4546        $instance = wp_parse_args( (array) $instance, $default );
     
    102103                    <p class="field-description"><?php echo __('Enter HTML markup which represents your custom multishare button.', 'sharpay-plugin'); ?></p>
    103104                </div>
     105               
     106                <div class="group always-visible">
     107                    <input type="checkbox" id="<?php echo "{$id}-modal" ?>" name="<?php echo $this->get_field_name( 'modal' ); ?>"
     108                        <?php echo $instance['modal'] === true ? 'checked' : '' ?> >
     109                        <label for="<?php echo "{$id}-modal" ?>"><?php echo __('Open in modal window', 'sharpay-plugin'); ?></label>
     110                    <p class="field-description"><?php echo __('The sharing window will open in modal mode without creating a new browser window.', 'sharpay-plugin'); ?></p>
     111                </div>
    104112
    105113                <div class="group always-visible">
     
    109117                    <p class="field-description"><?php echo __('Enter class, id or URL of an image to make it selected by default in sharing window.', 'sharpay-plugin'); ?></p>
    110118                </div>
     119               
    111120            </div>
    112121            <?php
     
    139148
    140149        $instance['image'] = sanitize_text_field($new_instance['image']);
     150       
     151        $instance['modal'] = (bool) $new_instance['modal'];
    141152
    142153        return $instance;
  • sharpay/trunk/includes/sharpay-admin.php

    r2088844 r2132258  
    3939        'share_counter' => false,
    4040        'share_counter_mode' => 'page',
    41         'image' => ''
     41        'image' => '',
     42        'modal' => true,
    4243    );
    4344
     
    5051        'color_bg' => 'ff9933',
    5152        'image' => '',
     53        'modal' => true,
    5254        'use_custom_markup' => false,
    5355        'custom_markup' => 'Sharpay multishare button'
     
    100102                    <td>
    101103                        <input type="text" id="sharpay-site-code" name="sharpay_options[site_id]"
    102                             value="<?php echo esc_attr($sharpay_options['site_id']); ?>" />
     104                            value="<?php echo esc_attr($sharpay_options['site_id']); ?>" <?php if( empty( $sharpay_options['site_id'] ) ) { echo 'class="sharpay-code-error"'; } ?>/>
    103105                        <a id="sharpay-select-site" href="#">
    104106                            <?php echo __('Get your project ID or register new project for your site in Sharpay', 'sharpay-plugin'); ?>
     
    213215        <p class="description"><?php echo __('Check if you want our button to show how many times your page was shared via Sharpay.', 'sharpay-plugin'); ?></p>
    214216    </div>
     217   
     218    <div class="group">
     219        <input type="checkbox" name="sharpay_options[floating_options][modal]" id="sharpay_options-modal" class=""
     220            <?php echo $sharpay_options['floating_options']['modal'] === true ? 'checked' : '' ?> >
     221        <label for="sharpay_options-modal"><?php echo __('Open in modal window', 'sharpay-plugin'); ?></label>
     222        <p class="description"><?php echo __('The sharing window will open in modal mode without creating a new browser window.', 'sharpay-plugin'); ?></p>
     223    </div>
    215224
    216225    <div class="group">
     
    294303        <p class="description"><?php echo __('Enter HTML markup which represents your custom multishare button.', 'sharpay-plugin'); ?></p>
    295304    </div>
    296 
     305   
     306    <div class="group always-visible">
     307        <input type="checkbox" name="<?php echo $options; ?>[modal]" id="<?php echo "{$prop}-modal" ?>" class=""
     308            <?php echo $sharpay_options[$prop]['modal'] === true ? 'checked' : '' ?> >
     309        <label for="<?php echo "{$prop}-modal" ?>"><?php echo __('Open in modal window', 'sharpay-plugin'); ?></label>
     310        <p class="description"><?php echo __('The sharing window will open in modal mode without creating a new browser window.', 'sharpay-plugin'); ?></p>
     311    </div>
     312   
    297313    <div class="group always-visible">
    298314        <input type="text" id="image" name="<?php echo $options; ?>[image]"
     
    385401
    386402    $input['image'] = sanitize_text_field($input['image']);
     403   
     404    $input['modal'] = sharpay_sanitize_checkbox($input, 'modal');
    387405
    388406    return $input;
     
    411429    $dir = dirname(__FILE__);
    412430
    413     wp_register_style('sharpay-admin-styles', plugins_url('assets/css/admin.css', dirname(__FILE__)), array(), SHARPAY_PLUGIN_VERSION);
     431    wp_register_style('sharpay-admin-styles', plugins_url('assets/css/sharpay-admin.css', dirname(__FILE__)), array(), SHARPAY_PLUGIN_VERSION);
    414432    wp_enqueue_style( 'sharpay-admin-styles' );
    415433
    416     wp_register_script('sharpay-admin-js', plugins_url('assets/js/admin.js', dirname(__FILE__)), array('jquery'), SHARPAY_PLUGIN_VERSION);
     434    wp_register_script('sharpay-admin-js', plugins_url('assets/js/sharpay-admin.js', dirname(__FILE__)), array('jquery'), SHARPAY_PLUGIN_VERSION);
    417435    wp_enqueue_script('sharpay-admin-js');
    418436}
  • sharpay/trunk/includes/sharpay-public.php

    r2088844 r2132258  
    9494        $src .= "data-image=\"{$options['image']}\" ";
    9595    }
     96   
     97    if ( $options['modal'] ) {
     98        $src .= "data-modal=\"true\" ";
     99    }
    96100
    97101    if ($is_static && isset($options['use_custom_colors']) && $options['use_custom_colors']) {
  • sharpay/trunk/readme.txt

    r2088844 r2132258  
    3636== Changelog ==
    3737
     38= 1.6 =
     39* Modal window mode.
     40
    3841= 1.5 =
    3942* Font and background color options for static button.
  • sharpay/trunk/sharpay.php

    r2088844 r2132258  
    2121Plugin URI: https://github.com/sharpay-io/wordpress
    2222Description: Sharpay is multisharing button with blockchain profit. It allows you to reward site's visitors for sharing content to their audience via Facebook, Twitter, Medium, Reddit and many other social networks.
    23 Version: 1.5
     23Version: 1.6
    2424Author: Sharpay Inc
    2525Author URI: https://sharpay.io
     
    2929*/
    3030
    31 define('SHARPAY_PLUGIN_VERSION', '1.5');
     31define('SHARPAY_PLUGIN_VERSION', '1.6');
    3232
    3333register_activation_hook(__FILE__, 'sharpay_activate');
Note: See TracChangeset for help on using the changeset viewer.