MediaWiki talk:Gadget-DotsSyntaxHighlighter.js

Latest comment: 9 years ago by Maiden taiwan in topic Load only in editor

Protected edit request on 18 July 2014

edit

Please remove "&smaxage=21600&maxage=86400" as in mw:Special:Diff/1068457. These parameters are not necessary. Helder.wiki 16:06, 18 July 2014 (UTC)Reply

  Done Ruslik_Zero 19:29, 18 July 2014 (UTC)Reply

Load only in editor

edit

I suggest you surround this code with:

if (document.getElementById('wpTextbox1')) {
  //syntax highlighter
  mw.loader.load('....')
}

so it loads only on the edit page. Otherwise it's loading on every page, which can be a performance hit. Maiden taiwan (talk) 16:36, 21 January 2015 (UTC)Reply