Changeset 2088844
- Timestamp:
- 05/16/2019 06:19:27 AM (7 years ago)
- Location:
- sharpay
- Files:
-
- 20 added
- 6 edited
-
tags/1.5 (added)
-
tags/1.5/LICENSE (added)
-
tags/1.5/README.md (added)
-
tags/1.5/assets (added)
-
tags/1.5/assets/css (added)
-
tags/1.5/assets/css/admin.css (added)
-
tags/1.5/assets/js (added)
-
tags/1.5/assets/js/admin.js (added)
-
tags/1.5/includes (added)
-
tags/1.5/includes/class-sharpay-widget.php (added)
-
tags/1.5/includes/sharpay-admin.php (added)
-
tags/1.5/includes/sharpay-public.php (added)
-
tags/1.5/index.php (added)
-
tags/1.5/languages (added)
-
tags/1.5/languages/README.md (added)
-
tags/1.5/languages/sharpay-plugin-ru_RU.mo (added)
-
tags/1.5/languages/sharpay-plugin-ru_RU.po (added)
-
tags/1.5/languages/sharpay-plugin.pot (added)
-
tags/1.5/readme.txt (added)
-
tags/1.5/sharpay.php (added)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/includes/sharpay-admin.php (modified) (7 diffs)
-
trunk/includes/sharpay-public.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sharpay.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sharpay/trunk/assets/css/admin.css
r1865952 r2088844 55 55 } 56 56 57 58 #sharpay-settings .colors { 59 margin-top: 10px; 60 } 61 62 57 63 /* Widget Settings -----------------------------------------------------------*/ 58 64 -
sharpay/trunk/assets/js/admin.js
r1865952 r2088844 34 34 $(e.target).parent().siblings('.group').not('.always-visible').toggle(); 35 35 }); 36 37 $('body').on('change', '.use-custom-colors', function(e) { 38 $(e.target).siblings('.colors').toggle(); 39 }); 36 40 }); 37 41 -
sharpay/trunk/includes/sharpay-admin.php
r2063466 r2088844 46 46 'share_counter' => false, 47 47 'share_counter_mode' => 'page', 48 'use_custom_colors' => false, 49 'color_font' => 'ffffff', 50 'color_bg' => 'ff9933', 48 51 'image' => '', 49 52 'use_custom_markup' => false, … … 68 71 69 72 $sharpay_options = get_option('sharpay_options'); 73 70 74 if ( empty($sharpay_options) ) { 71 75 $sharpay_options = sharpay_default_options(); 76 } 77 78 $static_buttons = array('before_content_options', 'after_content_options', 'shortcode_options'); 79 foreach($static_buttons as $sb) { 80 if (! isset($sharpay_options[$sb]['use_custom_colors'])) { 81 $sharpay_options[$sb]['use_custom_colors'] = false; 82 } 83 if (! isset($sharpay_options[$sb]['color_font'])) { 84 $sharpay_options[$sb]['color_font'] = 'ffffff'; 85 } 86 if (! isset($sharpay_options[$sb]['color_bg'])) { 87 $sharpay_options[$sb]['color_bg'] = 'ff9933'; 88 } 72 89 } 73 90 … … 240 257 241 258 <div class="group"> 259 <input type="checkbox" name="<?php echo $options; ?>[use_custom_colors]" 260 id="<?php echo "{$prop}-use-custom-colors" ?>" class="use-custom-colors" 261 <?php echo $sharpay_options[$prop]['use_custom_colors'] === true ? 'checked' : '' ?> > 262 <label for="<?php echo "{$prop}-use-custom-colors" ?>"> 263 <?php echo __('Would you like to use custom colors for Sharpay button?', 'sharpay-plugin'); ?></label> 264 265 <div class="colors" style="<?php echo $sharpay_options[$prop]['use_custom_colors'] === true ? '' : 'display:none;' ?>"> 266 <label for="<?php echo "{$prop}-font-color" ?>"> 267 <?php echo __('Font color', 'sharpay-plugin'); ?> 268 </label> 269 <span>#</span> 270 <input type="text" value="<?php echo $sharpay_options[$prop]['color_font'] ?>" 271 name="<?php echo $options; ?>[color_font]" 272 id="<?php echo "{$prop}-font-color" ?>"> 273 274 <label for="<?php echo "{$prop}-bg-color" ?>"> 275 <?php echo __('Background color', 'sharpay-plugin'); ?> 276 </label> 277 <span>#</span> 278 <input type="text" value="<?php echo $sharpay_options[$prop]['color_bg'] ?>" 279 name="<?php echo $options; ?>[color_bg]" 280 id="<?php echo "{$prop}-bg-color" ?>"> 281 </div> 282 283 </div> 284 285 <div class="group"> 242 286 <input type="checkbox" name="<?php echo $options; ?>[use_custom_markup]" id="<?php echo "{$prop}-use-custom-markup" ?>" class="use-custom-markup" 243 287 <?php echo $sharpay_options[$prop]['use_custom_markup'] === true ? 'checked' : '' ?> > … … 246 290 247 291 <div class="group" style="<?php echo $sharpay_options[$prop]['use_custom_markup'] === true ? '' : 'display:none;' ?>"> 248 <textarea name="<?php echo $options; ?>[custom_markup]" rows="5"><?php echo $sharpay_options[$prop]['custom_markup']; ?></textarea> 292 <textarea name="<?php echo $options; ?>[custom_markup]" rows="5"> 293 <?php echo $sharpay_options[$prop]['custom_markup']; ?></textarea> 249 294 <p class="description"><?php echo __('Enter HTML markup which represents your custom multishare button.', 'sharpay-plugin'); ?></p> 250 295 </div> … … 267 312 268 313 $input['before_content'] = sharpay_sanitize_checkbox($input, 'before_content'); 269 $input['before_content_options'] = sharpay_sanitize_static_options($input['before_content_options'] );314 $input['before_content_options'] = sharpay_sanitize_static_options($input['before_content_options'], 'before'); 270 315 271 316 $input['after_content'] = sharpay_sanitize_checkbox($input, 'after_content'); 272 $input['after_content_options'] = sharpay_sanitize_static_options($input['after_content_options'] );317 $input['after_content_options'] = sharpay_sanitize_static_options($input['after_content_options'], 'after'); 273 318 274 319 $input['shortcode'] = sharpay_sanitize_checkbox($input, 'shortcode'); 275 $input['shortcode_options'] = sharpay_sanitize_static_options($input['shortcode_options'] );320 $input['shortcode_options'] = sharpay_sanitize_static_options($input['shortcode_options'], 'shortcode'); 276 321 277 322 return $input; … … 297 342 } 298 343 299 function sharpay_sanitize_static_options( $input ) {300 344 function sharpay_sanitize_static_options( $input, $tag ) 345 { 301 346 $input = sharpay_sanitize_common_options( $input ); 302 347 … … 307 352 $input['height'] = $height; 308 353 309 $input['use_custom_markup'] = isset($input['use_custom_markup']) 310 && sanitize_text_field($input['use_custom_markup']) === 'on' ? true : false; 354 if (isset($input['use_custom_colors'])) { 355 $val = $input['use_custom_colors']; 356 $input['use_custom_colors'] = ($val === 'on' || $val === true) ? true : false; 357 } 358 else { 359 $input['use_custom_colors'] = false; 360 } 361 362 $input['color_font'] = sanitize_text_field($input['color_font']); 363 $input['color_bg'] = sanitize_text_field($input['color_bg']); 364 365 if (isset($input['use_custom_markup'])) { 366 $val = $input['use_custom_markup']; 367 $input['use_custom_markup'] = ($val === 'on' || $val === true) ? true : false; 368 } 369 else { 370 $input['use_custom_markup'] = false; 371 } 311 372 312 373 return $input; -
sharpay/trunk/includes/sharpay-public.php
r2024832 r2088844 95 95 } 96 96 97 if ($is_static && isset($options['use_custom_colors']) && $options['use_custom_colors']) { 98 $src .= "data-color-font=\"{$options['color_font']}\" data-color-bg=\"{$options['color_bg']}\""; 99 } 100 97 101 if ( $lang != 'en' ) { 98 102 $src .= "data-lang=\"{$lang}\" "; -
sharpay/trunk/readme.txt
r2063469 r2088844 4 4 Tags: social, sharing 5 5 Requires at least: 3.5 6 Tested up to: 5. 16 Tested up to: 5.2 7 7 Stable tag: "trunk" 8 8 Requires PHP: 5.2.4 … … 36 36 == Changelog == 37 37 38 = 1.5 = 39 * Font and background color options for static button. 40 38 41 = 1.4 = 39 42 * Updated translation -
sharpay/trunk/sharpay.php
r2063472 r2088844 21 21 Plugin URI: https://github.com/sharpay-io/wordpress 22 22 Description: 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. 423 Version: 1.5 24 24 Author: Sharpay Inc 25 25 Author URI: https://sharpay.io … … 29 29 */ 30 30 31 define('SHARPAY_PLUGIN_VERSION', '1. 4');31 define('SHARPAY_PLUGIN_VERSION', '1.5'); 32 32 33 33 register_activation_hook(__FILE__, 'sharpay_activate');
Note: See TracChangeset
for help on using the changeset viewer.