Skip to content
Snippets Groups Projects
Select Git revision
  • 834ef18c0973a515e941c8d9f5fa7d0a0b1cd954
  • master default protected
  • pymilter-1.0.4
  • pymilter-1.0.3
  • pymilter-1.0.2
  • pymilter-1.0.1
  • pymilter-1_0
  • milter-0_8_18
  • pymilter-0_9_8
  • pymilter-0_9_7
  • pymilter-0_9_6
  • pymilter-0_9_5
  • pymilter-0_9_4
  • pymilter-0_9_2
  • pymilter-0_9_1
  • pymilter-0_9_0
  • pymilter-0_8_12
  • pymilter-0_8_11
  • pymilter-0_8_10
  • pymilter-0_8_9
  • milter-0_8_8
  • milter-0_8_7
22 results

setup.py

Blame
  • plugin.js 1.34 KiB
    // Create a new plugin which registers a custom code highlighter
    CKEDITOR.plugins.add('customCodeHighlighter', {
      afterInit: function (editor) {
        var highlighter = new CKEDITOR.plugins.codesnippet.highlighter({
          languages: {
            apache: 'Apache',
            bash: 'Bash',
            coffeescript: 'CoffeeScript',
            cpp: 'C++',
            cs: 'C#',
            css: 'CSS',
            diff: 'Diff',
            html: 'HTML',
            http: 'HTTP',
            ini: 'INI',
            java: 'Java',
            javascript: 'JavaScript',
            json: 'JSON',
            makefile: 'Makefile',
            markdown: 'Markdown',
            nginx: 'Nginx',
            objectivec: 'Objective-C',
            perl: 'Perl',
            php: 'PHP',
            python: 'Python',
            ruby: 'Ruby',
            sql: 'SQL',
            vbscript: 'VBScript',
            xhtml: 'XHTML',
            xml: 'XML'
          },
          init: function (ready) {
            // Here we should load any required resources
            ready();
          },
          highlighter: function (code, language, callback) {
            // Here we are highlighting the code and returning it.
            /**
             * Note: Since we're not adding any highlighting we have to
             * encode the html so that the html is not being run.
             */
            callback(CKEDITOR.tools.htmlEncode(code));
          }
        });
        editor.plugins.codesnippet.setHighlighter(highlighter);
      }
    });