Spacer - Version 3.0.2

Version Description

  • Adds compatibility with Line-On-Sides Headers add-on
  • WP tested up to version 4.5
Download this release

Release Info

Developer clevelandwebdeveloper
Plugin Icon 128x128 Spacer
Version 3.0.2
Comparing to
See all releases

Code changes from version 3.0.1 to 3.0.2

images/lhart.png ADDED
Binary file
index.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Spacer
5
  Plugin URI: http://www.clevelandwebdeveloper.com/wordpress-plugins/spacer
6
  Description: Adds a spacer button to the WYSIWYG visual editor which allows you to add precise custom spacing between lines in your posts and pages.
7
- Version: 3.0.1
8
  Author: Justin Saad
9
  Author URI: http://www.clevelandwebdeveloper.com
10
  License: GPL2
@@ -111,19 +111,19 @@ class motech_spacer {
111
  $user_id = get_current_user_id();
112
  //there is no default spacer height set, and nag message not ignored...
113
  //$checkdefault = get_option($this->plugin_slug . '_default_height_mobile','');
114
- if ( ( ! get_user_meta($user_id, 'spacer3195_nag_ignore') ) && (current_user_can( 'manage_options' )) ) {
115
  echo '<div id="message" class="updated fade notice"><p>';
116
- echo "<b>".__('You can now preview the Visual Artist tool for your Spacers. Check it out!', 'motech-spacer')."</b>";
117
  echo "</p>";
118
- echo "<p><strong><a href=\"".get_bloginfo( 'wpurl' ) . "/wp-admin/options-general.php?page=".$this->plugin_slug."-setting-admin\" target=\"_parent\">".__('Create Spacers &raquo;', 'motech-spacer')."</a> | <a class=\"dismiss-notice\" style=\"color:red;\" href=\"".get_bloginfo( 'wpurl' ) . "/wp-admin/options-general.php?page=".$this->plugin_slug."-setting-admin&spacer3195_nag_ignore=0\" target=\"_parent\">".__('I got it. Thanks.', 'motech-spacer')." [X]</a></strong></p></div>";
119
  }
120
  }
121
 
122
  function adminmessage_init()
