User talk:Fred Gandt

From Wikipedia, the free encyclopedia
Jump to: navigation, search
House.svg Fred Gandt is currently in the process of moving home and has no idea which way is up.

Contents

Tracker tool[edit]

Hi Fred, thanks mucho for the watchUserContribs.js tool! I was going to write to you with a request for some way to ID pages that are already on my watchlist (perhaps with the cute watchlist star), but I see you took care of that with the slick blue border around the checkboxes. That's cool! Seems to be working fine. Many thanks and I plan to keep using it! Regards, Cyphoidbomb (talk) 16:28, 10 April 2016 (UTC)

You're welcome. Let me know if it goes wrong; there may be cases I've not accounted for.
I was going to add the watchlist stars, but it'd require more code, and processing and makes clutter. The outline gets the job done on the cheap :-)
FYI: If your watchlist is epic, the load time may be slowed significantly (API limits). If that is a problem, I can fix it, but would prefer to avoid it (it would have knock on effects that then also need solutions).
I'm always open to requests/suggestions if you ever need/want anything. I enjoy code :-) fredgandt 16:36, 10 April 2016 (UTC)
I haven't noticed any problems thus far. My watchlist is pretty epic with 8000+ pages, but so far so good. Cyphoidbomb (talk) 19:53, 10 April 2016 (UTC)
Wow! If that's 8000 excluding talk pages, that's 16000 titles to be fetched at 500 per API call - 32 requests before anything else can happen! I'll add session caching of the results. fredgandt 02:39, 11 April 2016 (UTC)
8,668, to be exact, excluding talk pages. Of course many of them are dead and not frequently used... I do notice that it takes about 7 seconds for the tool to fully load on Chrome. I do, however, have several other tools in my common.js, so that might be contributing. Cyphoidbomb (talk) 15:32, 11 April 2016 (UTC)
Yeah, that's 35 API requests @ approx. 200ms per call, so 7 seconds doesn't surprise me ;-)
I've tweaked the code a little already in advance of adding caching, and it should actually run a little faster, but the initial API requests to gather the watchlist for comparison aren't ever going to run any faster. They won't actually block the page from loading or being interactive, since the calls are dealt with asynchronously, but while they're going on in the background, the UI elements involved won't show.
The idea is to cache the watchlist, so subsequent page views will process almost instantly. I've not decided which storage solution to utilise yet though (pros and cons); once I've actioned the decision, the update will be pleasingly obvious.
There's an opportunity for some nifty side benefits to keeping a cached copy of your watchlist handy; like the ability to highlight links to watched pages, and/or un/watch from anywhere. If I choose to go down that route, I'll make that into a unique script, and have both feed off the same cache. fredgandt 16:39, 11 April 2016 (UTC)
@Cyphoidbomb: - I've added session caching with a major caveat. Any watch or unwatch action outside the operation of this script's functions will not affect the cache, which means, the cache and reality can become desynchronised. I have added a button to manually clear the cache, which you should use if you have reason to suspect the cache is inaccurate.
Example
  1. You're looking at a user's contribs in one tab, and looking at page histories in another tab.
  2. In the histories tab, you watch the page manually by clicking the star at the top, then go back to the contribs tab.
  3. At that point, the cache of your watchlist will be missing the page you just watched, so you should clear the cache.
Qs
Why didn't I make it so any watch actions were monitored and used to keep the cache in sync?
Because there are ways the watchlist can be updated that no JavaScript can keep track of; more than there being no guarantee it would work, it'd be guaranteed to fail.
Why use session caching instead of something more permanent?
Privacy, security and because the longer it lasts, the less useful it is per the above.
Why cache the watchlist at all?
Assuming you want to look at several pages worth each of several users' contribs (especially in the hunt for sockpuppets), without caching, the watchlist would need to be recompiled from many API requests on every page load. With caching (accepting the caveat), the watchlist is requested fewer times and possibly only once (depending on other activity).
Any questions or problems - let me know. fredgandt 00:52, 16 April 2016 (UTC)
I trust your judgment! Also, I'm not too sharp with the technicals. :D Many thanks! Cyphoidbomb (talk) 01:13, 16 April 2016 (UTC)

Tech News: 2016-15[edit]

20:45, 11 April 2016 (UTC)

"Edit wars" in LZ related articles[edit]

More nonsense similar to what you addressed at Talk:The Rain Song#Edit war over cited content has been going on at "Dazed and Confused"[10], "Beck's Bolero"[11], Peter Grant,[12], and maybe others. Besides temporary RfPPs, any ideas for a longer term solution? —Ojorojo (talk) 17:51, 14 April 2016 (UTC)

  1. Don't join in, reach out to the involved editors on their user talk pages softly warning them that they are edit warring and if they continue, they may be reported to WP:ANEW.
  2. Start a related talk page section specifically to tackle the dispute (per dispute), and {{ping}} the involved editors.
  3. Leave long gaps between messages to give editors a chance to read and think, then read and think again - and again.
  4. If you have an opinion, and as far as you're concerned you're right, someone else should arbitrate.
As for long term, policies and guidelines (yawn) can be found or drawn up (very long term) to establish exactly what, where, how etc. should be in articles. I'm on the fuzzy edge at the end of a long day right now, so don't fancy searching, but maybe look for a style guide for music/song articles, and if there isn't one, consider writing one and posting an RfC at WP:VPP for wider input to bring it up to consensus. Then that can be used to settle any disputes over content.
I'll pay more attention tomorrow. See ya then :-) fredgandt 18:11, 14 April 2016 (UTC)
Let's say, for sake of discussion, that this is just the work of one or two editors who is/are seeking to draw attention. They know the ins and outs of WP and use constantly changing IPs. Whatever the sources say is secondary, so discussing facts and references will make little difference. Established policies about verifiability, improper synthesis, neutral point of view, etc. are routinely ignored as would newly established ones. With the history at LZ articles, editors avoid discussions, such as this recent RfC. A situation such as this would require a different approach. —Ojorojo (talk) 21:29, 14 April 2016 (UTC)
@Ojorojo: - I've looked and am now watching. Ugly. There's no magic bullet, but verifiability not truth applies. However, especially on Peter Grant, the users should have been warned about their warring a long time ago. If it flares up again, I'll jump on it. fredgandt 01:00, 16 April 2016 (UTC)

Idea for a new JS script[edit]

Hi, Fred! From VPT I see, you like creating some javascript scripts for others :) May I suggest a new one? I would love to have a script OK, my home Wikipedia is another one, but that shouldn't be a reason not to have one here, too, that creates redirects. I have expressed my ideas about it here. OK, I have some more ideas, but they can wait :) Thoughts? --Edgars2007 (talk/contribs) 17:25, 18 April 2016 (UTC)

Am I correct in thinking you'd like to:
  1. Land on any page
  2. Desire to create a redirect to it
  3. Use a scripted tool to create the redirect page remotely
rather than
  1. Land on any page
  2. Use a scripted tool to create a redirect from there to another page
fredgandt 17:45, 18 April 2016 (UTC)
Yes, because the second one is basically the same, what is done currently (that is, a script wouldn't save basically any time). --Edgars2007 (talk/contribs) 17:49, 18 April 2016 (UTC)
Sure. I'll ping you when it's done. Don't hold your breath - I'm working on the other thing 'till it's done. fredgandt 17:51, 18 April 2016 (UTC)
@Edgars2007: - Not done yet. It's being built under teleDirect.js (name will probably change) and isn't even the complete GUI yet. I'm pinging to let you know that it could take a while. There are a lot of variables to be accounted for, and a lot to get wrong if I'm not careful. The next ping will be when it does something useful. No need to reply. fredgandt 19:29, 20 April 2016 (UTC)
@Edgars2007: - Just letting you know I haven't forgotten (and won't). fredgandt 23:18, 28 April 2016 (UTC)

This is not in hurry, of course. I know, you currently have other work to do. Just updated dialog window. Now I understood, that I don't have to use Paint, but can use MS Access :) Those "#Name?" are meant to be "First redirect" and "Second redirect" (by default at start only first one is shown, of course). Next three buttons to them are "Delete redirect", "Add new", "Copy this redirect to a new redirect". The buttons "A", "B", "C", "D" would be images. "A" would input in last (or the one, where cursor is set, if it's not too difficult) redirect pagename, "B" - pagenamebased title, C - well, in my Wikipedia it would input enwiki pagenamebased title (if there is such), here at enwiki it could be let's say dewiki pagenamebased title, "D" - I had something in my mind, but now I forgot it, but we can come up with some idea later :) --Edgars2007 (talk/contribs) 08:03, 22 May 2016 (UTC)

Acknowledged. Mind busy; I'll be back. Fred Gandt · talk · contribs 10:55, 22 May 2016 (UTC)
@Edgars2007: Sorry - I'm all over the place right now, but your request is not forgotten; it might just be a while.Fred Gandt · talk · contribs 00:25, 18 June 2016 (UTC)

Welcome to the Teahouse![edit]

Welcome to the Teahouse Badge Welcome to the Teahouse Badge
Awarded to editors who have introduced themselves at the Wikipedia Teahouse.

Guest editors with this badge show initiative and a great drive to learn how to edit Wikipedia.

Earn more badges at: Teahouse Badges

from: Elsa Enchanted (talk) 17:37, 18 April 2016 (UTC)

Techy things.[edit]

You told me to send you a message on your talk page about helping with techy things (on Template_talk:By_whom). I would love to help with techy things (I have done quite a bit of programming, and I love tech) I don't know much about what is used on MediaWiki (WikiMarkUp—I think—, HTML, CSS—Is it used?—, and javascript—I know a bit about this—) do I need to know some of this to help? Do you have a recommendation on where I can learn? Hungryce (talk) 18:42, 21 April 2016 (UTC)

Hi. There's a lot to summarize:
Templates
Templates work by transclusion, which is a way to include parts of another page where the template is called. The content of the transclusion is limited in all the same ways as all other wiki content.
Magic Words and Parser Functions allow us to create conditional templates utilizing a limited range of variables.
Lua has been introduced, further extending the possibilities by invoking modules to process data in many ways, more efficiently and logically than without.
HTML
There are limits to what HTML can be used in wiki markup.
CSS
Although we can create stylesheets for users (including ourselves) in our user space, which can be utilized by JavaScripts or included separately, there isn't yet a way to apply CSS in pages or templates. However, there is a light at the end of that tunnel will be archived soon. We can include inline styles in accepted HTML markup, which can also be transcluded.
Every registered editor has a common.css they can edit to affect the presentation of the relative MediaWiki site, and global.css (and .js) to affect ALL the wikimedia sites you're registered on. There are also skin specific CSS and JS pages.
JavaScript
We can create user scripts for ourselves and others within our user space. The common.js is where to start, then as with CSS, further resources can be created in subpages e.g. User:Example/example.js. JavaScript can call the ever present jQuery and built in MediaWiki library, and utilise the API.
So there's some info to get you started. Please feel free to ask for more. I will respond. fredgandt 21:57, 21 April 2016 (UTC)

Disambiguation link notification for April 28[edit]

Hi. Thank you for your recent edits. Wikipedia appreciates your help. We noticed though that when you edited List of Google easter eggs, you added a link pointing to the disambiguation page Carlsbad (check to confirm | fix with Dab solver). Such links are almost always unintended, since a disambiguation page is merely a list of "Did you mean..." article titles. Read the FAQ • Join us at the DPL WikiProject.

It's OK to remove this message. Also, to stop receiving these messages, follow these opt-out instructions. Thanks, DPL bot (talk) 10:29, 28 April 2016 (UTC)

User script request[edit]

Would it be possible to create a user script that automated the process of closing Requested moves discussions. Also, a script for accepting/declining WP:Articles for creation/Redirects requests? Thank you. Music1201 talk 23:25, 3 May 2016 (UTC)

Hi. Semi automating the closure of WP:Articles for creation/Redirects is relatively trivial, and I will happily make something for you, but Wikipedia:Requested moves/Closing instructions is a long page and the throbbing headache that accompanied the abscess in the back of my lower mandible I developed a few days ago makes it hard to muster the energy to read - so will have to wait.
I'll ping you. Fred Gandt (talk|contribs) 01:05, 4 May 2016 (UTC)
@Music1201: The first script - easy-AfC-Redirect-and-Category-Response.js is nearly done. I just need to establish the options for category request responses and weave them in. It currently outputs, to the browser console, what it would submit to the API as the section content. I'll ping again when I've finished. In the meantime, please try it and let me know if there's any problems. Fred Gandt (talk|contribs) 05:53, 7 May 2016 (UTC)
P.S. I've still got the edit response handling to do too (edit conflicts etc.). Fred Gandt (talk|contribs)
I tried the script and could not seem to get it working. After the dialog box comes up and I enter the page title and press okay it just exits the box and doesn't do anything. Music1201 talk 18:15, 7 May 2016 (UTC)
Correct. As I said above, it's not finished yet and outputs what would be submitted to the API to the browser console. It'll be finished later tonight (UTC). Fred Gandt (talk|contribs) 23:32, 7 May 2016 (UTC)
@Music1201: easy-AfC-Redirect-and-Category-Response.js is done. Everything happens behind the scenes. If you make selections, they WILL result in edits to the page, so be careful. If anything goes wrong, let me know.
I'll have a look at the other script at some point, but am really quite ill right now, and feel like curling up into a little ball and crying for my mummy to bring me soup. Unfortunately she's 250 miles away and I'm supposed to be a grown man :-( Fred Gandt (talk|contribs) 06:12, 8 May 2016 (UTC)
Thank you so much! Music1201 talk 06:18, 8 May 2016 (UTC)

Script: Copy/Paste tables from Word to Wiki[edit]

@Martinevans123: I'm adding this thread here to keep track of it. I'll let you know here when there's something to try. Fred Gandt (talk|contribs) 06:19, 8 May 2016 (UTC)

Many thanks, Fred. Martinevans123 (talk) 10:17, 8 May 2016 (UTC)
No problem. Did you see that someone linked to a bunch of tools that might do the job on your post on WP:VPT? If anything there does the job, there's little point me reinventing the wheel. Fred Gandt (talk|contribs) 11:40, 8 May 2016 (UTC)
Thanks for tipping me off. Yes, that seems to provide all I may need for now. Martinevans123 (talk) 12:39, 8 May 2016 (UTC)
Okay. Feel free to let me know if you ever need any technical things later; I like technical things :-) Fred Gandt (talk|contribs) 12:41, 8 May 2016 (UTC)
Cheers, Fred. Martinevans123 (talk) 12:43, 8 May 2016 (UTC)

