WordPress.org

Ready to get started?Download WordPress

Forums

Crayon Syntax Highlighter
[resolved] Tag Editor Not Working (11 posts)

  1. Hi,

    I can't get the tag editor to work in Chrome 18 on Mac. The button simply doesn't do anything. Chrome Dev tools throws the following error when clicking it:

    4event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
    crayon_te.js:519Uncaught TypeError: Cannot call method 'val' of null
    resetSettingscrayon_te.js:519
    showDialogcrayon_te.js:153
    (anonymous function)/content/plugins/crayon-syntax-highlighter/util/tag-editor/crayon_tinymce.js?ver=345-20111127:74
    m.create.execCommandtiny_mce.js:1
    c.create.createButton.i.onclicktiny_mce.js:1
    b.create.postRendertiny_mce.js:1
    d.create.add.g

    http://wordpress.org/extend/plugins/crayon-syntax-highlighter/

  2. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    I'm also using a Mac, same browser version. I can't replicate that error without passing in a null, and jQuery will pass an 'undefined' object instead if the setting isn't found, which won't generate the error. That function shouldn't even be called with anything but a defined object...

    jQuery('.'+gs.setting).each(function() {
    			var setting = jQuery(this);
    			me.settingValue(setting, setting.attr(gs.orig_value));
    			// Update highlights
    			setting.change();
    		});

    setting should not be null/undefined there... What version of jQuery are you running? And is this happening when adding or editing a Crayon? Is it happening when editing a post or when adding a new post? Also try updating to 1.9.1 and making sure all the files are there in the /util/tag-editor/ folder.

  3. rockschtar
    Member
    Posted 2 years ago #

    I had the same issue. Seems to be a problem with some themes.

    I fixed it by changing the following:

    In "util/tag-editor/crayon_te_content.php" move the line with wp_load_path behind the include of crayon_settings_wp.class.php.

    Orginal (Buggy) Code:

    require_once ($root . '/crayon_wp.class.php');
    require_once (CrayonWP::wp_load_path());
    require_once ($root.'/crayon_settings_wp.class.php');

    Fixed Code:

    require_once ($root . '/crayon_wp.class.php');
    require_once ($root.'/crayon_settings_wp.class.php');
    require_once (CrayonWP::wp_load_path());

    Then it worked in my case. Because the value of $root changed to my theme directory after the call of CrayonWP::wp_load_path().

  4. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    Oh! Nice catch! That's a little crazy, because it can only happen if another script which is loaded decided to do:

    global $root
    $root = '...'

    Which isn't impossible, but unlikely. To avoid conflicts like this I've reordered it and also changed any global variables to include a crayon_ prefix, so this shouldn't happen again. Try this zip:

    http://dl.dropbox.com/u/33811812/Crayon/crayon-syntax-highlighter-1.9.1-2.zip

  5. Crisium
    Member
    Posted 1 year ago #

    the <> does nothing now after the last update.. something is broken.

  6. akarmenia
    Member
    Plugin Author

    Posted 1 year ago #

    It's working for me. Anything useful in the js console?

  7. Crisium
    Member
    Posted 1 year ago #

    nope.. no javascript errors:

    http://screencast-o-matic.com/watch/cllFIUV1r0

    see the screencast

    regards,
    Peter

  8. Crisium
    Member
    Posted 1 year ago #

    some extra info: I'm using the plugin TinyMCE Advanced

    your crayon worked great before the update also with TinyMCE Advanced

    regards,
    Peter

  9. Crisium
    Member
    Posted 1 year ago #

    more info:

    tried it with internet explorer.. and it works there.

    but does not work with chrome.

    peter

  10. Crisium
    Member
    Posted 1 year ago #

    I'm back... problem solved... clearing the cache on chrome did it... apparently some cache data is causing problems with the crayon from the last version.

    peter

  11. akarmenia
    Member
    Plugin Author

    Posted 1 year ago #

    Ah great! Thanks for taking a look at it. WordPress appends a suffix "ver" variable that should prevent such issues, but I'm not using it for GET requests - as far as I know this is something ajaxurl should handle, but since I don't provide it its likely not taking place. A minor problem I hope. I'll fix it shortly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic