SHARE
TWEET

Untitled

a guest Mar 20th, 2014 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // test code to generate errors in https://www.mediawiki.org/wiki/Extension:MultimediaViewer
  2. // after running, you need to press "Next" twice (due to preloading) to see an error
  3.  
  4. function unfix ( provider, errorMessage ) {
  5.         provider.api = { get: function() {
  6.                 return $.Deferred().reject( errorMessage || 'Failed!' );
  7.         } };
  8. };
  9.  
  10. function fix ( provider ) {
  11.         provider.api = new mw.Api();
  12. };
  13.  
  14. // break image loading
  15. // just delete "un" to fix
  16. unfix( mw.mmv.bootstrap.viewer.thumbnailInfoProvider );
  17.  
  18.  
  19. // break metadata loading
  20. // just delete "un" to fix
  21. unfix( mw.mmv.bootstrap.viewer.imageInfoProvider );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top