Sha256: 67db7e07e7fe4e56f134e91c4ceec0ea3b63f8290285c9c4f234a44c0a9c6c0e

Contents?: true

Size: 927 Bytes

Versions: 3

Compression:

Stored size: 927 Bytes

Contents

tinyMCEPopup.requireLangPack();

var AnchorDialog = {
	init : function(ed) {
		var action, elm, f = document.forms[0];

		this.editor = ed;
		elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG');
		v = ed.dom.getAttrib(elm, 'name');

		if (v)
			f.anchorName.value = v;

		f.insert.value = ed.getLang(elm ? 'update' : 'insert');
	},

	update : function() {
		var ed = this.editor;

		// Webkit acts weird if empty inline element is inserted so we need to use a image instead
		if (tinymce.isWebKit)
			ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}));
		else
			ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, ''));

		tinyMCEPopup.close();
	}
};

tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
typo-5.0.1 public/javascripts/tiny_mce/themes/advanced/js/anchor.js
typo-5.0.2 public/javascripts/tiny_mce/themes/advanced/js/anchor.js
typo-5.0 public/javascripts/tiny_mce/themes/advanced/js/anchor.js