MediaWiki talk:Gadget-teahouse/content.js

Edit Request
I'd like someone to remove the added newline to the posted question. It would entail changing line 49 from:

to:

that is, deleting the.

This would resolve a bug where each question asked through this gadget adds an extra newline above it; these newlines accumulate as more questions are added and mess up the spacing of the page. Thanks. Writ Keeper &#9863;&#9812; 14:48, 10 April 2012 (UTC)

Edit request
Can someone replace  with  ? The script goes crazy if more than one .mw-editsection element is present in a headline (e.g. if another script adds something to the header, to be styled identically). Nothing will change in the typical case. Keφr 12:02, 23 May 2013 (UTC)
 * I still think that this script should be tied to .mw-headline and not .mw-editsection which would avoid this situation entirely. People are responding to/joining the section using a custom script/edit box, not directly editing the page like if they were using the [edit] link.  Technical 13 (talk) 12:40, 23 May 2013 (UTC)
 * Yes check.svg Done. I've fulfilled the request as Keφr stated it for now, with no prejudice against further improvements in line with Technical 13's suggestion. — Mr. Stradivarius  ♪ talk ♪ 12:32, 31 May 2013 (UTC)

Interface edit request (May 31, 2013)
Please change: to: This will fix the bug as seen in the edit summary of as can be seen in  based on test edits using the code in my test script I created just for this purpose. Thanks. Technical 13 (talk) 23:13, 31 May 2013 (UTC)
 * Yes check.svg Done. Thanks for your work! — Mr. Stradivarius  ♪ talk ♪ 02:10, 1 June 2013 (UTC)

Edit request
I would do this myself but I am not proficient with javascript. Per Wikipedia talk:Teahouse/Archive 7, please replace:
 * On Wikipedia, you should sign all of your posts by ending them with four tildes (~)

With:
 * On Wikipedia, you should sign all of your non-article posts by ending them with four tildes (~)

Please add directly below this, using some kind of a break, the following text in a smaller font:
 * (Note: this question submission form will not work without them.)

Thanks.--Fuhghettaboutit (talk) 00:59, 18 July 2013 (UTC)

WITH:
 * , simply replace:
 * Technical 13 (talk) 02:14, 18 July 2013 (UTC)
 * Thanks Tecnical. I was mainly concerned that the small text had to be (or was better done) in a different way in javascript than the normal method and wasn't sure of the line break would be before or after the ask my question text--Fuhghettaboutit (talk) 02:36, 18 July 2013 (UTC)

Edit Request 15 Aug 2013
Please replace:

With:

This will put a bullet at the front of every response to the question which I feel is needed as it is kind of hard to see one user's answer from another, and I expect it is even more difficult for a new user. Thanks Technical 13 (talk) 12:42, 15 August 2013 (UTC)
 * Red information icon with gradient background.svg Not done: per WP:TPYES, bullets do not yield standard indentation. -- Red rose64 (talk) 15:06, 7 September 2013 (UTC)


 * Bullets
 * Do indeed
 * Yield a standard indentation. WP:INDENT is only and essay and mentions nothing of not using bullets as an indentation type. Technical 13 (talk) 03:01, 24 December 2013 (UTC)
 * Red information icon with gradient background.svg Not done: Sorry, but now that we have disagreement about the change, enacting it without discussion would be controversial. Could you ask people at the Teahouse what they think? If there's a consensus from a discussion there, I'd be willing to enact this. Best — Mr. Stradivarius  ♪ talk ♪ 05:49, 24 December 2013 (UTC)

Edit Request 26 Aug 2013
Please replace: with: so that the new question name will be a section link in the edit summary. Thanks! Technical 13 (talk) 14:37, 26 August 2013 (UTC)
 * Red information icon with gradient background.svg Not done: please establish a consensus for this alteration before using the template. That would make the edit summary even more non-standard. Why is the standard edit summary for a new thread - which would be coded as


 * not being used? Placing the section heading between comment markers creates a link automatically. -- Red rose64 (talk) 15:11, 7 September 2013 (UTC)


 * That would be fine. The purpose of the edit request is to add a link to the summary by whatever means acceptable. Technical 13 (talk) 16:30, 7 September 2013 (UTC)
 * Yes check.svg Done -- Red rose64 (talk) 18:45, 7 September 2013 (UTC)


 * This change broke a lot of my logging scripts. HostBot keeps track of questions and answers on the Teahouse Q&A board, and it depends on a consistent edit comment format to identify Q/A pairs. I can update the scripts, but it'll take a bit of time. My bad for not documenting these dependencies better; I'll do that from now on. However, is there a good place for me to place a request to be notified about proposed changes to this script in future? Any advice is appreciated. Cheers, - J-Mo  Talk to Me   Email Me  19:47, 16 September 2013 (UTC)

Section headings with a wikilink
If the section heading contains a wikilink then the automatic edit summary contains html code for the link. See [//en.wikipedia.org/w/index.php?title=Wikipedia:Teahouse/Questions&diff=prev&oldid=587456743]. The section heading was  but the edit summary contained. If the normal "edit" link at the section is clicked then MediaWiki makes the prefilled edit summary  which makes a correct link to the section on the arrow "→‎" at the edit summary. It's not a big deal. If it's hard to fix then we can live with the issue. PrimeHunter (talk) 02:20, 24 December 2013 (UTC)
 * Okay, so I looked this over and the fix would look something like appending:
 * with the following code


 * which will check if there is a link in the header and replace the html with the proper wikilink version. This will find and replace only the first wikilink in each section header, if there are more than one, there will still be an issue.  I'll work out how to get all of the links in a bit, but figured I'd offer this to start so you would know it can be done fairly easily.   Technical 13 (talk) 03:47, 24 December 2013 (UTC)


 * A wikilink in the header should not be reproduced. The link code should be removed completely, exactly like MediaWiki did in [//en.wikipedia.org/w/index.php?title=Wikipedia:Teahouse/Questions&diff=587466505&oldid=587462083] when editing  became , and an arrow "→‎" with a section link is automatically made when the edit is viewed, as described at Edit summary. PrimeHunter (talk) 04:10, 24 December 2013 (UTC)
 * , I was actually more worried about multiple differnt links in the header, your concern is easily fixed (and shortens the code a hair). The fix would look something like appending:


 * with the following code


 * which will check if there are links in the header and replace the html with raw text for each link. See a working truncated example in this jsfiddle. Technical 13 (talk) 04:39, 24 December 2013 (UTC)

Edit Request 29 Jan 2014
As you can see in this screencast, there seems to be some z-index problem related to this script. Helder 12:11, 29 January 2014 (UTC)
 * Red question icon with gradient background.svg Not done: please be more specific about what needs to be changed. -- Red rose64 (talk) 12:56, 29 January 2014 (UTC)
 * See also WP:Village pump (technical)#Unable to copy at the Teahouse. Helder 13:23, 29 January 2014 (UTC)
 * Yes, I saw that: but it still doesn't indicate how the script should be amended. -- Red rose64 (talk) 13:41, 29 January 2014 (UTC)

Update request (October 2014)
Hi. Please sync this page with testwiki:MediaWiki:Gadget-teahouse/content.js. This is related to this discussion. Thanks. --MZMcBride (talk) 04:48, 13 October 2014 (UTC)
 * I did it. --Closedmouth (talk) 05:03, 13 October 2014 (UTC)
 * Heh, my bad. There's a bit of debugging code left in there. You can remove the "console.log" line. &lt;3 --MZMcBride (talk) 05:16, 13 October 2014 (UTC)
 * Yes. --Closedmouth (talk) 05:19, 13 October 2014 (UTC)

Protected edit request on 9 January 2017
References to  on lines 43, 58, 147, 167 and 181 need to be changed to   to reflect the recent page move. As it is, the Teahouse gadget is completely broken. –&#8239;Joe (talk) 10:50, 9 January 2017 (UTC)
 * Yes check.svg Done -- Samtar talk &middot; contribs 10:59, 9 January 2017 (UTC)

Edit request April 6, 2017
The discussion Wikipedia talk:Teahouse resulted in a decision to have new questions posted at the bottom of the page rather than the top. There is some confusion about how to implement this. See Wikipedia talk:Teahouse. If this is the place to make the change, please do so. Thankyou. StarryGrandma (talk) 18:07, 7 April 2017 (UTC)
 * Discussion here is fine, once the technical code change is ready feel free to reactivate the edit request so patrolling administrators can implement it. — xaosflux  Talk 12:36, 15 April 2017 (UTC)
 * Hi where would we find someone who understands the current code and can figure out how to change it to get the desired result? Roger (Dodger67) (talk) 12:59, 15 April 2017 (UTC)
 * perhaps recent editors to the page: - if not, try WP:VPT. —  xaosflux  Talk 14:23, 15 April 2017 (UTC)
 * Thanks for the ping! Hmm, who I would first have thought of, Werdna (obviously, as the original coder), is inactive. No I am not competent to oversee this (though I am happy to implement a plan if provided). I can sometimes figure out technical stuff just by its internal logic, by playing around and emulation but I'm charitably a dilettante. However, I know of a few users who are wizes. Hope none of them mind these pings:  and .--Fuhghettaboutit (talk) 15:08, 15 April 2017 (UTC)
 * Sorry, JavaScript is outside my area (I'm good for Lua modules). Johnuniq (talk) 00:14, 16 April 2017 (UTC)
 * I've just changed the gadget to add new questions at the bottom. In the end, the necessary edit was pretty simple (although not helped by my backwards edit summary...). — Mr. Stradivarius  ♪ talk ♪ 06:52, 16 April 2017 (UTC)
 * , thank you very much. StarryGrandma (talk) 08:54, 16 April 2017 (UTC)

Huh, I argued many years ago against top-posting. I guess everyone else has now come around as well. Mr. Stradivarius: if you're interested, the code could be improved to be more efficient. MediaWiki naturally supports appending sections to a page. This script hacked around the limitation/inability to top-post sections in MediaWiki by getting the existing revision text and then prepending to it. Instead of doing this, we could use section=new, as documented in . This would obviate the need to grab the existing revision text and would automatically handle the edit summary instead of manually concatenating/emulating the new section edit summary. --MZMcBride (talk) 05:47, 23 April 2017 (UTC)
 * Thanks for the tip! That saved 507 bytes of code. — Mr. Stradivarius  ♪ talk ♪ 08:15, 23 April 2017 (UTC)

Remove from gadgets?
This gadget is no longer used, as the "Ask a question" button at Teahouse now uses mw:Extension:DiscussionTools. In addition, it will be broken by the upcoming mw:Heading HTML changes. It should either me removed or userfied. --Ahecht (TALK PAGE) 15:51, 12 June 2024 (UTC)