Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-08-12 10:48:19

kram
Xinha Community Member
Registered: 2005-03-26
Posts: 21

Equation / AsciiMathML plugins

In XINHA version 0.931 (2007-05-16) I'm assuming that the 'Equation' plugin is the same thing as the 'AsciiMath' plugin developed by Peter Jipsen - or rather that the original Equation plugin has been replaced Peter's code?

I'm using Firefox 2.0.0.6 & Explorer 7.0.5730.11 on Windows XP. Web server is Domino 7.0.2

No Javascript errors occur (at least according to the Firefox Web Developer plugin). In Firefox the plugin works and I can see formulae in the textarea. In Explorer with the latest MathPlayer ActiveX plugin I can see formulae in the plugin but they appear as text in the textarea, like this `lim_(x->oo)`

On submitting with Firefox all formulae are lost, all that remains is {p}{span class="AM"}{/span}{/p}. In Explorer the text representation of formulae are saved but they're never visible again as formulae even when the page is re-edited.

It would be nice to be able to show formula on pages that aren't being edited - essential really. I think I must be missing something basic from the page - like a JS library? Any ideas why Firefox is stripping out the formula on submit?

Thanks.

kram


xinha.config

var xinha_editors=null;
var xinha_init=null;
var xinha_config=null;
var xinha_plugins=null;

xinha_init=xinha_init ? xinha_init : function()
{    // load no plugins
//     xinha_plugins = xinha_plugins ? xinha_plugins : [ ];

    // load specifed plugins
    xinha_plugins=xinha_plugins ? xinha_plugins :
    [
        'Abbreviation',
        'CharacterMap',
        'CharCounter',
        'ContextMenu',
        'Equation',
        'FindReplace',
        'InsertSmiley',   
        'ListType',
        'NoteServer',
        'PasteText',
        'SmartReplace',
        'TableOperations'
    ];

    if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;

    xinha_editors=xinha_editors ? xinha_editors :
    [
        'Body'
    ];

    xinha_config = new Xinha.Config();
    xinha_config.width = '98%';
    xinha_config.height = '330px';
/*    xinha_config.statusBar = false; */
    xinha_config.pageStyle='body { font-family:Verdana,Arial,Helvetica,Sans-Serif; font-size:1em}';

    xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
    Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init);
// executes xinha_init function on page load, does not interfere with window.onload properties set by other scripts



from the page header when editing:

{script type="text/javascript"}
    var _editor_url='/XINHA/';
    var _editor_lang='en';
    var _editor_skin='xp-blue';
{/script}
{script type="text/javascript" src="/XINHA/htmlarea.js"}{/script}
{script type="text/javascript" src="/dev/BT6Main.nsf/xinha_config.js"}{/script}

Last edited by kram (2007-08-12 10:48:55)

Offline

#2 2007-08-17 14:18:16

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Equation / AsciiMathML plugins

Hi kram!

kram wrote:

In XINHA version 0.931 (2007-05-16) I'm assuming that the 'Equation' plugin is the same thing as the 'AsciiMath' plugin developed by Peter Jipsen - or rather that the original Equation plugin has been replaced Peter's code?

No the plugin has been  by me using parts from Peter's code (like the input table)

kram wrote:

In Explorer with the latest MathPlayer ActiveX plugin I can see formulae in the plugin but they appear as text in the textarea, like this `lim_(x->oo)`

I'm sorry, I had a terriby hard time trying to make it work in IE and finally gave it up. Maybe I try to fix it some other time

kram wrote:

On submitting with Firefox all formulae are lost,

I just submitted a fix for this to the trunk, see http://xinha.webfactional.com/ticket/1059 . For some other changes I did see http://xinha.webfactional.com/ticket/1060

kram wrote:

It would be nice to be able to show formula on pages that aren't being edited - essential really. I think I must be missing something basic from the page - like a JS library?

Indeed, you have to include ASCIIMathML.js, see the readme files in the plugin folder. That is because it's not at all trivial to make MathML show on a page and it works really good with  ASCIIMathML.js

Offline

#3 2007-08-18 04:40:27

kram
Xinha Community Member
Registered: 2005-03-26
Posts: 21

Re: Equation / AsciiMathML plugins

Thank you Ray. Can't do anything immediately but will try again in a few days.

Offline

#4 2007-08-19 19:35:01

kram
Xinha Community Member
Registered: 2005-03-26
Posts: 21

Re: Equation / AsciiMathML plugins

Ray. Have made progress. The formula saves in Firefox now - thanks for that.

Had a look at your example file in the Equation plugin & now have equations displaying correctly in Firefox and Explorer (with MathML plugin).

Fantastic!

Thanks.

Offline

Board footer

Powered by FluxBB