Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hacktoberfest fix #1131

Merged
merged 1 commit into from
Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions test/dev-setup.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
(function() {

var IS_FILE_PROTOCOL = (window.location.protocol === 'file:');
var DIRNAME = null;
let IS_FILE_PROTOCOL = (window.location.protocol === 'file:');
let DIRNAME = null;
if (IS_FILE_PROTOCOL) {
var port = window.location.port;
let port = window.location.port;
if (port.length > 0) {
port = ':' + port;
}
DIRNAME = window.location.protocol + '//' + window.location.hostname + port + window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/'));

var bases = document.getElementsByTagName('base');
let bases = document.getElementsByTagName('base');
if (bases.length > 0) {
DIRNAME = DIRNAME + '/' + bases[0].getAttribute('href');
}
}


var LOADER_OPTS = (function() {
let LOADER_OPTS = (function() {
function parseQueryString() {
var str = window.location.search;
let str = window.location.search;
str = str.replace(/^\?/, '');
var pieces = str.split(/&/);
var result = {};
let pieces = str.split(/&/);
let result = {};
pieces.forEach(function(piece) {
var config = piece.split(/=/);
let config = piece.split(/=/);
result[config[0]] = config[1];
});
return result;
}
var overwrites = parseQueryString();
var result = {};
let overwrites = parseQueryString();
let result = {};
result['editor'] = overwrites['editor'] || 'npm/dev';
METADATA.PLUGINS.map(function(plugin) {
result[plugin.name] = overwrites[plugin.name] || 'npm/dev';
});
return result;
})();
function toHREF(search) {
var port = window.location.port;
let port = window.location.port;
if (port.length > 0) {
port = ':' + port;
}
Expand All @@ -56,7 +56,7 @@
return /release/.test(this.selectedPath);
};
Component.prototype.getResolvedPath = function() {
var resolvedPath = this.paths[this.selectedPath];
let resolvedPath = this.paths[this.selectedPath];
if (this.selectedPath === 'npm/dev' || this.selectedPath === 'npm/min' || this.isRelease()) {
if (IS_FILE_PROTOCOL) {
resolvedPath = DIRNAME + '/../' + resolvedPath;
Expand All @@ -74,14 +74,14 @@
dest[this.modulePrefix] = this.getResolvedPath();
};
Component.prototype.generateUrlForPath = function(pathName) {
var NEW_LOADER_OPTS = {};
let NEW_LOADER_OPTS = {};
Object.keys(LOADER_OPTS).forEach(function(key) {
NEW_LOADER_OPTS[key] = (LOADER_OPTS[key] === 'npm/dev' ? undefined : LOADER_OPTS[key]);
});
NEW_LOADER_OPTS[this.name] = (pathName === 'npm/dev' ? undefined : pathName);

var search = Object.keys(NEW_LOADER_OPTS).map(function(key) {
var value = NEW_LOADER_OPTS[key];
let search = Object.keys(NEW_LOADER_OPTS).map(function(key) {
let value = NEW_LOADER_OPTS[key];
if (value) {
return key + '=' + value;
}
Expand All @@ -102,16 +102,16 @@
};


var RESOLVED_CORE = new Component('editor', 'vs', METADATA.CORE.paths);
let RESOLVED_CORE = new Component('editor', 'vs', METADATA.CORE.paths);
self.RESOLVED_CORE_PATH = RESOLVED_CORE.getResolvedPath();
var RESOLVED_PLUGINS = METADATA.PLUGINS.map(function(plugin) {
let RESOLVED_PLUGINS = METADATA.PLUGINS.map(function(plugin) {
return new Component(plugin.name, plugin.modulePrefix, plugin.paths, plugin.contrib);
});
METADATA = null;


function loadScript(path, callback) {
var script = document.createElement('script');
let script = document.createElement('script');
script.onload = callback;
script.async = true;
script.type = 'text/javascript';
Expand All @@ -121,12 +121,12 @@


(function() {
var allComponents = [RESOLVED_CORE];
let allComponents = [RESOLVED_CORE];
if (!RESOLVED_CORE.isRelease()) {
allComponents = allComponents.concat(RESOLVED_PLUGINS);
}

var div = document.createElement('div');
let div = document.createElement('div');
div.style.position = 'fixed';
div.style.top = 0;
div.style.right = 0;
Expand All @@ -138,9 +138,9 @@

document.body.appendChild(div);

var aElements = document.getElementsByTagName('a');
for (var i = 0; i < aElements.length; i++) {
var aElement = aElements[i];
let aElements = document.getElementsByTagName('a');
for (let i = 0; i < aElements.length; i++) {
let aElement = aElements[i];
if (aElement.className === 'loading-opts') {
aElement.href += window.location.search
}
Expand All @@ -152,7 +152,7 @@
PATH_PREFIX = PATH_PREFIX || '';

loadScript(PATH_PREFIX + RESOLVED_CORE.getResolvedPath() + '/loader.js', function() {
var loaderPathsConfig = {};
let loaderPathsConfig = {};
if (!RESOLVED_CORE.isRelease()) {
RESOLVED_PLUGINS.forEach(function(plugin) {
plugin.generateLoaderConfig(loaderPathsConfig);
Expand Down
6 changes: 4 additions & 2 deletions website/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ h6 small {

.navbar-inverse .navbar-inner {
background-color: #68217A;
filter: none;
-webkit-filter: none;
filter: none;
}

.navbar-inverse.home .navbar-inner {
Expand Down Expand Up @@ -177,7 +178,8 @@ body > section > .container {
.navbar-inverse .nav .active>a.nav-item, .navbar-inverse .nav .active>a.nav-item:hover, .navbar-inverse .nav .active>a.nav-item:focus {
color:#fff;
background-color: rgba(0,0,0,.24);
box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}

.navbar .logo {
Expand Down