heyanlong / summernote-ext-highlight

Based on code-prettify the summernote code highlighting plugin
MIT License
29 stars 29 forks source link

Error: Uncaught TypeError: Cannot read property 'getTemplate' of undefined (Line 18) #3

Closed ghost closed 8 years ago

ghost commented 8 years ago

When trying to use this with Summernote, I am getting the error above in the console. Here is my JS:

$(document).ready(function(){
        $content.summernote({
            prettifyHtml:false,
            codemirror: {
                theme: 'default',
            },
            toolbar:[
                ['highlight', ['highlight']],
            ],
        });

    });

And here is the loading order of my assets:

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" rel='stylesheet' type='text/css'>
    <link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700" rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.css">
    <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.7.1/summernote.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css">
    <link href="{{ URL::to('assets/css/app.css') }}" rel="stylesheet">

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.js"></script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.7.1/summernote.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.js"></script>
    <script src="{{ URL::to('assets/js/vendor.js') }}"></script>
    <script src="{{ URL::to('assets/js/admin.js') }}"></script>

Any idea what may be causing this?