From: MatmaRex Date: Tue, 15 Jan 2013 18:14:53 +0000 (+0100) Subject: (bug 43981) disable live preview on user .js/.css pages X-Git-Tag: 1.31.0-rc.0~21034^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24plugin.url%7Cescape%7D?a=commitdiff_plain;h=113fdbc67300564c802fc69c300f6002b5522f15;p=lhc%2Fweb%2Fwiklou.git (bug 43981) disable live preview on user .js/.css pages Disable live preview on user .js/.css pages, as there's no sane way of "previewing" the scripts or styles without reloading the page. Change-Id: I8750448c827eb965509158bb4a0cd8b0cf3c7a67 --- diff --git a/resources/mediawiki.action/mediawiki.action.edit.preview.js b/resources/mediawiki.action/mediawiki.action.edit.preview.js index cddf6ccf53..602aadb0ba 100644 --- a/resources/mediawiki.action/mediawiki.action.edit.preview.js +++ b/resources/mediawiki.action/mediawiki.action.edit.preview.js @@ -102,6 +102,12 @@ } $( document ).ready( function () { + // Do not enable on user .js/.css pages, as there's no sane way of "previewing" + // the scripts or styles without reloading the page. + if ( $( '#mw-userjsyoucanpreview' ).length || $( '#mw-usercssyoucanpreview' ).length ) { + return; + } + // The following elements can change in a preview but are not output // by the server when they're empty until the preview reponse. // TODO: Make the server output these always (in a hidden state), so we don't