User talk:Js/preview2.js
Appearance
Fixes
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Could someone apply this bug fix to the script? Currently it does not works on Translatewiki, because $wgLegacyJavaScriptGlobals seems to be set to false there (and will be false here as well in the future). Helder 22:54, 25 October 2012 (UTC)
frm.wpSummary is undefined
I got
Uncaught TypeError: Cannot read property 'value' of undefined
from the following line when trying to do a preview in a new topic on Wikidata:
data = { title: mw.config.get('wgPageName'), text: txt, summary: frm.wpSummary.value}
Helder 17:18, 12 November 2012 (UTC)
Add MathJax compatibility
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Could you replace
if (window.ajaxPreviewExec) ajaxPreviewExec(wkPreview[0])
by something like
if ( $( '.tex' ).length ){
mw.loader.using( 'ext.math.mathjax.enabler', function () {
$('#wikiPreview').renderTex();
} );
}
if (window.ajaxPreviewExec) ajaxPreviewExec(wkPreview[0])
to make the script work with the mathjax code from mw:Extension:Math? See gerrit:61183 for details. Helder 17:01, 1 June 2013 (UTC)
Not done for now: The
{{editprotected}}
template should only be used when there is "a complete and specific description of the request, so that an editor unfamiliar with the subject matter could complete the requested edit immediately". The phrase "by something like" implies that the above request is not specific. --Redrose64 (talk) 20:59, 2 June 2013 (UTC)- @Helder.wiki: Done, with an additional check on actually having mathjax mode selected in your preferences. —TheDJ (talk • contribs) 21:28, 2 June 2013 (UTC)
- Thank you! I think it is necessary to move around the code which loads module "user.options" at User:Js/ajaxPreview.js, and made a request for this at User talk:Js/ajaxPreview.js#Fix dependencies. Helder 14:47, 3 June 2013 (UTC)
- @Helder.wiki: Done, with an additional check on actually having mathjax mode selected in your preferences. —TheDJ (talk • contribs) 21:28, 2 June 2013 (UTC)