News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[2.0] IE11 - Rich Text Editing

Started by Antes, November 02, 2013, 04:55:24 AM

Previous topic - Next topic

Antes

Problem is simple if you are using IE11 you can't toggle to rich text editing.

Reported by eмre

emanuele

Probably related to the browser detection bug.
I'm surprised it works with IE9 and 10.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Arantor

Well, the browser detection now has IE11 in it in 2.1... I don't know about backporting that to 2.0 though.

Oldiesmann

It shouldn't be too difficult to backport it to 2.0. I'll take a look later and see what needs to be done.
Michael Eshom
Christian Metal Fans

Oldiesmann

Not tested, but this should work...

Themes/default/scripts/script.js

Find
var is_ie8up = is_ie8 && !is_ie7down;

Add after that
var is_ie11 = is_gecko && ua.indexOf('Trident') != -1;

Themes/default/scripts/editor.js

Find
this.bRichTextPossible = !this.opt.bRichEditOff && ((is_ie5up && !is_ie50) || is_ff || is_opera95up || is_safari || is_chrome) && !(is_iphone || is_android);

Replace
this.bRichTextPossible = !this.opt.bRichEditOff && ((is_ie5up && !is_ie50) || is_ff || is_opera95up || is_safari || is_chrome || is_ie11) && !(is_iphone || is_android);

Also, the following steps are needed to make the "Listen to the letters" thing work in IE11:

Sources/Load.php

Find
// Internet Explorer 5 and 6 are often "emulated".

Add after that
$context['browser']['is_ie11'] = $context['browser']['is_gecko'] && strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false;

Themes/default/Register.template.php

Find
if ($context['browser']['is_ie'])

Replace
if ($context['browser']['is_ie'] || $context['browser']['is_ie11'])

Also note that after you make the changes to the JS files, users may need to do a hard refresh (CTRL+R or CMD+R on Mac) to force their browsers to reload the JS in order for this to work.
Michael Eshom
Christian Metal Fans

Arantor

If this works I'll roll it into the patch I have thus far.

sheryltoo

I followed your instructions on my 2.0.6 forum but it didn't help. I also did the crtl R but that didn't help either.

Oldiesmann

Hate to bump an old topic, but I just figured out why it isn't working. indexOf() is case-sensitive and SMF forces the user agent string to be lowercase. So, the first "add" should be this instead of what's above:
var is_ie11 = is_gecko && ua.indexOf('trident') != -1;

Just make sure "trident" is lowercase.
Michael Eshom
Christian Metal Fans

Arantor

Something else to put in the next release then.

Oldiesmann

After further investigation, a couple of additional changes are needed to make it work, but even then it doesn't work properly, so I think we're best off not bothering to fix this.
Michael Eshom
Christian Metal Fans

Arantor


Advertisement: