There is a chunk that is supposed to convert a hyphen to an ndash:
value = value.replace(/-/g, "â"); //Replace hyphens with en dashes [[WP:ENDASH]]
However, it is obviously inserting unicode characters instead. ---— Gadget850 (Ed) talk 12:31, 27 November 2011 (UTC)
Not into JS, but the fix looks obvious. To be safe, I tracked the origin of this code to User:Apoc2400/refToolbar.js.
citevalue = citevalue.replace(/-/g, "–"); //Replace hyphens with en dashes [[WP:ENDASH]]
---— Gadget850 (Ed) talk 16:09, 27 November 2011 (UTC)
{{cite book}}
: Missing or empty |title=
(help) works for me! I did control-shift-R to reload .js files. Graeme Bartlett (talk) 21:09, 27 November 2011 (UTC)
hi. i saw your name in the history of this file, so i write it here - maybe it should belong elsewhere.
so here is the deal: the line that reads
document.getElementById('citeselect').appendChild( reftoolformarea );"
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
var
citemain = $('<div>', {id: 'citeselest'})
.css({display: 'none', margin: '0.2em 0 -0.2em 0'})
.append(addOption(citeWeb, "Web"))
.append(addOption(citeNews, "News"))
.append(addOption(citeBook, "Book"))
.append(addOption(citeJournal, "Journal"))
.append(addOption(citeNamedRef, "Named references"))
.append(addOption(dispErrors, "Error check"))
.append(addOption(showMore, "More"))
.append(addOption(hideInitial, "Cancel"));
var
citemore = $('<div>', {id: 'citemore'})
.css({display: 'none'})
.append(addOption(citeEncyclopedia, "Encyclopedia"));))
.append(addOption(citePressRelease, "Press release"));))
.append(addOption(citeMap, "Map"))
.append(addOption(showRefSectionOptions, "Ref Section"))
.append($('<span>', {id: 'refToolFormArea'});
citemain.append(citemore);
$('#toolbar').append(citemain);
function addOption(script, text) {
return $('<input>', {type: 'button', value: text}).click(script);
}
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.
peace, קיפודנחש (talk) 18:35, 13 March 2012 (UTC)
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)
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Based on Wikipedia:Village_pump_(technical)#Wikipedia:RefToolbar_1.0_does_not_autofill_from_ISBN.2C_DOI.2C_URL.2C_etc., please change
var defaultRefTagURL = 'http://reftag.appspot.com/';
to
var defaultRefTagURL = '//reftag.appspot.com/';
so users don't run into mixed content blocking when using the secure site. Thanks, Theopolisme (talk) 15:13, 13 October 2013 (UTC)
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
On line 616, change:
insertTags(cite, '', '');
to:
$("#wpTextbox1").focus();
insertTags(cite, '', '');
On line 650, change:
insertTags(wikicode, '', '');
to:
$("#wpTextbox1").focus();
insertTags(wikicode, '', '');
On line 719, change:
insertTags(ref, '', '');
to:
$("#wpTextbox1").focus();
insertTags(ref, '', '');
On line 1062, change:
insertTags(cite, '', '');
to:
$("#wpTextbox1").focus();
insertTags(cite, '', '');
Same as MediaWiki talk:RefToolbarNoDialogs.js#Bugfix for caret focus, more detailed explanation. Fixes the same bug for users who have enabled neither "Enable enhanced editing toolbar" nor "Enable wizards [...]" at Editing Preferences (i.e. legacy editing settings.) --hydrox (talk) 17:50, 3 April 2014 (UTC)
![]() | 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
new XMLHttpRequest();
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)
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Could some admin with js knowledge change deprecated mwCustomEditButtons
to mw.toolbar
? --Edgars2007 (talk/contribs) 08:13, 8 October 2015 (UTC)
Any reason why this script appears in Category:Pages with empty citations? -Einstein95 (talk) 01:17, 6 December 2015 (UTC)
![]() | 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.
line # | new code |
---|---|
162 | document.getElementById('access-date').value = getTime();
|
252 | '<tr><td width="120"><label for="access-date"> Access date: </label></td>'+
|
253 | '<td width="400"><input type="text" tabindex=1 style="width:100%" id="access-date" value="'+ newtime +'"></td>'+
|
291 | <td><label for="author-link'+i+'"> Author link: </label></td> \
|
292 | <td><input type="text" tabindex=1 style="width:100%" id="author-link'+i+'"> \
|
337 | <td><label for="access-date"> Access date:</label></td> \
|
338 | <td><input type="text" tabindex=1 style="width:100%" id="access-date"></td></tr> \
|
402 | '<td width="120"><label for="access-date"> Access date: </label></td>'+
|
403 | '<td width="400"><input type="text" tabindex=1 style="width:100%" id="access-date"></td></tr>'+
|
452 | '<td width="120"><label for="access-date"> Access date: </label></td>'+
|
453 | '<td width="400"><input type="text" tabindex=1 style="width:100%" id="access-date"></td></tr>'+
|
486 | '<td width="120"><label for="access-date"> Access date: </label></td>'+
|
487 | '<td width="400"><input type="text" tabindex=1 style="width:100%" id="access-date" value="'+ getTime() +'"></td></tr>'+
|
514 | '<td width="120"><label for="access-date"> Access date: </label></td>'+
|
515 | '<td width="400"><input type="text" tabindex=1 style="width:100%" id="access-date"></td></tr>'+
|
938 | var authorlink = document.getElementById('author-link' + i).value;
|
941 | authorcite = '|author-link' + i + '=' + authorlink + authorcite;
|
982 | cite += '|author-mask=';
|
984 | cite += '|trans-title=';
|
987 | cite += '|orig-date=';
|
994 | cite += '|trans-chapter=';
|
996 | cite += '|chapter-url=';
|
999 | cite += '|lay-url=';
|
1000 | cite += '|lay-date=';
|
1142 | document.getElementById('access-date').value = formatDate(document.getElementById('access-date').value, dateformat);
|
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.
—Trappist the monk (talk) 13:53, 16 March 2021 (UTC)
//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');
importScript('User:Trappist the monk/Sandbox/MediaWiki talk:RefToolbarLegacy.js');
(in User:Trappist_the_monk/common.js)<label for="coauthors"> <s>Coauthors: </s></label>
<s>...</s>
tags aren't allowed in <label>...</label>
tags, I changed those same labels to:
<label for="coauthors"> coauthors: </label>
|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.|editors=
→ |editor=
in the book cite form (old: lines 432, 433; new: lines 439, 439)|location=
label and input in the cite web form (old: lines 254, 255; new: lines 254–261)
html entities from the left-column labels of all forms except the cite book form (which did not have left-column leading
)