123
  {
124
- if ( isset($_GET['spacer3195_nag_ignore']) && '0' == $_GET['spacer3195_nag_ignore'] ) {
125
  $user_id = get_current_user_id();
126
- add_user_meta($user_id, 'spacer3195_nag_ignore', 'true', true);
127
  if (wp_get_referer()) {
128
  /* Redirects user to where they were before */
129
  wp_safe_redirect(wp_get_referer());
@@ -378,62 +378,128 @@ function activespacer($id="") { #return attributes for active spacer based on id
378
 
379
 
380
  <div id="green_ribbon">
381
-
382
- <div id="green_ribbon_top">
383
- <div id="green_ribbon_left">
384
- </div>
385
- <div id="green_ribbon_base">
386
- <span id="hms_get_premium"><?php _e('NEW! Get Premium &raquo;', 'motech-spacer')?></span>
387
- <span class="hms_get_premium_meta"><?php _e('Visual Artist Add-On now available for as low as $20!', 'motech-spacer')?></span>
 
 
 
388
  </div>
389
- <div id="green_ribbon_right">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  </div>
391
  </div>
392
 
393
- <div class="motech_premium_box">
394
- <div class="motech_premium_box_wrap">
395
- <h2><?php _e('Get Visual Artist', 'motech-spacer')?></h2>
396
- <div class="updated below-h2" style="margin-bottom: -20px !important;"><p><strong><?php _e('Purchase will be processed via PayPal.', 'motech-spacer')?></strong></p></div>
397
- <div class="updated below-h2"><p><strong><?php _e('Every license is valid for the lifetime of the website where it\'s installed.', 'motech-spacer')?></strong></p></div>
398
- <div class="motech_purchase_buttons">
399
-
400
- <div class="motech_purchase_button unlimited_use">
401
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input name="cmd" value="_s-xclick" type="hidden"><input name="hosted_button_id" value="FK8RLFRUBCL5N" type="hidden"><input type="hidden" name="page_style" value="visual_artist">
402
- <button name="submit">
403
- <div class="purchase_graphic"><?php _e('Buy', 'motech-spacer')?> <span><?php _e('Unlimited', 'motech-spacer')?></span></div>
404
- <div class="purchase_bubble">
405
- <div class="purchase_price">$50</div>
406
- <div class="purchase_meta"><?php _e('Unlimited sites forever!', 'motech-spacer')?></div>
407
- </div>
408
- </button>
409
- <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" border="0" height="1" width="1">
410
- </form>
411
- </div>
412
-
413
- <div class="motech_purchase_button one_use">
414
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input name="cmd" value="_s-xclick" type="hidden"><input name="hosted_button_id" value="C59XHASJBCHLQ" type="hidden"><input type="hidden" name="page_style" value="visual_artist">
415
- <button name="submit">
416
- <div class="purchase_graphic"><?php _e('Buy 1 Use', 'motech-spacer')?></div>
417
- <div class="purchase_bubble">
418
- <div class="purchase_price">$20</div>
419
- <div class="purchase_meta"><?php _e('1 site license', 'motech-spacer')?></div>
420
- </div>
421
- </button>
422
- <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" border="0" height="1" width="1">
423
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  </div>
425
 
426
- </div>
427
-
428
- <div class="motech_premium_cancel"><span><?php _e('Cancel', 'motech-spacer')?></span></div>
429
-
430
  </div>
431
  </div>
 
 
432
  </div>
 
433
 
434
  <h2 class="nav-tab-wrapper">
435
  <a href="#defaultspacer" class="nav-tab nav-tab-active"><?php _e('Default', 'motech-spacer')?></a>
436
  <a href="#addspacers" class="nav-tab"><span class="dashicons dashicons-plus dashicons-plus-alt"></span> <?php _e('Add Spacers', 'motech-spacer')?></a>
 
437
  <a href="#addons" class="nav-tab"><span class="dashicons dashicons-admin-plugins"></span> <?php _e('Add-Ons', 'motech-spacer')?></a>
438
  <a href="#licenses" class="nav-tab"><span class="dashicons dashicons-admin-network"></span> <?php _e('Licenses', 'motech-spacer')?></a>
439
  <?php /*?> <a href="#privacy-settings" class="nav-tab">Privacy settings</a>
@@ -526,16 +592,28 @@ function activespacer($id="") { #return attributes for active spacer based on id
526
 
527
 
528
  </div>
 
529
  <div id="addons" class="metabox-holder mainsection hidden wrap">
530
  <?php
531
- $actionbutton = '<a href="#" title="'.__('Buy Visual Artist', 'motech-spacer').'" class="button-primary msbutton buynowbutton">'.__('Buy Now', 'motech-spacer').'</a>';
532
  if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
533
  $actionbutton = '<a href="javascript:void(0)" title="'.__('Active', 'motech-spacer').'" class="button-secondary msbutton">'.__('Active', 'motech-spacer').'</a>';
534
  } elseif( file_exists(plugin_dir_path(__FILE__) . '../spacer-visual-artist/index.php') ) {
535
  $actionbutton = '<a href="javascript:void(0)" title="'.__('Installed', 'motech-spacer').'" class="button-secondary msbutton">'.__('Installed', 'motech-spacer').'</a>';
536
  }
537
  ?>
538
- <div class="msaddon mscol"><img src="<?php echo plugins_url( 'images/vart.png' , __FILE__ ) ?>"><h2><?php _e('Visual Artist', 'motech-spacer') ?></h2><div class="msaddon-content"><p><?php _e('Design fancy dividers, horizontal rules, and other ornate section breaks. Incorporate rich colors and images, all without mastering css.', 'motech-spacer') ?></p><div class="msaddon-buttons"><a href="http://www.clevelandwebdeveloper.com/?p=644&amp;utm_medium=plugin&amp;utm_source=plugin-addons-page&amp;utm_campaign=Spacers+Addons+Page&amp;utm_content=Spacer+Learn" target="_blank" class="button-secondary msdbutton"><?php _e('Learn More', 'motech-spacer') ?></a><?php echo $actionbutton ?></div></div></div>
 
 
 
 
 
 
 
 
 
 
 
539
  </div>
540
  <div id="licenses" class="metabox-holder mainsection hidden wrap">
541
  <div class="motech-spacer-options section general wrap">
@@ -756,7 +834,7 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
756
  $this->plugin_slug.'_setting_section',
757
  array( // The array of arguments to pass to the callback.
758
  "id" => $field_id, //sends field id to callback
759
- "desc" => __('Enter custom css to apply to all of your spacer elements. This is for advanced users. Just leave this empty if you\'re not sure what this means or if you don\'t have a use for it.<br><span style="color:red">NEW:</span> Want to create visually stunning divider elements, without needing to know any CSS? See <a href="http://www.clevelandwebdeveloper.com/wordpress-plugins/visual-artist/?utm_medium=plugin&amp;utm_source=plugin-settings-page&amp;utm_campaign=Spacers+Settings+Page&amp;utm_content=Spacer+Inline" target="_blank">examples of what you can do with the Visual Artist add-on &raquo;</a><br>Ready to make your own? <a href="#" class="buynowbutton">Buy It Now &raquo;</a>', 'motech-spacer'), //description of the field (optional)
760
  "key" => $key,
761
  "class" => 'msstyle',
762
  "placeholder" => __('(for example)', 'motech-spacer').' border-top: solid 2px black; border-bottom: solid 2px black; margin-bottom: 25px;' //sets the field placeholder which appears when the field is empty (optional)
@@ -880,7 +958,7 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
880
  $this->plugin_slug.'_setting_section',
881
  array( // The array of arguments to pass to the callback.
882
  "id" => $field_id, //sends field id to callback
883
- "desc" => __('Enter custom css to apply to all of your spacer elements. This is for advanced users. Just leave this empty if you\'re not sure what this means or if you don\'t have a use for it.<br><span style="color:red">NEW:</span> Want to create visually stunning divider elements, without needing to know any CSS? See <a href="http://www.clevelandwebdeveloper.com/wordpress-plugins/visual-artist/?utm_medium=plugin&amp;utm_source=plugin-settings-page&amp;utm_campaign=Spacers+Settings+Page&amp;utm_content=Spacer+Inline" target="_blank">examples of what you can do with the Visual Artist add-on &raquo;</a><br>Ready to make your own? <a href="#" class="buynowbutton">Buy It Now &raquo;</a>', 'motech-spacer'), //description of the field (optional)
884
  "placeholder" => __('(for example)', 'motech-spacer').' border-top: solid 2px black; border-bottom: solid 2px black; margin-bottom: 25px;' //sets the field placeholder which appears when the field is empty (optional)
885
  )
886
  );
@@ -903,6 +981,8 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
903
  $this->DisplayMobileOptions();
904
  $this->DisplayStyleOptions();
905
  $this->DisplayAddSpacers();
 
 
906
 
907
  add_settings_section(
908
  $this->plugin_slug.'_setting_section',
@@ -1101,9 +1181,7 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
1101
  $max_length_html = "";
1102
  }
1103
  if(isset($args["default"])) {
1104
- $default = $args["default"];
1105
- } else {
1106
- $default = false;
1107
  }
1108
  if(!isset($args["class"])){
1109
  $args["class"] = "";
@@ -1111,10 +1189,13 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
1111
  $key = $args["key"];
1112
  $getarray = get_option($args["id"]);
1113
  if(!isset($getarray[$key])){
1114
- $getarray[$key] = "";
 
 
 
1115
  }
1116
  // Render the output
1117
- echo '<input type="text" ' . $placeholder_html . $max_length_html . ' class="' . $args["class"]. '" name="' . $args["id"] . '['.$key.']" value="' . $getarray[$key] . '" />';
1118
  //echo '<input type="text" ' . ' name="' . $args["id"] . '['.$key.']" value="' . $value . '" />';
1119
  if(isset($args["desc"])) {
1120
  echo "<p class='description'>".$args["desc"]."</p>";
@@ -1226,9 +1307,9 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
1226
  $html = "";
1227
  //get default value if there is one
1228
  if(isset($args["default"])) {
1229
- $default = $args["default"];
1230
  } else {
1231
- $default = false;
1232
  }
1233
  if(isset($args["meta"])) {
1234
  $meta = $args["meta"];
@@ -1239,13 +1320,15 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
1239
  $args["class"] = "";
1240
  }
1241
  $key = $args["key"];
1242
- $getarray = get_option($args["id"], $default);
1243
  if(!isset($getarray[$key])){
1244
- $getarray[$key] = "";
1245
- }
 
 
1246
  $html .= '<select id="' . $args["id"] . $args["key"] . '" class="' . $args["class"]. '" name="' . $args["id"]. '['.$key.']" ' . $meta . '" >';
1247
  foreach($select_options as $select_option) {
1248
- $html .= '<option value="'.$select_option["value"].'" ' . selected( $select_option["value"], $getarray[$key], false) . '>'.$select_option["label"].'</option>';
1249
  }
1250
  $html .= '</select>';
1251
  if(isset($args["desc"])) {
@@ -1634,7 +1717,7 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
1634
  <?php endif ?>
1635
 
1636
  jQuery("#hms_get_premium").click(function(){
1637
- jQuery(".motech_premium_box").slideToggle(200);
1638
  });
1639
 
1640
  jQuery(".motech_premium_cancel span").click(function(){
@@ -1648,13 +1731,25 @@ if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
1648
  jQuery(".redeem_info").slideToggle(200);
1649
  });
1650
 
1651
- jQuery("body").on('click', '.hms_get_premium, .buynowbutton', function(e) {
1652
  e.preventDefault();
1653
  jQuery("html, body").animate({ scrollTop: 0 }, 300, function() {
1654
  // Animation complete.
1655
  jQuery("#green_ribbon").show();
1656
  jQuery(".motech_premium_box").slideDown(200);
 
1657
  });
 
 
 
 
 
 
 
 
 
 
 
1658
  });
1659
 
1660
 
4
  Plugin Name: Spacer
5
  Plugin URI: http://www.clevelandwebdeveloper.com/wordpress-plugins/spacer
6
  Description: Adds a spacer button to the WYSIWYG visual editor which allows you to add precise custom spacing between lines in your posts and pages.
7
+ Version: 3.0.2
8
  Author: Justin Saad
9
  Author URI: http://www.clevelandwebdeveloper.com
10
  License: GPL2
111
  $user_id = get_current_user_id();
112
  //there is no default spacer height set, and nag message not ignored...
113
  //$checkdefault = get_option($this->plugin_slug . '_default_height_mobile','');
114
+ if ( ( ! get_user_meta($user_id, 'spacer3185_nag_ignore') ) && (current_user_can( 'manage_options' )) ) {
115
  echo '<div id="message" class="updated fade notice"><p>';
116
+ echo "<b>".__('Create headers that really stand out with the new Spacer add-on, Line-On-Sides Headers!', 'motech-spacer')."</b>";
117
  echo "</p>";
118
+ echo "<p><strong><a href=\"http://www.clevelandwebdeveloper.com/?p=868&amp;utm_medium=plugin&amp;utm_source=plugin-notice-msg&amp;utm_campaign=Spacer+Notice+Msg&amp;utm_content=Lineonsides+Notice\" target=\"_blank\">".__('Create Line-On-Sides Headers &raquo;', 'motech-spacer')."</a> | <a class=\"dismiss-notice\" style=\"color:red;\" href=\"".get_bloginfo( 'wpurl' ) . "/wp-admin/options-general.php?page=".$this->plugin_slug."-setting-admin&spacer3185_nag_ignore=0\" target=\"_parent\">".__('I got it. Thanks.', 'motech-spacer')." [X]</a></strong></p></div>";
119
  }
120
  }
121
 
122
  function adminmessage_init()
123
  {
124
+ if ( isset($_GET['spacer3185_nag_ignore']) && '0' == $_GET['spacer3185_nag_ignore'] ) {
125
  $user_id = get_current_user_id();
126
+ add_user_meta($user_id, 'spacer3185_nag_ignore', 'true', true);
127
  if (wp_get_referer()) {
128
  /* Redirects user to where they were before */
129
  wp_safe_redirect(wp_get_referer());
378
 
379
 
380
  <div id="green_ribbon">
381
+ <div class="grwrap visualartist" style="display:none;">
382
+ <div id="green_ribbon_top">
383
+ <div id="green_ribbon_left">
384
+ </div>
385
+ <div id="green_ribbon_base">
386
+ <span id="hms_get_premium" addonname="visualartist"><?php _e('NEW! Get Premium &raquo;', 'motech-spacer')?></span>
387
+ <span class="hms_get_premium_meta"><?php _e('Visual Artist Add-On now available for as low as $20!', 'motech-spacer')?></span>
388
+ </div>
389
+ <div id="green_ribbon_right">
390
+ </div>
391
  </div>
392
+
393
+ <div class="motech_premium_box">
394
+
395
+
396
+ <div class="motech_premium_box_wrap">
397
+ <h2><?php _e('Get Visual Artist', 'motech-spacer')?></h2>
398
+ <div class="updated below-h2" style="margin-bottom: -20px !important;"><p><strong><?php _e('Purchase will be processed via PayPal.', 'motech-spacer')?></strong></p></div>
399
+ <div class="updated below-h2"><p><strong><?php _e('Every license is valid for the lifetime of the website where it\'s installed.', 'motech-spacer')?></strong></p></div>
400
+ <div class="motech_purchase_buttons">
401
+
402
+ <div class="motech_purchase_button unlimited_use">
403
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input name="cmd" value="_s-xclick" type="hidden"><input name="hosted_button_id" value="FK8RLFRUBCL5N" type="hidden"><input type="hidden" name="page_style" value="visual_artist">
404
+ <button name="submit">
405
+ <div class="purchase_graphic"><?php _e('Buy', 'motech-spacer')?> <span><?php _e('Unlimited', 'motech-spacer')?></span></div>
406
+ <div class="purchase_bubble">
407
+ <div class="purchase_price">$50</div>
408
+ <div class="purchase_meta"><?php _e('Unlimited sites forever!', 'motech-spacer')?></div>
409
+ </div>
410
+ </button>
411
+ <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" border="0" height="1" width="1">
412
+ </form>
413
+ </div>
414
+
415
+ <div class="motech_purchase_button one_use">
416
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input name="cmd" value="_s-xclick" type="hidden"><input name="hosted_button_id" value="C59XHASJBCHLQ" type="hidden"><input type="hidden" name="page_style" value="visual_artist">
417
+ <button name="submit">
418
+ <div class="purchase_graphic"><?php _e('Buy 1 Use', 'motech-spacer')?></div>
419
+ <div class="purchase_bubble">
420
+ <div class="purchase_price">$20</div>
421
+ <div class="purchase_meta"><?php _e('1 site license', 'motech-spacer')?></div>
422
+ </div>
423
+ </button>
424
+ <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" border="0" height="1" width="1">
425
+ </form>
426
+ </div>
427
+
428
+ </div>
429
+
430
+ <div class="motech_premium_cancel"><span><?php _e('Cancel', 'motech-spacer')?></span></div>
431
+
432
+ </div>
433
+
434
  </div>
435
  </div>
436
 
437
+
438
+ <div class="grwrap lineonsidesheaders">
439
+
440
+ <div id="green_ribbon_top">
441
+ <div id="green_ribbon_left">
442
+ </div>
443
+ <div id="green_ribbon_base">
444
+ <span id="hms_get_premium" addonname="lineonsidesheaders"><?php _e('NEW! Get Premium &raquo;', 'motech-spacer')?></span>
445
+ <span class="hms_get_premium_meta"><?php _e('Header Add-On now available for as low as $10!', 'motech-spacer')?></span>
446
+ </div>
447
+ <div id="green_ribbon_right">
448
+ </div>
449
+ </div>
450
+
451
+ <div class="motech_premium_box">
452
+
453
+
454
+ <div class="motech_premium_box_wrap">
455
+ <h2><?php _e('Get Line-On-Sides Headers', 'motech-spacer')?></h2>
456
+ <div class="updated below-h2" style="margin-bottom: -20px !important;"><p><strong><?php _e('Purchase will be processed via PayPal.', 'motech-spacer')?></strong></p></div>
457
+ <div class="updated below-h2"><p><strong><?php _e('Every license is valid for the lifetime of the website where it\'s installed.', 'motech-spacer')?></strong></p></div>
458
+ <div class="motech_purchase_buttons">
459
+
460
+ <div class="motech_purchase_button unlimited_use">
461
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input name="cmd" value="_s-xclick" type="hidden"><input name="hosted_button_id" value="D2R9YPYQHK63L" type="hidden">
462
+ <button name="submit">
463
+ <div class="purchase_graphic"><?php _e('Buy', 'motech-spacer')?> <span><?php _e('Unlimited', 'motech-spacer')?></span></div>
464
+ <div class="purchase_bubble">
465
+ <div class="purchase_price">$25</div>
466
+ <div class="purchase_meta"><?php _e('Unlimited sites forever!', 'motech-spacer')?></div>
467
+ </div>
468
+ </button>
469
+ <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" border="0" height="1" width="1">
470
+ </form>
471
+ </div>
472
+
473
+ <div class="motech_purchase_button one_use">
474
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input name="cmd" value="_s-xclick" type="hidden"><input name="hosted_button_id" value="F2CNV7FMSGAN8" type="hidden">
475
+ <button name="submit">
476
+ <div class="purchase_graphic"><?php _e('Buy 1 Use', 'motech-spacer')?></div>
477
+ <div class="purchase_bubble">
478
+ <div class="purchase_price">$10</div>
479
+ <div class="purchase_meta"><?php _e('1 site license', 'motech-spacer')?></div>
480
+ </div>
481
+ </button>
482
+ <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" border="0" height="1" width="1">
483
+ </form>
484
+ </div>
485
+
486
  </div>
487
 
488
+ <div class="motech_premium_cancel"><span><?php _e('Cancel', 'motech-spacer')?></span></div>
489
+
490
+ </div>
491
+
492
  </div>
493
  </div>
494
+
495
+
496
  </div>
497
+
498
 
499
  <h2 class="nav-tab-wrapper">
500
  <a href="#defaultspacer" class="nav-tab nav-tab-active"><?php _e('Default', 'motech-spacer')?></a>
501
  <a href="#addspacers" class="nav-tab"><span class="dashicons dashicons-plus dashicons-plus-alt"></span> <?php _e('Add Spacers', 'motech-spacer')?></a>
502
+ <?php do_action( 'spacer_sectiontabhook' ); #use this hook to add additional section tabs ?>
503
  <a href="#addons" class="nav-tab"><span class="dashicons dashicons-admin-plugins"></span> <?php _e('Add-Ons', 'motech-spacer')?></a>
504
  <a href="#licenses" class="nav-tab"><span class="dashicons dashicons-admin-network"></span> <?php _e('Licenses', 'motech-spacer')?></a>
505
  <?php /*?> <a href="#privacy-settings" class="nav-tab">Privacy settings</a>
592
 
593
 
594
  </div>
595
+ <?php do_action( 'spacer_sectionshook' ); #use this hook to add additional sections ?>
596
  <div id="addons" class="metabox-holder mainsection hidden wrap">
597
  <?php
598
+ $actionbutton = '<a href="#" title="'.__('Buy Visual Artist', 'motech-spacer').'" class="button-primary msbutton buynowbutton" addonname="visualartist">'.__('Buy Now', 'motech-spacer').'</a>';
599
  if( is_plugin_active( 'spacer-visual-artist/index.php' ) ) {
600
  $actionbutton = '<a href="javascript:void(0)" title="'.__('Active', 'motech-spacer').'" class="button-secondary msbutton">'.__('Active', 'motech-spacer').'</a>';
601
  } elseif( file_exists(plugin_dir_path(__FILE__) . '../spacer-visual-artist/index.php') ) {
602
  $actionbutton = '<a href="javascript:void(0)" title="'.__('Installed', 'motech-spacer').'" class="button-secondary msbutton">'.__('Installed', 'motech-spacer').'</a>';
603
  }
604
  ?>
605
+ <div class="msaddon mscol"><img src="<?php echo plugins_url( 'images/vart.png' , __FILE__ ) ?>"><h2><?php _e('Visual Artist', 'motech-spacer') ?></h2><div class="msaddon-content"><p><?php _e('Design fancy dividers, horizontal rules, and other ornate section breaks. Incorporate rich colors and images, all without mastering css.', 'motech-spacer') ?></p><div class="msaddon-buttons"><a href="http://www.clevelandwebdeveloper.com/?p=644&amp;utm_medium=plugin&amp;utm_source=plugin-addons-page&amp;utm_campaign=Spacers+Addons+Page&amp;utm_content=Spacer+Learn" target="_blank" class="button-secondary msdbutton"><?php _e('Learn More', 'motech-spacer') ?></a><?php echo $actionbutton ?></div></div></div>
606
+
607
+ <?php
608
+ $actionbutton = '<a href="#" title="'.__('Buy Line-On-Sides Headers', 'motech-spacer').'" class="button-primary msbutton buynowbutton" addonname="lineonsidesheaders">'.__('Buy Now', 'motech-spacer').'</a>';
609
+ if( is_plugin_active( 'spacer-lineonsides-headers/index.php' ) ) {
610
+ $actionbutton = '<a href="javascript:void(0)" title="'.__('Active', 'motech-spacer').'" class="button-secondary msbutton">'.__('Active', 'motech-spacer').'</a>';
611
+ } elseif( file_exists(plugin_dir_path(__FILE__) . '../spacer-lineonsides-headers/index.php') ) {
612
+ $actionbutton = '<a href="javascript:void(0)" title="'.__('Installed', 'motech-spacer').'" class="button-secondary msbutton">'.__('Installed', 'motech-spacer').'</a>';
613
+ }
614
+ ?>
615
+ <div class="msaddon mscol"><img src="<?php echo plugins_url( 'images/lhart.png' , __FILE__ ) ?>"><h2><?php _e('Line-On-Sides Headers', 'motech-spacer') ?></h2><div class="msaddon-content"><p><?php _e('Create headers that really stand out with lines on the sides.', 'motech-spacer') ?></p><div class="msaddon-buttons"><a href="http://www.clevelandwebdeveloper.com/?p=868&amp;utm_medium=plugin&amp;utm_source=plugin-addons-page&amp;utm_campaign=Spacers+Addons+Page&amp;utm_content=Lineonsides+Learn" target="_blank" class="button-secondary msdbutton"><?php _e('Learn More', 'motech-spacer') ?></a><?php echo $actionbutton ?></div></div></div>
616
+
617
  </div>
618
  <div id="licenses" class="metabox-holder mainsection hidden wrap">
619
  <div class="motech-spacer-options section general wrap">
834
  $this->plugin_slug.'_setting_section',
835
  array( // The array of arguments to pass to the callback.
836
  "id" => $field_id, //sends field id to callback
837
+ "desc" => __('Enter custom css to apply to all of your spacer elements. This is for advanced users. Just leave this empty if you\'re not sure what this means or if you don\'t have a use for it.<br><span style="color:red">NEW:</span> Want to create visually stunning divider elements, without needing to know any CSS? See <a href="http://www.clevelandwebdeveloper.com/wordpress-plugins/visual-artist/?utm_medium=plugin&amp;utm_source=plugin-settings-page&amp;utm_campaign=Spacers+Settings+Page&amp;utm_content=Spacer+Inline" target="_blank">examples of what you can do with the Visual Artist add-on &raquo;</a><br>Ready to make your own? <a href="#" class="buynowbutton" addonname="visualartist">Buy It Now &raquo;</a>', 'motech-spacer'), //description of the field (optional)
838
  "key" => $key,
839
  "class" => 'msstyle',
840
  "placeholder" => __('(for example)', 'motech-spacer').' border-top: solid 2px black; border-bottom: solid 2px black; margin-bottom: 25px;' //sets the field placeholder which appears when the field is empty (optional)
958
  $this->plugin_slug.'_setting_section',
959
  array( // The array of arguments to pass to the callback.
960
  "id" => $field_id, //sends field id to callback
961
+ "desc" => __('Enter custom css to apply to all of your spacer elements. This is for advanced users. Just leave this empty if you\'re not sure what this means or if you don\'t have a use for it.<br><span style="color:red">NEW:</span> Want to create visually stunning divider elements, without needing to know any CSS? See <a href="http://www.clevelandwebdeveloper.com/wordpress-plugins/visual-artist/?utm_medium=plugin&amp;utm_source=plugin-settings-page&amp;utm_campaign=Spacers+Settings+Page&amp;utm_content=Spacer+Inline" target="_blank">examples of what you can do with the Visual Artist add-on &raquo;</a><br>Ready to make your own? <a href="#" class="buynowbutton" addonname="visualartist">Buy It Now &raquo;</a>', 'motech-spacer'), //description of the field (optional)
962
  "placeholder" => __('(for example)', 'motech-spacer').' border-top: solid 2px black; border-bottom: solid 2px black; margin-bottom: 25px;' //sets the field placeholder which appears when the field is empty (optional)
963
  )
964
  );
981
  $this->DisplayMobileOptions();
982
  $this->DisplayStyleOptions();
983
  $this->DisplayAddSpacers();
984
+ do_action( 'spacer_sectionfieldhook', $this ); #use this hook to add additional field sections
985
+
986
 
987
  add_settings_section(
988
  $this->plugin_slug.'_setting_section',
1181
  $max_length_html = "";
1182
  }
1183
  if(isset($args["default"])) {
1184
+ $usevalue = $args["default"];
 
 
1185
  }
1186
  if(!isset($args["class"])){
1187
  $args["class"] = "";
1189
  $key = $args["key"];
1190
  $getarray = get_option($args["id"]);
1191
  if(!isset($getarray[$key])){
1192
+ //$getarray[$key] = "";
1193
+ $usevalue = "";
1194
+ } else {
1195
+ $usevalue = $getarray[$key];
1196
  }
1197
  // Render the output
1198
+ echo '<input type="text" ' . $placeholder_html . $max_length_html . ' class="' . $args["class"]. '" name="' . $args["id"] . '['.$key.']" value="' . $usevalue . '" />';
1199
  //echo '<input type="text" ' . ' name="' . $args["id"] . '['.$key.']" value="' . $value . '" />';
1200
  if(isset($args["desc"])) {
1201
  echo "<p class='description'>".$args["desc"]."</p>";
1307
  $html = "";
1308
  //get default value if there is one
1309
  if(isset($args["default"])) {
1310
+ $usevalue = $args["default"];
1311
  } else {
1312
+ //$default = false;
1313
  }
1314
  if(isset($args["meta"])) {
1315
  $meta = $args["meta"];
1320
  $args["class"] = "";
1321
  }
1322
  $key = $args["key"];
1323
+ $getarray = get_option($args["id"]);
1324
  if(!isset($getarray[$key])){
1325
+ //$getarray[$key] = "";
1326
+ } else {
1327
+ $usevalue = $getarray[$key];
1328
+ }
1329
  $html .= '<select id="' . $args["id"] . $args["key"] . '" class="' . $args["class"]. '" name="' . $args["id"]. '['.$key.']" ' . $meta . '" >';
1330
  foreach($select_options as $select_option) {
1331
+ $html .= '<option value="'.$select_option["value"].'" ' . selected( $select_option["value"], $usevalue, false) . '>'.$select_option["label"].'</option>';
1332
  }
1333
  $html .= '</select>';
1334
  if(isset($args["desc"])) {
1717
  <?php endif ?>
1718
 
1719
  jQuery("#hms_get_premium").click(function(){
1720
+ //jQuery(".motech_premium_box").slideToggle(200);
1721
  });
1722
 
1723
  jQuery(".motech_premium_cancel span").click(function(){
1731
  jQuery(".redeem_info").slideToggle(200);
1732
  });
1733
 
1734
+ jQuery("body").on('click', '#hms_get_premium, .hms_get_premium, .buynowbutton', function(e) {
1735
  e.preventDefault();
1736
  jQuery("html, body").animate({ scrollTop: 0 }, 300, function() {
1737
  // Animation complete.
1738
  jQuery("#green_ribbon").show();
1739
  jQuery(".motech_premium_box").slideDown(200);
1740
+
1741
  });
1742
+
1743
+ //switch to different add on if set
1744
+ var addonname = jQuery(this).attr('addonname');
1745
+ console.log(addonname);
1746
+ // For some browsers, `attr` is undefined; for others, `attr` is false. Check for both.
1747
+ if (typeof addonname !== typeof undefined && addonname !== false) {
1748
+ // Element has this attribute
1749
+ jQuery(".grwrap").hide();
1750
+ jQuery(".grwrap."+addonname).show();
1751
+ }
1752
+
1753
  });
1754
 
1755
 
js/motech-color-picker.js CHANGED
@@ -7,6 +7,10 @@ jQuery(document).ready(function($){
7
  $(event.target).closest(".aspacerunit").find(".spacer_preview").css('border-top-color',ui.color.toString());
8
  }else if($(event.target).attr("name").indexOf("motech_spacer_default_border_bottom_color") >= 0){
9
  $(event.target).closest(".aspacerunit").find(".spacer_preview").css('border-bottom-color',ui.color.toString());
 
 
 
 
10
  }
11
  }
12
  });
7
  $(event.target).closest(".aspacerunit").find(".spacer_preview").css('border-top-color',ui.color.toString());
8
  }else if($(event.target).attr("name").indexOf("motech_spacer_default_border_bottom_color") >= 0){
9
  $(event.target).closest(".aspacerunit").find(".spacer_preview").css('border-bottom-color',ui.color.toString());
10
+ }else if($(event.target).attr("name").indexOf("motech_spacer_linecolor_addheaders") >= 0){
11
+ spacerElement = $(event.target).closest(".aheaderunit");
12
+ headerid = spacerElement.find("input[type=text].addheader_id").val();
13
+ spacerElement.find(".lineonsides_style_hook").append("<style>.spacer_lineonsides.spacer_lineonsides_"+headerid+":before,.spacer_lineonsides.spacer_lineonsides_"+headerid+":after {border-top-color:"+ui.color.toString()+";}</style>");
14
  }
15
  }
16
  });
js/motech-javascript.js CHANGED
@@ -36,13 +36,13 @@ jQuery(document).ready(function($){
36
  var hash = window.location.hash;
37
  $('.nav-tab-wrapper a[href="'+hash+'"]').click();
38
 
39
- $("body").on('click', '.removebutton', function(e) {
40
  e.preventDefault();
41
  element = $(this).closest(".addspacerunit.postbox");
42
  element.fadeOut("fast", function() {
43
  element.remove();
44
  if($(".addspacerunit.postbox").length == 0){
45
- $(".nothinghere").hide().removeClass(".hidden").fadeIn("fast");
46
  }
47
  });
48
  });
@@ -53,15 +53,15 @@ jQuery(document).ready(function($){
53
  $(this).closest(".postbox").toggleClass("closed");
54
  });
55
 
56
- $('body').on('input change', 'input.addingspacer', function() {
57
  var newval = jQuery(this).val();
58
  if(newval==""){
59
  newval = "Untitled";
60
  }
61
- jQuery(this).closest(".addspacerunit.postbox").find(".hndle span").first().text(newval);
62
  });
63
 
64
- $('body').on('input change', '.aspacerunit input, .aspacerunit textarea, .aspacerunit select', function() {
65
  spacerunit = $(this).closest(".aspacerunit");
66
  motechSpacerPreview.core(spacerunit);
67
  });
@@ -70,14 +70,14 @@ jQuery(document).ready(function($){
70
 
71
 
72
  //perform function when element is clicked
73
- jQuery(".newbutton").click(function(){
74
- $(".nothinghere").fadeOut("fast", function() {
75
  if($(".addspacerunit").length != 0){
76
  newspacer = $(".addspacerunit").last().clone();
77
  }else{
78
  newspacer = lastspacer.clone();
79
  }
80
- newspacer.hide().insertBefore(".newbutton").fadeIn("fast");
81
  newspacer.find(":input:not(select):not([type=button])").val("").trigger("change");
82
  newspacer.find(":input").removeAttr("id");
83
  newspacer.find("input.sheight").val("20");
@@ -177,7 +177,7 @@ jQuery(document).ready(function($){
177
  lastspacer = $(".addspacerunit").last().clone(); //create a clone of the last spacer during initial load, store it for later...
178
  if(lastspacer.find("input.addspacer_id").val()==""){ //delete initial add spacer if none exist...
179
  $(".addspacerunit").last().remove();
180
- $(".nothinghere").hide().removeClass(".hidden").fadeIn("fast");
181
  }
182
 
183
  $(".aspacerunit").each(function () {
36
  var hash = window.location.hash;
37
  $('.nav-tab-wrapper a[href="'+hash+'"]').click();
38
 
39
+ $("body").on('click', '.aspacerunit .removebutton', function(e) {
40
  e.preventDefault();
41
  element = $(this).closest(".addspacerunit.postbox");
42
  element.fadeOut("fast", function() {
43
  element.remove();
44
  if($(".addspacerunit.postbox").length == 0){
45
+ $("#addspacers .nothinghere").hide().removeClass(".hidden").fadeIn("fast");
46
  }
47
  });
48
  });
53
  $(this).closest(".postbox").toggleClass("closed");
54
  });
55
 
56
+ $('body').on('input change', 'input.addingspacer, input.addingheader', function() {
57
  var newval = jQuery(this).val();
58
  if(newval==""){
59
  newval = "Untitled";
60
  }
61
+ jQuery(this).closest(".addspacerunit.postbox, .aheaderunit.postbox").find(".hndle span").first().text(newval);
62
  });
63
 
64
+ $('body').on('.aspacerunit input change', '.aspacerunit input, .aspacerunit textarea, .aspacerunit select', function() {
65
  spacerunit = $(this).closest(".aspacerunit");
66
  motechSpacerPreview.core(spacerunit);
67
  });
70
 
71
 
72
  //perform function when element is clicked
73
+ jQuery("#addspacers .newbutton").click(function(){
74
+ $("#addspacers .nothinghere").fadeOut("fast", function() {
75
  if($(".addspacerunit").length != 0){
76
  newspacer = $(".addspacerunit").last().clone();
77
  }else{
78
  newspacer = lastspacer.clone();
79
  }
80
+ newspacer.hide().insertBefore("#addspacers .newbutton").fadeIn("fast");
81
  newspacer.find(":input:not(select):not([type=button])").val("").trigger("change");
82
  newspacer.find(":input").removeAttr("id");
83
  newspacer.find("input.sheight").val("20");
177
  lastspacer = $(".addspacerunit").last().clone(); //create a clone of the last spacer during initial load, store it for later...
178
  if(lastspacer.find("input.addspacer_id").val()==""){ //delete initial add spacer if none exist...
179
  $(".addspacerunit").last().remove();
180
+ $("#addspacers .nothinghere").hide().removeClass(".hidden").fadeIn("fast");
181
  }
182
 
183
  $(".aspacerunit").each(function () {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: clevelandwebdeveloper
3
  Donate link: http://www.clevelandwebdeveloper.com/wordpress-plugins/donate.php
4
  Tags: spacer, spacing, line space
5
  Requires at least: 3.5
6
- Tested up to: 4.4
7
- Stable tag: 3.0.1
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -85,6 +85,10 @@ Try adding <code>margin-bottom: 25px;</code> to the Spacer's Style setting.
85
 
86
  == Changelog ==
87
 
 
 
 
 
88
  = 3.0.1 =
89
  * Fixed Spacer button bug, which prevented some users from seeing the dropdown list via the Spacer button
90
  * Added compatibility with Beaver Page Builder's wysiswyg UI
@@ -120,5 +124,5 @@ Try adding <code>margin-bottom: 25px;</code> to the Spacer's Style setting.
120
 
121
  == Upgrade Notice ==
122
 
123
- = 3.0.1 =
124
- New: This update fixes the bug which prevented some users from seeing the dropdown list via the Spacer button. Also adds compatibility with Beaver Page Builder's wysiswyg UI and fixes lack of a trash icon in WP version 3.8. Finally, it adds a a live preview tool for Visual Artist. Enjoy!
3
  Donate link: http://www.clevelandwebdeveloper.com/wordpress-plugins/donate.php
4
  Tags: spacer, spacing, line space
5
  Requires at least: 3.5
6
+ Tested up to: 4.5
7
+ Stable tag: 3.0.2
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
85
 
86
  == Changelog ==
87
 
88
+ = 3.0.2 =
89
+ * Adds compatibility with Line-On-Sides Headers add-on
90
+ * WP tested up to version 4.5
91
+
92
  = 3.0.1 =
93
  * Fixed Spacer button bug, which prevented some users from seeing the dropdown list via the Spacer button
94
  * Added compatibility with Beaver Page Builder's wysiswyg UI
124
 
125
  == Upgrade Notice ==
126
 
127
+ = 3.0.2 =
128
+ New: This version adds compatibility with the new Line-On-Sides Headers add-on. Spacer is now tested up to WP version 4.5 - Enjoy!