helialprofile.png
Welcome to IOPWiki, Commander. You can contribute to this wiki without an account. Learn how to contribute.

MediaWiki:Gadget-pixiLoader.js

From IOP Wiki
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
window.animations = window.animations || {};

if (!window.animations.PIXILoader) {
	window.animations.PIXILoader = {};
	window.animations.PIXILoader.initialized = false;
	window.animations.PIXILoader.init = function() {
		return new Promise(
		    function (resolve, reject) {
		    	if (window.animations.PIXILoader.initialized) {
		    		resolve(null);
		    		return;
		    	}
		    	
		    	$.ajax({
				    cache: true,
				    url: "/index.php?title=MediaWiki:Gadget-pixiJsWithSpine.js&action=raw",
				    dataType: "script"
				}).done(function() {
					console.log("Request PIXI JS Framework successfull");
					window.animations.PIXILoader.initialized = true;
				    resolve(null);
				}).fail(function() {
			        console.error("Loading PIXI framework failed");
			        var reason = new Error('PIXI framework failed loading');
			        reject(reason);
			    });
		    }
		);
	};
}

console.log("Loaded PIXI JS Gadget");