hudmol/archivesspace — pull request #139 by payten (2012-11-14 20:58:15+00:00)
Title: [Delivers #37821423] Add mixed content feature to notes content fields

Introduce CodeMirror jquery plugin to support XML markup in the note's content fields (mixed-content.config.js). The plugin takes the defined element from AS.mixedContentElements and allows for keyboard auto-markup when entering '<' in the field (it also has auto-close of tags and auto-markup of tag attributes).

The CodeMirror textarea is applied to any "textarea.mixed-content" fields. The javascript for enabling these fields is in a discrete file and can be pulled in for other records in future if required (mixed-content.js).

I've added a "Wrap with " feature that displays when there is a text selection (there is also a selenium test for this).

I had to tweak the notes custom javascript events to use "init.subrecord" as "new.subrecord" was not being triggered correctly -- I think this was a jquery issue and I'll investigate it further.

The selenium tasks to populate these content textareas had to be tweaked as the codemirror field is not actually a . I've changed the tests to use @driver.execute_script to mimic the keyboard-entry behaviour (for now).