Wikipedia talk:User scripts/Archive 5
![]() | This is an archive of past discussions on Wikipedia:User scripts. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | ← | Archive 3 | Archive 4 | Archive 5 | Archive 6 | Archive 7 |
Protection and management of scripts?
See discussion at Village Pump (policy)#Protection and management of scripts?. Relevant to Lua, userscripts, and user scripting generally. Comments appreciated.
FT2 (Talk | email) 02:06, 20 March 2013 (UTC)
Request to change User Tabs script
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Should someone change Wikipedia:WikiProject User scripts/Scripts/User tabs from http://toolserver.org/~tparis/count/index.php? to http://tools.wmflabs.org/xtools/pcount/index.php? as a result of the move? Thanks! GoingBatty (talk) 02:47, 3 June 2013 (UTC)
unofficial opt-in ad scripts?
It is my understanding that the Wikimedia Foundation's official stance is it will not run any ads. There have been some serious proposals for an opt-in ad system, but nothing has come out of it.
On the other hand, opt-in ads are something that can be easily implemented in a user script. For example, I could sign up for an ad exchange service (such as Infolinks) and put the ad-generating code in a script here. Any money that is gained can then be donated to Wikipedia.
However, there are a few potential problems with this approach. Because the Wikimedia Foundation does not officially run ads, there would be no oversight: a less-than-honest person could keep some of the funds for himself. Also, if a user does something that violates the ad exchange's terms of service, it could sever ties between the service and Wikipedia. This could become problematic should Wikipedia ever "needs" ads.
Would such a script be discouraged? --Ixfd64 (talk) 18:56, 4 July 2013 (UTC)
Adding tabs to the project page
Would anyone mind if I add a tab system to the project page that would look like the ones at the AfC project or the GoCE project? Thanks! (I really think it would look a lot better and aid in navigation.) APerson (talk!) 20:57, 11 August 2013 (UTC)
Done Added. APerson (talk!) 01:10, 12 August 2013 (UTC)
RfC: Are the Category:Wikipedians and its subcategories appropriate for Wikipedia
There is an ongoing RfC going on at Category talk:Wikipedians#RfC: Is this category and current subcategories appropriate for Wikipedia that readers of this WikiProject may be interested it. Technical 13 (talk) 12:19, 29 August 2013 (UTC)
No more javascript
I recently got a new laptop, and I don't get my javascript any more on no:Wikisource. (I neither get my additional edit buttons, nor the [common] box of edit tools under the edit window. Is there something wrong with my javascript or some plug-in/add-on that I don't have? V85 (talk) 04:21, 6 May 2013 (UTC)
- Have you changed the browser? Which browser you use, with which addons (Noscript?). --Rezonansowy --Rezonansowy (talk • contribs) 01:25, 9 November 2013 (UTC)
User:Rezonansowy/ToCommons
I'm not sure where should I place my script - User:Rezonansowy/ToCommons. --Rezonansowy (talk • contribs) 23:23, 9 November 2013 (UTC)
- I'd put it under "Images", I think. equazcion → 01:15, 10 Nov 2013 (UTC)
- Thanks! --Rezonansowy (talk • contribs) 12:31, 10 November 2013 (UTC)
BeeLine Reader
Have there been any significant efforts/discussions about adapting BeeLine Reader as a user script?
The issues with the existing implementation are as follows:
A quick look at the bookmarklet shows that it loads some scripts/stylesheets from www.beelinereader.com
without https. The Firefox extension seems to have that problem too.
HTTPS support?
|
---|
|
I could work around that by making on-wiki copies of the dependencies, except that I would like the script only to change text colors without doing any of the other reformatting it currently does. This is somewhat nontrivial for me to figure out, given the length of the script that does the actual work.
Any ideas where I should get started? --SoledadKabocha (talk) 22:01, 14 December 2013 (UTC)
- To clarify, it is possible that the "readability" script only does the aforementioned "reformatting," and the colors are handled elsewhere. --SoledadKabocha (talk) 03:16, 15 December 2013 (UTC)
- Upon digging a bit further, it is indeed the case that the coloring is handled separately from readability.js; the files have different names depending on the color scheme chosen (see the radio buttons on the bookmarklet installation page, and look at the resulting code of the bookmarklet). For example: BlackNavyCrimson.js for the "Dark" color scheme. An obvious change that would need to be made (in addition to removing the Google Analytics stuff) is that the
readInner
element ID would need to be changed tobodyContent
orcontent
if the page isn't going to be preprocessed by Readability. - At this point I think I can handle this myself. I don't intend for this to be developed as a gadget or otherwise widely publicized; that could run into licensing issues anyway. --SoledadKabocha (talk) 03:36, 15 December 2013 (UTC)
- Upon digging a bit further, it is indeed the case that the coloring is handled separately from readability.js; the files have different names depending on the color scheme chosen (see the radio buttons on the bookmarklet installation page, and look at the resulting code of the bookmarklet). For example: BlackNavyCrimson.js for the "Dark" color scheme. An obvious change that would need to be made (in addition to removing the Google Analytics stuff) is that the
JavaScript edit requests
See template talk:JavaScript where a new JS edit request template has been proposed -- 70.50.148.122 (talk) 07:01, 9 January 2014 (UTC)
Gadget or user script for disablesuggest
I have gone looking for admins who would like to approve a proposal I made for a gadget that disables search suggestions. Recently, one of them referred me to this project.
The project page says that the "most popular" scripts become gadgets. What usage is this approximately? The core preference to disable suggestions was used by 112 editors and some others couldn't find it. At least 7 of them have voiced their desire to get this option back in a discussion and a developer has encouraged me to write a similar gadget. The sheer number of search suggest bugs both technical and philosophical makes me surprised that the option would ever be taken out of core.
Are these reasons enough to have my script added as a gadget? If not, I am happy to list it on the project page so we can first make sure that it gets enough usage. I just hope this gets the attention of someone who can make the decision. Connor Behan (talk) 05:59, 6 February 2014 (UTC)
- Putting it in User:Connor_Behan/disablesuggest.js as this seems better than referring people to the proposal page. Check there for the latest version. Connor Behan (talk) 01:55, 7 February 2014 (UTC)
- Many thanks to TheDJ who just added this as a gadget! Connor Behan (talk) 20:36, 1 March 2014 (UTC)
Need script to filter navboxes in "What links here"
When using the tool "What links here" for geographical entries (such as Wichita Falls, Texas), all links in navboxes are listed as well as the usual article links. For someplace like Texas, this makes hundreds and hundreds of links to wade through. Would it be possible to make a user script that would filter out everything in navboxes? Or is there one already I haven't found? Many thanks. - Gorthian (talk) 19:39, 19 April 2014 (UTC)
- I think that would require the script to request and download all these hundreds of articles in order to check whether the link is in a template or not, not really a good idea. --V111P (talk) 08:48, 20 April 2014 (UTC)
- Not necessarily. You could prompt the user for the name of the navbox(es) that should be excluded (e.g. in this case {{Texas}} plus some others). Then you could query what links are inside that template and subtract those pages off from the whatlinkshere of the page. In navboxes, any link inside the template is also a link to that page.--Dudemanfellabra (talk) 17:03, 20 April 2014 (UTC)
- That wouldn't quite work, as many small cities in Texas have the template without being in the template (e.g. Hutchins, Texas). --V111P (talk) 13:43, 21 April 2014 (UTC)
- I was thinking something along the lines of an invisible something in the navbox template that would tell the script "here are the links contained within," and then the script could note those and ignore them. Obviously, I'm no programmer; I don't know how any of this works. - Gorthian (talk) 19:25, 21 April 2014 (UTC)
- No, I just used the template's "What links here" backlinks instead of the links in the template and it works! The former include all the pages that transclude the template. Thanks for the idea, Gorthian! I'll post the script a little later. --V111P (talk) 19:42, 21 April 2014 (UTC)
- Really? Cool! I'm thrilled! - Gorthian (talk) 02:16, 22 April 2014 (UTC)
- I want to thank Dudemanfellabra for his idea too, I actually only slightly modified it. --V111P (talk) 06:52, 22 April 2014 (UTC)
- Really? Cool! I'm thrilled! - Gorthian (talk) 02:16, 22 April 2014 (UTC)
- No, I just used the template's "What links here" backlinks instead of the links in the template and it works! The former include all the pages that transclude the template. Thanks for the idea, Gorthian! I'll post the script a little later. --V111P (talk) 19:42, 21 April 2014 (UTC)
- I was thinking something along the lines of an invisible something in the navbox template that would tell the script "here are the links contained within," and then the script could note those and ignore them. Obviously, I'm no programmer; I don't know how any of this works. - Gorthian (talk) 19:25, 21 April 2014 (UTC)
- That wouldn't quite work, as many small cities in Texas have the template without being in the template (e.g. Hutchins, Texas). --V111P (talk) 13:43, 21 April 2014 (UTC)
- Not necessarily. You could prompt the user for the name of the navbox(es) that should be excluded (e.g. in this case {{Texas}} plus some others). Then you could query what links are inside that template and subtract those pages off from the whatlinkshere of the page. In navboxes, any link inside the template is also a link to that page.--Dudemanfellabra (talk) 17:03, 20 April 2014 (UTC)
- Here is the documentation for the script: User:V111P/js/What Links Here link filter. Tell me if you have any problems because I haven't done much testing. I tested it on Whichita Falls, Texas with Namespace set to (Article) and templates:
County, Texas|Template:Texas|Template:Texas county seats|Template:Texas cities and mayors of 100,000 population|Template:Texas counties
- It reduces the pages from 1841 to 755. Well, that's still a lot of pages... but I hope it's helpful anyway.
- If you want, Gorthian, you can try some of my other scripts too and tell me if you like/don't like them. Thanks. --V111P (talk) 06:52, 22 April 2014 (UTC)
Asynchronous ends too late
Hello. Here is a basic script that queries the API as explained in the documentation. But the result arrives too late, because the JS continues without waiting the api.get() finish, and numberOfEditors is [0, 0]. How can I stop the run until api.get() is really ".done()" ? emijrp (talk) 18:14, 22 June 2014 (UTC)
- You cannot use return in a callback; when done() is fired, there is nothing to return to, because the function already returned [0, 0]. You need to point the callback to a separate function.
-- [[User:Edokter]] {{talk}}
21:57, 22 June 2014 (UTC)- Using asynchronous I/O really requires a different way of looking at how a program operates. Assuming that you do not have significant additional processing to perform while the asynchronous operation is in process, you need to complete whatever operations you can/should do prior to getting the data from the asynchronous operation and then just return. You rely on getting a callback from the async op to start your processing back up again. You absolutely should not just sit and spin in a loop waiting for a flag to be set indicating completion. Doing so effectively changes the async op to synchronous which undermines the purpose of having asynchronous operations.
- The typical method to accomplishing this is that you continue everything that should happen after the asynchronous action is complete from the callback function passed to the function which actually initiates the asynchronous action. Very specifically, there is a period of time during which your script is not actually running, except for the asynchronous action.
- Conceptually, you really should not view it as something like a synchronous readFile(), but more of a requestURL(callWhenDataAvailable,callIfError). Your processing then stops, you return(), until you get a response. You should also set up a timeout so that you definitely get a callback to something that makes your script return to being processed. You should also initiate the async request as soon as you know that you are going to need it. Given that JS is, generally, single threaded, you don't have to worry about the issue of having the callback routing being called while you are still completing your initial processing.
- I'm not sure I've done a decent job of explaining this, but how much of the surrounding concepts should be explained here is not clear. From your question, the fundamental thing that appears to be an issue is that you have not made the paradigm shift in your thinking from how to use synchronous I/O to how to use asynchronous I/O. One of the things that appears to help people conceptually is to use the difference in nomenclature I indicated above (i.e. don't use getURL(), but requestURL()). This helps keep in mind that you are actually making a request for the data rather than starting a blocking I/O operation. — Makyen (talk) 00:53, 23 June 2014 (UTC)
Preloads for easier installing
Why are there no easy links to preloads to install scripts more easily? For example this link : [1] will automatically fill in the contents of the Template:! on a new section of the sandbox. Similarly, code could be appended to the bottom of the user's script page via preloads. The preload could perhaps be stored on the User:Example/Script.js/preload page. That would mean installing the script is only 1 click to open the user's script page, and 1 click to submit - instead of requiring the users to copy over the contents themselves.
From personal experience I say that in general it's best to do the work for users as much as possible, when it comes down to code. Of course this would not automatically insert the preload-link, but I think it would be good to add the option to add a preload link to the template. Any thoughts? Joeytje50 (talk) 21:28, 23 February 2014 (UTC)
- Creating these extra preload pages and hiding from the user what is actually happening is not a good idea in my opinion. Plus we can't have new sections in the script files. But thanks for the suggestion. --V111P (talk) 08:58, 20 April 2014 (UTC)
- A script could be made that adds a script to the user's javascript file. It would load the text of the file, append the new importScript() call, and edit the page with the new text. Then the user would only have to add a script once and then simply click a button to add new scripts. It could even be made to remove scripts if desired.--Dudemanfellabra (talk) 17:06, 20 April 2014 (UTC)
- You can try Equazcion's ScriptInstaller. Having to install a script in order to install another script kind of defeats its purpose though. But if you want to try many different scripts it makes sence. --V111P (talk) 23:24, 20 April 2014 (UTC)
- I think what you are asking for is detailed in the bug report I've tracked above and to the right. Maybe it will happen... I'm hoping. — {{U|Technical 13}} (e • t • c) 01:29, 23 June 2014 (UTC)
- You can try Equazcion's ScriptInstaller. Having to install a script in order to install another script kind of defeats its purpose though. But if you want to try many different scripts it makes sence. --V111P (talk) 23:24, 20 April 2014 (UTC)
- A script could be made that adds a script to the user's javascript file. It would load the text of the file, append the new importScript() call, and edit the page with the new text. Then the user would only have to add a script once and then simply click a button to add new scripts. It could even be made to remove scripts if desired.--Dudemanfellabra (talk) 17:06, 20 April 2014 (UTC)
Add only local scripts?
Means this page that only local "English WP" scripts are allowed? Script functions are mostly language independent (or can be made multilingual extended), is it not useful to add some more existing Wiki scripts? Concretely I would suggest an auto. signing script and an auto. section link corrector for the edit summary. This could also be useful as moduls for other scripts!? → User: Perhelion 22:39, 22 June 2014 (UTC)
- No, the scripts should work on this Wikipedia and they should be documented in English, but their source code doesn't have to be on the English Wikipedia. --V111P (talk) 19:03, 23 June 2014 (UTC)
Automatic totals for a table?
Following a discussion at WT:FOOTY#Career totals template, we were wondering if anyone here would be able to create a script to automatically total up the numbers from the rows above. For example, this could be used for medal tables, where the bottom row is a sum of all medals won, or for career statistics, such as at Scott Loach#Career statistics. - 97rob (talk) 15:30, 6 June 2014 (UTC)
- A link to the now archived discussion: #. I suggested using User:V111P/js/Sum numbers to sum the numbers manually. --V111P (talk) 19:44, 23 June 2014 (UTC)
Removing scripts
How do you change back to the default skin after you add a script? --UserJDalek 01:29, 8 August 2014 (UTC)
- Go to your common.js page and remove the line that imports any scripts you no longer want to affect your skin. You may have also added some custom CSS to your common.css page which you may want to remove.
- Gadgets are another possible way your skin may have been changed.
- For a completely default (vanilla) experience, reset all your gadgets to the default, and remove all the text from both your common.js and common.css pages. That should do it. fredgandt 01:40, 8 August 2014 (UTC)
- Thanks. --UserJDalek 02:04, 8 August 2014 (UTC)
- You're welcome. I might suggest (even though I do say so myself) that in future you use something like my userResourceManager (see the entry overleaf) to make the task of organising your enhancements easier. fredgandt 05:24, 8 August 2014 (UTC)
Using JS libraries
Hello. I'm starting to do user scripts, previously I did mostly Python bots. I'm thinking about a user script that shows charts/graphs using Flotr library or similar. Is it possible to use these libraries in a user script? How? Thanks. emijrp (talk) 18:00, 22 June 2014 (UTC)
- You can copy the contents of excanvas.min.js to a sub page of your user page and then load it from the main file of your user script, for example with
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Emijrp/excanvas.min.js&action=raw&ctype=text/javascript')
. You should also include the license [2] somewhere (the original Github page may disappears one day so just adding a link to it may not be enough). Another option is to try to load excanvas.min.js directly from Github, but I'm not sure if that's a good idea. --V111P (talk) 19:38, 23 June 2014 (UTC) - The simplest thing to do would be to copy the whole script directly into your user script. But what I like to do is to have a small main script file which loads the larger script when the user requests to use the tool. --V111P (talk) 23:45, 23 June 2014 (UTC)
- @Emijrp and V111P: is that license compatible with CC-BY-SA? If not, the script could not be
importedcopied to English Wikipedia. Helder 01:51, 8 August 2014 (UTC)- @Helder.wiki: Good question. I believe it is one-way compatible provided you keep the copyright notice, which is also required by CC-BY-SA. But of course, I'm not a lawyer, so I can't say for sure. To clarify, the question is whether you can copy the script to Wikipedia, I see no possible problem with importing the script from somewhere else with mw.loader.load(). --V111P (talk) 17:16, 9 August 2014 (UTC)
- See also Wikipedia:Village pump (policy)/Archive 98#Proper licensing of gadgets, user scripts and lua modules. Helder 18:30, 9 August 2014 (UTC)
- @Helder.wiki: Now I realize that technically we should probably license our user scripts with GPL v. 2 or later at least in addition to the default CC-BY-SA, otherwise we may be in violation of the license of the MediaWiki JavaScript modules we are using, including mw.loader. --V111P (talk) 22:22, 9 August 2014 (UTC)
- See also Wikipedia:Village pump (policy)/Archive 98#Proper licensing of gadgets, user scripts and lua modules. Helder 18:30, 9 August 2014 (UTC)
- @Helder.wiki: Good question. I believe it is one-way compatible provided you keep the copyright notice, which is also required by CC-BY-SA. But of course, I'm not a lawyer, so I can't say for sure. To clarify, the question is whether you can copy the script to Wikipedia, I see no possible problem with importing the script from somewhere else with mw.loader.load(). --V111P (talk) 17:16, 9 August 2014 (UTC)
- @Emijrp and V111P: is that license compatible with CC-BY-SA? If not, the script could not be
Copying from logs of IRC channel #wikimedia-dev connect:
<helderwiki> Since mw code is under GPL, does that mean any user script using mw.loader must also be licensed as GPL?
<helderwiki> (context: https://en.wikipedia.org/w/index.php?diff=620559132 )
<MatmaRex> whaaa? no
<MatmaRex> disclaimer: i am not a lawyer
* helderwiki neither
<MatmaRex> but i don't see how MW being licensed under GPL would force the on-wiki scripts to also be
<MatmaRex> it's not distributed together with them or anything
<helderwiki> Doesn't using these libraries makes the code "linked" to MW somehow?
<p858snake|l> iirc this has been discussed hundreds of time on the ML
<p858snake|l> and the answer is no
Helder 23:15, 9 August 2014 (UTC)
- OK, thanks. --V111P (talk) 00:28, 10 August 2014 (UTC)
- I'm also not a lawyer, but the way I'd look at it is from an almost purely technical perspective.
- A library imported by and for a user script is imported by the user, not by Wikipedia (JS being client side and all), so if the library is free to use in/on projects by whomever (unless you can somehow control who uses the script), load away!
- Consider if you will that use of Google's Maps in web pages must (Google says so, and that's the webmaster's agreement with Google) be accompanied by a clear privacy statement pointing out to the user of that web site, that by continued use, thay are agreeing to Google's use and privacy policies. It's not the webmaster that uses the Maps, it's the end user, so they're the ones who have to agree and be bound by Google's licencing and policies.
- The webmaster may have other policies and agreements with Google regarding the use of those imported resources, but they're strictly between the webmaster and Google, and have no practical bearing on the agreements between the end user and Google.
- However, the actual text added to any Wikipedia page could be contentious. i.e The call to load the library may need attribution(?) and certainly a full copy of a library might (depending on it's usage licencing thing).
- P.S. I'm kinda glad I'm not a lawer ;-) fredgandt 04:19, 10 August 2014 (UTC)
Comment on the WikiProject X proposal
Hello there! As you may already know, most WikiProjects here on Wikipedia struggle to stay active after they've been founded. I believe there is a lot of potential for WikiProjects to facilitate collaboration across subject areas, so I have submitted a grant proposal with the Wikimedia Foundation for the "WikiProject X" project. WikiProject X will study what makes WikiProjects succeed in retaining editors and then design a prototype WikiProject system that will recruit contributors to WikiProjects and help them run effectively. Please review the proposal here and leave feedback. If you have any questions, you can ask on the proposal page or leave a message on my talk page. Thank you for your time! (Also, sorry about the posting mistake earlier. If someone already moved my message to the talk page, feel free to remove this posting.) Harej (talk) 22:48, 1 October 2014 (UTC)
User script suddenly not working any more
I use User:קיפודנחש/watchlistScout.js to alert me when something on my watchlist changes. It is supposed to run on page load and refresh every 60 seconds afterwards. For the past day or so, though, I have been getting nothing from the script. All of my other scripts are working, I'm getting no errors on the javascript console, and it doesn't look like anything has changed in the code of the script recently (latest change was in 2012). Is there something else that may have changed site-wide that broke the script? Possibly an update to the API or something?--Dudemanfellabra (talk) 05:58, 11 October 2014 (UTC)
- I recently updated my own watchlist-related scripts to fix bugs which had caused them to be broken for over a year. I was wondering if that was causing your problem, but you apparently don't have them installed, so that probably isn't the cause. This doesn't fix your problem, but I thought I'd mention it in order to prevent other people searching blind alleys. --ais523 07:09, 11 October 2014 (UTC)
- @Dudemanfellabra: Why ask this here instead of on the script author's talk page? --V111P (talk) 22:00, 13 October 2014 (UTC)
- Hmm I suppose I should have done that--or at least pinged him/her--but since nothing had changed with the JS file itself and User:קיפודנחש's contributions don't show any recent edits that would have affected the script, I figured it wasn't his/her fault but some other error like a site-wide change that may have affected more than just this script. Seeing as how the people that watch this talk page are well versed in user scripts, I figured here would be a good place to ask. I also asked at the help desk, and they directed me to VPT, where I'm about to post as well.--Dudemanfellabra (talk) 02:32, 14 October 2014 (UTC)
- there was some change in module mediawiki.api in latest code update. i think i fixed the code to match the more modern style. peace - קיפודנחש (aka kipod) (talk) 04:15, 14 October 2014 (UTC)
- Hmm I suppose I should have done that--or at least pinged him/her--but since nothing had changed with the JS file itself and User:קיפודנחש's contributions don't show any recent edits that would have affected the script, I figured it wasn't his/her fault but some other error like a site-wide change that may have affected more than just this script. Seeing as how the people that watch this talk page are well versed in user scripts, I figured here would be a good place to ask. I also asked at the help desk, and they directed me to VPT, where I'm about to post as well.--Dudemanfellabra (talk) 02:32, 14 October 2014 (UTC)
Two questions
- Anyone know which gadget / tool / script / bot -- it is that re-orders cites for articles in the right order?
- What's the tool / gadget / script / bot -- that automatically or semi-automatically checks for archived versions of URLs and adds them into the citations with archiveurl parameter?
Thank you for your time,
— Cirt (talk) 19:39, 10 October 2014 (UTC)
- @Cirt: Any bot or human using AWB's general fixes will do #1. Don't know about #2, as I don't know how it would verify that the archived version supports the sentence in the article. GoingBatty (talk) 03:40, 7 November 2014 (UTC)
- Okay, no worries, and thank you, — Cirt (talk) 03:41, 7 November 2014 (UTC)
- GB I think for #2 he means searching webcite for archived versions of pages that now return 404 errors. If the citation was already there, it wouldn't be unreasonable to have a bot find a webcite version for it if it became a deadlink. That said, I have no idea what bot would do that. — {{U|Technical 13}} (e • t • c) 03:59, 7 November 2014 (UTC)
WikiProject X is live!

Hello everyone!
You may have received a message from me earlier asking you to comment on my WikiProject X proposal. The good news is that WikiProject X is now live! In our first phase, we are focusing on research. At this time, we are looking for people to share their experiences with WikiProjects: good, bad, or neutral. We are also looking for WikiProjects that may be interested in trying out new tools and layouts that will make participating easier and projects easier to maintain. If you or your WikiProject are interested, check us out! Note that this is an opt-in program; no WikiProject will be required to change anything against its wishes. Please let me know if you have any questions. Thank you!
Note: To receive additional notifications about WikiProject X on this talk page, please add this page to Wikipedia:WikiProject X/Newsletter. Otherwise, this will be the last notification sent about WikiProject X.
Harej (talk) 16:58, 14 January 2015 (UTC)
3% of page views have no Javascript
Some of you might be interested in this research: mw:Analytics/Reports/Clients without JavaScript. The very rough estimate is that about 3% of page views come from people who have Javascript disabled or from a device that doesn't support it. Whatamidoing (WMF) (talk) 05:21, 27 March 2015 (UTC)
Proposal to add global JavaScript
There is an ongoing discussion that watchers of this page may be interested in on Proposal to add global JavaScript and add an extra step for new users to get live IRC help. — {{U|Technical 13}} (e • t • c)
19:41, 28 April 2015 (UTC)
Request for "Delete-block-post" script
Is this the right place to request a script?
- Purpose
To delete the userpage, block the account, and post at the user's talk.
This is something I do hundreds of times exactly the same way. A script would make things so fast. I do this when I am at the userpage. It is an advert that says something like "Our mission is to provide great cosmetics. Try us!" and the username is something like "Maryspam Idiotic Cosmetics Co. Ltd." The steps goes like this:
- Steps
- 1. Select the "delete" tab. Delete the page with the reason "G11: Unambiguous advertising or promotion."
- 2. Select "block user".
- 3. From the "Expiry:" dropdown menu, select "indefinite".
- 4. From the "Reason:" dropdown menu, select {{spamusernameblock}}
- 5. Leave the tickboxes as default.
- 6. Click block to block.
- 7. Go to the user talk page and click new section.
- 8. Paste {{subst:User:Anna Frodesiak/Cuw-soa-block}} ~~~~ and save.
- 9. End.
Can this be done? I would be eternally grateful! Anna Frodesiak (talk) 09:53, 24 November 2014 (UTC)
- I apologize Anna, I totally forgot about your request for this, and it has been a long time you have been waiting. It most certainly can be done, and it's actually easier than what you have listed here. I'll have to dig up my research I did on this project, and I'll post whatever help I can here. If no-one else wants to pick up where I left off and work on this, I'll see if I can't put something together in a few days. — {{U|Technical 13}} (e • t • c) 14:04, 24 November 2014 (UTC)
- Not at all. I just figured you were busy. Anyway, I would just love to have this script. It would save me oceans of time which I could apply to the mainspace instead to help make Wikipedia better. :) Anna Frodesiak (talk) 15:51, 24 November 2014 (UTC)
- And also, I would advertise this script in the admin IRC channel and lots of other admins would use it. It is a common action we all do manually. Anna Frodesiak (talk) 15:52, 24 November 2014 (UTC)
- Been thinking about this, Anna, and have started putting together User:Technical_13/SandBox/SpamUNblocker.js. Currently, it does all of what you want at a most basic level as in it opens three new tabs (one to delete, one to block, and one to notify) with all of the settings that you want. The reason I've done it like this for now in this alpha stage is to give you a chance to review the action you are about to take instead of just having it done for you with no review. Once I make sure that everything is working exactly as intended, then I'll start making parts of it automated so eventually one click will carry out all three steps automatically. I'll note that with my current setup, you'd have to change your template slightly for the talk page block notice to mirror testwiki:User:Anna Frodesiak/Cuw-soa-block to have your signature in there automatically (otherwise you can simply add it manually on the end). — {{U|Technical 13}} (e • t • c) 21:36, 25 November 2014 (UTC)
- Sounds great, Technical 13! Let me know how I can help. As for the signature, if I add it to the template, won't it turn into today's date as soon as I click save? Anna Frodesiak (talk) 22:16, 25 November 2014 (UTC)
- If you directly copy :testwiki:User:Anna Frodesiak/Cuw-soa-block to :en:User:Anna Frodesiak/Cuw-soa-block it should be fine. You'll note there is no actually signature in the template (it's added using the
&preloadparams%5B%5D=%7E%7E%7E%7E
by the script). — {{U|Technical 13}} (e • t • c) 22:34, 25 November 2014 (UTC)
- Done. Anna Frodesiak (talk) 22:38, 25 November 2014 (UTC)
- I tested it and it makes a dollar. Anna Frodesiak (talk) 22:40, 25 November 2014 (UTC)
- Yep, that's what it looks like when directly applied (unless you use |1=~~~~). To get an example of exactly what it will look like on that page try this link. — {{U|Technical 13}} (e • t • c) 23:30, 25 November 2014 (UTC)
- Fantastique! :) Anna Frodesiak (talk) 03:13, 26 November 2014 (UTC)
- If you directly copy :testwiki:User:Anna Frodesiak/Cuw-soa-block to :en:User:Anna Frodesiak/Cuw-soa-block it should be fine. You'll note there is no actually signature in the template (it's added using the
- Sounds great, Technical 13! Let me know how I can help. As for the signature, if I add it to the template, won't it turn into today's date as soon as I click save? Anna Frodesiak (talk) 22:16, 25 November 2014 (UTC)
- Hi, I would also benefit hugely from a script like this. However I'd want it to post the {{spamusernameblock}} on the user talk page. Perhaps make it configurable? For more generalized use I would say have {{spamusernameblock}} be the default but make it so that it can be overridden but putting
var spamublockTemplate="User:Whomever/customTemplate"
at the top of your common.js (or wherever you import your scripts). In other words, the script would see if spamublockTempalte is set and if it is use that, otherwise just use {{spamusernameblock}}. How does that sound? Thanks! — MusikAnimal talk 23:40, 25 November 2014 (UTC)- I can easily do that, but you'll have to manually add your signature. The alternative would require me to be in the template editor or administrator user groups to edit protected pages, and I'm not really interested in being in either group at this time. Fair enough? — {{U|Technical 13}} (e • t • c) 23:55, 25 November 2014 (UTC)
- Actually, on further thought, I may be able to change the way I'm doing a few other things to accommodate this request without additional effort by the end user (you). Let me play with some ideas to accomplish this tomorrow or after the Thanksgiving holiday. — {{U|Technical 13}} (e • t • c) 03:12, 26 November 2014 (UTC)
- @Technical 13: Well, for the record, I'm happy to assist you in any way :) I'm a bit of a coder myself. This all sounds like a fun project. Do you know if it is possible to perform the actual block with JavaScript? I'm not aware of any scripts that do this, but I know Twinkle can do some admin bits like page protection. Also, is there a good go-to resource for all the available MediaWiki JavaScript functions? I've just been learning as I go along from existing scripts. Thanks! — MusikAnimal talk 03:30, 26 November 2014 (UTC)
- MA, the three parts of this script could be accomplished through the API automatically using mw:Manual:Ajax with mw:API:Block to block the editor, mw:API:Edit to post the notice on the talk page, and mw:API:Delete to delete the violation. While I've taken some advanced Javascript classes in school, there are a lot of the ever evolving mw:JavaScript libraries that I'm not completely familiar with and exceed my current comfort level (whether or not I can actually implement it). — {{U|Technical 13}} (e • t • c) 03:50, 26 November 2014 (UTC)
- @Technical 13: Well, for the record, I'm happy to assist you in any way :) I'm a bit of a coder myself. This all sounds like a fun project. Do you know if it is possible to perform the actual block with JavaScript? I'm not aware of any scripts that do this, but I know Twinkle can do some admin bits like page protection. Also, is there a good go-to resource for all the available MediaWiki JavaScript functions? I've just been learning as I go along from existing scripts. Thanks! — MusikAnimal talk 03:30, 26 November 2014 (UTC)
- Actually, on further thought, I may be able to change the way I'm doing a few other things to accommodate this request without additional effort by the end user (you). Let me play with some ideas to accomplish this tomorrow or after the Thanksgiving holiday. — {{U|Technical 13}} (e • t • c) 03:12, 26 November 2014 (UTC)
- I can easily do that, but you'll have to manually add your signature. The alternative would require me to be in the template editor or administrator user groups to edit protected pages, and I'm not really interested in being in either group at this time. Fair enough? — {{U|Technical 13}} (e • t • c) 23:55, 25 November 2014 (UTC)
- Is the current method of opening three new tabs and allowing review before pulling the trigger on each phase a preferred way to do it, or should I pursue modifying the script to take the requested actions on your behalf without the "confirmation step"? I have no idea what might be most efficient and preferred. If there is a variety of opinions on this, I may see if I can make it a toggled preference. Thanks. — {{U|Technical 13}} (e • t • c) 03:12, 26 November 2014 (UTC)
- Three tabs? I open the userpage and if I discover a blatant ad, and the username is a company, and I see the edit count as "1", then it is almost certain that I will want to run this script. It would be nice to end it on the talk page in case there's a message about deleted article. I would sometimes also check the deleted contribs after that. But, this script is for accounts that registered only a few minutes earlier, so the chances are very high that the only thing that the user did was paste an advert and that's it. When you say "3" tabs, if you mean the block page being one, then I would never want to open it if I can use this script. The script would do it for me. I would start on the userpage, make a decision to run the script, and then would be taken to the usertalk page so I could see that the block notice has been placed, the user has been blocked, and the userpage tab is now redlinked. Anna Frodesiak (talk) 05:41, 1 December 2014 (UTC)
- Anna, what I mean is that when you run the current script, it opens up three new tabs for you. It opens up a tab (new window?) for deleting the user page (tab 1), then it opens a tab (new window?) to leave your custom message on the user's talk page (tab 2), finally, it opens a tab (new window?) to block the user (tab 3). The third tab has focus (since it was opened last) so you can quickly block to prevent them from doing any more damage. I figured the next most important thing was to notify them, so this was tab 2 so when you complete the blocking process and close that tab, you are defaulted here. I figured cleaning up and deleting the user page was of the least importance, so it opens that one first so it is the last one you get to be default. You can easily do things in any order on a case-by-case basis by clicking the tab you want to process next. So, to be clear, three tabs == {block, talk, delete}. Yes, you run it from the userpage, and it opens three pages. I don't currently have it set up to close the tab that you launch it from, but I suppose that would be easy enough if it would help. :) Also, to try and be clear, it is currently not set up to do all the work for you automatically through the api, it is set up to simplify the process by opening pages you want (block, talk, delete) with all of the settings preset for you. What I'm wondering is if this is a better idea so you can either click "Block" or "Delete" or "Save page" or on a case-by-case basis maybe change a setting here or there (like maybe you want to block talk page or email access for a particular one) before preforming the action. Q: Have you tried the script yet (here or on testwiki) to see how it works? If you need testwiki admin bit to test it, I'd be happy to give it to you and to set you up for this. — {{U|Technical 13}} (e • t • c) 06:47, 1 December 2014 (UTC)
- I'm so sorry. I'm going to drive you bonkers. :) For me, I need no options and no pages left open everywhere. I would ideally like to be looking at a userpage with no tabs open. Click a button, no options, no case-by-case. Then, as if by magic (which is pretty much what scripts are to me), the userpage gets deleted, the user spamblocked, and a standard template glued to the bottom of his usertalk. I am then brought to the usertalk with nothing else open anywhere. That's it. Can that be done?
- You mention "prevent them from doing any more damage". The scenario for which I want to use the script is always the same. It is a new user who drops and advert with a single edit and then you never see him edit again. There are tons of those.
- Try it, you ask? I'd love to. But how? I do not even know how to install the thing. It is one of those bits of code I stick in the ...js something-or-other? Anna Frodesiak (talk) 06:59, 1 December 2014 (UTC)
- Yep, you can go to testwiki:User:Technical-13, click on the "SPAMblock" link (should be in the same general area is "move", "protect", and "delete") and see what happens. I've already given you the admin bit, set it up in your common.js, and created your custom template page for the message to post. Happy editing! — {{U|Technical 13}} (e • t • c) 07:07, 1 December 2014 (UTC)
- I don't see the "SPAMblock" link, nor "move", "protect", and "delete" at https://test.wikipedia.org/wiki/User:Technical-13 Anna Frodesiak (talk) 07:14, 1 December 2014 (UTC)
- Ah, okay I found it. It was in a dropdown menu at the top. I clicked it. It brought up a the delete page page prompting me to choose advert reason. I clicked it. that was all it did. Anna Frodesiak (talk) 07:19, 1 December 2014 (UTC)
- I'm on IRC if that's helpful. Anna Frodesiak (talk) 07:15, 1 December 2014 (UTC)
- I don't see the "SPAMblock" link, nor "move", "protect", and "delete" at https://test.wikipedia.org/wiki/User:Technical-13 Anna Frodesiak (talk) 07:14, 1 December 2014 (UTC)
- Three tabs? I open the userpage and if I discover a blatant ad, and the username is a company, and I see the edit count as "1", then it is almost certain that I will want to run this script. It would be nice to end it on the talk page in case there's a message about deleted article. I would sometimes also check the deleted contribs after that. But, this script is for accounts that registered only a few minutes earlier, so the chances are very high that the only thing that the user did was paste an advert and that's it. When you say "3" tabs, if you mean the block page being one, then I would never want to open it if I can use this script. The script would do it for me. I would start on the userpage, make a decision to run the script, and then would be taken to the usertalk page so I could see that the block notice has been placed, the user has been blocked, and the userpage tab is now redlinked. Anna Frodesiak (talk) 05:41, 1 December 2014 (UTC)
- @Anna and MA: I have an update for you on this script. I've adjusted it so that it always uses your "/SpamUNblocker" subpage. That means, that you can put whatever you want into that subpage of yours (Anna will probably want to do like I did on testwiki:User:Technical 13/SpamUNblocker (verbatim, exactly the same) and MA will probably want code that looks something like
{{Uw-spamublock|indef=yes|sig=yes}}
). — {{U|Technical 13}} (e • t • c) 01:03, 29 November 2014 (UTC)
- That sounds good. Anna Frodesiak (talk) 05:41, 1 December 2014 (UTC)
- Anna, I'm back on this task. Due to your popup blocker issue, I've basically scrapped the entire script that I had. This new version will have an interface and do everything for you (without opening pages for you to do it yourself). Due to the great deal of added complexity of this new version, it may take me a little while to complete. I'll ping you again when I have a semi-working prototype. What would would really useful for me, is if you can create an account on testwiki (maybe AnnaTheSpammer or something silly like that) and make a few edits like what you normally see from these users so I can have a "test case" to work with. Thanks! — {{U|Technical 13}} (e • t • c) 15:23, 4 January 2015 (UTC)
- Done: https://test.wikipedia.org/wiki/User:Anna_Spamdesiak
- I'm sorry to give you all this work. Isn't it possible to just supress the popups and make the darn thing do all three steps all tied together and in the background? Anna Spamdesiak (talk) 15:31, 4 January 2015 (UTC) (Anna Frodesiak (talk) 15:33, 4 January 2015 (UTC))
- Don't be sorry, from the discussion above, it seems like this will be useful to at least a few admins. As for your question, yes, but that is what is causing all the work. :p lol no worries, I'm enjoying doing it. — {{U|Technical 13}} (e • t • c) 17:02, 4 January 2015 (UTC)
- @Anna Frodesiak, MusikAnimal, and Technical 13: I've just finished writing User:Mr. Stradivarius/gadgets/SpamUserPage, which does everything requested here and more, and with a nice user interface. Take a look and see if you like it. — Mr. Stradivarius ♪ talk ♪ 06:57, 18 June 2015 (UTC)
- @Mr. Stradivarius: Nice work! I like that it can handle uw-softerblock as well. I've been using User:MusikAnimal/spamublock which is more of a quick and dirty solution to the {{uw-spamublock}}, using only default block options. It also works on mainspace articles, as you'll often see the spamublock scenario with the page creator there as well. I'm sure you could incorporate that easily! Adding something like this to the Twinkle block module is on the back-burner, just so ya know, and you are welcome to help out with that! :) Cheers — MusikAnimal talk 14:35, 18 June 2015 (UTC)
- @Mr. Stradivarius: Very nice work indeed! Thank you very much. I must apologize for not adding a comment here that said MusikAnimal already made a type of this. I like your options and will use it too, as will others I am sure. Thank you again!!! :) Anna Frodesiak (talk) 22:30, 18 June 2015 (UTC)
Request for "reply to talk page comment" script
Heya,
Is it possible to make a script that'll let you reply with a ping with one click to signed comments on talk pages? Current steps to do this are:
- Edit the source of the section
- Find the comment you're trying to reply to
- Put the right number of
::
's next to it - Place a
{{ping|username you're replying to}}
before your reply - Write the reply
This process seems rather arduous for simply replying to a talk page comment and letting the user you're replying to know you replied.
Thanks!
| Nayptatalk opened his mouth at 17:42, 2 July 2015 (UTC)
I want it to alert me sometimes
I have this code:
if (5 === 5); { alert("Have a good day!"); }
in my common.js page. How do I make it alert me only when I log in? it's getting very annoying. Catmando999 Check out his talk page! 06:48, 11 September 2015 (UTC)
Script request - "diff only" link on diff pages
Yo, could anyone help me out by creating a (hopefully simple) script?
Every diff page has "← Previous edit" and "Next edit →" links. I'd like each of those to be followed by a "(diff only)" link, which would point to the same URL, but with the additional parameter &diffonly[[:Template:Equals]]1
.
Thanks in advance for any help on this. — Scott • talk 17:12, 27 September 2015 (UTC)
- @Scott: h/t HighInBC - Wikipedia talk:Administrators' noticeboard/Archive 5#This page is so long, I hope this helps. 185.108.128.3 (talk) 22:49, 27 September 2015 (UTC)
- I have used it all the time since I wrote it. There are some bugs with duplicate parameters in the url sometimes, but it still works fine. Makes cruising through diffs on long pages a breeze. HighInBC (was Chillum) 23:05, 27 September 2015 (UTC)
- @185.108.128.3 and HighInBC: 2007! Hard to believe that something so basic has been missing for so long. Thank you both. I've also filed T113891 to request it be fixed. — Scott • talk 00:04, 28 September 2015 (UTC)
- @Scott and HighInBC: I saw that this script was using addOnloadHook, which is deprecated and will be removed from MediaWiki sooner or later, so I had a go at turning it into a proper gadget. You can find it at User:Mr. Stradivarius/gadgets/DiffOnly.js. And of course, while I was at it I had to fix the duplicate URL parameter bug and make the arrow always appear in the right place. :) Try it out and let me if you think the interface needs tweaking. — Mr. Stradivarius ♪ talk ♪ 10:39, 28 September 2015 (UTC)
- @185.108.128.3 and HighInBC: 2007! Hard to believe that something so basic has been missing for so long. Thank you both. I've also filed T113891 to request it be fixed. — Scott • talk 00:04, 28 September 2015 (UTC)
- I have used it all the time since I wrote it. There are some bugs with duplicate parameters in the url sometimes, but it still works fine. Makes cruising through diffs on long pages a breeze. HighInBC (was Chillum) 23:05, 27 September 2015 (UTC)
Much better. I only left it as it was because it was not broken enough to fix, but now that it is fixed I love it. Before I would manually remove the diff_only from the uri, now you can click out proper. People should use your version for sure. HighInBC (was Chillum) 15:06, 28 September 2015 (UTC)