WordPress.org

Forums

Crayon Syntax Highlighter
[resolved] REQUEST: Click to expand (9 posts)

  1. stalks
    Member
    Posted 2 years ago #

    I'd like to add large bits of code but initially only show a single line like

    [+] Click to expand

    And then clicking will show the code. The "Click to expand" could be the title.

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

  2. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    While Crayon doesn't support this, it'd be super easy to write some jQuery for it. Give me 20 min.

  3. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    Ok, download this zip:

    https://www.dropbox.com/s/5xymv9us8lc45pj/expand.zip

    Put it in your theme directory. Then add these:

    wp_enqueue_script( 'expand-script', get_template_directory_uri() . '/expand/expand.js', array('jquery'), '1.0', true );
    	wp_enqueue_style( 'expand-style', get_template_directory_uri() . '/expand/expand.css' );

    I added them in the function twentytwelve_scripts_styles().

    This is a neat feature, so I'll add it to Crayon shortly. Please test this and let me know.

  4. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    Just noticed that events are broken from this, still some work to do, but the click to expand works fine.

  5. stalks
    Member
    Posted 2 years ago #

    You're a whizz :) Thanks.

  6. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    See the latest github:

    https://github.com/aramkocharyan/crayon-syntax-highlighter/archive/master.zip

    I've added it into Crayon. Enable "minimize code" under Code in settings.

  7. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

  8. stalks
    Member
    Posted 2 years ago #

    Wow and it looks so nice! Thankyou very much! Great project you have here, you're very talented, thanks.

  9. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    Much appreciated :) glad you like it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Crayon Syntax Highlighter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.