Skip to content

Conversation

@cahrens
Copy link

@cahrens cahrens commented Apr 1, 2014

This branch came from #3103. It reorders commits and combines all the commits related to switching to TinyMCE 4.0.20.

This PR continues #2657. We had 2 issues that we needed to resolve in order for TinyMCE to work on the LMS instructor page (bulk e-mail) in our production environment (which uses the Cloudfront CDN). Note that we do not host the static files on Cloudfront for Studio, which is why this bug was only an issue for LMS.

  1. TinyMCE was dynamically loading its skin and plugin files. This bypassed our hashed files that are produced by our static file pipeline. In addition to the fact that incorrect files could be returned if any of these files are subsequently edited (until the CDN cache expires), this issue meant we weren't using the hashed font file. On Firefox, font files from a different origin can't be used unless something is put into their headers to allow the access-- and that change had only been made to the hashed files, as produced in our pipeline. Hence, toolbar icons (which come from the font file) were not displaying on Firefox. Note that the annotations usage of TinyMCE exhibits this bug currently in production.
  2. The codemirror plugin for TinyMCE was attempting to access JavaScript variables from different origins. When running on the CDN, the codemirror plugin is running on Cloudfront, but the frame holding TinyMCE is on our courses.edx.org server. Communication between the codemirror iframe and the frame hosting TinyMCE most happen through postMessage, instead of direct access to JavaScript variables.

This PR corrects these 2 issues and also upgrades us to the most recent version of TinyMCE (4.0.20).

@cahrens cahrens changed the title Christina/tinymce update cdn2 Upgrade TinyMCE to 4.0.20 and replaced tabbed HTML editor Apr 1, 2014
devdob and others added 11 commits April 2, 2014 10:35
Detailed commit messages:
deleted old tinymce

new tinymce
js changes to support new tinymce
scss changes for alignments

Include all the controls on the toolbar that we previously had.

Changes to support Bulk e-mail usage.

adding new studio skin for TinyMCE4

Get handling of static image links working again.

Delete old Studio skin.

Version 1.3 of CodeMirror plugin.

Modify paths for location of CodeMirror files.

Fire events when CodeMirror Editor is open and closed.

Needed to switch static links back and forth.

Remove CodeMirror tabbed editor.

fixed tinymce visual editor css

Change how we detect that an image has been inserted.

made the codemirror look more studio-like

reordered the tinymce buttons

Update unit tests.

Update acceptance test for image plugin.

Make sure to strip out temporary caret.

It can get left behind in style blocks.

Test for style block being maintained.

Allow TinyMCE to create p's, else formatting doesn't work.

Add tests for toolbar buttons and converting links.

Add test for code format toolbar button.

Remove unnecessary code.

Remove unused testing templates and unused tabs.

Update tinymce paths.

Fire an event with the link plugin closes so we can rewrite links.

pep8

Updates from code review.

Change the name of the button to "Edit HTML".

Changed menu name for consistency, but we don't show it.

Changed name of "code" toolbar button to "Code block".

Switch from tabbed Visual/HTML Editor for HTML modules to showing the code editor as a plugin within TinyMCE (triggered from toolbar). STUD-1422

Fire events before and after the image dialog is shown.

We use this to rewrite links.

Change the event handling for image plugin.

Fixes FireFox bug, and allows us to correct the image path when we show the plugin (as opposed ot only correcting path when we close the plugin).

Code review feedback.

Fire events before and after the link dialog is shown.

This allows us to convert the static links.

Remove unnecessary helper method.

keeping the component editor inside the component window

Use compressed CodeMirror file.

replaced code icon in TinyMCE editor; simplified UI on TMCE toolbar

Change code editor icon to say HTML.

Move code style block button.

Update tests for minor UI changes.

Code editor button no longer shows an icon, and code style toolbar button location has moved.

Fix typos.
This gets around cross-origin issues on the CDN.

Delete plugin.min.js as the Jake command will minimize into the full file.
Changed tiny-MCE to not load CSS files dynamically.
Added CSS files for tiny-MCE in env files.
Moved TinyMCE files to directory structure required by Jake command.
Changed clients of "tinymce.min.js" to use "tinymce.full.min.js" instead.
Updated CHANGELOG to indicate tinymce version 4.0.20.
Renamed tinymce.css.
Directions for creating tinymce.full.min.js and commenting of edX changes.
Updated comments related to disabling dynamic JS and CSS file loading in tinymce.
Allow TinyMCE to handle CSS within the iframe.
Needed for TinyMCE CodeMirror plugin.
…d Studio HTML xmodule preview

Separating and documenting tinyMCE font imports from customized vendor code and customized render styling css files (because font must load first in iframe).

Add the TinyMCE font file to the CMS pipeline.
@cahrens cahrens mentioned this pull request Apr 2, 2014
@cahrens
Copy link
Author

cahrens commented Apr 2, 2014

This PR is ready for review. Note that the first commit is a squash of what was previously reviewed and submitted to master. So it is only necessary to review the commits after the first one. I have taken care to make the commits logical and have them overlap as little as possible.

@frrrances and @talbs can you please review each other's changes?

@andy-armstrong and @nasthagiri Please look again at my postMessage commit. I got rid of the GUID.

@andy-armstrong Review everything else too. :)

The code is up on http://studio.cahrens.m.sandbox.edx.org/. Also check out bulk e-mail usage in LMS instructor dashboard (http://cahrens.m.sandbox.edx.org/courses/edX/Open_DemoX/edx_demo_course/instructor).

My sandbox is using the CDN to serve our static files like we do in production.

@cahrens
Copy link
Author

cahrens commented Apr 2, 2014

Screenshot of the lms/envs/common.py diff, which GIT is declining to show. Note that we don't use the Studio-specific CSS on the LMS side now (which will be a change in behavior).

screen shot 2014-04-02 at 12 43 20 pm

@cahrens
Copy link
Author

cahrens commented Apr 2, 2014

Screenshot of the instructor_dashboard.html diff. The changes are the same for instructor_dashboard_2.html.

screen shot 2014-04-02 at 12 46 25 pm

@nasthagiri
Copy link
Contributor

👍 Looks good! Yay! I like the new way of authenticating the postmessage.

@andy-armstrong
Copy link
Contributor

👍 This was an epic, but worth it for the end result!

@talbs
Copy link
Contributor

talbs commented Apr 2, 2014

👍

@frrrances, your work on this makes sense and looks good. Thanks for the help getting this sorted out and for the moral support in later stages.

Nice work, @cahrens and @nasthagiri in getting this to the finish line :)

@frrrances
Copy link
Contributor

Hooray! Fantastic work on total chaos. 👍

@cahrens
Copy link
Author

cahrens commented Apr 2, 2014

Here we go again!

cahrens pushed a commit that referenced this pull request Apr 2, 2014
Upgrade TinyMCE to 4.0.20 and replaced tabbed HTML editor
@cahrens cahrens merged commit 269cd19 into master Apr 2, 2014
@a-nassif
Copy link

a-nassif commented Apr 8, 2014

@frrrances Glad this has been updated and merged again. But I just realized that the RTL align option has been disabled in the editor, which was kind of the whole point of updating to a newer tinymce version. Any chance of getting that back on?

@frrrances
Copy link
Contributor

@abdoosh00 Yes, we weren't aware that it was disabled. Can you create a PR or let us know how to enable it as you would like? Thanks!

@jzoldak jzoldak deleted the christina/tinymce-update-cdn2 branch May 5, 2014 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants