FIX Missing shortcode field and broken Javascript when inserting document in TinyMCE

This commit is contained in:
Robbie Averill 2017-08-07 11:21:35 +12:00
parent 77f137fcda
commit 6a67cddc38
2 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,8 @@ class DocumentHtmlEditorFieldToolbar extends Extension
$addExistingField->setUseFieldClass(false);
$fieldList->insertAfter($addExistingField, 'Description');
$fieldList->push(HiddenField::create('DMSShortcodeHandlerKey', false, DMS::inst()->getShortcodeHandlerKey()));
// Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
// Requirements::javascript(SAPPHIRE_DIR . "/javascript/tiny_mce_improvements.js");
//

View File

@ -92,7 +92,7 @@
}
// Match a document or call the regular link handling
if (href.match(new RegExp("/^\[" + this.getShortcodeKey() + "(\s*|%20|,)?id=([0-9]+)\]?$/", "i"))) {
if (href.match(new RegExp('^\\[' + this.getShortcodeKey() + '(\s*|%20|,)?id=([0-9]+)\\]?$', 'i'))) {
var returnArray = {
LinkType: 'document',
DocumentID: RegExp.$2,