<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[TinyMCE Forum - Math and graph plugins]]></title>
		<link>http://www.tinymce.com/forum/viewtopic.php?id=13917</link>
		<description><![CDATA[The most recent posts in Math and graph plugins.]]></description>
		<lastBuildDate>Tue, 27 Nov 2012 13:55:28 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Math and graph plugins]]></title>
			<link>http://www.tinymce.com/forum/viewtopic.php?pid=104704#p104704</link>
			<description><![CDATA[<p>Hello,</p><p>Just want to point out that the message from <strong>neomod</strong> is two years old, and so was about the old WIRIS editor 2, a Java applet.<br />Now there is WIRIS editor 3, a complete rewrite in Javascript. It will be easier to put it in a inline popup.</p><br /><p>Developers who want to try it, can start with the minimal demos at:<br />http://www.wiris.com/plugins/docs/demo-download<br />changing the same file:<br />.../tinymce/jscripts/tiny_mce/plugins/tiny_mce_wiris/editor_plugin_src.js</p><br /><p><em>Inline popup</em> is a feature in our roadmap, but because we maintain lots of integrations, and this feature is highly editor dependent, this will take a while.</p><br /><p>If you need it right now, we willl be happy to provide you all the support at support_at_wiris.com.</p><br /><p>About the <strong>sarankup</strong> message, WIRIS editor is SaaS, and the server that finally makes the images is usually wiris.net.<br />But you as a developer can download and use the plugins from wiris.com, without previous register, for about 1000 images or so.</p><p>--</p>]]></description>
			<author><![CDATA[dummy@example.com (ivan_at_wiris)]]></author>
			<pubDate>Tue, 27 Nov 2012 13:55:28 +0000</pubDate>
			<guid>http://www.tinymce.com/forum/viewtopic.php?pid=104704#p104704</guid>
		</item>
		<item>
			<title><![CDATA[Re: Math and graph plugins]]></title>
			<link>http://www.tinymce.com/forum/viewtopic.php?pid=101331#p101331</link>
			<description><![CDATA[<p>is <a href="http://www.wiris.com">www.wiris.com</a> free? I setup the wiris, but the equation is not displaying, but some box is displayed.</p>]]></description>
			<author><![CDATA[dummy@example.com (sarankup)]]></author>
			<pubDate>Thu, 24 May 2012 12:12:52 +0000</pubDate>
			<guid>http://www.tinymce.com/forum/viewtopic.php?pid=101331#p101331</guid>
		</item>
		<item>
			<title><![CDATA[Re: Math and graph plugins]]></title>
			<link>http://www.tinymce.com/forum/viewtopic.php?pid=76339#p76339</link>
			<description><![CDATA[<p>Is possibile to load wiris in inline popup?</p><p>I have made some changes in editor_plugin_src.js (only for the formula editor). The original file is this:</p><div class="codebox"><pre><code>/* Enabling support for all tinyMCE versions */
var wrs_int_tinyManager = function () {};

if (!window.tinymce) {
    wrs_int_tinyManager.baseURL = tinyMCE.baseURL;
    wrs_int_tinyManager.addPlugin = function (pluginName, plugin) {
        tinyMCE.addPlugin(pluginName, plugin);
    }
}
else {
    wrs_int_tinyManager.baseURL = tinymce.baseURL;
    wrs_int_tinyManager.addPlugin = function (pluginName, plugin) {
        tinymce.create(&#039;tinymce.plugins.&#039; + pluginName, plugin);
        tinymce.PluginManager.add(pluginName, tinymce.plugins[pluginName]);
    }
}

/* Including core.js */
var script = document.createElement(&#039;script&#039;);
script.type = &#039;text/javascript&#039;;
script.src = wrs_int_tinyManager.baseURL + &#039;/plugins/tiny_mce_wiris/core/core.js&#039;;
document.getElementsByTagName(&#039;head&#039;)[0].appendChild(script);

/* Configuration */
var _wrs_conf_editorEnabled = true;        // Specifies if fomula editor is enabled
var _wrs_conf_CASEnabled = true;        // Specifies if WIRIS CAS is enabled

var _wrs_conf_imageMathmlAttribute = &#039;alt&#039;;    // Specifies the image tag where we should save the formula editor mathml code
var _wrs_conf_CASMathmlAttribute = &#039;alt&#039;;    // Specifies the image tag where we should save the WIRIS CAS mathml code

var _wrs_conf_editorPath = wrs_int_tinyManager.baseURL + &#039;/plugins/tiny_mce_wiris/integration/editor.php&#039;;            // Specifies where is the editor HTML code (for popup window)
var _wrs_conf_editorAttributes = &#039;width=500, height=400, scroll=no, resizable=yes&#039;;                                // Specifies formula editor window options
var _wrs_conf_CASPath = wrs_int_tinyManager.baseURL + &#039;/plugins/tiny_mce_wiris/integration/cas.php&#039;;                    // Specifies where is the WIRIS CAS HTML code (for popup window)
var _wrs_conf_CASAttributes = &#039;width=640, height=480, scroll=no, resizable=yes&#039;;                                // Specifies WIRIS CAS window options

var _wrs_conf_createimagePath = wrs_int_tinyManager.baseURL + &#039;/plugins/tiny_mce_wiris/integration/createimage.php&#039;;            // Specifies where is createimage script
var _wrs_conf_createcasimagePath = wrs_int_tinyManager.baseURL + &#039;/plugins/tiny_mce_wiris/integration/createcasimage.php&#039;;    // Specifies where is createcasimage script

/* Vars */
var _wrs_int_editorIcon = wrs_int_tinyManager.baseURL + &#039;/plugins/tiny_mce_wiris/core/wiris-formula.gif&#039;;
var _wrs_int_CASIcon = wrs_int_tinyManager.baseURL + &#039;/plugins/tiny_mce_wiris/core/wiris-cas.gif&#039;;
var _wrs_int_temporalIframe;
var _wrs_int_window;
var _wrs_int_window_opened = false;
var _wrs_int_temporalImageResizing;

/* Plugin integration */
(function () {
    var plugin = {
        // old versions
        initInstance: function (editor) {
            if (!editor.tiny_mce_wirisApplied) {
                editor.tiny_mce_wirisApplied = true;
                editor.oldTargetElement.value = wrs_initParse(editor.oldTargetElement.value);
                wrs_addIframeEvents(editor.iframeElement, wrs_int_doubleClickHandler, wrs_int_mousedownHandler, wrs_int_mouseupHandler);
            }
        },
    
        // new versions
        init: function (editor, url) {
            var iframe;
            
            editor.onInit.add(function (editor) {
                var textarea = editor.getElement();
                
                function whenDocReady() {
                    if (window.wrs_initParse) {
                        if (textarea.value == undefined) {
                            textarea.value = wrs_initParse(editor.getContent());
                        }
                        else {
                            textarea.value = wrs_initParse(textarea.value);
                        }
                        
                        editor.load();
                        iframe = editor.getContentAreaContainer().firstChild;
                        wrs_addIframeEvents(iframe, wrs_int_doubleClickHandler, wrs_int_mousedownHandler, wrs_int_mouseupHandler);
                    }
                    else {
                        setTimeout(whenDocReady, 50);
                    }
                }
                
                whenDocReady();
            });
            
            editor.onSaveContent.add(function (editor, params) {
                params.content = wrs_endParse(params.content);
            });
            
            if (_wrs_conf_editorEnabled) {
                editor.addCommand(&#039;tiny_mce_wiris_openFormulaEditor&#039;, function () {
                    wrs_int_openNewFormulaEditor(iframe);
                });
            
                editor.addButton(&#039;tiny_mce_wiris_formulaEditor&#039;, {
                    title: &#039;Formula Editor&#039;,
                    cmd: &#039;tiny_mce_wiris_openFormulaEditor&#039;,
                    image: url + &#039;/core/wiris-formula.gif&#039;
                });
            }
            
            if (_wrs_conf_CASEnabled) {
                editor.addCommand(&#039;tiny_mce_wiris_openCAS&#039;, function () {
                    wrs_int_openNewCAS(iframe);
                });
            
                editor.addButton(&#039;tiny_mce_wiris_CAS&#039;, {
                    title: &#039;WIRIS CAS&#039;,
                    cmd: &#039;tiny_mce_wiris_openCAS&#039;,
                    image: url + &#039;/core/wiris-cas.gif&#039;
                });
            }
        },
        
        // old versions
        getControlHTML: function (buttonName) {
            if (buttonName == &#039;tiny_mce_wiris_formulaEditor&#039;) {
                return tinyMCE.getButtonHTML(buttonName, &#039;Formula Editor&#039;, &#039;{$pluginurl}/core/wiris-formula.gif&#039;, &#039;tiny_mce_wiris_openFormulaEditor&#039;);
            }
            
            if (buttonName == &#039;tiny_mce_wiris_CAS&#039;) {
                return tinyMCE.getButtonHTML(buttonName, &#039;WIRIS CAS&#039;, &#039;{$pluginurl}/core/wiris-cas.gif&#039;, &#039;tiny_mce_wiris_openCAS&#039;);
            }
            
            return &#039;&#039;;
        },
        
        // old versions
        execCommand: function (editor_id, element, command, user_interface, value) {
            if (command == &#039;tiny_mce_wiris_openFormulaEditor&#039;) {
                var iframe = tinyMCE.getInstanceById(editor_id).iframeElement;
                wrs_int_openNewFormulaEditor(iframe);
            }
            else if (command == &#039;tiny_mce_wiris_openCAS&#039;) {
                var iframe = tinyMCE.getInstanceById(editor_id).iframeElement;
                wrs_int_openNewCAS(iframe);
            }
        },
        
        cleanup : function(type, content, editor) {
            if (type == &#039;insert_to_editor&#039;) {
                return wrs_initParse(editor.startContent);
            }
            
            if (type == &#039;submit_content&#039;) {
                return wrs_endParse(content);
            }
            
            return content;
        },


        // all versions
        getInfo: function () {
            return {
                longname : &#039;tiny_mce_wiris&#039;,
                author : &#039;Juan Lao Tebar - Maths for More&#039;,
                authorurl : &#039;http://www.wiris.com&#039;,
                infourl : &#039;http://www.mathsformore.com&#039;,
                version : &#039;1.0&#039;
            };
        }    
    };

    wrs_int_tinyManager.addPlugin(&#039;tiny_mce_wiris&#039;, plugin);
})();

/**
 * Opens formula editor.
 * @param object iframe Target
 */
function wrs_int_openNewFormulaEditor(iframe) {
    if (_wrs_int_window_opened) {
        _wrs_int_window.focus();
    }
    else {
        _wrs_int_window_opened = _wrs_isNewElement = true;
        _wrs_int_temporalIframe = iframe;
        _wrs_int_window = window.open(_wrs_conf_editorPath, &#039;WIRISFormulaEditor&#039;, _wrs_conf_editorAttributes);
    }
}

/**
 * Opens CAS.
 * @param object iframe Target
 */
function wrs_int_openNewCAS(iframe) {
    if (_wrs_int_window_opened) {
        _wrs_int_window.focus();
    }
    else {
        _wrs_int_window_opened = _wrs_isNewElement = true;
        _wrs_int_temporalIframe = iframe;
        _wrs_int_window = window.open(_wrs_conf_CASPath, &#039;WIRISCAS&#039;, _wrs_conf_CASAttributes);
    }
}

/**
 * Handles a double click on the iframe.
 * @param object iframe Target
 * @param object element Element double clicked
 */
function wrs_int_doubleClickHandler(iframe, element) {
    if (element.nodeName.toLowerCase() == &#039;img&#039;) {
        if (wrs_containsClass(element, &#039;Wirisformula&#039;)) {
            if (!_wrs_int_window_opened) {
                _wrs_temporalImage = element;
                wrs_int_openExistingFormulaEditor(iframe);
            }
            else {
                _wrs_int_window.focus();
            }
        }
        else if (wrs_containsClass(element, &#039;Wiriscas&#039;)) {
            if (!_wrs_int_window_opened) {
                _wrs_temporalImage = element;
                wrs_int_openExistingCAS(iframe);
            }
            else {
                _wrs_int_window.focus();
            }
        }
    }
}

/**
 * Opens formula editor to edit an existing formula.
 * @param object iframe Target
 */
function wrs_int_openExistingFormulaEditor(iframe) {
    _wrs_int_window_opened = true;
    _wrs_isNewElement = false;
    _wrs_int_temporalIframe = iframe;
    _wrs_int_window = window.open(_wrs_conf_editorPath, &#039;WIRISFormulaEditor&#039;, _wrs_conf_editorAttributes);
}

/**
 * Opens CAS to edit an existing formula.
 * @param object iframe Target
 */
function wrs_int_openExistingCAS(iframe) {
    _wrs_int_window_opened = true;
    _wrs_isNewElement = false;
    _wrs_int_temporalIframe = iframe;
    _wrs_int_window = window.open(_wrs_conf_CASPath, &#039;WIRISCAS&#039;, _wrs_conf_CASAttributes);
}

/**
 * Handles a mouse down event on the iframe.
 * @param object iframe Target
 * @param object element Element mouse downed
 */
function wrs_int_mousedownHandler(iframe, element) {
    if (element.nodeName.toLowerCase() == &#039;img&#039;) {
        if (wrs_containsClass(element, &#039;Wirisformula&#039;) || wrs_containsClass(element, &#039;Wiriscas&#039;)) {
            _wrs_int_temporalImageResizing = element;
        }
    }
}

/**
 * Handles a mouse up event on the iframe.
 */
function wrs_int_mouseupHandler() {
    if (_wrs_int_temporalImageResizing) {
        setTimeout(function () {
            _wrs_int_temporalImageResizing.removeAttribute(&#039;style&#039;);
            _wrs_int_temporalImageResizing.removeAttribute(&#039;width&#039;);
            _wrs_int_temporalImageResizing.removeAttribute(&#039;height&#039;);
        }, 10);
    }
}

/**
 * Calls wrs_updateFormula with well params.
 * @param string mathml
 */
function wrs_int_updateFormula(mathml) {
    wrs_updateFormula(_wrs_int_temporalIframe, mathml);
}

/**
 * Calls wrs_updateCAS with well params.
 * @param string appletCode
 * @param string image
 * @param int width
 * @param int height
 */
function wrs_int_updateCAS(appletCode, image, width, height) {
    wrs_updateCAS(_wrs_int_temporalIframe, appletCode, image, width, height);
}

/**
 * Handles window closing.
 */
function wrs_int_notifyWindowClosed() {
    _wrs_int_window_opened = false;
}</code></pre></div><p>I&#039;ve changed: <br />1) <em>wrs_int_openNewFormulaEditor(iframe);</em> on line 93 in <strong>wrs_int_openNewFormulaEditor(editor,iframe);</strong><br />2) <em>function wrs_int_openNewFormulaEditor(iframe) {</em> on line 173 in <strong>function wrs_int_openNewFormulaEditor(editor,iframe) {</strong><br />3) <em>_wrs_int_window = window.open(_wrs_conf_editorPath, &#039;WIRISFormulaEditor&#039;, _wrs_conf_editorAttributes);</em> online 180 in <strong>_wrs_int_window = editor.windowManager.open({title:&#039;WIRISFormulaEditor&#039;,file:_wrs_conf_editorPath,width:500,height:400,resizable:true,inline:1,scrollbars:false});</strong></p><p>So it load formula editor in a inline popup, but after buttons don&#039;t work anymore... there is some little changes to do... someone could help me?</p>]]></description>
			<author><![CDATA[dummy@example.com (neochmod)]]></author>
			<pubDate>Wed, 16 Jun 2010 09:58:43 +0000</pubDate>
			<guid>http://www.tinymce.com/forum/viewtopic.php?pid=76339#p76339</guid>
		</item>
		<item>
			<title><![CDATA[Re: Math and graph plugins]]></title>
			<link>http://www.tinymce.com/forum/viewtopic.php?pid=46944#p46944</link>
			<description><![CDATA[<p>Hi,</p><p>we would like to report on a new math plugin for TinyMCE.</p><p>WIRIS Plugin allows to easily integrate with TinyMCe the following tools:</p><p>* <strong>Equation editor</strong> WYSIWYG based on icons and palettes<br />* <strong>Online calculator</strong><br />&nbsp; - Integrals, derivatives, limits,…<br />&nbsp; - 2D and 3D graphics</p><p><strong>DEMO</strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.wiris.com/demo-php/pluginwiris/tiny_mce_wiris/">www.wiris.com/demo-php/pluginwiris/tiny_mce_wiris/</a><br /><strong>DOWNLOAD</strong> <a href="http://www.wiris.com/documents/plugin-tinyMCE.html">www.wiris.com/documents/plugin-tinyMCE.html</a></p>]]></description>
			<author><![CDATA[dummy@example.com (reixarch)]]></author>
			<pubDate>Wed, 24 Dec 2008 10:21:34 +0000</pubDate>
			<guid>http://www.tinymce.com/forum/viewtopic.php?pid=46944#p46944</guid>
		</item>
		<item>
			<title><![CDATA[Re: Math and graph plugins]]></title>
			<link>http://www.tinymce.com/forum/viewtopic.php?pid=45330#p45330</link>
			<description><![CDATA[<p>WOW!</p>]]></description>
			<author><![CDATA[dummy@example.com (Felix Riesterer)]]></author>
			<pubDate>Mon, 17 Nov 2008 14:53:54 +0000</pubDate>
			<guid>http://www.tinymce.com/forum/viewtopic.php?pid=45330#p45330</guid>
		</item>
		<item>
			<title><![CDATA[Math and graph plugins]]></title>
			<link>http://www.tinymce.com/forum/viewtopic.php?pid=45320#p45320</link>
			<description><![CDATA[<p>In case they&#039;d be useful to anyone, I wanted to share a pair of math and graph plugins I recently adapted for TinyMCE 3.</p><p>The math plugin allows inline entry of mathematics using the calculator-style ASCIIMath notation, instantly rendered using MathML or images depending upon browser support. </p><p>The graph plugin allows creation of function, polar, parametric, and slopefield graphs, rendered using SVG or images.</p><p>You can view a demo and download at <a href="http://www.imathas.com/editordemo/demo.html">http://www.imathas.com/editordemo/demo.html</a></p>]]></description>
			<author><![CDATA[dummy@example.com (drlippman)]]></author>
			<pubDate>Mon, 17 Nov 2008 07:27:15 +0000</pubDate>
			<guid>http://www.tinymce.com/forum/viewtopic.php?pid=45320#p45320</guid>
		</item>
	</channel>
</rss>
