diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 72abef0a7321..000000000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.npmignore b/.npmignore
index 462e805a67f3..d9e2e3bb2e65 100644
--- a/.npmignore
+++ b/.npmignore
@@ -19,7 +19,6 @@
/index.release.html
/Instrumented
/launches
-/logo.png
/server.js
/Source/copyrightHeader.js
/Source/main.js
diff --git a/Apps/CesiumViewer/CesiumViewer.js b/Apps/CesiumViewer/CesiumViewer.js
index 1f3880728728..9d0cbfeb9ff5 100644
--- a/Apps/CesiumViewer/CesiumViewer.js
+++ b/Apps/CesiumViewer/CesiumViewer.js
@@ -3,7 +3,6 @@ define([
'Cesium/Core/Cartesian3',
'Cesium/Core/defined',
'Cesium/Core/formatError',
- 'Cesium/Core/getFilenameFromUri',
'Cesium/Core/Math',
'Cesium/Core/objectToQuery',
'Cesium/Core/queryToObject',
@@ -19,7 +18,6 @@ define([
Cartesian3,
defined,
formatError,
- getFilenameFromUri,
CesiumMath,
objectToQuery,
queryToObject,
diff --git a/Apps/CesiumViewer/favicon.ico b/Apps/CesiumViewer/favicon.ico
index e28d548f0701..0b05a3cda16b 100644
Binary files a/Apps/CesiumViewer/favicon.ico and b/Apps/CesiumViewer/favicon.ico differ
diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js
index a6456aa1b240..585947073935 100644
--- a/Apps/Sandcastle/CesiumSandcastle.js
+++ b/Apps/Sandcastle/CesiumSandcastle.js
@@ -160,12 +160,16 @@ require({
var currentTab = '';
var newDemo;
var demoHtml = '';
- var demoJs = '';
+ var demoCode = '';
var previousCode = '';
+ var previousHtml = '';
var runGist = false;
var gistCode;
+ var gistHtml;
var sandcastleUrl = '';
+ var defaultHtml = '\n
\nLoading...
\n';
+
var galleryErrorMsg = document.createElement('span');
galleryErrorMsg.className = 'galleryError';
galleryErrorMsg.style.display = 'none';
@@ -504,7 +508,7 @@ require({
window.onbeforeunload = function (e) {
var htmlText = (htmlEditor.getValue()).replace(/\s/g, '');
var jsText = (jsEditor.getValue()).replace(/\s/g, '');
- if (demoHtml !== htmlText || demoJs !== jsText) {
+ if (demoHtml !== htmlText || demoCode !== jsText) {
return 'Be sure to save a copy of any important edits before leaving this page.';
}
};
@@ -695,7 +699,7 @@ require({
if (demo.name === 'Gist Import') {
jsEditor.setValue(gistCode);
- htmlEditor.setValue('\n\nLoading...
\n');
+ htmlEditor.setValue(gistHtml);
document.title = 'Gist Import - Cesium Sandcastle';
CodeMirror.commands.runCesium(jsEditor);
return;
@@ -719,17 +723,23 @@ require({
}
var scriptCode = scriptMatch[1];
- demoJs = scriptCode.replace(/\s/g, '');
+ demoCode = scriptCode.replace(/\s/g, '');
if (Cesium.defined(queryObject.gistId)) {
Cesium.loadJsonp('https://api.github.com/gists/' + queryObject.gistId + '?access_token=dd8f755c2e5d9bbb26806bb93eaa2291f2047c60')
.then(function(data) {
var files = data.data.files;
- var code = files[Object.keys(files)[0]].content;
+ var code = files['Cesium-Sandcastle.js'].content;
+ var htmlFile = files['Cesium-Sandcastle.html'];
+ var html = Cesium.defined(htmlFile) ? htmlFile.content : defaultHtml; // Use the default html for old gists
jsEditor.setValue(code);
- demoJs = code.replace(/\s/g, '');
+ htmlEditor.setValue(html);
+ demoCode = code.replace(/\s/g, '');
+ demoHtml = html.replace(/\s/g, '');
gistCode = code;
+ gistHtml = html;
previousCode = code;
+ previousHtml = html;
sandcastleUrl = Cesium.getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + gistId;
CodeMirror.commands.runCesium(jsEditor);
clearRun();
@@ -885,17 +895,22 @@ require({
var textArea = document.getElementById('link');
textArea.value = '\n\n';
var code = jsEditor.getValue();
- if (code === previousCode) {
+ var html = htmlEditor.getValue();
+ if (code === previousCode && html === previousHtml) {
textArea.value = sandcastleUrl;
textArea.select();
return;
}
previousCode = code;
+ previousHtml = html;
var data = {
public : true,
files : {
'Cesium-Sandcastle.js' : {
content : code
+ },
+ 'Cesium-Sandcastle.html' : {
+ content : html
}
}
};
@@ -915,9 +930,10 @@ require({
registry.byId('buttonImport').on('click', function() {
gistId = document.getElementById("gistId").value;
- if (gistId.indexOf('/') !== -1) {
- var index = gistId.lastIndexOf('/');
- gistId = gistId.substring(index + 1);
+ var gistParameter = '&gist=';
+ var gistIndex = gistId.indexOf(gistParameter);
+ if (gistIndex !== -1) {
+ gistId = gistId.substring(gistIndex + gistParameter.length);
}
window.location.href = Cesium.getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + gistId;
});
@@ -926,7 +942,7 @@ require({
var htmlText = (htmlEditor.getValue()).replace(/\s/g, '');
var jsText = (jsEditor.getValue()).replace(/\s/g, '');
var confirmChange = true;
- if (demoHtml !== htmlText || demoJs !== jsText) {
+ if (demoHtml !== htmlText || demoCode !== jsText) {
confirmChange = window.confirm('You have unsaved changes. Are you sure you want to navigate away from this demo?');
}
if (confirmChange) {
@@ -1169,7 +1185,7 @@ require({
var htmlText = (htmlEditor.getValue()).replace(/\s/g, '');
var jsText = (jsEditor.getValue()).replace(/\s/g, '');
var confirmChange = true;
- if (demoHtml !== htmlText || demoJs !== jsText) {
+ if (demoHtml !== htmlText || demoCode !== jsText) {
confirmChange = window.confirm('You have unsaved changes. Are you sure you want to navigate away from this demo?');
}
if (confirmChange) {
diff --git a/Apps/Sandcastle/Sandcastle-header.js b/Apps/Sandcastle/Sandcastle-header.js
index ed9c763c31f6..e75def7f5ebe 100644
--- a/Apps/Sandcastle/Sandcastle-header.js
+++ b/Apps/Sandcastle/Sandcastle-header.js
@@ -26,6 +26,30 @@
document.body.className = document.body.className.replace(/(?:\s|^)sandcastle-loading(?:\s|$)/, ' ');
},
+ addToggleButton : function(text, checked, onchange, toolbarID) {
+ window.Sandcastle.declare(onchange);
+ var input = document.createElement('input');
+ input.checked = checked;
+ input.type = 'checkbox';
+ input.style.pointerEvents = 'none';
+ var label = document.createElement('label');
+ label.appendChild(input);
+ label.appendChild(document.createTextNode(text));
+ label.style.pointerEvents = 'none';
+ var button = document.createElement('button');
+ button.type = 'button';
+ button.className = 'cesium-button';
+ button.appendChild(label);
+
+ button.onclick = function() {
+ window.Sandcastle.reset();
+ window.Sandcastle.highlight(onchange);
+ input.checked = !input.checked;
+ onchange(input.checked);
+ };
+
+ document.getElementById(toolbarID || 'toolbar').appendChild(button);
+ },
addToolbarButton : function(text, onclick, toolbarID) {
window.Sandcastle.declare(onclick);
var button = document.createElement('button');
diff --git a/Apps/Sandcastle/gallery/Atmosphere Color.html b/Apps/Sandcastle/gallery/Atmosphere Color.html
index f58f0517dec1..9e23fbd04f6e 100644
--- a/Apps/Sandcastle/gallery/Atmosphere Color.html
+++ b/Apps/Sandcastle/gallery/Atmosphere Color.html
@@ -56,14 +56,14 @@
-
-
-
-
-
-
-
-
-Loading...
-
-
-
-