caleeli / mathmlformula

Automatically exported from code.google.com/p/mathmlformula
1 stars 0 forks source link

Plugin Not working in Firefox 9.0.1 with ckEditor #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Open the plugin and insert any image
2.A broken image is shown on the editor content

Replicable from the Demo site (http://www.fmath.info/plugins/CKEditor/demo.jsp) 
as well.

Original issue reported on code.google.com by abir2008...@gmail.com on 5 Jan 2012 at 9:35

GoogleCodeExporter commented 9 years ago
Able to resolve the issue by trimming the name of the src attribute in function 
saveAndUpdate() of editor HTML. Code snippet is attached below...

 function saveAndUpdate(){
    var mathml = getMathMLFromEditor();
    var newId = parent.CKEDITOR.plugins.get('fmath_formula').addMathML(mathml);
            ed.insertHtml("<img src='"+trim(name)+"' border='0' id='"+newId+"' data-mathml='" + escape(mathml) + "' />");
    var dialog = parent.CKEDITOR.dialog.getCurrent();
    dialog.hide();
    }
// Trim Functions

function trim(str, chars) {
  return ltrim(rtrim(str, chars), chars);
}
function ltrim(str, chars) {
  chars = chars || "\\s";
  return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
function rtrim(str, chars) {
  chars = chars || "\\s";
  return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

Original comment by abir2008...@gmail.com on 6 Jan 2012 at 6:55

GoogleCodeExporter commented 9 years ago
thank you :)

Original comment by ionel.alexandru@gmail.com on 6 Jan 2012 at 3:11

GoogleCodeExporter commented 9 years ago

Original comment by ionel.alexandru@gmail.com on 25 Jan 2012 at 3:11