Click here to Skip to main content
15,892,697 members
Articles / Programming Languages / C#

sharpcms.net - CMS framework based on XSLT and XML

Rate me:
Please Sign up or sign in to vote.
5.00/5 (16 votes)
29 Nov 20053 min read 72.3K   3.3K   90  
CMS for .NET based on XSLT, XML and C#.
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('advimage', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,no');

function TinyMCE_advimage_getInfo() {
	return {
		longname : 'Advanced image',
		author : 'Moxiecode Systems',
		authorurl : 'http://tinymce.moxiecode.com',
		infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advimage.html',
		version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
	};
};

function TinyMCE_advimage_getControlHTML(control_name) {
	switch (control_name) {
		case "image":
			return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvImage\');" target="_self" onmousedown="return false;"><img id="{$editor_id}_advimage" src="{$themeurl}/images/image.gif" title="{$lang_image_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreClass(this);" /></a>';
	}

	return "";
}

function TinyMCE_advimage_execCommand(editor_id, element, command, user_interface, value) {
	switch (command) {
		case "mceAdvImage":
			var template = new Array();

			template['file']   = '../../plugins/advimage/image.htm';
			template['width']  = 480;
			template['height'] = 380;

			// Language specific width and height addons
			template['width']  += tinyMCE.getLang('lang_advimage_delta_width', 0);
			template['height'] += tinyMCE.getLang('lang_advimage_delta_height', 0);

			tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});

			return true;
	}

	return false;
}

function TinyMCE_advimage_cleanup(type, content) {
	switch (type) {
		case "insert_to_editor_dom":
			var imgs = content.getElementsByTagName("img");
			for (var i=0; i<imgs.length; i++) {
				var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
				var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));

				if ((src = tinyMCE.getImageSrc(onmouseover)) != "") {
					src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
					imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
				}

				if ((src = tinyMCE.getImageSrc(onmouseout)) != "") {
					src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
					imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
				}
			}
			break;

		case "get_from_editor_dom":
			var imgs = content.getElementsByTagName("img");
			for (var i=0; i<imgs.length; i++) {
				var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
				var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));

				if ((src = tinyMCE.getImageSrc(onmouseover)) != "") {
					src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
					imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
				}

				if ((src = tinyMCE.getImageSrc(onmouseout)) != "") {
					src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
					imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
				}
			}
			break;
	}

	return content;
}

function TinyMCE_advimage_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
	tinyMCE.switchClassSticky(editor_id + '_advimage', 'mceButtonNormal');

	if (node == null)
		return;

	do {
		if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1)
			tinyMCE.switchClassSticky(editor_id + '_advimage', 'mceButtonSelected');
	} while ((node = node.parentNode));

	return true;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Denmark Denmark
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions