function patterns_load_codemirror in Patterns 7.2
Same name and namespace in other branches
- 7 includes/forms/editor.inc \patterns_load_codemirror()
Adds the JavaScript files to load the Co2 Editing textarea.
1 call to patterns_load_codemirror()
- patterns_editor in includes/
forms/ editor.inc - Builds up a pattern editing environment. Loads additional javascript libraries, and supplies AJAX validation on the fly.
File
- includes/
forms/ editor.inc, line 277 - Functions, forms related to the Patterns editor.
Code
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;
}