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 He7d3r (talk | contribs) at 17:01, 1 June 2013 (Add MathJax compatibility: Could you replace if (window.ajaxPreviewExec) ajaxPreviewExec(wkPreview[0]) by something like ... to make the script work with the mathjax code from mw:Extension:Math? See gerrit:61183 for details.). 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]