Proposed deletion of List of Google easter eggs/see it[edit]

Hello, Fred Gandt. I wanted to let you know that I’m proposing an article that you started, List of Google easter eggs/see it, for deletion because I don't think it meets our criteria for inclusion. If you don't want the article deleted:

  1. edit the page
  2. remove the text that looks like this: {{proposed deletion/dated...}}
  3. save the page

Also, be sure to explain why you think the article should be kept in your edit summary or on the article's talk page. If you don't do so, it may be deleted later anyway.

You can leave a note on my talk page if you have questions. —swpbT 17:31, 13 May 2016 (UTC)

Hi. Yeah that was my error. I forgot that subpages are disabled in the mainspace. I wondered why the markup wasn't working as expected - duh. I've moved the functionality to {{see it}}, and blanked the content (except for the PROD) in the issue page.
To err is human - whoops! Fred Gandt · talk · contribs 19:26, 13 May 2016 (UTC)

My unexplaned action[edit]

Hello. I was very surprised to read your message now. I checked the history and I still do not know what happened. I did not do it intentionally, of course. Why will I remove some pages and add some another I never heared about them? I am a sysop, I do not play with such things. This particular edit has one purpose: undo revision 15495015. Why did it undo another 6 revisions (all from that one till current) - I have no idea. I am glad you found this bug (mine or editor's one, I don't know), and thank you very much for this. I did not wanted this, but still I am very sorry for troubles I made without knowing. Next time I'll know this can happened somehow and check changes even on undoing. Now I removed the redundant line manually. Thanks again. IKhitron (talk) 10:41, 24 May 2016 (UTC)

@IKhitron: I see. Well then, sorry for the grumpy tone of my message to you. It did not look like a mistake since the entries were so perfectly targeted. Very strange; these things are sent to try us!
Thanks for explaining; I feel better knowing it's unlikely going to happen again. It does highlight a potential problem that could realistically do with a solution. Perhaps fully protecting the page, and having a bot handle user requests to add and remove subscriptions? Fred Gandt · talk · contribs 11:12, 24 May 2016 (UTC)
Thank you again. I did not see any grumpy tone. Maybe because English and me are not such good friends. The solution you proposed is possible, but I can think about something much simpler: you (and maybe one or two people) add it to the watchlist. A mail that this particular page was edited should not come more than once a month, so it will not disturb. IKhitron (talk) 13:39, 24 May 2016 (UTC)
Done, but the bot option is a longer term solution with a faster response and unbiased result.
For public record: this conversation is about the tech news subscription page at meta. Fred Gandt · talk · contribs 22:16, 24 May 2016 (UTC)
Great. I did this too. IKhitron (talk) 22:34, 24 May 2016 (UTC)

Tech News: 2016-22[edit]

16:19, 30 May 2016 (UTC)

Tech News: 2016-23[edit]

20:51, 6 June 2016 (UTC)

Please comment on Wikipedia:Requests for comment/April Fools' 2[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Requests for comment/April Fools' 2. Legobot (talk) 04:26, 7 June 2016 (UTC)

Please comment on Template talk:Government misconduct accusations/doc[edit]

The feedback request service is asking for participation in this request for comment on Template talk:Government misconduct accusations/doc. Legobot (talk) 04:28, 8 June 2016 (UTC)

The Template:Rfd2 RfC[edit]

Just wanted to inform you that I requested a close for the RfC. Hopefully, the RfC gets closer soon so that whatever result can be implemented. Steel1943 (talk) 13:34, 10 June 2016 (UTC)

