projects
/
GitHub
/
WoltLab
/
WCF.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1533ede
)
Explicitly propagating shuffle() in global namespace
author
Alexander Ebert
<ebert@woltlab.com>
Fri, 6 Feb 2015 13:29:26 +0000
(14:29 +0100)
committer
Alexander Ebert
<ebert@woltlab.com>
Fri, 6 Feb 2015 13:29:26 +0000
(14:29 +0100)
The minified JS files use IIFE wrappers to utilize strict mode, but this can cause the shuffle() function to be unknown outside the wrapper.
wcfsetup/install/files/js/WCF.js
patch
|
blob
|
blame
|
history
diff --git
a/wcfsetup/install/files/js/WCF.js
b/wcfsetup/install/files/js/WCF.js
index 30c0bc96c20223da6c25fddccedb05af689d63f3..a327938d5ee7e22b8466cc35a7a5dbe7e5cd0c45 100755
(executable)
--- 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...