Sergiu Dumitriu wrote:
On 01/29/2010 03:48 PM, Jerome Velociter wrote:
Marius Dumitru Florea wrote:
FYI, I get a JavaScript exception ("XWiki is not defined") if I edit Main.AllDocs when javascript.vm template is not imported in WYSIWYG editing mode. Should the live table macro check if the XWiki JavaScript object is present? Yes It should. Thanks for catching this.
Errr, no?
Correct, I spoke too fast. I thought the livetable did not check for the XWiki namespace presence but it does. (Indeed it would not work if not)
If the XWiki object is not defined, then how will it work? I think the XWiki object is defined in the parent frame, so this would be better:
if (typeof(XWiki) == 'undefined') { if (typeof(window.parent.XWiki) != 'undefined') { XWiki = window.parent.XWiki; } else { // Critical, what now? } }