itsalltext icon indicating copy to clipboard operation
itsalltext copied to clipboard

IAT! doesn't work with GMail's new compose experience

Open jkakar opened this issue 11 years ago • 40 comments

I wouldn't expect it to because it doesn't use a textarea anymore. It seems to use a body element like so:

<body id=":lm" class="editable LW-avf"
      style="min-width: 0px; width: 577px; border: 0px none; margin: 0px;
             background: none repeat scroll 0% 0% transparent; height: 100%;
             overflow: hidden; direction: ltr; min-height: 420px;"
      hidefocus="true" g_editable="true" role="textbox"></body>

I haven't done enough investigation to see how easy or hard it would be to special-case IAT! to make editing the content here possible, but I did notice that it seems to represent the text as HTML DOM elements... which isn't so promising.

Anyway, I suspect editing content in GMail is a primary activity for IAT! users so it'd be nice if we can find a way to make it work with the new compose experience.

jkakar avatar Mar 30 '13 02:03 jkakar

I suppose a workaround for this issue, when the new compose experience becomes the default and the old one goes away, would be to use GMail's basic HTML mode, but that means no keyboard shortcuts among other things:

http://support.google.com/mail/answer/15049?hl=en

jkakar avatar Mar 30 '13 02:03 jkakar

I find a solution by using having 2 shorcuts to my gmail, one using the simple html version of gmail and the other the full version (ajax), if I want to use it's all text I click on the simple html version

2013/3/30, Jamu Kakar [email protected]:

I wouldn't expect it to because it doesn't use a textarea anymore. It seems to use a body element like so:

<body id=":lm" class="editable LW-avf"
      style="min-width: 0px; width: 577px; border: 0px none; margin: 0px;
             background: none repeat scroll 0% 0% transparent; height:
100%;
             overflow: hidden; direction: ltr; min-height: 420px;"
      hidefocus="true" g_editable="true" role="textbox"></body>

I haven't done enough investigation to see how easy or hard it would be to special-case IAT! to make editing the content here possible, but I did notice that it seems to represent the text as HTML DOM elements... which isn't so promising.

Anyway, I suspect editing content in GMail is a primary activity for IAT! users so it'd be nice if we can find a way to make it work with the new compose experience.


Reply to this email directly or view it on GitHub: https://github.com/docwhat/itsalltext/issues/36

viaa avatar Mar 30 '13 14:03 viaa

@viaa: what are the shortcut URLs? Thanks.

ntc2 avatar Apr 02 '13 22:04 ntc2

basic html view url: https://mail.google.com/mail/h/ full view: http://www.gmail.com

2013/4/3 Nathan Collins [email protected]

@viaa https://github.com/viaa: what are the shortcut URLs? Thanks.

— Reply to this email directly or view it on GitHubhttps://github.com/docwhat/itsalltext/issues/36#issuecomment-15805711 .

viaa avatar Apr 03 '13 10:04 viaa

I'm an "me too" for this issue...

robertII avatar Apr 30 '13 13:04 robertII

If I recall correctly, Pentadactyl's shortcut for editing in an external editor (gvim by default, of course) does work in Gmail's new compose window, maybe their source code could serve as inspiration.

oantolin avatar Jul 05 '13 02:07 oantolin

Vimperator's shortcut key for editing in an external editor does work too, in the sense that it opens the external editor (emacsclient in my case) but the buffer that is opened is not empty; it contains the body element noted in the first comment here. Deleting the body element and writing in the emptied buffer does not help: Upon future edits (from Gmail to external editor) the same body element appears with the new text embedded in the buffer. One hack I can think of is to write a hook in Emacs to remove everything but text every time we go to a buffer. But first IAT must be able to open the external editor as it used to (and as Vimperator or Pentadactyl do).

0mid avatar Jul 24 '13 20:07 0mid

Gmail rolled out the new compose today so I had to fix this. Not sure it's an acceptable solution but the patch is available at: https://github.com/patjak/itsalltext/commit/2e671f65745466d1aff71c6443df706a6c90f0c5

patjak avatar Aug 15 '13 22:08 patjak

Thanks Patrik!

ITA maintainers: will this patch make it into the official ITA and then an add-on update soon, or should I install Patrik's fork from source (not sure how to do this with Firefox add-ons) if I want to run this feature soon?

On Thu, Aug 15, 2013 at 3:21 PM, Patrik Jakobsson [email protected] wrote:

Gmail rolled out the new compose today so I had to fix this. Not sure it's an acceptable solution but the patch is available at: patjak@2e671f6

— Reply to this email directly or view it on GitHub.

ntc2 avatar Aug 15 '13 22:08 ntc2

I'll take a look at it this weekend.

docwhat avatar Aug 16 '13 13:08 docwhat

There's a problem with my approach though. I'm fetching the "innerHTML" which contain HTML entities instead of pure text. Gonna see if I can get innerText / textContent instead.

patjak avatar Aug 16 '13 14:08 patjak

@patjak

It only works for me with the to/cc line.

If I could tell when the editor exited a better approach would be to write a separate plugin that calls IAT and gets text back. However, Firefox doesn't support that. :-(

Ciao!

docwhat avatar Aug 17 '13 02:08 docwhat