@Steel1943: thanks for letting me know. There are several minor improvements in the new code. If the decision is made to not update to the proposed thing (brain refuses to give me the word I want), those little tweaks can still be included. Gotta take dog out. See ya later!Fred Gandt · talk · contribs 14:09, 10 June 2016 (UTC)
@Steel1943: Didn't know this was going on. I haven't been at RfD much, but I've noticed the large amount of stuff Rfd2 dumps. I recently made a simplification to {{RMassist}}, which spit out a large amount of "template guts" that cluttered requests. I made a new template {{RMassist/core}} to hold this logic (couldn't put some of it in, like anchors), and let {{RMassist}} call it (Special:Diff/725435173/725447178). Part of what made the {{RMassist}} refactor easy is that WP:RM/TR doesn't hold on to requests, unlike daily RfD pages, so transclusions don't accumulate. It looks like {{Rfd2}} has much more complicated use cases though. I don't know if this post makes me involved in the RfC (probably not) but if no one is around to close it, I possibly can if I can find the time. --Andy�W.(talk·ctb) 01:07, 17 June 2016 (UTC)
I actually went ahead and closed the RfC. Special:Permalink/725657614. --Andy�W.(talk·ctb) 02:12, 17 June 2016 (UTC)
Thanks for the heads up Andy; I now think it's worth discussing making the proposed change but adding subst: to the call to {{rfd links}}. This would add a couple of cleanups and navigation features to the fully substituted output.
I'm pretty sure AnomieBOT can handle substituting {{rfd links}} in closed requests with a little tweak, but unfortunately Anomie didn't respond to pings. If anyone (maybe myself later) wants to start a new discussion about this, Anomie should be more directly contacted for input.Fred Gandt · talk · contribs 04:52, 17 June 2016 (UTC)
No one ever actually pang me there. This edit didn't ping because pings don't happen when you're adding subsections, and pings of the bot don't notify the operator.
AnomieBOT's existing substitution code cannot handle "only in closed discussions"; doing this would require custom code specifically for RfD. If you already have a bot clerking RfD, it would likely be better to see if that bot can add the substing to its duties instead of having two bots doing different parts of it. Anomie** 13:03, 17 June 2016 (UTC)
Sorry Anomie, that whole no pangs in a new sub-section thing went under my radar (and got lost under the desk), then you and your bot came up in conversation so often I just assumed (never works out well) you weren't interested. I did you a grave injustice and must be punished. Can I haz cake? I promise I won't like it ;-)
As for if there are already bots patrolling those pages - I have no idea; Steel1943 may or Oiyarbepsy? I still think it's trivial to ask the closing editors to do it... Fred Gandt · talk · contribs 13:22, 17 June 2016 (UTC)
In my opinion, an additional bot doesn't need to be closing the discussions and day subpages at RfD: other editors do that just fine. Also, RfD already has a bot doing some of the clerking: DumbBOT. Steel1943 (talk) 13:33, 17 June 2016 (UTC)
(edit conflict) It's no big deal, I just wanted to let you know I wasn't ignoring pings. I see User:DumbBOT maintains the list of subpages at Wikipedia:Redirects for discussion#Current list, although I don't know what (if anything) else it might do there or if there are already other clerking bots. Anomie** 13:35, 17 June 2016 (UTC)
So it looks like DumbBOT operated by Tizio would be best employed if ever desired/needed/wanted.
Steel1943, the idea isn't to have the BOT closing the discussions, just substing {{rfd links}} if ever employed as earlier proposed. The discussions would still be closed as normal - manually, then the BOT would come along and subst any unsubsted instances of the links. Fred Gandt · talk · contribs 13:44, 17 June 2016 (UTC)
About your first question, I'm not sure given that the aforementioned bot operator isn't very active on Wikipedia anymore. Steel1943 (talk) 13:51, 17 June 2016 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── Actually, @Steel1943: {{Rfd top collapse}} is "transcluded but not counted" when {{subst:Rfd top}} happens. I'm assuming you don't have a problem with this, since it's behind an #ifeq check, right? --Andy�W.(talk·ctb) 21:04, 17 June 2016 (UTC)

@Andy M. Wang:, I'm not so concerned with transclusions that are enclosed in "includeonly" tags since they only have potential to "mess up" the page which it is transcluded on. But, to answer a question you asked on your closing statement: Using a bot to substitute the transclusions of {{Rfd2}} may work, but the "when" for that should be "when the page's transclusion is removed from Wikipedia:Redirects for discussion". Steel1943 (talk) 21:09, 17 June 2016 (UTC)
I've emailed Tizio, outlining the events so far, and requested that if interested, they come and join the conversation. I made it clear that this was an open request, and to feel no pressure, so if they're not keen, they may not show up (fair enough).Fred Gandt · talk · contribs 00:22, 18 June 2016 (UTC)
Hi. I took a look at the issue, and while it seems a relatively easy task, it would be a new functionality for the bot. Given the little time I can spend on this nowadays, I'd prefer not to. Tizio 08:15, 18 June 2016 (UTC)
No problem Tizio; thanks for getting back to us. We now know more than we did :-) May the clock be kind to you. Fred Gandt · talk · contribs 08:19, 18 June 2016 (UTC)
@Steel1943: See Special:Diff/663597074. {{Relist}} is used at TfD, but note how it adds a transclusion of {{resize}} when substituted. It's probably not as big a deal as {{rfd links}} because it's used only occasionally, and not on every single discussion... but just an FYI. — Andy W. (talk ·ctb) 15:42, 25 June 2016 (UTC)

Please comment on Talk:Avedis Zildjian Company[edit]

The feedback request service is asking for participation in this request for comment on Talk:Avedis Zildjian Company. Legobot (talk) 04:30, 12 June 2016 (UTC)

