Skip to content

Commit

Permalink
Remove all double quote usage from JS code
Browse files Browse the repository at this point in the history
99% of this PR was automatically fixed with eslint, I simply removed the
`"quotes": "off"` from Sandcastle and Specs which was ignoring the
standard rule of using single quotes.

Also added some Sandcastle generated files to .eslintignore.
  • Loading branch information
mramato committed Jul 24, 2018
1 parent 380bbd1 commit 6e0911e
Show file tree
Hide file tree
Showing 230 changed files with 2,227 additions and 2,225 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Expand Up @@ -8,3 +8,5 @@ Source/ThirdParty/**
Source/Workers/cesiumWorkerBootstrapper.js
ThirdParty/**
Tools/**
Apps/Sandcastle/jsHintOptions.js
Apps/Sandcastle/gallery/gallery-index.js
3 changes: 1 addition & 2 deletions Apps/Sandcastle/.eslintrc.json
Expand Up @@ -10,7 +10,6 @@
"rules": {
"no-alert": ["off"],
"no-implicit-globals": "off",
"no-unused-vars": ["off"],
"quotes": "off"
"no-unused-vars": ["off"]
}
}
18 changes: 9 additions & 9 deletions Apps/Sandcastle/CesiumSandcastle.js
Expand Up @@ -27,10 +27,10 @@ require({
location: '../Apps/Sandcastle/ThirdParty'
}]
}, [
"dijit/Dialog",
"dijit/form/Button",
"dijit/form/Form",
"dijit/form/Textarea",
'dijit/Dialog',
'dijit/form/Button',
'dijit/form/Form',
'dijit/form/Textarea',
'CodeMirror/lib/codemirror',
'dijit/layout/ContentPane',
'dijit/popup',
Expand Down Expand Up @@ -549,10 +549,10 @@ require({
'//Sandcastle_End\n' +
' Sandcastle.finishedLoading();\n' +
'}\n' +
'if (typeof Cesium !== "undefined") {\n' +
'if (typeof Cesium !== \'undefined\') {\n' +
' startup(Cesium);\n' +
'} else if (typeof require === "function") {\n' +
' require(["Cesium"], startup);\n' +
'} else if (typeof require === \'function\') {\n' +
' require([\'Cesium\'], startup);\n' +
'}\n';
}

Expand Down Expand Up @@ -949,7 +949,7 @@ require({
});

registry.byId('buttonImport').on('click', function() {
var gistId = document.getElementById("gistId").value;
var gistId = document.getElementById('gistId').value;
var gistParameter = '&gist=';
var gistIndex = gistId.indexOf(gistParameter);
if (gistIndex !== -1) {
Expand Down Expand Up @@ -1196,7 +1196,7 @@ require({
demoLink.className = 'linkButton';
demoLink.href = 'gallery/' + encodeURIComponent(demo.name) + '.html';

if (demo.name === "Hello World") {
if (demo.name === 'Hello World') {
newDemo = demo;
}
demoLink.onclick = function(e) {
Expand Down
8 changes: 4 additions & 4 deletions Apps/Sandcastle/LinkButton.js
Expand Up @@ -15,19 +15,19 @@ define([
'use strict';

return declare('Sandcastle.LinkButton', [_WidgetBase, _TemplatedMixin, _CssStateMixin], {
baseClass : "dijitButton",
baseClass : 'dijitButton',
templateString : template,
showLabel : true,

_setShowLabelAttr : function(val) {
if (this.containerNode) {
domClass.toggle(this.containerNode, "dijitDisplayNone", !val);
domClass.toggle(this.containerNode, 'dijitDisplayNone', !val);
}
this._set("showLabel", val);
this._set('showLabel', val);
},

_setLabelAttr : function(/*String*/content) {
this._set("label", content);
this._set('label', content);
(this.containerNode || this.focusNode).innerHTML = content;
}
});
Expand Down
6 changes: 3 additions & 3 deletions Apps/Sandcastle/gallery/3D Models Coloring.html
Expand Up @@ -233,10 +233,10 @@
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
Expand Down
8 changes: 4 additions & 4 deletions Apps/Sandcastle/gallery/3D Models.html
Expand Up @@ -10,7 +10,7 @@
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
if(typeof require === "function") {
if(typeof require === 'function') {
require.config({
baseUrl : '../../../Source',
waitSeconds : 120
Expand Down Expand Up @@ -95,10 +95,10 @@
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions Apps/Sandcastle/gallery/3D Tiles Adjust Height.html
Expand Up @@ -80,10 +80,10 @@
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
Expand Down
20 changes: 11 additions & 9 deletions Apps/Sandcastle/gallery/3D Tiles BIM.html
Expand Up @@ -2,18 +2,20 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="A sample BIM dataset rendered with 3D Tiles.">
<meta name="cesium-sandcastle-labels" content="Showcases, 3D Tiles">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
if(typeof require === 'function') {
require.config({
baseUrl : '../../../Source',
waitSeconds : 120
});
}
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
Expand All @@ -38,12 +40,12 @@
console.log(error);
});
//Sandcastle_End
Sandcastle.finishedLoading();
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
Expand Down
48 changes: 24 additions & 24 deletions Apps/Sandcastle/gallery/3D Tiles Batch Table Hierarchy.html
Expand Up @@ -100,55 +100,55 @@
addStyle('No style', {});

addStyle('Color by building', {
"color" : {
"conditions" : [
'color' : {
'conditions' : [
["${building_name} === 'building0'", "color('purple')"],
["${building_name} === 'building1'", "color('red')"],
["${building_name} === 'building2'", "color('orange')"],
["true", "color('blue')"]
['true', "color('blue')"]
]
}
});

addStyle('Color all doors', {
"color" : {
"conditions" : [
'color' : {
'conditions' : [
["isExactClass('door')", "color('orange')"],
["true", "color('white')"]
['true', "color('white')"]
]
}
});

addStyle('Color all features derived from door', {
"color" : {
"conditions" : [
'color' : {
'conditions' : [
["isClass('door')", "color('orange')"],
["true", "color('white')"]
['true', "color('white')"]
]
}
});

addStyle('Color features by class name', {
"defines" : {
"suffix" : "regExp('door(.*)').exec(getExactClassName())"
'defines' : {
'suffix' : "regExp('door(.*)').exec(getExactClassName())"
},
"color" : {
"conditions" : [
'color' : {
'conditions' : [
["${suffix} === 'knob'", "color('yellow')"],
["${suffix} === ''", "color('lime')"],
["${suffix} === null", "color('gray')"],
["true", "color('blue')"]
['${suffix} === null', "color('gray')"],
['true', "color('blue')"]
]
}
});

addStyle('Style by height', {
"color" : {
"conditions" : [
["${height} >= 10", "color('purple')"],
["${height} >= 6", "color('red')"],
["${height} >= 5", "color('orange')"],
["true", "color('blue')"]
'color' : {
'conditions' : [
['${height} >= 10', "color('purple')"],
['${height} >= 6', "color('red')"],
['${height} >= 5', "color('orange')"],
['true', "color('blue')"]
]
}
});
Expand Down Expand Up @@ -200,10 +200,10 @@
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html
Expand Up @@ -264,10 +264,10 @@
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions Apps/Sandcastle/gallery/3D Tiles Feature Picking.html
Expand Up @@ -238,10 +238,10 @@
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
Expand Down
52 changes: 26 additions & 26 deletions Apps/Sandcastle/gallery/3D Tiles Feature Styling.html
Expand Up @@ -54,14 +54,14 @@
tileset.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["${height} >= 300", "rgba(45, 0, 75, 0.5)"],
["${height} >= 200", "rgb(102, 71, 151)"],
["${height} >= 100", "rgb(170, 162, 204)"],
["${height} >= 50", "rgb(224, 226, 238)"],
["${height} >= 25", "rgb(252, 230, 200)"],
["${height} >= 10", "rgb(248, 176, 87)"],
["${height} >= 5", "rgb(198, 106, 11)"],
["true", "rgb(127, 59, 8)"]
['${height} >= 300', 'rgba(45, 0, 75, 0.5)'],
['${height} >= 200', 'rgb(102, 71, 151)'],
['${height} >= 100', 'rgb(170, 162, 204)'],
['${height} >= 50', 'rgb(224, 226, 238)'],
['${height} >= 25', 'rgb(252, 230, 200)'],
['${height} >= 10', 'rgb(248, 176, 87)'],
['${height} >= 5', 'rgb(198, 106, 11)'],
['true', 'rgb(127, 59, 8)']
]
}
});
Expand All @@ -71,17 +71,17 @@
function colorByLatitude() {
tileset.style = new Cesium.Cesium3DTileStyle({
defines: {
latitudeRadians: "radians(${latitude})"
latitudeRadians: 'radians(${latitude})'
},
color: {
conditions: [
["${latitudeRadians} >= 0.7125", "color('purple')"],
["${latitudeRadians} >= 0.712", "color('red')"],
["${latitudeRadians} >= 0.7115", "color('orange')"],
["${latitudeRadians} >= 0.711", "color('yellow')"],
["${latitudeRadians} >= 0.7105", "color('lime')"],
["${latitudeRadians} >= 0.710", "color('cyan')"],
["true", "color('blue')"]
['${latitudeRadians} >= 0.7125', "color('purple')"],
['${latitudeRadians} >= 0.712', "color('red')"],
['${latitudeRadians} >= 0.7115', "color('orange')"],
['${latitudeRadians} >= 0.711', "color('yellow')"],
['${latitudeRadians} >= 0.7105', "color('lime')"],
['${latitudeRadians} >= 0.710', "color('cyan')"],
['true', "color('blue')"]
]
}
});
Expand All @@ -91,15 +91,15 @@
function colorByDistance() {
tileset.style = new Cesium.Cesium3DTileStyle({
defines : {
distance : "distance(vec2(radians(${longitude}), radians(${latitude})), vec2(-1.291777521, 0.7105706624))"
distance : 'distance(vec2(radians(${longitude}), radians(${latitude})), vec2(-1.291777521, 0.7105706624))'
},
color : {
conditions : [
["${distance} > 0.0012","color('gray')"],
["${distance} > 0.0008", "mix(color('yellow'), color('red'), (${distance} - 0.008) / 0.0004)"],
["${distance} > 0.0004", "mix(color('green'), color('yellow'), (${distance} - 0.0004) / 0.0004)"],
["${distance} < 0.00001", "color('white')"],
["true", "mix(color('blue'), color('green'), ${distance} / 0.0004)"]
['${distance} > 0.0012',"color('gray')"],
['${distance} > 0.0008', "mix(color('yellow'), color('red'), (${distance} - 0.008) / 0.0004)"],
['${distance} > 0.0004', "mix(color('green'), color('yellow'), (${distance} - 0.0004) / 0.0004)"],
['${distance} < 0.00001', "color('white')"],
['true', "mix(color('blue'), color('green'), ${distance} / 0.0004)"]
]
}
});
Expand All @@ -115,7 +115,7 @@
// Show only buildings greater than 200 meters in height.
function hideByHeight() {
tileset.style = new Cesium.Cesium3DTileStyle({
show : "${height} > 200"
show : '${height} > 200'
});
}

Expand Down Expand Up @@ -151,10 +151,10 @@
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
Expand Down

0 comments on commit 6e0911e

Please sign in to comment.