-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify that oembed is working for YouTube #77
Comments
Works for me in latest Chrome (OSX): http://cdev.gc.cuny.edu/papers/image-tests/ The YouTube URL must be on a line of its own though. |
Oh, but it's wildly oversized :( |
I can also confirm that YouTube oEmbeds work.
I've looked into using JS to resize IFRAMES dynamically when the browser is resized. But, there is another issue with post revisions. If you add a new YouTube URL so it will trigger oEmbed and then disable editing, you'll see the YouTube video in its IFRAME. If you re-enable editing and make some changes, the YouTube URL gets replaced with the oEmbed IFRAME contents... this isn't great because it will create a new post revision. I just tested this on a new install with just FEE and FEE does not cause the YouTube URL to turn to an IFRAME when updating. I think this issue and the other issues caused by autosave revisions via wptexturize(), etc. (#42, #71) are because of the comment tracking code. My guess is the @christianwach - Do we need to copy the reader mode contents back into the editor? If we strip the paragraph |
@r-a-y The |
In response to the comment from @r-a-y above, I've been writing a custom method to selectively apply So, having discovered that
And then, like Ray, I revisited a vanilla WP FEE install. I had been under the impression that clicking the "Leave" button in the "The changes you made will be lost if you navigate away from this page" dialog would, well, discard the changes in the editor. However, the vanilla WP FEE install showed me that this wasn't that case at all. The changes in the editor remain when returning to the editor. I now see that it was actually the To my mind, WP FEE's behaviour is counter-intuitive. The "Leave" button does not suggest to me that the content of the editor remains unchanged, especially given the text in the dialog. I'm open to other people's views, however. The consequences seem to be:
Apologies if my brain dump is rather haphazard, but I hadn't expected that replacing |
Thanks for plugging away at this, @christianwach.
I certainly agree that the behavior isn't accurately described by the text of the dialog. What counts as "intuitive" in this case is not clear to me, though. I think it would be perfectly natural, for instance, if FEE didn't show the notice at all when clicking "Disable Editing", but only Setting aside the "proper" behavior of the Leave button for a moment, can you remind me what problem |
@boonebgorges Thanks for your feedback. The goal of 'changes.js' is to maintain (as best we can) the associations between comments and paragraphs during edits. However, in order to track changes to the editor content (and apply those changes to the As I tried to explain above, |
I'm afraid I don't agree with you here @boonebgorges. When I click "Disable Editing", I expect the visible content to show the content of the editor in "Read" mode. By default, FEE does not do this, which (for me) produces a strange, dissonant effect when toggling between "Read" and "Edit" modes thereafter. It then appears that I am not editing the content, but rather have two parallel "contents", which is true, but counter-intuitive - to me at least. |
I'm not saying that this seems wrong, just not that it seems obviously right. If I'm understanding the situation correctly:
Is it possible for us to accomplish 1 without changing the editor content? What if we had a paragraph map, built on |
Instead of comparing content, we set an `isDirty` flag whenever a change is detected. The flag gets set back to `false` on `fee-after-save`. This technique can result in some false positives, as when you change content but then undo that change. But it has a couple of benefits that outweigh this downside: * It warns the user about unsaved changes on the Settings panel, which FEE doesn't know about. * It allows us to modify the content of the editor at will, without worrying about FEE's `isDirty` checks. See #77, #71, #42.
Here's an attempt to sidestep the whole issue: 831e171 Requires the following modification to FEE: cuny-academic-commons/wp-front-end-editor@3dc1d47 One way of looking at our current problems is this: FEE determines dirtiness by comparing the editor content with the "original" content. My suggestion is that we stop FEE from doing this. Instead, we set an @christianwach @r-a-y Would appreciate your thoughts on this technique. |
@boonebgorges Very handy! I think the modification of FEE is logical regardless of what SP does with it. More generally, I think it could make sense to maintain an SP fork of FEE since it is a basic requirement of the project and FEE doesn't seem to be getting any TLC right now. Although it would be sensible to minimise the changes made to that fork. Hooking into |
@boonebgorges @r-a-y I've added a new branch called "no-copy" that handles oEmbeds by replacing For me, even without 831e171, it never seems to trigger the I haven't applied the new logic to cut/paste yet, so please just test with enter, delete and printing chars for now. EDIT: logic applied to cut and paste |
Thanks for your work on this, @christianwach. The approach looks good to me, and so far I haven't managed to make FEE throw any notices. Would appreciate a look from @r-a-y before merging. |
@boonebgorges Thanks for looking and glad it seems good to you. To clarify: my comment about it working without your I'll tackle |
I've tested the @christianwach - Merge at will! |
@r-a-y I fixed an edge case (when I have bumped an issue on the TinyMCE issue queue for the Gecko/Webkit difference in classes when merging paragraphs. This still needs to be addressed in SP's change-tracking code. For |
Ensure that responsive JS code loads when a user is logged out. See #77 (comment)
Most of the oEmbed providers I have tested work okay, though some have needed code tweaks in order that they don't cause a mismatch between Read and Edit modes. The following, however, is the scenario for Twitter embeds, which is giving me a right headache. NB, I am using a filter on <p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p> with <div><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></div> This at least removes the script container from the equation. Otherwise, it is parsed by IC but is not viewable due to the Read Modea) Inline Comments parses content before Tweet has been rendered In this case, IC picks up the two paragraphs in, for example: <blockquote class="twitter-tweet" width="550"><p lang="en" dir="ltr">Perspective <a href="https://t.co/GymOsgKll2">pic.twitter.com/GymOsgKll2</a></p>
<p>— Christian Wach (@interactivist) <a href="https://twitter.com/interactivist/status/666956609919320064">November 18, 2015</a></p></blockquote> These paragraphs are then removed from the DOM by the async Javascript, leading to subsequent paragraphs being numbered incorrectly. b) Inline Comments parses content after Tweet has been rendered IC picks up no paragraphs in the tweet, despite there being one, eg:
I presume this is because it's inside the Edit Mode:Sometimes the Tweet renders, other times it doesn't. a) On first clicking "Enable Editing", tweets do not render Example <div class="wpview-wrap" data-wpview-text="https%3A%2F%2Ftwitter.com%2Finteractivist%2Fstatus%2F666956609919320064" data-wpview-type="embedURL"><p class="wpview-selection-before"> </p><div class="wpview-body" contenteditable="false"><div class="wpview-content wpview-type-embedURL"><blockquote class="twitter-tweet" width="550"><p lang="en" dir="ltr">Perspective <a href="https://t.co/GymOsgKll2">pic.twitter.com/GymOsgKll2</a></p>— Christian Wach (@interactivist) <a href="https://twitter.com/interactivist/status/666956609919320064">November 18, 2015</a></blockquote><script async="" src="//platform.twitter.com/widgets.js" charset="utf-8"></script></div><div class="wpview-overlay"></div></div><p class="wpview-selection-after"> </p></div> b) On clicking "Update", the tweet renders I need to match the number of paragraphs in Edit Mode to the number in Read Mode. So, at present, I disallow any paras from being parsed in Edit Mode, but this leads to a mismatch when IC creates the bubbles before the tweet has been rendered. Conversely, if I allow two paragraphs within the Unfortunately, there is no way of knowing whether or not the Tweet has rendered when IC parses the content. So there is always the possibility of a mismatch - the result of which is that reassigning comments in Read Mode can produce incorrect associations. |
From http://commons.gc.cuny.edu/?p=44237
I haven't verified, but this should be checked
The text was updated successfully, but these errors were encountered: