r81329 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81328‎ | r81329 | r81330 >
Date:22:26, 1 February 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
fix for MW pre1.17: tried to use jQuery without check
Modified paths:
  • /trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js
@@ -244,6 +244,8 @@
245245 }
246246 }
247247
248 -if (wgAction=='formedit' || wgCanonicalSpecialPageName == 'FormEdit')
249 -// addOnloadHook(ajaxFormPreviewInit);
250 - jQuery(function(){ajaxFormPreviewInit()});
 248+if (wgAction=='formedit' || wgCanonicalSpecialPageName == 'FormEdit') {
 249+ if ( typeof( addOnloadHook ) != 'undefined' ) addOnloadHook(ajaxFormPreviewInit);
 250+ else if ( typeof( jQuery ) != 'undefined' ) jQuery(function(){ajaxFormPreviewInit()});
 251+ // else sorry, no Ajax preview for you
 252+}