fregante / GhostText

👻 Use your text editor to write in your browser. Everything you type in the editor will be instantly updated in the browser (and vice versa).
https://GhostText.fregante.com
MIT License
3.32k stars 115 forks source link

Ctrl+S in Sublime to click on submit button in Chrome #44

Closed radubr closed 9 years ago

radubr commented 9 years ago

Hi,

First off all congrats on the job well done.

I suggest a feature that when a user saves the file in Sublime it automatically clicks on the submit button on the related page in Chrome so it's update there also. It's best to keep the possibility to undo any changes.

Very useful for making live editing in WordPress and other CMSs. It skips the step of installing a plugin to do it every time.

Regards, Radu

fregante commented 9 years ago

Thanks, Radu. Unfortunately there are a few issues:

So while it may be feasible, it's not practical and introduces more issues.

Were you hoping to use this for the wp-admin/theme-editor.php page or in the post editor page (wp-admin/post-new.php)?

Cacodaimon commented 9 years ago
  • it could be as simple as textarea.form.submit.click() for <textarea> fields (like in WordPress' theme-editor.php page), but support for complex javascript editors and non-standard forms is more complicated

As long the code editor is nested into the right form this should be no problem, otherwise remote submission would be disabled.

  • how do we tell the user that this functionality might work on the current site or that it doesn't?

If the input area is nested into a from tag we could show the user if remote submitting is available or not.

  • supporting this means breaking the save functionality in the text editor.

Yes "overriding" the on save would be a bad idea but whats about a extra keyboard shortcut for submitting forms.

  • once you "save" the file, the form is sent, page reloads and GT connection is lost, so you might as well switch to the browser and click on the [Save] button yourself.

I only can agree with you!

So while it may be feasible, it's not practical and introduces more issues.

I'm not afraid about the issue but the practical reason is not clear at the moment.