You are here

function patterns_load_codemirror in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/forms/ \patterns_load_codemirror()

Adds the JavaScript files to load the Co2 Editing textarea.

1 call to patterns_load_codemirror()
patterns_editor in includes/forms/
Builds up a pattern editing environment. Loads additional javascript libraries, and supplies AJAX validation on the fly.


includes/forms/, line 267
Functions, forms related to the Patterns editor.


function patterns_load_codemirror($format = PATTERNS_FORMAT_YAML) {

  // Load the CodeMirror Editor if installed in the libraries folder
  $library = libraries_load('codemirror');
  if (!empty($library['loaded'])) {

    // Adding Pattern Customization for Co2
    drupal_add_css(drupal_get_path('module', 'patterns') . '/css/editor.css');
    drupal_add_js(drupal_get_path('module', 'patterns') . '/js/editor.js');
    return TRUE;
  return FALSE;