WordPress.org

Ready to get started?Download WordPress

Forums

Shortcodes Pro
[resolved] Attributes not working? (9 posts)

  1. Nikho
    Member
    Posted 1 year ago #

    Hi,
    I'm having trouble in getting attributes to work:
    each time I click "Insert" in the attributes modal window, nothing happens.
    Inspecting the problem via chrome developer tool I see the following:

    ncaught ReferenceError: checkSubmit is not defined
    shortcodespro-overlay.php:73

    Any idea?

    My conf is:
    Mac OSX 10.7.5, Safari/Chrome, Wp 3.4.2
    Shortcode without attributes working like expected.

    http://wordpress.org/extend/plugins/shortcodes-pro/

  2. Nikho
    Member
    Posted 1 year ago #

    Sorry, it was a plugin conflict. In this case with Editor repositioner plugin, which wrap the post editor inside a metabox. At the same time I verified that the "attributes dialog" does not work for textareas (custom fileds), where you may want to load TinyMce.

    Any idea to make shortcode-pro more modular ?

  3. Nikho
    Member
    Posted 1 year ago #

    Shortcode UI works smoothly everywhere TinyMce is called, no matter if is a custom filed or a different meta box. However I still much prefer the Shortcodes Pro approach in terms of UI and user interaction so I really hope to find a fix to make it available no matter where TinyMce is instantiated.

  4. Nikho
    Member
    Posted 1 year ago #

    The problem seems to be related in shortcodespro-overlay.php around line 108:

    window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, shortcodeContent);
    		tinyMCEPopup.editor.execCommand('mceRepaint');
    		tinyMCEPopup.close();
  5. Nikho
    Member
    Posted 1 year ago #

    OK, finally I've solved it by my self : )
    in shortcodespro-overlay.php on line 109 change:
    window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, shortcodeContent);
    into:
    window.tinyMCE.execCommand('content', 'mceInsertContent', false, shortcodeContent);

    Now Shortcodes Pro work smoothly everywhere!

    For more info see:
    /www.tinymce.com/wiki.php/Command_identifiers

  6. Jose Pacheco
    Member
    Posted 1 year ago #

    Well done Nikho... just could be of some javascript. In this case the tiny mc. Although i use tinymc as well i would recomend to take a look for some kind pro wordpress html5 editor as http://aloha-editor.org/demos/wordpress-demo/

  7. Nikho
    Member
    Posted 1 year ago #

    There's a typo in my latest comment, this is the proper syntax:
    window.tinyMCE.execCommand('mceInsertContent', false, shortcodeContent);

    Jose, I've looked at the Aloha Editor a couple of times but it still miss a clean approach IMO. I think we need a solid markdown parser, which hopefully merge all the different implementations (markdown, markdown-extra, multi-markdown). It seems like someone just did it https://github.com/PieroWbmstr/Extended_Markdown
    On the other hand we could rely on some javascript to handle the preview, like the epic editor does http://epiceditor.com/ But the Epic editor relies on marked.js, which actually supports just a subset of the Extended Markdown features. So the quest for the perfect editor remains open...

  8. petemurray
    Member
    Posted 1 year ago #

    Nikho, I've tried your solution on a WordPress 3.5 install, but I'm still getting the 'checkSubmit is not defined' error. Also I'm not seeing any attributes in dropdowns, if I create any attributes of the 'select' type.

    Does this work for you in 3.5?

  9. Nikho
    Member
    Posted 1 year ago #

    Yes Pete, just tested. Be sure to use latest version of the plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic