1 tinyMCEPopup.requireLangPack();
\r
4 init : function(ed) {
\r
5 var action, elm, f = document.forms[0];
\r
8 elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG');
\r
9 v = ed.dom.getAttrib(elm, 'name');
\r
12 this.action = 'update';
\r
13 f.anchorName.value = v;
\r
16 f.insert.value = ed.getLang(elm ? 'update' : 'insert');
\r
19 update : function() {
\r
20 var ed = this.editor;
\r
22 tinyMCEPopup.restoreSelection();
\r
24 if (this.action != 'update')
\r
25 ed.selection.collapse(1);
\r
27 // Webkit acts weird if empty inline element is inserted so we need to use a image instead
\r
28 if (tinymce.isWebKit)
\r
29 ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}));
\r
31 ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, ''));
\r
33 tinyMCEPopup.close();
\r
37 tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);
\r