(bug 43981) disable live preview on user .js/.css pages
authorMatmaRex <matma.rex@gmail.com>
Tue, 15 Jan 2013 18:14:53 +0000 (19:14 +0100)
committerMatmaRex <matma.rex@gmail.com>
Tue, 15 Jan 2013 18:14:53 +0000 (19:14 +0100)
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

resources/mediawiki.action/mediawiki.action.edit.preview.js

index cddf6cc..602aadb 100644 (file)
        }
 
        $( 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