Sha256: f9d139c94bb302e055a5618ea1e6298862f01442070ce589878b2b97a4e847bd

Contents?: true

Size: 1.71 KB

Versions: 110

Compression:

Stored size: 1.71 KB

Contents

 /**
 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
 *
 * @author Moxiecode - based on work by Andrew Tetlaw
 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
 */

function init() {
	SXE.initElementDialog('ins');
	if (SXE.currentAction == "update") {
		setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
		setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
		SXE.showRemoveButton();
	}
}

function setElementAttribs(elm) {
	setAllCommonAttribs(elm);
	setAttrib(elm, 'datetime');
	setAttrib(elm, 'cite');
}

function insertIns() {
	var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
	tinyMCEPopup.execCommand('mceBeginUndoLevel');
	if (elm == null) {
		var s = SXE.inst.selection.getContent();
		if(s.length > 0) {
			insertInlineElement('INS');
			var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
			for (var i=0; i<elementArray.length; i++) {
				var elm = elementArray[i];
				setElementAttribs(elm);
			}
		}
	} else {
		setElementAttribs(elm);
	}
	tinyMCEPopup.editor.nodeChanged();
	tinyMCEPopup.execCommand('mceEndUndoLevel');
	tinyMCEPopup.close();
}

function removeIns() {
	SXE.removeElement('ins');
	tinyMCEPopup.close();
}

function insertInlineElement(en) {
	var ed = tinyMCEPopup.editor, dom = ed.dom;

	ed.getDoc().execCommand('FontName', false, 'mceinline');
	tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
		if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
			dom.replace(dom.create(en), n, 1);
	});
}

tinyMCEPopup.onInit.add(init);

Version data entries

110 entries across 88 versions & 11 rubygems

Version Path
kete-tiny_mce-0.1.0 lib/tiny_mce/assets/tiny_mce/plugins/xhtmlxtras/js/ins.js
krasivotokak-tiny_mce-0.0.1 public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
krasivotokak-tiny_mce-0.0.2 public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
krasivotokak-tiny_mce-0.0.4 public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
krasivotokak-tiny_mce-0.1.0 lib/tiny_mce/assets/tiny_mce/plugins/xhtmlxtras/js/ins.js
forgeos_core-1.9.4 app/assets/javascripts/forgeos/tiny_mce/plugins/xhtmlxtras/js/ins.js
forgeos_core-1.9.3 app/assets/javascripts/forgeos/tiny_mce/plugins/xhtmlxtras/js/ins.js
forgeos_core-1.9.2 app/assets/javascripts/forgeos/tiny_mce/plugins/xhtmlxtras/js/ins.js
forgeos_core-1.9.1 app/assets/javascripts/forgeos/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-oauth-0.2.4 test/rails_root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-oauth-0.2.3 test/rails_root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-oauth-0.2.2 test/rails_root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-contents-0.2.22 test/rails_root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-contents-0.2.21 public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-contents-0.2.21 test/rails_root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-oauth-0.2.1 test/rails_root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-oauth-0.2.0 test/rails_root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
ds-kitsune-0.2.5 generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-contents-0.2.20 public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
muck-contents-0.2.20 test/rails_root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js