')); }; var open = function (editor, headState) { var data = htmlToData(editor, headState.get()); var defaultData = { title: '', keywords: '', description: '', robots: '', author: '', docencoding: '' }; var initialData = __assign(__assign({}, defaultData), data); editor.windowManager.open({ title: 'Metadata and Document Properties', size: 'normal', body: { type: 'panel', items: [ { name: 'title', type: 'input', label: 'Title' }, { name: 'keywords', type: 'input', label: 'Keywords' }, { name: 'description', type: 'input', label: 'Description' }, { name: 'robots', type: 'input', label: 'Robots' }, { name: 'author', type: 'input', label: 'Author' }, { name: 'docencoding', type: 'input', label: 'Encoding' } ] }, buttons: [ { type: 'cancel', name: 'cancel', text: 'Cancel' }, { type: 'submit', name: 'save', text: 'Save', primary: true } ], initialData: initialData, onSubmit: function (api) { var nuData = api.getData(); var headHtml = dataToHtml(editor, global$1.extend(data, nuData), headState.get()); headState.set(headHtml); api.close(); } }); }; var register = function (editor, headState) { editor.addCommand('mceFullPageProperties', function () { open(editor, headState); }); }; var protectHtml = function (protect, html) { global$1.each(protect, function (pattern) { html = html.replace(pattern, function (str) { return ''; }); }); return html; }; var unprotectHtml = function (html) { return html.replace(//g, function (a, m) { return unescape(m); }); }; var each = global$1.each; var low = function (s) { return s.replace(/<\/?[A-Z]+/g, function (a) { return a.toLowerCase(); }); }; var handleSetContent = function (editor, headState, footState, evt) { var startPos, endPos, content, styles = ''; var dom = editor.dom; if (evt.selection) { return; } content = protectHtml(getProtect(editor), evt.content); if (evt.format === 'raw' && headState.get()) { return; } if (evt.source_view && shouldHideInSourceView(editor)) { return; } if (content.length === 0 && !evt.source_view) { content = global$1.trim(headState.get()) + '\n' + global$1.trim(content) + '\n' + global$1.trim(footState.get()); } content = content.replace(/<(\/?)BODY/gi, '<$1body'); startPos = content.indexOf('
\n