IE fixes
This commit is contained in:
parent
d83046460f
commit
eb9cd1e397
9 changed files with 34 additions and 9 deletions
|
@ -40,6 +40,7 @@ Ox.LoadingIcon = function(options, self) {
|
|||
css = 'rotate(' + deg + 'deg)';
|
||||
that.css({
|
||||
MozTransform: css,
|
||||
MsTransform: css,
|
||||
OTransform: css,
|
||||
WebkitTransform: css
|
||||
});
|
||||
|
|
|
@ -60,7 +60,7 @@ Ox.Filter = function(options, self) {
|
|||
{id: '=,', title: 'is between'},
|
||||
{id: '!=,', title: 'is not between'}
|
||||
],
|
||||
enum: [
|
||||
'enum': [
|
||||
{id: '=', title: 'is'},
|
||||
{id: '!=', title: 'is not'},
|
||||
{id: '<', title: 'is less than'},
|
||||
|
@ -112,7 +112,7 @@ Ox.Filter = function(options, self) {
|
|||
self.defaultValue = {
|
||||
boolean: 'true',
|
||||
date: Ox.formatDate(new Date(), '%F'),
|
||||
enum: 0,
|
||||
'enum': 0,
|
||||
float: 0,
|
||||
hue: 0,
|
||||
integer: 0,
|
||||
|
|
|
@ -87,7 +87,12 @@ window.Ox = {
|
|||
function loadScript(script, callback) {
|
||||
var element = document.createElement('script'),
|
||||
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
|
||||
if (/MSIE/.test(navigator.userAgent)) {
|
||||
// fixme: find a way to check if css/js have loaded in msie
|
||||
setTimeout(callback, 2500);
|
||||
} else {
|
||||
element.onload = callback;
|
||||
}
|
||||
element.src = path + script + '?' + parseInt(Math.random() * 1000000);
|
||||
element.type = 'text/javascript';
|
||||
head.appendChild(element);
|
||||
|
|
|
@ -456,10 +456,24 @@ Ox.shuffle = function(collection) {
|
|||
Ox.slice <f> Alias for <code>Array.prototype.slice.call</code>
|
||||
> (function() { return Ox.slice(arguments, 1, -1); }(1, 2, 3))
|
||||
[2]
|
||||
> (function() { return Ox.slice(arguments, 1); }(1, 2, 3))
|
||||
[2, 3]
|
||||
@*/
|
||||
Ox.slice = function(value, start, stop) {
|
||||
return Array.prototype.slice.call(value, start, stop);
|
||||
};
|
||||
//IE8 returns an empty array if undefined is passed as start, stop
|
||||
//IE8 returns an array of nulls if a string is passed to Array.prototype.slice.call
|
||||
if(Ox.slice([1]).length == 0 || Ox.slice('a')[0] == null) {
|
||||
Ox.slice = function(value, start, stop) {
|
||||
if(Ox.typeOf(value) == 'string')
|
||||
value = value.split('')
|
||||
return stop === void 0
|
||||
? Array.prototype.slice.call(value, start)
|
||||
: Array.prototype.slice.call(value, start, stop);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*@
|
||||
Ox.some <f> Tests if one or more elements of a collection meet a given condition
|
||||
|
|
|
@ -38,7 +38,7 @@ Ox.formatDate <f> Formats a date according to a format string
|
|||
date <d|n|s> date
|
||||
utc <b> date is utc
|
||||
<script>
|
||||
Ox.test.date = new Date('2005-01-02 00:03:04');
|
||||
Ox.test.date = new Date('2005/01/02 00:03:04');
|
||||
</script>
|
||||
> Ox.formatDate(Ox.test.date, '%A') // Full weekday
|
||||
'Sunday'
|
||||
|
@ -253,7 +253,7 @@ Ox.formatDate <f> Formats a date according to a format string
|
|||
return Ox.getFullYear(date, utc).toString().slice(-2);
|
||||
}],
|
||||
['Z', function(date) {
|
||||
return date.toString().split('(')[1].replace(')', '');
|
||||
return (date.toString().split('(')[1] || '').replace(')', '');
|
||||
}],
|
||||
['z', function(date) {
|
||||
return Ox.getTimezoneOffsetString(date);
|
||||
|
|
|
@ -262,7 +262,7 @@ Ox.doc = (function() {
|
|||
array = string.split(':');
|
||||
string = array[0];
|
||||
if (array.length == 2) {
|
||||
ret.super = array[1];
|
||||
ret['super'] = array[1];
|
||||
}
|
||||
}
|
||||
string.split('|').forEach(function(string) {
|
||||
|
|
|
@ -126,12 +126,14 @@ Ox.loadFile = (function() {
|
|||
);
|
||||
element[type == 'css' ? 'href' : 'src'] = file + '?' + Ox.random(1000000);
|
||||
element.type = type == 'css' ? 'text/css' : 'text/javascript';
|
||||
if (type == 'css') {
|
||||
element.rel = 'stylesheet';
|
||||
}
|
||||
if (/MSIE/.test(navigator.userAgent)) {
|
||||
// fixme: find a way to check if css/js have loaded in msie
|
||||
setTimeout(addFileToCache, 2500);
|
||||
} else {
|
||||
if (type == 'css') {
|
||||
element.rel = 'stylesheet';
|
||||
waitForCSS();
|
||||
} else {
|
||||
element.onload = addFileToCache;
|
||||
|
|
|
@ -36,7 +36,7 @@ Ox.load({Geo: {}, UI: {}, Unicode: {}}, function() {
|
|||
function tests() {
|
||||
var passed = 0, failed = 0,
|
||||
lines, spaces, command, expected, result, passed,
|
||||
replace = ['', ''], fns = [], $test
|
||||
replace = ['', ''], fns = [], $test;
|
||||
Ox.forEach(Ox.isArray(arguments[0]) ? arguments[0] : arguments, function(script, i) {
|
||||
Ox.print(script)
|
||||
Ox.test(script, function(results) {
|
||||
|
@ -101,6 +101,9 @@ Ox.load({Geo: {}, UI: {}, Unicode: {}}, function() {
|
|||
colors[+passed][1] + '))'
|
||||
});
|
||||
});
|
||||
$.browser.msie && $element.css({
|
||||
background: 'rgb(' + colors[+passed][0] + ')'
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue