Plugin Directory

Changeset 1433465


Ignore:
Timestamp:
06/09/2016 02:52:38 AM (10 years ago)
Author:
healcode_wordpress
Message:

Update to 1.1.8

Add conditional to handle empty shortcodes

Location:
healcode-mindbody-widget/trunk
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • healcode-mindbody-widget/trunk/hc-editor-plugin.php

    r1431621 r1433465  
    2121
    2222    public function add_hc_media_button() {
    23       $hc_json = json_encode($this->hc_codesnippets_arr);
    24       printf("<a href=\"#\" class=\"button\" onclick=\"hcShortcodeWindow(this);return false;\" data-editor=\"content\" data-hc-codes=\"%s\"><i class=\"mce-ico mce-i-icon hc-hmw-own-icon\"></i> HealCode</a>", htmlspecialchars($hc_json), 100);
     23      if (count($this->hc_codesnippets_arr)==0) {
     24        $hc_json = "{}";
     25      } else {
     26        $hc_json = json_encode($this->hc_codesnippets_arr);
     27      }
     28        printf("<a href=\"#\" class=\"button\" onclick=\"hcShortcodeWindow(this);return false;\" data-editor=\"content\" data-hc-codes=\"%s\"><i class=\"mce-ico mce-i-icon hc-hmw-own-icon\"></i> HealCode</a>", htmlspecialchars($hc_json), 100);
    2529    }
    2630
     
    3640      global $wpdb;
    3741      $this->hc_codesnippets_arr = $wpdb->get_results($wpdb->prepare( "SELECT id,title FROM ".$wpdb->prefix."hc_hmw_short_code WHERE status=%d  ORDER BY id DESC",1), ARRAY_A );
    38       if(count($this->hc_codesnippets_arr)==0)
    39       die;
     42
    4043      // if(floatval(get_bloginfo('version')) < 3.9) {
    4144      // Might have to treat the content differently if WP version is less than 3.9
  • healcode-mindbody-widget/trunk/header.php

    r1431617 r1433465  
    11<!-- HealCode MINDBODY Widget Plugin for WordPress -->
    22<!-- Header for pages -->
    3 
    4 <!-- Style Section - Remove in the future as is not necessary
    5 <style>
    6 #text {margin:50px auto; width:500px}
    7 .hotspot {color:#900; padding-bottom:1px; border-bottom:1px dotted #900; cursor:pointer}
    8 #tt {position:absolute; display:block; }
    9 #tttop {display:block; height:5px; margin-left:5px;}
    10 #ttcont {display:block; padding:2px 10px 3px 7px;  margin-left:-400px; background:#666; color:#FFF}
    11 #ttbot {display:block; height:5px; margin-left:5px; }
    12 </style>
    13 -->
    14 
    15 
    163<!-- Header Links to our About page in WordPress and HealCode -->
    174
  • healcode-mindbody-widget/trunk/healcode-mb-widget.php

    r1431621 r1433465  
    44Plugin URI: https://wordpress.org/plugins/healcode-mb-widget/
    55Description: Add HealCode Widgets to your WordPress website. This plugin lets you generate a shortcode for a widget. The shortcodes can be used in your pages, posts and widgets.
    6 Version: 1.1.7
     6Version: 1.1.8
    77Author: HealCode
    88Author URI: http://www.healcode.com/
  • healcode-mindbody-widget/trunk/js/healcode-wp-mb-widget.js

    r1431622 r1433465  
    1919function hcAddCodeContent(codeArray) {
    2020  var content = "<h3 >Click button to insert shortcode</h3>";
    21   jQuery.each(codeArray, function(index, value) {
    22     content += "<div class=\"hc-shortcode-row\" style=\"width: 100%; border-bottom: 1px solid #E5E4E2\"><div style=\"width: 50%; display: inline-block;\"><div style=\"font-size: 1.1em;\">" + value.title + "</div></div><div style=\"width: 50%; display: inline-block;\" ><button style=\"font-size: 1.2em; line-height: 2em; margin: 10px auto; width: 100%; cursor: pointer;\" class=\"hc-insert-shortcode\" value=" + value.title + ">" + value.title + "</button></div></div>";
    23   })
     21  if (jQuery.isEmptyObject(codeArray)) {
     22    content += "<div class=\"hc-shortcode-empty-contents\" style=\"width: 100%;\"><div style=\"color: green; line-height:2em; font-size: 2em;\">First you have to set up your shortcodes in settings</div></div>";
     23  } else {
     24    jQuery.each(codeArray, function(index, value) {
     25      content += "<div class=\"hc-shortcode-row\" style=\"width: 100%; border-bottom: 1px solid #E5E4E2\"><div style=\"width: 50%; display: inline-block;\"><div style=\"font-size: 1.1em;\">" + value.title + "</div></div><div style=\"width: 50%; display: inline-block;\" ><button style=\"font-size: 1.2em; line-height: 2em; margin: 10px auto; width: 100%; cursor: pointer;\" class=\"hc-insert-shortcode\" value=" + value.title + ">" + value.title + "</button></div></div>";
     26    })
     27  }
    2428  jQuery('#healcode-wp-shortcodes-content').html(content);
    2529}
  • healcode-mindbody-widget/trunk/readme.txt

    r1431636 r1433465  
    55Requires at least: 3.0
    66Tested up to: 4.5
    7 Stable tag: 1.1.7
     7Stable tag: 1.1.8
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2002001. The “Add Widget Shortcode” page in the WordPress Dashboard
    2012012. This is the Widget’s entry after adding a Widget shortcode; you have the options of deactivating the widget, editing it, or deleting it.
    202 3. The dropdown in the TinyMCE editor. Widgets can quickly and easily be added to pages.
    203 4. This is a demo Schedule Widget that was installed using a Widget shortcode. Notice that the Schedule Widget is displaying real-time information from our demo MINDBODY account.
    204 5. Adding a HealCode Widget to a "sidebar" using WordPress widgets (not to be consfused with HealCode widgets).
    205 6. You can add a "Today's Schedule" widget to the sidebar.
     2023. This the button in the editor you click to select your shortcode.
     2034. The modal allows for super easy shortcode insertion. Just click the button for the shortcode you want to insert.
     2045. This is a demo Schedule Widget that was installed using a Widget shortcode. Notice that the Schedule Widget is displaying real-time information from our demo MINDBODY account.
     2056. Adding a HealCode Widget to a "sidebar" using WordPress widgets (not to be confused with HealCode widgets).
     2067. You can add a "Today's Schedule" widget to the sidebar.
    206207
    207208
     
    230231== Changelog ==
    231232
     233= 1.1.8 =
     234* Fix initial load for first time installers
     235* Update screenshots
    232236= 1.1.7 =
    233237* Editor update
     
    270274== Upgrade Notice ==
    271275
     276= 1.1.8 =
     277* Fix initial load for first time installers
     278* Update screenshots
    272279= 1.1.7 =
    273280* Editor update
Note: See TracChangeset for help on using the changeset viewer.