Jump to content

User talk:Js/preview2.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by TheDJ (talk | contribs) at 21:28, 2 June 2013 (Add MathJax compatibility: done). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Fixes

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)[reply]

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)[reply]

Add MathJax compatibility

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)[reply]

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)[reply]
@Helder.wiki: Done, with an additional check on actually having mathjax mode selected in your preferences. —TheDJ (talkcontribs) 21:28, 2 June 2013 (UTC)[reply]