Small changes

This commit is contained in:
Jonathan Hodgson 2017-08-14 17:01:01 +01:00
parent c1fa136caa
commit b30fb8b8e2
3 changed files with 55 additions and 51 deletions

View file

@ -1,27 +1,29 @@
var xhr = new XMLHttpRequest(); if(window.location.host.indexOf(".local") == -1){
xhr.open('GET', 'https://dotcss.local/' + window.location.host.replace(/^www\./, '') + '.css'); var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://dotcss.local/' + window.location.host.replace(/^www\./, '') + '.css');
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if(xhr.readyState == 4) { if(xhr.readyState == 4) {
if(xhr.status == 200) { if(xhr.status == 200) {
var style = document.createElement('style'); var style = document.createElement('style');
style.textContent = xhr.responseText; style.textContent = xhr.responseText;
document.head.appendChild(style); document.head.appendChild(style);
return return
} else if(xhr.status == 404) { } else if(xhr.status == 404) {
var defaultXHR = new XMLHttpRequest(); var defaultXHR = new XMLHttpRequest();
defaultXHR.open('GET', 'https://dotcss.local/default.css'); defaultXHR.open('GET', 'https://dotcss.local/default.css');
defaultXHR.onreadystatechange = function() { defaultXHR.onreadystatechange = function() {
if (defaultXHR.readyState == 4 && defaultXHR.status == 200){ if (defaultXHR.readyState == 4 && defaultXHR.status == 200){
var style = document.createElement('style'); var style = document.createElement('style');
style.textContent = defaultXHR.responseText; style.textContent = defaultXHR.responseText;
document.head.appendChild(style); document.head.appendChild(style);
return; return;
}
} }
defaultXHR.send();
} }
defaultXHR.send();
} }
} };
};
xhr.send(); xhr.send();
}

View file

@ -1,27 +1,29 @@
var xhr = new XMLHttpRequest(); if(window.location.host.indexOf(".local") != -1){
xhr.open('GET', 'https://dotjs.local/' + window.location.host.replace(/^www\./, '') + '.js'); var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://dotjs.local/' + window.location.host.replace(/^www\./, '') + '.js');
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if(xhr.readyState == 4) { if(xhr.readyState == 4) {
if(xhr.status == 200) { if(xhr.status == 200) {
var script = document.createElement('script'); var script = document.createElement('script');
script.textContent = xhr.responseText; script.textContent = xhr.responseText;
document.head.appendChild(script); document.head.appendChild(script);
return; return;
} else if(xhr.status == 404) { } else if(xhr.status == 404) {
var defaultXHR = new XMLHttpRequest(); var defaultXHR = new XMLHttpRequest();
defaultXHR.open('GET', 'https://dotjs.local/default.js'); defaultXHR.open('GET', 'https://dotjs.local/default.js');
defaultXHR.onreadystatechange = function() { defaultXHR.onreadystatechange = function() {
if (defaultXHR.readyState == 4 && defaultXHR.status == 200){ if (defaultXHR.readyState == 4 && defaultXHR.status == 200){
var script = document.createElement('script'); var script = document.createElement('script');
script.textContent = defaultXHR.responseText; script.textContent = defaultXHR.responseText;
document.head.appendChild(script); document.head.appendChild(script);
return; return;
}
} }
defaultXHR.send();
} }
defaultXHR.send();
} }
} };
};
xhr.send(); xhr.send();
}

View file

@ -2,15 +2,15 @@
# Custom dir command # Custom dir command
function my_dir(){ function my_dir(){
homeIcon=" " homeIcon=""
wpPluginsIcon=".p." wpPluginsIcon=".p."
wpThemesIcon=".t." wpThemesIcon=".t."
siteIcon=" " siteIcon=""
wpSiteIcon=" " wpSiteIcon=""
magentoSiteIcon=" " magentoSiteIcon=""
dropboxIcon=" " dropboxIcon=""
seperator="  " seperator=" "
root=" " root=""
# Gets the path. # Gets the path.
local current_path="$(print -P "%~")" local current_path="$(print -P "%~")"