| Name | Size | Mode | Actions |
|---|---|---|---|
| caret/ | - | 0755 | rm |
| data/ | - | 0755 | rm |
| dom/ | - | 0755 | rm |
| file/ | - | 0755 | rm |
| fmt/ | - | 0755 | rm |
| geom/ | - | 0755 | rm |
| html/ | - | 0755 | rm |
| text/ | - | 0755 | rm |
| ui/ | - | 0755 | rm |
| util/ | - | 0755 | rm |
| AddOnManager.js | 7664 | 0644 | editdlrm |
| Compat.js | 2065 | 0644 | editdlrm |
| DragDropOverrides.js | 7153 | 0644 | editdlrm |
| Editor.js | 65215 | 0644 | editdlrm |
| EditorCommands.js | 21227 | 0644 | editdlrm |
| EditorManager.js | 18496 | 0644 | editdlrm |
| EditorObservable.js | 5308 | 0644 | editdlrm |
| EditorUpload.js | 5746 | 0644 | editdlrm |
| EnterKey.js | 21487 | 0644 | editdlrm |
| Env.js | 4419 | 0644 | editdlrm |
| FocusManager.js | 8836 | 0644 | editdlrm |
| ForceBlocks.js | 3791 | 0644 | editdlrm |
| Formatter.js | 71892 | 0644 | editdlrm |
| InsertContent.js | 10850 | 0644 | editdlrm |
| InsertList.js | 4825 | 0644 | editdlrm |
| jquery.tinymce.js | 10167 | 0644 | editdlrm |
| LegacyInput.js | 1829 | 0644 | editdlrm |
| Mode.js | 1917 | 0644 | editdlrm |
| NodeChange.js | 4670 | 0644 | editdlrm |
| NotificationManager.js | 3652 | 0644 | editdlrm |
| Register.js | 644 | 0644 | editdlrm |
| SelectionOverrides.js | 26883 | 0644 | editdlrm |
| Shortcuts.js | 5481 | 0644 | editdlrm |
| UndoManager.js | 9691 | 0644 | editdlrm |
| WindowManager.js | 7208 | 0644 | editdlrm |
/home/aqcert/public_html/admin/tinymce/js/tinymce/classes/InsertContent.js (10850B)
|
rng = selection.getRng(); var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null); var body = editor.getBody(); if (caretElement === body && selection.isCollapsed()) { if (dom.isBlock(body.firstChild) && canHaveChildren(body.firstChild) && dom.isEmpty(body.firstChild)) { rng = dom.createRng(); rng.setStart(body.firstChild, 0); rng.setEnd(body.firstChild, 0); selection.setRng(rng); } } // Insert node maker where we will insert the new HTML and get it's parent if (!selection.isCollapsed()) { // Fix for #2595 seems that delete removes one extra character on // WebKit for some odd reason if you double click select a word editor.selection.setRng(editor.selection.getRng()); editor.getDoc().execCommand('Delete', false, null); trimNbspAfterDeleteAndPaddValue(); } parentNode = selection.getNode(); // Parse the fragment within the context of the parent node var parserArgs = {context: parentNode.nodeName.toLowerCase(), data: details.data}; fragment = parser.parse(value, parserArgs); // Custom handling of lists if (details.paste === true && InsertList.isListFragment(fragment) && InsertList.isParentBlockLi(dom, parentNode)) { rng = InsertList.insertAtCaret(serializer, dom, editor.selection.getRng(true), fragment); editor.selection.setRng(rng); editor.fire('SetContent', args); return; } markFragmentElements(fragment); // Move the caret to a more suitable location node = fragment.lastChild; if (node.attr('id') == 'mce_marker') { marker = node; for (node = node.prev; node; node = node.walk(true)) { if (node.type == 3 || !dom.isBlock(node.name)) { if (editor.schema.isValidChild(node.parent.name, 'span')) { node.parent.insert(marker, node, node.name === 'br'); } break; } } } editor._selectionOverrides.showBlockCaretContainer(parentNode); // If parser says valid we can insert the contents into that parent if (!parserArgs.invalid) { value = serializer.serialize(fragment); // Check if parent is empty or only has one BR element then set the innerHTML of that parent node = parentNode.firstChild; node2 = parentNode.lastChild; if (!node || (node === node2 && node.nodeName === 'BR')) { dom.setHTML(parentNode, value); } else { selection.setContent(value); } } else { // If the fragment was invalid within that context then we need // to parse and process the parent it's inserted into // Insert bookmark node and get the parent selection.setContent(bookmarkHtml); parentNode = selection.getNode(); rootNode = editor.getBody(); // Opera will return the document node when selection is in root if (parentNode.nodeType == 9) { parentNode = node = rootNode; } else { node = parentNode; } // Find the ancestor just before the root element while (node !== rootNode) { parentNode = node; node = node.parentNode; } // Get the outer/inner HTML depending on if we are in the root and parser and serialize that value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); value = serializer.serialize( parser.parse( // Need to replace by using a function since $ in the contents would otherwise be a problem value.replace(//i, function() { return serializer.serialize(fragment); }) ) ); // Set the inner/outer HTML depending on if we are in the root or not if (parentNode == rootNode) { dom.setHTML(rootNode, value); } else { dom.setOuterHTML(parentNode, value); } } reduceInlineTextElements(); moveSelectionToMarker(dom.get('mce_marker')); umarkFragmentElements(editor.getBody()); editor.fire('SetContent', args); editor.addVisual(); }; var processValue = function (value) { var details; if (typeof value !== 'string') { details = Tools.extend({ paste: value.paste, data: { paste: value.paste } }, value); return { content: value.content, details: details }; } return { content: value, details: {} }; }; var insertAtCaret = function (editor, value) { var result = processValue(value); insertHtmlAtCaret(editor, result.content, result.details); }; return { insertAtCaret: insertAtCaret }; });