Skip to content

This is a Redactor plugin which introduces a new button in the interface for adding Github Gists.

License

Notifications You must be signed in to change notification settings

1up-lab-archive/redactorjs-gist-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This plugin has still some serious flaws! A list can be found on the bottom of this readme.

Gist plugin for Redactor WYSIWYG-Editor

This is a Redactor plugin which introduces a new button in the interface for adding Github Gists. Gist Plugin Screenshot

Activate Plugin

Simply follow the instructions on the official documentation or take a look at the following minimal example.

<!DOCTYPE html>
<html>
<head>	
    <title>Redactor Gist plugin is awesome!</title>
    <meta charset="utf-8">
	
    <link rel="stylesheet" href="http://imperavi.com/js/redactor/redactor.css" />
    <link rel="stylesheet" href="https://raw.github.com/1up-lab/redactorjs-gist-plugin/master/gist.css" />
	
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
    <script src="http://imperavi.com/js/redactor/redactor.js"></script>    
    <script src="https://raw.github.com/1up-lab/redactorjs-gist-plugin/master/gist.js"></script>

    <script type="text/javascript">
    $(document).ready(function()
    {
        $('#redactor').redactor(
        { 
            plugins: ['gist']
        });	
    });
    </script>
</head>
<body>
    <div id="page">
        <textarea id="redactor" name="content"></textarea>
    </div>
</body>	
</html>

That's all! No additional assets like images needed. They are integrated inline in the CSS file.

Known Flaws

  • This plugin does not work on the current community-version of RedactorJS as it does not support plugins.
  • There is still a bug when loading the editor with gist script-tags in the content, as they will be stripped. Hey RedactorJS-devs: post-submit hooks would be nice. Consider that.
  • When pasting a Gist-URL to the editor and forget to unlink the element, the gist itself will be clickable, because the surrounding link is not removed. If you have an idea how to work around this flaw, drop me line!
  • Templating could be nicer. Working with DOM-Elements instead of string-values for example.

Thanks!

You're welcome.


Jim Schmid for 1up.io

About

This is a Redactor plugin which introduces a new button in the interface for adding Github Gists.

http://

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages