User talk:Anomie/ajaxpreview.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Description?[edit]

What does this script do? SharkD (talk) 08:29, 8 July 2009 (UTC)[reply]

It adds a button "Ajax Preview w/Refs" next to the standard Preview button. Clicking this button does the following:
  • Copies the wikitext out of the edit box.
  • Checks the copy for named refs without content. If any are found, it downloads the whole article wikitext from the API and fills the missing refs into the copy.
  • Appends {{reflist}} to the copy if necessary (i.e. refs are found, but no {{reflist}} or <references/>).
  • Passes the copy to the API to convert it to HTML.
  • Replaces the preview at the top of the page with the HTML from the previous step.
This is sometimes faster than the normal preview button, and of course includes refs when editing a section. Anomie 12:36, 8 July 2009 (UTC)[reply]

Can't Remote with mw.loader[edit]

Hi, this doesn't seem to work over on gunretort.xyz:

mw.loader.load('//https://en.wikipedia.org/wiki/User:Anomie/ajaxpreview.js?action=raw&ctype=text/javascript');  // Linkback: [https://en.wikipedia.org/wiki/User:Anomie/ajaxpreview.js]

Am i doing it wrong? thx - Johnywhy (talk) 02:46, 4 July 2018 (UTC)[reply]