Add $.unsafeWindow.
This commit is contained in:
parent
f20a7bd78c
commit
02a739c572
@ -488,6 +488,11 @@
|
||||
$.add(d.head, script);
|
||||
return $.rm(script);
|
||||
},
|
||||
unsafeWindow: window.opera && window || unsafeWindow || (function() {
|
||||
d.createElement('p');
|
||||
p.setAttribute('onclick', 'return window');
|
||||
return el.onclick();
|
||||
})(),
|
||||
shortenFilename: function(filename, isOP) {
|
||||
var threshold;
|
||||
threshold = isOP ? 40 : 30;
|
||||
|
||||
@ -371,6 +371,12 @@ $.extend $,
|
||||
textContent: code
|
||||
$.add d.head, script
|
||||
$.rm script
|
||||
# http://mths.be/unsafewindow
|
||||
unsafeWindow: window.opera and window or unsafeWindow or (->
|
||||
d.createElement 'p'
|
||||
p.setAttribute 'onclick', 'return window'
|
||||
el.onclick()
|
||||
)()
|
||||
shortenFilename: (filename, isOP) ->
|
||||
# FILENAME SHORTENING SCIENCE:
|
||||
# OPs have a +10 characters threshold.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user