MediaWiki talk:Gadget-LicenseReview.js
![]() | This script, LicenseReview, is a JavaScript gadget which can be enabled or disabled in your Preferences. The documentation page is located at Help:Gadget-LicenseReview. |
![]() | Gadget descriptions: LicenseReview: Helps license reviewers and administrators with reviewing files. [talk] |
i18n | Gadget translations:
no internationalisation required: |
Ipernity
Lemill Web Albums
OpenPhoto
iNaturalist
Scanned books, documents and ephemra
- Scans from the Internet Archive/unverified (1,581,815)
- Scans from Google Books/unverified (513)
Other reviews
- Unreviewed files from Bollywood Hungama (53)
- Filmitadka review needed (0)
- CC without license information (0)
- PD files for review (122)
- Tasnimnews review needed (11,096)
- Mehrnews review needed (1,553)
- Farsnews review needed (1,573)
- Nasimnews review needed (0)
- Khamenei.ir review needed (366)
- Mojnews review needed (0)
- Finna review needed (33,713)
- Unreviewed files from Pixabay (72)
- Unreviewed photos of GODL-India (15,357)
- Unreviewed photos of GWOIA (44)
- License review needed (71,484)
Remove ArrangedLicenseReview automatically
edit{{Edit request}} Currently User:Eatcha's bot removes it. It can be done by the script.
Add the following line after line 138.
tb1.value = tb1.value.replace(/\{\{ArrangedLicenseReview.*\}\}/g, );
Refer to history of File:李佳芯.jpg for an example.--Roy17 (talk) 13:30, 4 May 2020 (UTC)
- Done Awesome! Thank you! 4nn1l2 (talk) 13:48, 4 May 2020 (UTC)
- Thx! It's working special:diff/417126765.--Roy17 (talk) 17:51, 4 May 2020 (UTC)
- Thanks to both of you for improving the Workflow. // Eatcha (talk) 16:49, 5 May 2020 (UTC)
- Thx! It's working special:diff/417126765.--Roy17 (talk) 17:51, 4 May 2020 (UTC)
- this code has a flaw and causes this: special:diff/432441725. to prevent this, change the
Review.*\}
toReview[^}]*\}
, so the \}\} would match the first }} only.--RZuo (talk) 08:55, 4 August 2020 (UTC)- @RZuo: Is it not the
ArrangedLicenseReview.*\}
that is the problem here? If you see special:diff/417054424 then the script did not remove too much. --MGA73 (talk) 10:34, 4 August 2020 (UTC)- Why not use the non-greedy
\{\{ArrangedLicenseReview.*?\}\}
. // Eatcha (talk) 14:28, 4 August 2020 (UTC)- @Eatcha: Non-greedy is fine with me. I was only trying to find out what part of the code that was the problem. --MGA73 (talk) 14:58, 4 August 2020 (UTC)
- That would be my fix as well. I did that in User:AntiCompositeNumber/LicenseReview.js (as well as updating some strings). Tested here. Could someone merge those changes into this script? --AntiCompositeNumber (talk) 20:04, 4 August 2020 (UTC)
- Done, @Roy17, RZuo, Eatcha, MGA73, and AntiCompositeNumber: please test! --Lucas Werkmeister (talk) 20:42, 6 August 2020 (UTC)
- Why not use the non-greedy
- @RZuo: Is it not the
License migration
editThe code include stuff about license migration. What does the code actually do?
Per Commons_talk:License_Migration_Task_Force#Restart_2020 we still have files that needs to be fixed. Atm there are about 10 k. But the script does not seem to be useful when I check those files. --MGA73 (talk) 21:26, 20 June 2020 (UTC)
- It's not a complaint. I'm just trying to find out how to use it (or improve it). --MGA73 (talk) 21:37, 20 June 2020 (UTC)
The number of files in Category:License migration candidates and subcategory is down to about 5k files. So if no one wants to or know how to fix the script I suggest that we remove the code to make the script more simple. --MGA73 (talk) 18:14, 4 August 2020 (UTC)
- This edit should give an idea of what to remove if it can't be fixed. --MGA73 (talk) 19:08, 4 August 2020 (UTC)
- Better get someone to fix the code or at least identify where the code stalls. It doesn't seem to be able to detect the license migration at all. --Denniss (talk) 19:16, 4 August 2020 (UTC)
- @Denniss: yes but it seems we lack users to maintain the script and if license migration is not something many users care about its better to keep the code simple. At least we could use better description to help others understand what the different parts of the script does. --MGA73 (talk) 16:36, 5 August 2020 (UTC)
- I added headings where the code starts and ends as far as I can tell. There are 2 blocks/parts. See this edit. --MGA73 (talk) 18:41, 8 September 2020 (UTC)
Done I added div.LMR to activate the script and a div class to the template. So now the script will let users work on the files. --MGA73 (talk) 21:09, 11 September 2020 (UTC)
- This edit did not work as planned. Problem is the template ends with 4x} and script can't place the code the right place. --MGA73 (talk) 21:34, 11 September 2020 (UTC)
- Done With this edit thanks to User:Acagastya. --MGA73 (talk) 17:15, 17 September 2020 (UTC)
As mentioned above MediaWiki:LicenseReview.js can be used to do a license migration review of files. If you go to a file that is a candidate or need review you will see some buttons and boxes where you can select the option you want in a drop down menu. Then you can click save. If you want you can add an extra edit summary before you save. --MGA73 (talk) 17:23, 17 September 2020 (UTC)
Needs support for {{INaturalistreview}} added
editThe {{INaturalistreview}} template works similar to other review templates, but isn't supported by the LicenseReview gadget. Kaldari (talk) 16:33, 22 June 2020 (UTC)
- Don't we have a bot that should review those? --MGA73 (talk) 21:39, 22 June 2020 (UTC)
- @AntiCompositeNumber: How are User:iNaturalistReviewBot doing? --MGA73 (talk) 21:41, 22 June 2020 (UTC)
- I've made the changes that are required in User:AntiCompositeNumber/LicenseReview.js. --AntiCompositeNumber (talk) 19:06, 9 September 2020 (UTC)
Done @AntiCompositeNumber: Added! --MGA73 (talk) 19:25, 9 September 2020 (UTC)
PDM
editPer this:
The script needs to be updated. New template is {{PDMark-owner}}. --MGA73 (talk) 17:26, 27 August 2020 (UTC)
I think we need to change here:
// Change license LicenseReviewChange: function () { ... <option value="PD">No known restrictions (Flickr only)</option>\ ADD: <option value="PDMo">PDMark owner (Flickr only)</option>\ ... case 'PD' : doReplacement('{{Flickr-no known copyright restrictions}}', 'Flickr-no known copyright restrictions'); break; ADD: case 'PDMo' : ADD: doReplacement('{{PDMark-owner}}', 'Flickr-PDMark owner'); ADD: break; ...
Anything else? --MGA73 (talk) 18:29, 6 September 2020 (UTC)
- I think we also need Cc-zero as an option. I think this change works.
- I edited a file to PDMark owner and to Cc-zero (I know edit summary was bad). And after that a review. --MGA73 (talk) 19:20, 6 September 2020 (UTC)
- Done I added code for PDMark-owner and Cc-zero. See this edit. --MGA73 (talk) 18:41, 8 September 2020 (UTC)
YouTube review fail if reversed
editNot really related to the edits above but it seems that YouTubereview fails if templates are reverser. See this edit. I got same result then reversed at got better result. If we are going to fix script perhaps we can fix that too. --MGA73 (talk) 14:16, 7 September 2020 (UTC)
- Should we reverse the code in the regex from
\{\{YouTubeReview(.+?|)}}/ig,
to\{\{YouTubeReview(|.+?)}}/ig,
or make it\{\{YouTubeReview(.*?|)}}/ig,
- (twice) --MGA73 (talk) 14:28, 7 September 2020 (UTC)
- Done I made it non-greedy. See this edit. --MGA73 (talk) 18:41, 8 September 2020 (UTC)
Pixabay support
editI have added support for files from Pixabay. I would hope people try and give me feedback if the script is working as inteded or not. Please see the patch. And if it looks all right, can you please update the script?
Acagastya (talk) 22:31, 9 September 2020 (UTC)
- Done @Acagastya: Thank you. I tested and some fixes was added so I copied the latest version of the script instead of the diff above. --MGA73 (talk) 20:35, 10 September 2020 (UTC)
- Thank you for the feedback, helping me fix the required elements, MGA73!
Acagastya (talk) 20:40, 10 September 2020 (UTC)
- Thank you for the feedback, helping me fix the required elements, MGA73!
Keyboard shortcuts
editCan you please add the access keys + and - for license+ and license-? It will make it easier for users to do things by keyboard shortcuts. See this diff.
Acagastya (talk) 06:04, 19 September 2020 (UTC)
- I think it sounds like a good idea. I will wait a little before I add it in case someone can think of a good reason not to do it. --MGA73 (talk) 09:18, 19 September 2020 (UTC)
- @Acagastya: Done please test to see if it works as it should. --MGA73 (talk) 17:01, 21 September 2020 (UTC)
- Seems like it is. Thanks, @MGA73:
Acagastya (talk) 08:46, 25 September 2020 (UTC)
- Seems like it is. Thanks, @MGA73:
- @Acagastya: Done please test to see if it works as it should. --MGA73 (talk) 17:01, 21 September 2020 (UTC)
iNaturalist
editSeems can not match {{INaturalistreview}}, See [1]. (`・ω・´) (talk) 14:46, 9 March 2021 (UTC)
- Hi (`・ω・´)! It seems that the problem was that there were no license? --MGA73 (talk) 18:13, 2 April 2022 (UTC)
Add support to GWOIA template
edit{{GWOIA}} template is not currently supported by this gadget, see also their cat. I think currently there is not bot support this template. Stang★ 11:35, 24 January 2022 (UTC)
Problem with youtube review
editHi! It seems that something does not work. See Special:diff/646124528. Problem is that it adds "id=rom YouTube". I checked an old file File:Ashi Singh.gif and that seems to have the same problem. Not quite sure how to fix because if there is a time included in the link then we miss that if we only add the id. @C1K98V: that uploaded the file and tipped me. --MGA73 (talk) 18:18, 2 April 2022 (UTC)
- I also made a post at Template_talk:YouTubeReview#How_to_indicate_id_and_time_of_screenshot_in_review. --MGA73 (talk) 18:21, 2 April 2022 (UTC)
Another problem is that script does not work when it does not say {{YouTubeReview}} but {{YouTube Review}} (with a blank). I tried to fix but had to restore (see Special:Diff/674000584) because my change made the review add "desc" where it should not per Special:Diff/673999968.
If there is no {{YouTubeReview}} the script ask to add a template but "YouTubeReview" is not on the drop down list. That would be nice too. --MGA73 (talk) 08:20, 13 July 2022 (UTC)
Edit button
editHello, I noticed that the 'Edit' button interface goes a bit long downwards. It's not a problem though doesn't look good IMO. Could someone please fix it? Kind regards, — Tulsi 24x7 06:13, 10 August 2022 (UTC)
Flickr no source
editAdd support for {{Flickr no source}}, see [2] [3]. It would just be adding it as an replacement alternative on line 238. [[c maybe? :) Platonides (talk) 21:09, 23 August 2022 (UTC)
- @Platonides: It seems like a good idea. I imagine you are thinking of adding something like "
|({{(F|f)lickr no source.*?}})
"? --MGA73 (talk) 19:36, 24 August 2022 (UTC)- Yes, exactly MGA73. In fact, the parens around the different options are not needed, I don't know why they are included in existing ones, but harmless. Platonides (talk) 21:34, 24 August 2022 (UTC)
- @Platonides: Done. I was wondering about the parens but since it was used for the other options I thought perhaps it is made by someone to indicate that it is a "set" that belongs together. I changed and tested with Special:Diff/684935762. It seems to work as it should. --MGA73 (talk) 05:40, 25 August 2022 (UTC)
- Yes, exactly MGA73. In fact, the parens around the different options are not needed, I don't know why they are included in existing ones, but harmless. Platonides (talk) 21:34, 24 August 2022 (UTC)
Position of insertion
editinstead of appending, the "passed" template should be inserted somewhere before the first occurrence of [[Category . i think the logic can be like this:
- (maintain a list of copyright templates) match the last occurrence of a template in the list. insert template at a new line after it.
- if no template in the list can be matched, then match =={{int:license-header}}==. insert template at a new line after it.
- if license-header is not found, then match the first occurrence of [[Category . insert template at a new line before it.
- if no cat is found, then append.
- if license-header is not found, then match the first occurrence of [[Category . insert template at a new line before it.
- if no template in the list can be matched, then match =={{int:license-header}}==. insert template at a new line after it.
PD files for review
editPlease add support for the procedure at Commons:PD files § Where to ask for PD review. When a file has Category:PD files for review, ensure that tracking category is removed and subst:{{PDr}} is added (with an optional task to add a note to the talk page of the file concerned.) Matr1x-101 {user - talk? - useless contributions} 19:57, 18 May 2023 (UTC)
Can't use the gadget
editThe screen is stuck at "The editor will now load. If you still see this message after a few seconds, please reload the page." when clicking on "license +".
In console, it is throwing up this error:
Uncaught TypeError: Cannot read properties of undefined (reading 'wpTextbox1')
at Object.gotEditHTML [as success] (ext.gadget.LicenseReview-script-0.js:760:23)
at fire (jquery.js:3223:31)
at Object.fireWith [as resolveWith] (jquery.js:3353:7)
at done (jquery.js:9627:14)
at XMLHttpRequest.<anonymous> (jquery.js:9888:9)
I am using Visual Editor. Please advise. Robertsky (talk) 11:37, 10 February 2024 (UTC)
- An obvious workaround on your part is not to use VisualEditor. A probably easy workaround on the gadget’s part is replacing with
$.get(mw.util.wikiScript('index'), { action: 'edit', title: conf.wgPageName.replace(/ /g, '_') }, gotEditHTML);
– this forces the traditional wikitext editor to be used for that particular request even if the user otherwise prefers VisualEditor or the 2017 wikitext editor. Of course, the good solution is making it compatible with VisualEditor, but that’s probably magnitudes more complicated than this workaround. —Tacsipacsi (talk) 01:59, 11 February 2024 (UTC)$.get(mw.util.wikiScript('index'), { action: 'submit', title: conf.wgPageName.replace(/ /g, '_') }, gotEditHTML);
Encounter a problem with the gadget
editHello, I've just encounter a problem while using the gadget. Please See Special:diff/914359187. I've just clicked on license+
to mark a file as reviewd, but it faild with the wrong edit. Thanks. –TANBIRUZZAMAN (💬) 01:09, 22 August 2024 (UTC)