Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Search
Editing
MediaWiki talk:Common.js
(section)
From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history
Namespaces
Message
Discussion
More
More
Page actions
Read
Edit source
New topic
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Require a license value === {{collapse top|Require a license value on file upload}} Try adding this to the '''end''' of the script, code from codepen. It might also be possible to adapt so that a description must be entered too. ~[[User:Notjusttired|Njt]] ([[User talk:Notjusttired|talk]]) 14:50, November 2, 2019 (EDT) :I have added it, but it doesn't seem to work. (and other custom javascript doesn't work as well) [[User:Notjusttired|Njt]] :[[User:Pyrrhus|Pyrrhus]] ([[User talk:Pyrrhus|talk]]) 21:16, November 2, 2019 (EDT) ::It looks like that was relying on a plug-in we don't have. Can you try this instead. It disables the first option, which may be enough to force a choice. If not, keep this code in and I will look at adding an action to the Submit button too. [[User:Pyrrhus]] ~[[User:Notjusttired|Njt]] ([[User talk:Notjusttired|talk]]) 15:13, November 6, 2019 (EST) :::Thanks for proposing this, [[User:Notjusttired|Njt]]! I have added it, but it doesn't seem to work. I have noticed that many people have already tried javascript solutions for this on the web, but I couldn't find a simple solution. By the way, MediaWiki core includes a custom form of jquery. :::[[User:Pyrrhus|Pyrrhus]] ([[User talk:Pyrrhus|talk]]) 15:39, November 6, 2019 (EST) :::Okay, it's now fixed, [[User:Notjusttired|Njt]]! Your code successfully disabled (greyed-out) the selection, but it did not de-select the option, so "None selected" was still the default selection, even though it was greyed-out. I made a small change to your code that removes "None selected" altogether. :::[[User:Pyrrhus|Pyrrhus]] ([[User talk:Pyrrhus|talk]]) 19:12, November 6, 2019 (EST) <pre> /* Disable default license option on Special:Upload (None Selected) to force a choice. */ $(function () { myElement = document.getElementById("wpLicense"); Β myElement.options[0].disabled = true; }()); </pre> ::::That looks good, although because it now defaults to I don't know exactly we may still have the issue of people not looking at the license options. I think it would be better to have a blank choice. Also could you change the default description to use this info instead, with headings rather than bullets. [[User:Pyrrhus]] ~[[User:Notjusttired|Njt]] ([[User talk:Notjusttired|talk]]) 06:15, November 8, 2019 (EST) ::::Try this for setting the default option to a message not in the drop down box. I think this should prevent the option being saved. It could be altered to have a useful message instead, like a translation of "Please choose a license". It also sets Required so the option can't be left blank. ~[[User:Notjusttired|Njt]] ([[User talk:Notjusttired|talk]]) 06:48, November 8, 2019 (EST) <pre> document.getElementById("wpLicense").value = ""; document.getElementById("wpLicense").required = true; </pre> ::::New content for default upload summary, using system messages where possible (for languages other than French, Spanish, German, Dutch). ~[[User:Notjusttired|Njt]] ([[User talk:Notjusttired|talk]]) 07:08, November 8, 2019 (EST) <pre> ==wm-license-information-description== ==wm-license-information-author== ==wm-license-information-source== wm-license-artwork-notes: </pre> ::::The system message [[MediaWiki:Maintenance-option-required]] translates (required) and other system messages cash be used, eg for "Please choose a license" and [[MediaWiki:Wm-license-information-description-missing-request|Please provide a meaningful description]]. ~[[User:Notjusttired|Njt]] ([[User talk:Notjusttired|talk]]) 07:25, November 8, 2019 (EST) :[[User:Notjusttired|Njt]] I have updated the default summary, but now I am concerned that the default summary box is too confusing/intimidating for someone who doesn't understand the Source Editor. I wonder if there is a better way... :[[User:Pyrrhus|Pyrrhus]] ([[User talk:Pyrrhus|talk]]) 14:13, November 8, 2019 (EST) :[[User:Notjusttired|Njt]] I have updated the javascript, and now it seems to work!!! Good job! :[[User:Pyrrhus|Pyrrhus]] ([[User talk:Pyrrhus|talk]]) 15:45, November 8, 2019 (EST) ::This is great! {{Thank}}At least! Also no changes are needed for different skins. ~[[User:Notjusttired|Njt]] ([[User talk:Notjusttired|talk]]) 12:32, November 9, 2019 (EST) ====Re: Require a license value -- ~~~~==== :: Replace this text with your reply
Summary:
Please make sure your edits are consistent with
MEpedia's guidelines
.
By saving changes, you agree to the
Terms of use
, and you irrevocably agree to release your contribution under the
CC BY-SA 3.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Skip to content
Main page
Browse
Become an editor
Random page
Popular pages
Abbreviations
Glossary
About MEpedia
Links for editors
Contents
Guidelines
Recent changes
Pages in need
Search
Help
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs