1
\$\begingroup\$

I have a problem when posting an answer to a question that already have several answers and/or several comments:

The "post your answer" form sits on bottom, the answer is on top. There is an awful lot of "clutter" between them, that are not needed for the act of posting a new answer (yes, I've read the other answers and comments, what I am about to write is original).

I have a very short short term memory and hate to scroll all the way up and down to read question and write answer text.

Write a script or program that

  • Can run on vanilla (downloaded from the main page for those softwares) Firefox and/or Chrome (irrelevant if it also runs on other browsers or on all browsers)
    you get 10 fake internet points from me if it runs on all browsers, but this is not a victory condition

  • You can call any code that ships with the browser, loads with the SE page (like jQuery) or sideloads from the web.

  • Can be run (as a bookmarklet, from console, any input method) on a fresh install of one of those two browsers.

  • Does not depend on any other software installed on the machine, or the installation of any add-ons and/or plugins on the browsers.

  • Irrelevant if it runs only on windows, only on mac or only on linux, as long as those browsers can be downloaded from the browsers' official download page, for that platform.

  • Does not break the submit answer form (I can still write my answer and submit, and the whole edit toolbar is still intact - including the help icon).

  • Question is intact. Title, body, votes panel, post menu and owner signature.

(italics denote editted-in content)

  • vertical Distance between bottom of owner signature and the top of edit toolbar is the same or smaller (negatives allowed) than when posting the first answer to a question in the same site.

  • Edit form toolbar cannot be higher than the question title.

    • both question, answer edit form, answer toolbar and answer preview have to remain visible and non-overlapping.
  • Only the screen display matters. If the other elements were hidden, deleted, moved, ejected into outer space or phase-shifted into a Dirac Sea is irrelevant.

Your code must work for a minimum of:

This is , so the shortest code in bytes will win!


I am now required to link this question for the exerpts' credits. Thanks @Doorknob.

P.S.: It is my first time in PpCG, be kind.

\$\endgroup\$
  • \$\begingroup\$ What about an approach which moves the question? E.g. inject <style>.question{position:fixed;height:300px;background:white;overflow:auto}body{padding-top:300px}</style> into the header? \$\endgroup\$ – Peter Taylor Oct 3 '14 at 13:58
  • \$\begingroup\$ Have to add "both question, answer edit form, answer toolbar and answer preview have to remain visible and non-overlapping. Sorry for any confusion my newbieness caused. \$\endgroup\$ – Mindwin Oct 3 '14 at 14:04
  • \$\begingroup\$ @Mindwin Your rule changes have invalidated more than one answer. Next time, consider posting your challenge to the Sandbox before posting it here. You'll get feedback from the community that will help you avoid changing the rules after the challenge has started. I'm not sure why you felt the need to add "non-overlapping" as a rule. \$\endgroup\$ – Rainbolt Oct 3 '14 at 14:12
  • \$\begingroup\$ I agree with @Mindwin that no overlapping was implied already. \$\endgroup\$ – Optimizer Oct 3 '14 at 14:26
  • \$\begingroup\$ The down votes are mostly because the challenge is not interesting enough and it is a language specific task. That combination is really hated. \$\endgroup\$ – Optimizer Oct 3 '14 at 14:33
4
\$\begingroup\$

JavaScript, 35 34 bytes

$(answers).before($('#post-form'))
\$\endgroup\$
  • 1
    \$\begingroup\$ If only the #post-form id did not have - in it ... \$\endgroup\$ – Optimizer Oct 3 '14 at 15:37
2
\$\begingroup\$

JavaScript (38 bytes)

$('#question').append($('#post-form'))
\$\endgroup\$
  • \$\begingroup\$ This could be shortened by copying Optimizer's trick of exploiting browser lifting of elements with suitable ids to global variables as $(question). etc. \$\endgroup\$ – Peter Taylor Oct 3 '14 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.