Move hacks for phantomjs to spec.html
This ain't pretty, but I just want to see if it helps to fix specs on phantomjs, I may move them to separate file and take into account in Assetfile later.
This commit is contained in:
parent
2e8b74160c
commit
25079b8d79
|
@ -14,26 +14,3 @@ minispade.require 'app'
|
||||||
now = -> new Date('2012-07-02T00:03:00Z')
|
now = -> new Date('2012-07-02T00:03:00Z')
|
||||||
$.timeago.settings.nowFunction = -> now().getTime()
|
$.timeago.settings.nowFunction = -> now().getTime()
|
||||||
Travis.currentDate = now
|
Travis.currentDate = now
|
||||||
|
|
||||||
# hacks for missing features in webkit
|
|
||||||
unless Function::bind
|
|
||||||
Function::bind = (oThis) ->
|
|
||||||
|
|
||||||
# closest thing possible to the ECMAScript 5 internal IsCallable function
|
|
||||||
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable") if typeof this isnt "function"
|
|
||||||
aArgs = Array::slice.call(arguments, 1)
|
|
||||||
fToBind = this
|
|
||||||
fNOP = ->
|
|
||||||
|
|
||||||
fBound = ->
|
|
||||||
fToBind.apply (if this instanceof fNOP and oThis then this else oThis), aArgs.concat(Array::slice.call(arguments_))
|
|
||||||
|
|
||||||
fNOP.prototype = @.prototype
|
|
||||||
fBound.prototype = new fNOP()
|
|
||||||
fBound
|
|
||||||
|
|
||||||
window.history.state = {}
|
|
||||||
oldPushState = window.history.pushState
|
|
||||||
window.history.pushState = (state, title, href) ->
|
|
||||||
window.history.state = state
|
|
||||||
oldPushState.apply this, arguments
|
|
||||||
|
|
|
@ -6,6 +6,41 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Travis CI - Free Hosted Continuous Integration Platform for the Open Source Community</title>
|
<title>Travis CI - Free Hosted Continuous Integration Platform for the Open Source Community</title>
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico">
|
<link rel="icon" type="image/png" href="/favicon.ico">
|
||||||
|
|
||||||
|
<script>
|
||||||
|
if (!Function.prototype.bind) {
|
||||||
|
Function.prototype.bind = function (oThis) {
|
||||||
|
if (typeof this !== "function") {
|
||||||
|
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
||||||
|
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
||||||
|
}
|
||||||
|
|
||||||
|
var aArgs = Array.prototype.slice.call(arguments, 1),
|
||||||
|
fToBind = this,
|
||||||
|
fNOP = function () {},
|
||||||
|
fBound = function () {
|
||||||
|
return fToBind.apply(this instanceof fNOP && oThis
|
||||||
|
? this
|
||||||
|
: oThis,
|
||||||
|
aArgs.concat(Array.prototype.slice.call(arguments)));
|
||||||
|
};
|
||||||
|
|
||||||
|
fNOP.prototype = this.prototype;
|
||||||
|
fBound.prototype = new fNOP();
|
||||||
|
|
||||||
|
return fBound;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
window.history.state = {};
|
||||||
|
|
||||||
|
var oldPushState = window.history.pushState;
|
||||||
|
|
||||||
|
window.history.pushState = function(state, title, href) {
|
||||||
|
window.history.state = state;
|
||||||
|
return oldPushState.apply(this, arguments);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
<link rel="stylesheet" href="/styles/app.css">
|
<link rel="stylesheet" href="/styles/app.css">
|
||||||
<link rel="stylesheet" href="/styles/jasmine.css">
|
<link rel="stylesheet" href="/styles/jasmine.css">
|
||||||
<link rel="stylesheet" href="/styles/jasmine-ext.css">
|
<link rel="stylesheet" href="/styles/jasmine-ext.css">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user