You are here

function ueditor_init in UEditor - 百度编辑器 7.3

Same name and namespace in other branches
  1. 7.2 ueditor.module \ueditor_init()

Implementation of hook_init().

File

./ueditor.module, line 37
Integration ueditor for wysiwyg.

Code

function ueditor_init() {
  if (variable_get('ueditor_highlighting_format', 1) == 1) {
    if (!_ueditor_page_match()) {
      return;
    }
    if (module_exists('libraries')) {
      $lib_path = libraries_get_path('ueditor');
    }

    // Load SyntaxHighlighter js and css.
    drupal_add_css($lib_path . '/third-party/SyntaxHighlighter/shCoreDefault.css');
    drupal_add_js($lib_path . '/third-party/SyntaxHighlighter/shCore.js', array(
      'weight' => -1,
    ));
    drupal_add_js('SyntaxHighlighter.all();', array(
      'type' => 'inline',
      'scope' => 'footer',
      'weight' => 5,
    ));
  }
}