Shorthand functions in plugin.js like `_setUpDynamicEditables()` break functionality in IE11, since shorthand functions are not supported. I'm not that worried about it, though I have some clients that need to use IE11 (because; reasons). Officially Drupal 8 should support IE11 right?

This "bug" will trigger a: SCRIPT1003: Expected ':'

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ambidex created an issue. See original summary.

oknate’s picture

Initial patch that replaces shorthand with declarations with colons. I haven't tested on ie11.

oknate’s picture

Status: Active » Needs review

I tested #2 on IE11. I didn't see any issues.

Wim Leers’s picture

Title: Plugin.js contains IE11 incompatible code » CKEditor plugin contains IE11-incompatible JavaScript syntax
Status: Needs review » Reviewed & tested by the community
Issue tags: +JavaScript, +Needs followup

Woah, excellent catch! This reminds me: we should make this comply with Drupal core's eslint. Then this would not have been possible. That means we should rename our current plugin.js to plugin.es6.js and then let eslint perform the necessary transpilation into plugin.js.

Either you can create that follow-up issue, or I can, but we should definitely do that before tagging a stable 8.x-1.0 release!

narnua’s picture

Patch fails for me locally, under @@ -262,7 +262,7 @@ doesn't match with rc2:
if (this.data.hasCaption && this.editables.caption.getData() !== this.data.attributes['data-caption']) {

This is the line in RC2
if (this.data.hasCaption && this.editables.caption.$.innerHTML !== this.data.attributes['data-caption']) {

Made a new patch with the (seemingly) correct version of the above line, as we will need a functional patch for a production site update soon.

Edit: attached patch is for rc2.

Wim Leers’s picture

#5: the patch in #2 applies to 8.x-1.x HEAD, which is two commits ahead of 8.x-1.0-rc2. Nonetheless, it's helpful to have a patch for RC2 users!

idflood’s picture

Applied the patch in #5 on rc-2 for a production website and it fixed the issue. I quickly checked the code and everything looks right. Thanks narnua.

  • Wim Leers committed 10f6371 on 8.x-1.x authored by oknate
    Issue #3062737 by oknate, narnua, Wim Leers, Ambidex, idflood: CKEditor...
Wim Leers’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs followup
Related issues: +#3063043: replace plugin.js with plugin.es6.js

@oknate created that follow-up: #3063043: replace plugin.js with plugin.es6.js. I was hoping to land that instead of this, but despite Drupal Core JavaScript maintainer @alwaysworking handling that, it seems to be less trivial than expected. So, committing this while waiting for that to happen.

Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.