From: Alexander Ebert Date: Fri, 6 Feb 2015 13:29:26 +0000 (+0100) Subject: Explicitly propagating shuffle() in global namespace X-Git-Tag: 2.1.0_RC_1~72 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=01a570df55b84f14647e1e7e6489895a2dd9f264;p=GitHub%2FWoltLab%2FWCF.git Explicitly propagating shuffle() in global namespace The minified JS files use IIFE wrappers to utilize strict mode, but this can cause the shuffle() function to be unknown outside the wrapper. --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 30c0bc96c2..a327938d5e 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -103,7 +103,7 @@ String.prototype.hashCode = function() { * * @see http://stackoverflow.com/a/2450976 */ -function shuffle(array) { +window.shuffle = function(array) { var currentIndex = array.length, temporaryValue, randomIndex; // While there remain elements to shuffle...