Please comment on Wikipedia talk:In the news/2016 RD proposal[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:In the news/2016 RD proposal. Legobot (talk) 04:27, 13 June 2016 (UTC)

Tech News: 2016-24[edit]

18:41, 13 June 2016 (UTC)

Please comment on Wikipedia talk:Articles for deletion[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Articles for deletion. Legobot (talk) 04:28, 14 June 2016 (UTC)

Please comment on Talk:Imelda Marcos[edit]

The feedback request service is asking for participation in this request for comment on Talk:Imelda Marcos. Legobot (talk) 04:28, 18 June 2016 (UTC)

Javascript question[edit]

Hi! I have one quick question. So I have such script, that does many F->R. Is it possible to include some variable in replace text? That is, for line

sel = sel.replace( /\|(\s*)name(\s*)=(\s*)([^\n]*)/g, "|$1name$2=$3$4\n|$1origname$2=$3''$4''" );

I would like to use wgTitle instead of first $4. Easy? --Edgars2007 (talk/contribs) 06:54, 18 June 2016 (UTC)

Like
sel = sel.replace( /\|(\s*)name(\s*)=(\s*)([^\n]*)/g, "|$1name$2=$3" + mw.config.get( 'wgTitle' ) + "\n|$1origname$2=$3''$4''" );
 ? Fred Gandt · talk · contribs 07:14, 18 June 2016 (UTC)
S* :D That looked too wrong to try out :) Thanks! --Edgars2007 (talk/contribs) 07:35, 18 June 2016 (UTC)
 :-) No problem. If you're going to use that value multiple times, store it as var wgTitle = mw.config.get( 'wgTitle' ); in the appropriate parent scope. Then use it as "|$1name$2=$3" + wgTitle + "\n|$1origname$2=$3$4". Fred Gandt · talk · contribs 07:48, 18 June 2016 (UTC)
Yeah, thanks. --Edgars2007 (talk/contribs) 08:35, 18 June 2016 (UTC)

Part 2[edit]

Hi again! My next silly question. Why does this isn't working properly, that is, why padDigits('$2') returns "3", not "03"?

function padDigits(number) {
  number = number.toString();
  while (number.length < 2) number = "0" + number;
  return number;
}

sel = "1 min 3 s 1"

sel = sel.replace( /(\d+)\s*min\s*(\d+)\s*s\s*(\d+)/g, padDigits('$2') );
console.log(sel);//returns "3"

console.log(padDigits('3'));//returns "03"

Edgars2007 (talk/contribs) 07:10, 26 July 2016 (UTC)

Solution =
function padDigits( number ) {
  number = number.toString();
  while ( number.length < 2 ) number = "0" + number;
  return number;
}

sel = "1 min 3 s 1"

sel = sel.replace( /(\d+)\s*min\s*(\d+)\s*s\s*(\d+)/g, function( match, group1, group2 ) {
  return padDigits( group2 );
} );

console.log( sel ); //returns "03"
Reason = TBA (I will explain later)
console.log() the number argument inside the function, and you'll see that it's always $2 literal, rather than the matched digit(s). Fred Gandt · talk · contribs 16:42, 26 July 2016 (UTC)
As with most scripting concerns, the correct way to do something will depend on specific circumstances; there are many ways to skin a cat.
The following code will cut to the chase:
function padDigits( number ) {
  return ( number.length < 2 ? "0" : "" ) + number;
}

sel = "1 min 3 s 1"

sel = padDigits( sel.replace( /(\d+)\s*min\s*(\d+)\s*s\s*(\d+)/g, '$2' ) );

console.log( sel ); // returns "03"
When concatenating a number with a string, the number's variable type will be automagically changed to string since we can't do maths with strings, so it's assumed correctly) we mean to concatenate. Other mathematical operations including strings will try to use the strings as numbers, rather than the numbers as strings.
So there's no need to explicitly change the function's argument type, and there's no need to loop since it's only ever going to add 1 zero (or not).
The reason for the function not returning the padded 03 as expected, is that the padDigits( '$2' ) was processing the argument as a literal string, then returning it unchanged, then replace() acted on the return. We need to establish the value of the capture group before handing it to padDigits.
In my first solution, we can do all kinds of clever things to account for variable conditions, since we've got a safe zone to work in by the use of a function. The second simpler solution does exactly what you need, but has little wiggle room for development; it establishes the value from the capture group, then hands it to padDigits.
It will depend entirely on the specific circumstances as to which method suits best.
As for why replace works this way around: dunno; it just does. Fred Gandt · talk · contribs 01:13, 27 July 2016 (UTC)
Thanks for the code and explanation! Probably after some few hours searching Internet I would come to conclusion, that I have to place function in the replacement text, but... have other things to do :) In my case the first solution was the needed one, because I showed you only the essential part of my problem. The real thing looks like this. Again, thanks. --Edgars2007 (talk/contribs) 06:23, 27 July 2016 (UTC)

Part 3[edit]

