Fixed Guess it just took some time. While the conversion is a good idea, it is only implemented for Cite book. And the bug has been extant since at least February. ---— Gadget850 (Ed)talk22:54, 27 November 2011 (UTC)[reply]
throws exceptions on ie-9 when *not* in compatibility mode. the problem is that the brain-damaged browser returns "null" for document.getElementById('citeselect'), even though severl lines prior this section was just created.
i would recommend to transform this whole ugly piece to something that uses jquery, instead of having a piece of code that behaves differently for different browser in enwiki "Mediawiki:" space. let jquery worry about browser compatability.
i.e., replace the mess at the beginning of the file with
it would also make sense to translate the rest of the file to more modern and maintainable code (using jquery), but this is your business (i am not active on enwiki).
however, throwing exception is considered bad form and should be avoided where possible.
I think I found the error - you didn't set the id of the div in the else part of if (navigator.userAgent.indexOf('MSIE') == -1). Please, add citeselect.id = 'citeselect'; somewhere after line 56. Thanks. --V111P (talk) 03:04, 28 July 2013 (UTC)[reply]
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
The problem: In IE, when the option "Enable enhanced editing toolbar" is not checked in Preferences, IE reports an error when opening an article for editing: "Unable to get property 'appendChild' of undefined or null reference". Clicking on the {{Cite}} icon in the toolbar above the textarea results in the same error message and the citation tool doesn't work.
How to recreate the error: To see the error message, first uncheck the option "Enable enhanced editing toolbar" in the Editing section of your preferences. Now press F12 to open Developer Tools and click on the Console tab. Now open an article for editing. The error message should appear in the console and the {{Cite}} button above the textarea won't work.
The cause: This error is caused by the author of the script not setting the id of a div element in the else part of if (navigator.userAgent.indexOf('MSIE') == -1).
Solution: This error can be fixed by adding the line citeselect.id = 'citeselect'; after line 56 of this script. Line 56 currently reads: var citeselect = document.createElement('div'); --V111P (talk) 02:40, 15 August 2013 (UTC)[reply]
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
Due to the deprecation of the sajax API, please replace all occurrences of
sajax_init_object();// new XMLHttpRequest();
with
newXMLHttpRequest();
This is without risk, because Javascript on IE6 is no longer supported and that was the only functionality that this function was providing
—TheDJ (talk • contribs) 11:47, 10 August 2015 (UTC)[reply]
Problem is that the admins who patrol CAT:EP are not always the ones with js knowledge. I'll leave it open a couple of days just in case, but otherwise you can try WP:VPT. Regards — Martin (MSGJ · talk) 14:23, 8 October 2015 (UTC)[reply]
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
Hyphenated parameter names are the canonical forms for multiword cs1|2 parameters. WP:RefToolbar has been modified to use these canonical names so it makes sense (to me at least) that we should modify MediaWiki:RefToolbarLegacy.js so that it also uses the canonical-form names. While investigating this, I noticed that, in some cases, WP:RefToolbarLegacy also uses parameter names that are no-longer supported by cs1|2. To remedy these things, I propose that WP:RefToolbarLegacy shall be changed by replacing the code at certain line numbers with the code as listed in the table.
There is one parameter that I left unmodified: |coauthors=. I do not have sufficient javascript skills to understand how that parameter can be removed from this script so I make no suggestions about that. I do know that it appears relatively rarely in Category:CS1 errors: deprecated parameters so unless it becomes a problem, we can limp along without 'fixing' that one.
//importScript('User:Trappist the monk/Sandbox/MediaWiki talk:RefToolbarLegacy.js');//importScript('MediaWiki:RefToolbarLoader.js');//importScript('User:Mr.Z-man/refToolbar.js');//importScript('User:Apoc2400/refToolbar.js');importScript('User:Apoc2400/refToolbarPlus.js');
... And yes, I did the cache bypass thing ...
I can activate the legacy editor if I select 'Enable the legacy (2006) editing toolbar.' (under Editing at Special:Preferences#mw-prefsection-gadgets). But that isn't what is wanted. How to use the sandbox instead?
@Trappist the monk: You should be able to test it by: 1) importing the snadbox as a user script per normal; 2) going to Special:Preferences/Editing and unchecking the "Enable the editing toolbar" option under "Editor", and 3) going to the Gadgets tab and checking the "Enable the legacy (2006) editing toolbar." The language on the legacy toolbar option might need some tightening to make it clear that, if the option in Editing is checked, then the legacy toolbar gadget won't do anything. Let me know if these steps don't resolve the issues. Writ Keeper⚇♔17:57, 24 March 2021 (UTC)[reply]
@Writ Keeper: Thanks. Yep, all of this is what I did:
After doing these things, I get a 'legacy' editor but it doesn't appear to be the version in my sandbox – I changed the 'Coauthors' input text box labels to:
so that it would be obvious that the sandbox version is the editor in use; that didn't work. So, on the off-chance that <s>...</s> tags aren't allowed in <label>...</label> tags, I changed those same labels to:
<labelfor="coauthors"> coauthors:</label>
This also did not work which leads me to suspect that checking 'Enable the legacy (2006) editing toolbar.' (under Editing at Special:Preferences#mw-prefsection-gadgets) does, as it is advertised to do, cause the gadget version of the editor to load over whatever user script is loaded (if it's loaded).
Unchecking 'Enable the legacy (2006) editing toolbar' removes the editor even though steps 1 and 2 above remain unaltered. So, the question: 'How to use the sandbox?', remains a mystery (at least to me...)
@Trappist the_monk: Hmm, it seems to be working for me; I see "coauthors:" there. The editing toolbar gadget itself shouldn't overwrite your RefToolbar; that gadget refers to the buttons next to the cite button, but not the cite button itself, which has always been a separate gadget. In fact, the RefToolbar gadget just adds a button onto the toolbar that the edit toolbar gadget provides, which is why it needs to be enabled for your script to take effect: if it isn't, there's no toolbar for the RefToolbar script to add its button to.
Anyway, one thing I missed is that you also have to be sure to have disabled the current RefToolbar gadget (the refToolbar: checkbox in the Gadgets screen, just below the edit toolbar one). Make sure that's unchecked, as well, otherwise it might overwrite the custom script. Writ Keeper⚇♔19:32, 24 March 2021 (UTC)[reply]
I have implemented all of the items listed in the above table in User:Trappist the monk/Sandbox/MediaWiki talk:RefToolbarLegacy.js. The forms used by RefToolbarLegacy.js use html tables to do the form formatting. In my original post I noted that |coauthors= is no longer supported by cs1|2 but didn't have a solution for it. I have discovered a partial solution and that is to blank the table cells that hold the |coauthors=<label>...</label> and <input /> tags by wrapping the <td>...</td> content in <!--...--> markup. As part of this, and because I omitted an |access-date= tidbit that should have been listed in the table above, I changed line 954 to remove "coauthors", and hyphenate "accessdate" (I also normalized whitespace in that line); see line 960 in the sandbox.
I made some other adjustments:
'Website or work' label in the cite web form (old: line 244; new: line 244)
'Newspaper or work' label in the cite news form (same)
the cite web and cite news forms are shared; I blanked the table cell that holds the |location= label and input in the cite web form (old: lines 254, 255; new: lines 254–261)
I removed leading html entities from the left-column labels of all forms except the cite book form (which did not have left-column leading )
All of the changes can be seen in this comparison between MediaWiki:RefToolbarLegacy.js and User:Trappist the monk/Sandbox/MediaWiki talk:RefToolbarLegacy.js. cs1|2 templates created with this tool can be seen in this version of my sandbox
Hey, Trappist the_monk, sorry for the wait. One question (not a dealbreaker, I don't think): when you remove the coauthors field, you leave the empty TDs in place, which leaves a weird hole in the middle of the citation fields. Is there any reason why we shouldn't instead shift the TDs up one, to move that hole to the end of the fields instead? Writ Keeper⚇♔13:54, 5 April 2021 (UTC)[reply]
Minimal change. I thought about filling that hole but decided to leave it so that nothing else in the form moved. Editors who use this tool likely have come to expect the various fields to be where they are. No doubt, no doubt, some would not be happy were I to shuffle them (because, you know, Wikipedians hate, hate, hate, change). If you want to fill the hole, go ahead, that's on you.
Haha, no dispute there. :) Actually, what I think I might do, by way of explanation, is leave a plaintext note in that gap indicating that the coauthors field has been deprecated; that way nobody thinks that something has gone wrong. Thanks, I'll go ahead and implement this change. Writ Keeper⚇♔14:23, 5 April 2021 (UTC)[reply]