Changeset 1518058
- Timestamp:
- 10/19/2016 07:08:26 PM (9 years ago)
- Location:
- healcode-mindbody-widget/trunk
- Files:
-
- 2 edited
-
healcode-mb-widget.php (modified) (1 diff)
-
js/healcode-wp-mb-widget.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
healcode-mindbody-widget/trunk/healcode-mb-widget.php
r1437309 r1518058 4 4 Plugin URI: https://wordpress.org/plugins/healcode-mb-widget/ 5 5 Description: 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.1 26 Version: 1.1.13 7 7 Author: HealCode 8 8 Author URI: http://www.healcode.com/ -
healcode-mindbody-widget/trunk/js/healcode-wp-mb-widget.js
r1518057 r1518058 28 28 function hcShortCodeEditorInsertion(element) { 29 29 var shortCode = jQuery(element).val(); 30 var editor = jQuery(element).data('editor'); 31 hcGenerateShortCodeInsertEditor(shortCode, editor); 30 var editorName = jQuery(element).data('editor'); 31 var $editor = jQuery('#' + editorName); 32 var currentlyActive = activeTinyMCE($editor); 33 hcGenerateShortCodeInsertEditor(shortCode, $editor, editorName, currentlyActive); 32 34 } 33 35 34 function hcGenerateShortCodeInsertEditor(shortCodeValue, wpEditor) { 36 function activeTinyMCE($wpEditor) { 37 return $wpEditor.parents('.wp-editor-wrap').first().hasClass('tmce-active'); 38 } 39 40 function hcGenerateShortCodeInsertEditor(shortCodeValue, $wpEditor, wpEditorName, activeTinyMce) { 35 41 var fullShortCode = '[hc-hmw snippet="' + shortCodeValue + '"]'; 36 tinyMCE.editors[wpEditor].focus(); 37 tinyMCE.execCommand('mceInsertContent', false, fullShortCode); 42 if (activeTinyMce) { 43 tinyMCE.editors[wpEditorName].focus(); 44 tinyMCE.execCommand('mceInsertContent', false, fullShortCode); 45 } else { 46 // figure out how to insert at the last cursor position in the editor 47 } 38 48 tb_remove(); 39 49 } 40 50 41 51 jQuery(document).ready(function() { 42 tinymce.init({43 selector: "textarea"});44 45 52 jQuery('body').on('click', '.button.hc-wp-media-button', function() { 46 53 hcShortCodeModalContents(this);
Note: See TracChangeset
for help on using the changeset viewer.