One more problem/question. This time this is the script. After clicking "Rio props" in toolbar, window opens, where I can fill inputfields. What I would need, is some kind of button "Generate", which after pressing it stores all non-empty inputfields in some array/string (currently I don't care which one). --Edgars2007 (talk/contribs) 11:37, 28 July 2016 (UTC)

I haven't used the OOjs UI stuff at all, and would have to become familiar with it before I could make helpful suggestions. It will be more efficient for you to read and use the documentation, than for me to read it, so I can explain how to use it to you. It looks like you may be using the wrong type of dialog, and should perhaps employ a form inside a popup. Fred Gandt · talk · contribs 21:24, 28 July 2016 (UTC)
{{resolved}}. Found simple example with standart jQuery dialog window (now I start to know, what jQuery is :D ) and rewrote the script. I probably made it in the most unpretties way (I know, I will have to rewrite it as loop), but it works, what currently is the most important part. That means, that maybe you can put #Idea for a new JS script lower in your to-do-list, if it's not already on the last place in it :D Looks like I could try to create something usable, if not for enwiki use, then for my wiki. Anyway, thanks! --Edgars2007 (talk/contribs) 11:05, 29 July 2016 (UTC)

Tech News: 2016-25[edit]

19:14, 20 June 2016 (UTC)

Please comment on Wikipedia talk:WikiProject Photography[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:WikiProject Photography. Legobot (talk) 04:28, 21 June 2016 (UTC)

User page[edit]

Hi. Is "loath ignorance" on your user page intended to be a joke? The verb is loathe, of course. --MZMcBride (talk) 19:12, 22 June 2016 (UTC)

Nope, just a lack of knowledge. Corrected; thank you. Fred Gandt · talk · contribs 19:47, 22 June 2016 (UTC)

Please comment on Template talk:Infobox company[edit]

The feedback request service is asking for participation in this request for comment on Template talk:Infobox company. Legobot (talk) 04:24, 23 June 2016 (UTC)

Please comment on Wikipedia:Village pump (proposals)[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Village pump (proposals). Legobot (talk) 04:28, 25 June 2016 (UTC)

Please comment on Wikipedia talk:Featured picture candidates[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Featured picture candidates. Legobot (talk) 04:29, 26 June 2016 (UTC)

Tech News: 2016-26[edit]

15:42, 27 June 2016 (UTC)

Please comment on Talk:Pulse (nightclub)[edit]

The feedback request service is asking for participation in this request for comment on Talk:Pulse (nightclub). Legobot (talk) 04:29, 30 June 2016 (UTC)

Please comment on Template talk:Coat of arms[edit]

The feedback request service is asking for participation in this request for comment on Template talk:Coat of arms. Legobot (talk) 04:27, 2 July 2016 (UTC)

Tech News: 2016-27[edit]

19:45, 4 July 2016 (UTC)

Please comment on Wikipedia talk:Manual of Style/Titles[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Manual of Style/Titles. Legobot (talk) 04:27, 6 July 2016 (UTC)

Please comment on Wikipedia talk:Using archive.is[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Using archive.is. Legobot (talk) 04:28, 7 July 2016 (UTC)

Please comment on Template talk:Infobox company[edit]

The feedback request service is asking for participation in this request for comment on Template talk:Infobox company. Legobot (talk) 04:30, 8 July 2016 (UTC)

Please comment on Wikipedia talk:Moderators/Straw poll[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Moderators/Straw poll. Legobot (talk) 04:25, 9 July 2016 (UTC)

Tech News: 2016-28[edit]

15:14, 11 July 2016 (UTC)

Please comment on Wikipedia:Village pump (policy)[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Village pump (policy). Legobot (talk) 04:27, 12 July 2016 (UTC)

Please comment on Wikipedia talk:Gadget/proposals[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Gadget/proposals. Legobot (talk) 04:26, 14 July 2016 (UTC)

Please comment on Wikipedia:Village pump (proposals)[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Village pump (proposals). Legobot (talk) 04:25, 17 July 2016 (UTC)

Tech News: 2016-29[edit]

12:01, 18 July 2016 (UTC)

Please comment on Talk:Kingdom of Ulidia[edit]

The feedback request service is asking for participation in this request for comment on Talk:Kingdom of Ulidia. Legobot (talk) 04:24, 21 July 2016 (UTC)

Please comment on Wikipedia talk:Page mover[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Page mover. Legobot (talk) 04:28, 22 July 2016 (UTC)

Tech News: 2016-30[edit]

19:54, 25 July 2016 (UTC)

Please comment on Wikipedia talk:Disambiguation[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Disambiguation. Legobot (talk) 04:30, 26 July 2016 (UTC)

Please comment on Wikipedia:Administrators' noticeboard[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Administrators' noticeboard. Legobot (talk) 04:30, 28 July 2016 (UTC)

Please comment on Wikipedia:Administrators' noticeboard/CXT[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Administrators' noticeboard/CXT. Legobot (talk) 04:28, 30 July 2016 (UTC)

Tech News: 2016-31[edit]

21:48, 1 August 2016 (UTC)

Please comment on Talk:Gruffudd[edit]

The feedback request service is asking for participation in this request for comment on Talk:Gruffudd. Legobot (talk) 04:27, 3 August 2016 (UTC)

Please comment on Wikipedia talk:Non-free content[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Non-free content. Legobot (talk) 04:24, 7 August 2016 (UTC)

Tech News: 2016-32[edit]

15:41, 8 August 2016 (UTC)

Please comment on Wikipedia talk:Reference desk[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Reference desk. Legobot (talk) 04:26, 11 August 2016 (UTC)

Please comment on Wikipedia:Village pump (proposals)[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Village pump (proposals). Legobot (talk) 04:28, 12 August 2016 (UTC)

Tech News: 2016-33[edit]

19:37, 15 August 2016 (UTC)

Please comment on Wikipedia talk:Criteria for speedy deletion[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Criteria for speedy deletion. Legobot (talk) 04:27, 16 August 2016 (UTC)

Please comment on Template talk:Pull quote[edit]

The feedback request service is asking for participation in this request for comment on Template talk:Pull quote. Legobot (talk) 04:31, 17 August 2016 (UTC)

Please comment on Wikipedia:Village pump (proposals)[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Village pump (proposals). Legobot (talk) 04:25, 18 August 2016 (UTC)

Please comment on Talk:1[edit]

The feedback request service is asking for participation in this request for comment on Talk:1. Legobot (talk) 04:32, 20 August 2016 (UTC)

Please comment on Wikipedia talk:Manual of Style[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Manual of Style. Legobot (talk) 04:26, 21 August 2016 (UTC)

Tech News: 2016-34[edit]

21:18, 22 August 2016 (UTC)

Please comment on Talk:Jane Austen[edit]

The feedback request service is asking for participation in this request for comment on Talk:Jane Austen. Legobot (talk) 04:26, 23 August 2016 (UTC)

Please comment on Wikipedia talk:Route diagram template[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Route diagram template. Legobot (talk) 04:29, 26 August 2016 (UTC)

Please comment on Wikipedia:New pages patrol/RfC for patroller right[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:New pages patrol/RfC for patroller right. Legobot (talk) 04:30, 29 August 2016 (UTC)

Tech News: 2016-35[edit]

16:01, 29 August 2016 (UTC)

Please comment on Talk:List of senior officers of the Argentine Navy[edit]

The feedback request service is asking for participation in this request for comment on Talk:List of senior officers of the Argentine Navy. Legobot (talk) 04:26, 2 September 2016 (UTC)

Tech News: 2016-36[edit]

17:12, 5 September 2016 (UTC)

Please comment on Talk:New York[edit]

The feedback request service is asking for participation in this request for comment on Talk:New York. Legobot (talk) 04:26, 6 September 2016 (UTC)

Please comment on Talk:List of bus routes in London[edit]

The feedback request service is asking for participation in this request for comment on Talk:List of bus routes in London. Legobot (talk) 04:31, 10 September 2016 (UTC)

Please comment on Wikipedia talk:WikiProject Songs[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:WikiProject Songs. Legobot (talk) 04:24, 11 September 2016 (UTC)

Please comment on Wikipedia talk:Templates for discussion[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Templates for discussion. Legobot (talk) 04:31, 12 September 2016 (UTC)

Tech News: 2016-37[edit]

18:04, 12 September 2016 (UTC)

Please comment on Template talk:Infobox software[edit]

The feedback request service is asking for participation in this request for comment on Template talk:Infobox software. Legobot (talk) 04:27, 13 September 2016 (UTC)

Please comment on Wikipedia talk:Special:UnusedCategories[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Special:UnusedCategories. Legobot (talk) 04:29, 14 September 2016 (UTC)

Please comment on Template talk:Democratic Party (United States)/meta/color[edit]

The feedback request service is asking for participation in this request for comment on Template talk:Democratic Party (United States)/meta/color. Legobot (talk) 04:26, 15 September 2016 (UTC)

Please comment on Wikipedia:Requests for comment/Protect user pages by default[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia:Requests for comment/Protect user pages by default. Legobot (talk) 04:31, 16 September 2016 (UTC)

Please comment on Wikipedia talk:Featured list candidates[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Featured list candidates. Legobot (talk) 04:28, 17 September 2016 (UTC)

Tech News: 2016-38[edit]

22:08, 19 September 2016 (UTC)

Please comment on Talk:Orthopedic surgery[edit]

The feedback request service is asking for participation in this request for comment on Talk:Orthopedic surgery. Legobot (talk) 04:26, 21 September 2016 (UTC)

Please comment on Wikipedia talk:Harassment[edit]

The feedback request service is asking for participation in this request for comment on Wikipedia talk:Harassment. Legobot (talk) 04:27, 25 September 2016 (UTC)

Tech News: 2016-39[edit]

18:07, 26 September 2016 (UTC)