@docwhat Did you try the hot-key? The gumdrop doesn't appear for me though it is added in the DOM tree. Don't know how to catch the "editor exit" either, though I don't see how it's related to this issue. I'm using Firefox 23 if that is any help.

Thanks

patjak avatar Aug 17 '13 13:08 patjak

No I didn't try the hot-key. I did try the context menu and it was missing as well.

The "editor exit" thing was just me being annoyed at Firefox. :-)

Ciao!

Christian Höltje http://docwhat.org/

On Aug 17, 2013, at 9:44 AM, Patrik Jakobsson [email protected] wrote:

@docwhat Did you try the hot-key? The gumdrop doesn't appear for me though it is added in the DOM tree. Don't know how to catch the "editor exit" either, though I don't see how it's related to this issue. I'm using Firefox 23 if that is any help.

Thanks

— Reply to this email directly or view it on GitHub.

docwhat avatar Aug 17 '13 15:08 docwhat

Is the patch actually working welll? I've been contemplating downloading manually building IAT! to try it out but haven't made time for it... since it sounds like there are issues I thought I'd ask before going ahead with that.

jkakar avatar Sep 01 '13 18:09 jkakar

I need to sort out converting html entities (&amp stuff) back and forth between the editor and gmail. Other than that it seems ok.

patjak avatar Sep 03 '13 19:09 patjak

Patjak: what is the "it" that seems OK? Is there a version of IAT that (mostly) works with the new Gmail?

robertII avatar Sep 18 '13 09:09 robertII

A user review mentioned IAT works if you use Old Compose to get to the old compose window in GMail. I haven't tried it, but it looks helpful.

docwhat avatar Sep 24 '13 14:09 docwhat

The "Old Compose" Firefox extension (which is available via the normal FIrefox add-ons mechanism) does indeed get you back to the old textarea-based "compose" interface and, unsurprisingly, IAT works just as it ever did.

I guess that makes this a less urgent issue, for me at least. But a fix to work with the new interface would still be a Very Good Thing.

robertII avatar Sep 27 '13 09:09 robertII

Watch out! The new version of "Old Compose" that is now in beta does not seem to support IAT.

So if you are using it as a way to keep IAT functionality for email, contact them now and squeal!

robertII avatar Feb 18 '14 11:02 robertII

I don't know how to build Firefox extensions and install them locally, so I haven't tried @patjak's patch yet. Will it be included in It's All Text!? If the problem is that it get's you HTML instead of plain text, I'd like to remark that I don't believe that's a problem:

  1. GMail's new format really is HTML, why pretend it's not?

  2. Good text editors help either by a) providing support for editing HTML markup or b) more radically, by hiding the HTML tags and letting you edit as if the text were plain.

    For example, Emacs has gmail-message-mode that will let you edit a GMail HTML message as if it were Markdown (by transparently converting to and from HTML when you load and save). This is even better than somehow faking a pure plain text message, because you can still just use plain text if you want to, but additionally you could include, say, nicely formatted links (when emailing someone who doesn't mind formatted messages).

It think it would be great if It's All Text worked in the new GMail compose window giving me HTML to edit, and left it up to me how to deal with that.

EDIT: Instead of learning the proper way to make my own local version of the extension with @patjak's patch, I tried just unpacking and editing the extension. That works! I simplified the patch a little bit so that it doesn't muck around with the HTML and am now happily using it.

oantolin avatar Jun 22 '14 18:06 oantolin

Nice. I've been using http://oldcompose.com/ and that allows me to use an unmodified IAT! I also prefer the old experience, so it's kind of a double win.

jkakar avatar Jun 23 '14 00:06 jkakar

@oantolin So are you using the hot-key then?

docwhat avatar Jun 24 '14 15:06 docwhat

Yes, @docwhat, and not just for the GMail compose box, but everywhere. I configure It's All Text with no buttons and alt-Enter as the hot-key. (I prefer to use the keyboard for as much as I can, because it feels much faster than using the trackpad on my laptop.)

oantolin avatar Jun 24 '14 15:06 oantolin

As the author of gmail-message-mode (mentioned by @oantolin) I'd love to see something like @oantolin's solution implemented. It's not necessary to hack into the html and convert it, just let the editor take care of that.

Malabarba avatar Aug 08 '14 22:08 Malabarba

@oantolin Could you please publish your modified patch somewhere? I'd like to try it, as your approach (IAT without HTML modifications + gmail-message-mode) seems to be the cleanest IMO.

ffevotte avatar Aug 11 '14 08:08 ffevotte

@ffevotte Spurred on by your request I learned a tiny bit of github and git, just enough to fork @patjak's repository, make the tiny change I made and publish it on github. Here's the diff.

oantolin avatar Aug 11 '14 19:08 oantolin

Thanks a lot! I can confirm that @oantolin's patched version of IAT! works perfectly well along with @Bruce-Connor's gmail-message-mode

I can only second @Bruce-Connor's wish to see @oantolin's patch merged in the next official IAT! version.

ffevotte avatar Aug 12 '14 10:08 ffevotte

I'll take a look in a bit. I'm at a conference at the moment.

docwhat avatar Aug 16 '14 14:08 docwhat

@ffevotte could you share the patched addon somewhere? (linux binary in case it's possible).

memeplex avatar Aug 27 '14 23:08 memeplex