globalvoices / NewsFrames-Code

Code for the NewsFrames Platform available at newsframes.org
https://newsframes.globalvoices.org
Other
2 stars 1 forks source link

Adding MC word image makes the para wrap to the image width in etherpad #8

Open shrutimehta13 opened 6 years ago

shrutimehta13 commented 6 years ago

Browser: Firefox

  1. Create a pad. Enter multiple paragraphs
  2. Add to pad a MC word image
  3. Observe the para before which the image was added

Observed Result: Para shows wrapped up as per the image width

firefox-on add image see para

It gets corrected in ether pad only after some character is added to this paragraph

firefox-after add char to para
connieimdialog commented 6 years ago

just to clarify @shrutimehta13, it can be fixed by going in and adding hitting return or some space?

@sapraaman is this easily fixable by adding a
or

after the image upon insert, or?

sapraaman commented 6 years ago

Will try

connieimdialog commented 6 years ago

so i'm taking it that adding

before and after the image insert didn't work, yes? just confirming @sapraaman

sapraaman commented 6 years ago

@connieimdialog , the issue is that ep_copy_paste_images plugin get the callback and adds stuff for us. I was able to fix the weird cursor by adding < p / > before and after span tags it adds in ep_copy_paste_images code. One option is that we remove that plugin and copy/paste all the functionality in our plugin, remove ep_copy_paste_images and go from there. What do you think ?

connieimdialog commented 6 years ago

i don't exactly understand how this impacts what we currently have: what are we losing/how does the work around work?

sapraaman commented 6 years ago

@connieimdialog in etherpad, a plugin registers callbacks, like callback when image is encountered, callback when html is being generated etc. We are already using a plugin called ep_copy_paste_images which registers callbacks to deal with images (to support drag/drop). So to fix the issues we are facing, we will have to debug and modify the code for this plugin.

connieimdialog commented 6 years ago

ok, thanks for one more clarification @sapraaman : so the weird cursor thing is supposed to be fixed, from your comment above? is that in staging? or

sapraaman commented 6 years ago

Hey @connieimdialog sorry for not clarifying it. No, I tried modifying ep_copy_paste_images plugin locally to see if weird cursor thing gets fixed, and it does. However, those changes were not checked in or deployed on staging.

Do we want to go that route of maintaining a third party plugin? Should I make the change locally without checking in the code and deploy on staging for you to test ?

connieimdialog commented 6 years ago

somehow my response from yesterday didn't get logged, drat Github. Yes, i would like to test, @sapraaman

sapraaman commented 6 years ago

@connieimdialog its on staging. Weird cursor issue gets fixed partially with this fix.

connieimdialog commented 6 years ago

@sapraaman @shrutimehta13 -- i followed shruti's steps above but didn't get the weird formatting issue, see for example http://gv-stage.dev.colab.coop/projects/48

maybe this bug is fixed, or fixed enough?

-- weird cursor image fix, i think i'm ok with this --it's workaroundable. i think that would close #6 for the most part.

thoughts?

sapraaman commented 6 years ago

@connieimdialog please note this fix was temporary, and was done in ep_copy_paste_images plugin. If you are ok with that fix, we can checkin the plugin code in our repository with the fix.

CrisNelson commented 6 years ago

Connie is okay with modifying the third party plug-in.

sapraaman commented 6 years ago

@shrutimehta13 same comment as #6 and #14 . Please test once and let us know

shrutimehta13 commented 6 years ago

@sapraaman Reproducible and now on all browsers (chrome/safari/firefox)

screen shot 2018-07-11 at 5 55 27 pm