Dynamic "To Top" Plugin - Version 3.1.1

Version Description

Download this release

Release Info

Developer sksmatt
Plugin Icon wp plugin Dynamic "To Top" Plugin
Version 3.1.1
Comparing to
See all releases

Code changes from version 3.0 to 3.1.1

dynamic-to-top.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Dynamic To Top
4
- Version: 3.0
5
  Plugin URI: http://www.mattvarone.com
6
  Description: Adds an automatic and dynamic "To Top" button to scroll long pages back to the top.
7
  Author: Matt Varone
@@ -24,7 +24,7 @@ Author URI: http://www.mattvarone.com
24
  define('DYNAMIC_TO_TOP_BASENAME', plugin_basename(__FILE__));
25
  define('DYNAMIC_TO_TOP_URL', plugins_url('',__FILE__));
26
  define('DYNAMIC_TO_TOP_PATH', plugin_dir_path(__FILE__));
27
- define('DYNAMIC_TO_TOP_VERSION', '3.0');
28
  define('DYNAMIC_TO_TOP_FOLDER', '/'.basename(dirname(__FILE__)));
29
  define('DYNAMIC_TO_TOP_DOMAIN', 'dynamic-to-top');
30
 
1
  <?php
2
  /*
3
  Plugin Name: Dynamic To Top
4
+ Version: 3.1.1
5
  Plugin URI: http://www.mattvarone.com
6
  Description: Adds an automatic and dynamic "To Top" button to scroll long pages back to the top.
7
  Author: Matt Varone
24
  define('DYNAMIC_TO_TOP_BASENAME', plugin_basename(__FILE__));
25
  define('DYNAMIC_TO_TOP_URL', plugins_url('',__FILE__));
26
  define('DYNAMIC_TO_TOP_PATH', plugin_dir_path(__FILE__));
27
+ define('DYNAMIC_TO_TOP_VERSION', '3.1.1');
28
  define('DYNAMIC_TO_TOP_FOLDER', '/'.basename(dirname(__FILE__)));
29
  define('DYNAMIC_TO_TOP_DOMAIN', 'dynamic-to-top');
30
 
inc/dynamic-to-top-class.php CHANGED
@@ -71,8 +71,8 @@ if ( !class_exists('Dynamic_To_Top'))
71
  $this->options = array(
72
  'speed' => 1000,
73
  'distance' => 200,
74
- 'easing' => 'ease-in',
75
- 'position' => 'bottom-right',
76
  'padding_top_bottom' => '21',
77
  'padding_left_right' => '19',
78
  'font_size' => '1',
71
  $this->options = array(
72
  'speed' => 1000,
73
  'distance' => 200,
74
+ 'easing' => 'In Out',
75
+ 'position' => 'Bottom Right',
76
  'padding_top_bottom' => '21',
77
  'padding_left_right' => '19',
78
  'font_size' => '1',
inc/dynamic-to-top-options.php CHANGED
@@ -25,7 +25,7 @@ if ( !function_exists('dynamic_to_top_create_options_page') )
25
  function dynamic_to_top_create_options_page()
26
  {
27
  // Create Options Page
28
- add_options_page('Dynamic To Top Options','Dynamic To Top', 'administrator', __FILE__, 'dynamic_to_top_options_page');
29
  }
30
  }
31
 
@@ -65,7 +65,7 @@ if ( !function_exists('dynamic_to_top_register_and_build_fields') )
65
  add_settings_field('text_color',__('Text color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_color',__FILE__,'appearance_section');
66
  add_settings_field('bold',__('Bold Text',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_bold',__FILE__,'appearance_section');
67
  add_settings_field('text_shadow',__('Text shadow',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_shadow',__FILE__,'appearance_section');
68
- add_settings_field('shadow_color',__('Text shadow Color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_shadow_color',__FILE__,'appearance_section');
69
  add_settings_field('background_color',__('Background color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_background_color',__FILE__,'appearance_section');
70
 
71
  add_settings_field('border_color',__('Border color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_border_color',__FILE__,'appearance_section');
@@ -195,6 +195,17 @@ if ( !function_exists('dynamic_to_top_scripts') )
195
 
196
  if ( !function_exists('dynamic_to_top_is_page_options') )
197
  {
 
 
 
 
 
 
 
 
 
 
 
198
  function dynamic_to_top_is_page_options()
199
  {
200
  global $pagenow;
@@ -324,7 +335,7 @@ if ( !function_exists('dynamic_to_top_field_easing') )
324
  {
325
  $options = array( 'Linear', 'In','Out','In Out','Bounce','Elastic');
326
 
327
- echo dynamic_to_top_do_select('easing',$options,'easeInOutExpo',__('<a href="http://gsgd.co.uk/sandbox/jquery/easing" title="Easing type">Easing type</a> used to scroll the page up.',DYNAMIC_TO_TOP_DOMAIN));
328
  }
329
  }
330
 
@@ -360,7 +371,7 @@ if ( !function_exists('dynamic_to_top_field_scroll_time') )
360
 
361
  function dynamic_to_top_field_scroll_time()
362
  {
363
- echo dynamic_to_top_do_slider('speed',1000,__('Time it takes for the page to scroll up. Less for faster. ( <span id="speed-val"></span> Milliseconds )',DYNAMIC_TO_TOP_DOMAIN));
364
  }
365
  }
366
 
@@ -392,7 +403,7 @@ if ( !function_exists('dynamic_to_top_field_padding_top_bottom') )
392
 
393
  function dynamic_to_top_field_padding_top_bottom()
394
  {
395
- echo dynamic_to_top_do_slider('padding_top_bottom',5,__('Spacing on Top and Bottom. ( <span id="padding-top-bottom-val"></span>px )',DYNAMIC_TO_TOP_DOMAIN));
396
  }
397
  }
398
 
@@ -408,7 +419,7 @@ if ( !function_exists('dynamic_to_top_field_padding_left_right') )
408
 
409
  function dynamic_to_top_field_padding_left_right()
410
  {
411
- echo dynamic_to_top_do_slider('padding_left_right',21,__('Spacing on Left and Right. ( <span id="padding-left-right-val"></span>px )',DYNAMIC_TO_TOP_DOMAIN));
412
  }
413
  }
414
 
@@ -440,7 +451,7 @@ if ( !function_exists('dynamic_to_top_field_border_radius') )
440
 
441
  function dynamic_to_top_field_border_radius()
442
  {
443
- echo dynamic_to_top_do_slider('radius','3',__('Button border radius',DYNAMIC_TO_TOP_DOMAIN).' <span id="radius-val"></span>px.');
444
  }
445
  }
446
 
@@ -458,7 +469,7 @@ if ( !function_exists('dynamic_to_top_field_distance') )
458
 
459
  function dynamic_to_top_field_distance()
460
  {
461
- echo dynamic_to_top_do_textfield('distance',200,__('Distance from top to show the button. ( Pixels )',DYNAMIC_TO_TOP_DOMAIN));
462
  }
463
  }
464
 
@@ -492,7 +503,7 @@ if ( !function_exists('dynamic_to_top_field_prevent_on_mobile') )
492
 
493
  function dynamic_to_top_field_prevent_on_mobile()
494
  {
495
- echo dynamic_to_top_do_checkbox('prevent_on_mobile',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Disable the button on mobile browsers.',DYNAMIC_TO_TOP_DOMAIN));
496
  }
497
  }
498
 
@@ -508,7 +519,7 @@ if ( !function_exists('dynamic_to_top_field_text_version') )
508
 
509
  function dynamic_to_top_field_text_version()
510
  {
511
- echo dynamic_to_top_do_checkbox('text_version',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Show a text version instead of the arrow up icon.',DYNAMIC_TO_TOP_DOMAIN));
512
  }
513
  }
514
 
@@ -524,7 +535,7 @@ if ( !function_exists('dynamic_to_top_field_inset') )
524
 
525
  function dynamic_to_top_field_inset()
526
  {
527
- echo dynamic_to_top_do_checkbox('inset',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Add CSS3 inset-highlight.',DYNAMIC_TO_TOP_DOMAIN));
528
  }
529
  }
530
 
@@ -540,7 +551,7 @@ if ( !function_exists('dynamic_to_top_field_shadow') )
540
 
541
  function dynamic_to_top_field_shadow()
542
  {
543
- echo dynamic_to_top_do_checkbox('shadow',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Add CSS3 shadow.',DYNAMIC_TO_TOP_DOMAIN));
544
  }
545
  }
546
 
@@ -556,7 +567,7 @@ if ( !function_exists('dynamic_to_top_field_weight') )
556
 
557
  function dynamic_to_top_field_bold()
558
  {
559
- echo dynamic_to_top_do_checkbox('bold',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Make the text bold.',DYNAMIC_TO_TOP_DOMAIN));
560
  }
561
  }
562
 
@@ -572,7 +583,7 @@ if ( !function_exists('dynamic_to_top_field_text_shadow') )
572
 
573
  function dynamic_to_top_field_text_shadow()
574
  {
575
- echo dynamic_to_top_do_checkbox('text_shadow',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Add a subtle text shadow.',DYNAMIC_TO_TOP_DOMAIN));
576
  }
577
  }
578
  /*
@@ -595,12 +606,12 @@ if ( !function_exists('dynamic_to_top_do_checkbox') )
595
  *
596
  */
597
 
598
- function dynamic_to_top_do_checkbox($meta,$label="Yes",$value='yes',$desc="")
599
  {
600
 
601
  $options_db = get_option('dynamic_to_top');
602
 
603
- if ( isset($options_db[$meta]) && $options_db[$meta] == $value)
604
  $c = 'checked="checked"';
605
  else
606
  $c = "";
25
  function dynamic_to_top_create_options_page()
26
  {
27
  // Create Options Page
28
+ add_options_page('Dynamic To Top Options','Dynamic To Top', 'manage_options', __FILE__, 'dynamic_to_top_options_page');
29
  }
30
  }
31
 
65
  add_settings_field('text_color',__('Text color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_color',__FILE__,'appearance_section');
66
  add_settings_field('bold',__('Bold Text',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_bold',__FILE__,'appearance_section');
67
  add_settings_field('text_shadow',__('Text shadow',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_shadow',__FILE__,'appearance_section');
68
+ add_settings_field('shadow_color',__('Text shadow color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_shadow_color',__FILE__,'appearance_section');
69
  add_settings_field('background_color',__('Background color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_background_color',__FILE__,'appearance_section');
70
 
71
  add_settings_field('border_color',__('Border color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_border_color',__FILE__,'appearance_section');
195
 
196
  if ( !function_exists('dynamic_to_top_is_page_options') )
197
  {
198
+
199
+ /**
200
+ * Is dynamic to top page options?
201
+ *
202
+ * @package Dynamic To Top
203
+ * @subpackage Options
204
+ * @since 3.0
205
+ * @return boolean
206
+ *
207
+ */
208
+
209
  function dynamic_to_top_is_page_options()
210
  {
211
  global $pagenow;
335
  {
336
  $options = array( 'Linear', 'In','Out','In Out','Bounce','Elastic');
337
 
338
+ echo dynamic_to_top_do_select('easing',$options,'In',__('<a href="http://gsgd.co.uk/sandbox/jquery/easing" title="Easing type">Easing type</a> used to scroll the page up.',DYNAMIC_TO_TOP_DOMAIN));
339
  }
340
  }
341
 
371
 
372
  function dynamic_to_top_field_scroll_time()
373
  {
374
+ echo dynamic_to_top_do_slider('speed',1100,__('Time it takes for the page to scroll up. Less for faster. ( <span id="speed-val"></span> Milliseconds )',DYNAMIC_TO_TOP_DOMAIN));
375
  }
376
  }
377
 
403
 
404
  function dynamic_to_top_field_padding_top_bottom()
405
  {
406
+ echo dynamic_to_top_do_slider('padding_top_bottom',21,__('Spacing on Top and Bottom. ( <span id="padding-top-bottom-val"></span>px )',DYNAMIC_TO_TOP_DOMAIN));
407
  }
408
  }
409
 
419
 
420
  function dynamic_to_top_field_padding_left_right()
421
  {
422
+ echo dynamic_to_top_do_slider('padding_left_right',19,__('Spacing on Left and Right. ( <span id="padding-left-right-val"></span>px )',DYNAMIC_TO_TOP_DOMAIN));
423
  }
424
  }
425
 
451
 
452
  function dynamic_to_top_field_border_radius()
453
  {
454
+ echo dynamic_to_top_do_slider('radius','9',__('Button border radius',DYNAMIC_TO_TOP_DOMAIN).' <span id="radius-val"></span>px.');
455
  }
456
  }
457
 
469
 
470
  function dynamic_to_top_field_distance()
471
  {
472
+ echo dynamic_to_top_do_textfield('distance',300,__('Distance from top to show the button. ( Pixels )',DYNAMIC_TO_TOP_DOMAIN));
473
  }
474
  }
475
 
503
 
504
  function dynamic_to_top_field_prevent_on_mobile()
505
  {
506
+ echo dynamic_to_top_do_checkbox('prevent_on_mobile',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',false,__('Disable the button on mobile browsers.',DYNAMIC_TO_TOP_DOMAIN));
507
  }
508
  }
509
 
519
 
520
  function dynamic_to_top_field_text_version()
521
  {
522
+ echo dynamic_to_top_do_checkbox('text_version',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',false,__('Show a text version instead of the arrow up icon.',DYNAMIC_TO_TOP_DOMAIN));
523
  }
524
  }
525
 
535
 
536
  function dynamic_to_top_field_inset()
537
  {
538
+ echo dynamic_to_top_do_checkbox('inset',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',true,__('Add CSS3 inset-highlight.',DYNAMIC_TO_TOP_DOMAIN));
539
  }
540
  }
541
 
551
 
552
  function dynamic_to_top_field_shadow()
553
  {
554
+ echo dynamic_to_top_do_checkbox('shadow',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',true,__('Add CSS3 shadow.',DYNAMIC_TO_TOP_DOMAIN));
555
  }
556
  }
557
 
567
 
568
  function dynamic_to_top_field_bold()
569
  {
570
+ echo dynamic_to_top_do_checkbox('bold',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',true,__('Make the text bold.',DYNAMIC_TO_TOP_DOMAIN));
571
  }
572
  }
573
 
583
 
584
  function dynamic_to_top_field_text_shadow()
585
  {
586
+ echo dynamic_to_top_do_checkbox('text_shadow',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',true,__('Add a subtle text shadow.',DYNAMIC_TO_TOP_DOMAIN));
587
  }
588
  }
589
  /*
606
  *
607
  */
608
 
609
+ function dynamic_to_top_do_checkbox($meta,$label="Yes",$value='yes',$checked=false,$desc="")
610
  {
611
 
612
  $options_db = get_option('dynamic_to_top');
613
 
614
+ if ( $checked == true OR ( isset($options_db[$meta]) && $options_db[$meta] == $value ) )
615
  $c = 'checked="checked"';
616
  else
617
  $c = "";
readme.txt CHANGED
@@ -1,21 +1,21 @@
1
- === Dynamic "To Top" Plugin ===
2
  Contributors: sksmatt
3
  Donate link: http://www.mattvarone.com
4
  Tags: Dynamic, UI, Scroll, To top, Automatic
5
  Requires at least: 2.5
6
  Tested up to: 3.1.2
7
- Stable tag: 3.1
8
 
9
  Adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
10
 
11
  == Description ==
12
 
13
- This plugin for WordPress adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
14
 
15
  It features an intuitive control panel to style and adjust to each website's need. The button only appears for JS enabled browsers and can be optionally disabled for mobile visitors.
16
 
17
  * Image and text version supported.
18
- * Elegant options panel to style as desired.
19
  * CSS3 created button and hover effect with decent degradation for older browsers.
20
  * Custom created CSS and Javascript assets.
21
  * Caches assets for better performance.
1
+ === Dynamic To Top Plugin ===
2
  Contributors: sksmatt
3
  Donate link: http://www.mattvarone.com
4
  Tags: Dynamic, UI, Scroll, To top, Automatic
5
  Requires at least: 2.5
6
  Tested up to: 3.1.2
7
+ Stable tag: 3.1.1
8
 
9
  Adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
10
 
11
  == Description ==
12
 
13
+ This WordPress plugin adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
14
 
15
  It features an intuitive control panel to style and adjust to each website's need. The button only appears for JS enabled browsers and can be optionally disabled for mobile visitors.
16
 
17
  * Image and text version supported.
18
+ * Options panel to style as desired.
19
  * CSS3 created button and hover effect with decent degradation for older browsers.
20
  * Custom created CSS and Javascript assets.
21
  * Caches assets for better performance.
uninstall.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dynamic To Top Uninstall
4
+ *
5
+ * @package Dynamic To Top
6
+ * @author Matt Varone
7
+ */
8
+
9
+ // If uninstall not called from WordPress exit
10
+ if(!defined('WP_UNINSTALL_PLUGIN'))
11
+ exit();
12
+ // Delete option from options table
13
+ delete_option('dynamic_to_top');