Run `grunt`.
This commit is contained in:
Родитель
cf52f909d3
Коммит
d0be556cd8
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -420,6 +420,8 @@
|
||||||
|
|
||||||
options.container = options.container || options.transition ? document.querySelector('.content') : document.body;
|
options.container = options.container || options.transition ? document.querySelector('.content') : document.body;
|
||||||
|
|
||||||
|
var isFileProtocol = /^file:/.test(window.location.protocol);
|
||||||
|
|
||||||
for (key in bars) {
|
for (key in bars) {
|
||||||
if (bars.hasOwnProperty(key)) {
|
if (bars.hasOwnProperty(key)) {
|
||||||
options[key] = options[key] || document.querySelector(bars[key]);
|
options[key] = options[key] || document.querySelector(bars[key]);
|
||||||
|
@ -432,21 +434,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
xhr = new XMLHttpRequest();
|
xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', options.url, true);
|
if (isFileProtocol) {
|
||||||
xhr.setRequestHeader('X-PUSH', 'true');
|
xhr.open('GET', options.url, false);
|
||||||
|
} else {
|
||||||
|
xhr.open('GET', options.url, true);
|
||||||
|
xhr.setRequestHeader('X-PUSH', 'true');
|
||||||
|
|
||||||
xhr.onreadystatechange = function () {
|
xhr.onreadystatechange = function () {
|
||||||
if (options._timeout) {
|
if (options._timeout) {
|
||||||
clearTimeout(options._timeout);
|
clearTimeout(options._timeout);
|
||||||
}
|
|
||||||
if (xhr.readyState === 4) {
|
|
||||||
if (xhr.status === 200) {
|
|
||||||
success(xhr, options);
|
|
||||||
} else {
|
|
||||||
failure(options.url);
|
|
||||||
}
|
}
|
||||||
}
|
if (xhr.readyState === 4) {
|
||||||
};
|
if (xhr.status === 200) {
|
||||||
|
success(xhr, options);
|
||||||
|
} else {
|
||||||
|
failure(options.url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (!PUSH.id) {
|
if (!PUSH.id) {
|
||||||
cacheReplace({
|
cacheReplace({
|
||||||
|
@ -466,6 +472,14 @@
|
||||||
|
|
||||||
xhr.send();
|
xhr.send();
|
||||||
|
|
||||||
|
if (isFileProtocol) {
|
||||||
|
if (xhr.status === 0 || xhr.status === 200) {
|
||||||
|
success(xhr, options);
|
||||||
|
} else {
|
||||||
|
failure(options.url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (xhr.readyState && !options.ignorePush) {
|
if (xhr.readyState && !options.ignorePush) {
|
||||||
cachePush();
|
cachePush();
|
||||||
}
|
}
|
||||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -420,6 +420,8 @@
|
||||||
|
|
||||||
options.container = options.container || options.transition ? document.querySelector('.content') : document.body;
|
options.container = options.container || options.transition ? document.querySelector('.content') : document.body;
|
||||||
|
|
||||||
|
var isFileProtocol = /^file:/.test(window.location.protocol);
|
||||||
|
|
||||||
for (key in bars) {
|
for (key in bars) {
|
||||||
if (bars.hasOwnProperty(key)) {
|
if (bars.hasOwnProperty(key)) {
|
||||||
options[key] = options[key] || document.querySelector(bars[key]);
|
options[key] = options[key] || document.querySelector(bars[key]);
|
||||||
|
@ -432,21 +434,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
xhr = new XMLHttpRequest();
|
xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', options.url, true);
|
if (isFileProtocol) {
|
||||||
xhr.setRequestHeader('X-PUSH', 'true');
|
xhr.open('GET', options.url, false);
|
||||||
|
} else {
|
||||||
|
xhr.open('GET', options.url, true);
|
||||||
|
xhr.setRequestHeader('X-PUSH', 'true');
|
||||||
|
|
||||||
xhr.onreadystatechange = function () {
|
xhr.onreadystatechange = function () {
|
||||||
if (options._timeout) {
|
if (options._timeout) {
|
||||||
clearTimeout(options._timeout);
|
clearTimeout(options._timeout);
|
||||||
}
|
|
||||||
if (xhr.readyState === 4) {
|
|
||||||
if (xhr.status === 200) {
|
|
||||||
success(xhr, options);
|
|
||||||
} else {
|
|
||||||
failure(options.url);
|
|
||||||
}
|
}
|
||||||
}
|
if (xhr.readyState === 4) {
|
||||||
};
|
if (xhr.status === 200) {
|
||||||
|
success(xhr, options);
|
||||||
|
} else {
|
||||||
|
failure(options.url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (!PUSH.id) {
|
if (!PUSH.id) {
|
||||||
cacheReplace({
|
cacheReplace({
|
||||||
|
@ -466,6 +472,14 @@
|
||||||
|
|
||||||
xhr.send();
|
xhr.send();
|
||||||
|
|
||||||
|
if (isFileProtocol) {
|
||||||
|
if (xhr.status === 0 || xhr.status === 200) {
|
||||||
|
success(xhr, options);
|
||||||
|
} else {
|
||||||
|
failure(options.url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (xhr.readyState && !options.ignorePush) {
|
if (xhr.readyState && !options.ignorePush) {
|
||||||
cachePush();
|
cachePush();
|
||||||
}
|
}
|
||||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Загрузка…
Ссылка в новой задаче