Enlarge editor does not work with wiki pages in IE7

Enlarge editor does not work with wiki pages in IE7

by Pieter van der Hijden -
Number of replies: 8

In IE7, the enlarge editor button works fine when editing a web page. However, when editing a wiki page, the full screen window is opened but remains empty. In Firefox, everything is OK. I use Moodle 1.9.1+ (Build: 20080528).

Any suggestions?

Average of ratings: -
In reply to Pieter van der Hijden

Re: Enlarge editor does not work with wiki pages in IE7

by Dave Shearan -

Hi Pieter,

No fix I'm afraid - I have a similar problem but it doesn't happen for everybody. There are several users all working on the same wiki pages and when they try to use the full screen editor it hangs and IE7 has to be shut down using Task Manager. On my PC it has crashed once but most of the time it works for me.We use Moodle version 1.9.2+ and the problem has only started happening since we upgraded from version 1.8

In reply to Dave Shearan

Re: Enlarge editor does not work with wiki pages in IE7

by Kris Thornley -
Just had a look at this and it seems to be related to the /lib/editor/htmlarea/popups/fullscreen.php and the block of JS which includes scripts from the opener window

// load same scripts that were present in the opener page
var scripts = opener.document.getElementsByTagName("script");
var head = document.getElementsByTagName("head")[0];
for (var i = 0; i < scripts.length; ++i) {
var script = scripts[i];
if (typeof script.src != "undefined" && /\S/.test(script.src)) {
// document.write("<scr" + "ipt type=" + "\"script/javascript\"");
// document.write(" src=\"../" + script.src + "\"></scr" + "ipt>");
var new_script = document.createElement("script");
if (/^https?:/i.test(script.src)) {
new_script.src = script.src;
} else {
new_script.src = "../" + script.src;
}
head.appendChild(new_script);
}
}



After a bit of testing the script that really plays havoc on the dynamic inclusion is yui/event/event-min.js. I have no idea as to what this does but a small tweak will remove it from the append...

if(!script.src.indexOf("yui/event/event-min.js") ){
head.appendChild(new_script);
}

Block ends up looking like

var scripts = opener.document.getElementsByTagName("script");
var head = document.getElementsByTagName("head")[0];
for (var i = 0; i < scripts.length; ++i) {
var script = scripts[i];
if (typeof script.src != "undefined" && /\S/.test(script.src)) {
// document.write("<scr" + "ipt type=" + "\"script/javascript\"");
// document.write(" src=\"../" + script.src + "\"></scr" + "ipt>");
var new_script = document.createElement("script");
if (/^https?:/i.test(script.src)) {
new_script.src = script.src;
} else {
new_script.src = "../" + script.src;
}
//Added to remove offending script
if(!script.src.indexOf("yui/event/event-min.js") ){
head.appendChild(new_script);
}
}
}

Pretty ugly but seems to fix the issue

In reply to Kris Thornley

Re: Enlarge editor does not work with wiki pages in IE7

by Dave Shearan -

Thank you Kris,

Only just made those changes but it now works and my users are delighted. Is this something that needs to be reportedfixed via the Tracker?

Dave

In reply to Kris Thornley

Re: Enlarge editor does not work with wiki pages in IE7

by Jeffrey Thomas -

Yikes!  I just upgraded from v1.8.2 to v1.9.2 (build20080723), and found this as the only problem.   The Enlarge-editor (fullscreen.php)  IE7 worked fine yesterday under v1.8.2, and today under v1.9.2 it hangs -- but only when using the wiki editor, not when enlarging assignment htmlareas.   I can close the enlarged window, but it then aborts the entire IE7 process.

It smells like a bug, no?  I'll try to get into Tracker tomorrow to report it; though first I'll try to apply the patch that Mr.Shearan so diligently found.

In reply to Jeffrey Thomas

Re: Enlarge editor does not work with wiki pages in IE7

by Derry Lyons -

Hi Jeffrey,

Any luck applying the patch or getting it into tracker? We're seeing the same issue and wondering if there have been any updates since your post in late August. Thanks!! smile

In reply to Derry Lyons

Re: Enlarge editor does not work with wiki pages in IE7

by Bronwen Campbell -

I have just started having a problem with using the wiki editor in IE7. I'm not sure if it is related to having opened up the enlarge editor, which I did before experiencing the problem (although have done this in the past with no issues). Just to add to the confusion, the wiki is working fine in another course area within the same moodle instance. Only difference I can see is that there there are no groups.

I did not have the problem before, but now I can no longer see my WYSIWIG editor when using IE, but I can when using Firefox. The images below show exactly the same wiki page open for editing in firefox and IE.

Screenshot of wiki html editor

I am using Moodle 1.9.2. and IE 7.0.6

Does anyone have any suggestions as to what is causing this and how to fix it?

In reply to Derry Lyons

Re: Enlarge editor does not work with wiki pages in IE7

by Chris Fryer -
Kris's workaround has been committed to CVS, so Moodle 1.9.4 won't exhibit this behaviour anymore. It won't actually be fixed because HTMLArea is being dropped in version 2.0.