Skip to content

Commit

Permalink
Merge branch 'master' into shadows-entity
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jun 25, 2016
2 parents 41880d2 + 8910f43 commit 3069cf1
Show file tree
Hide file tree
Showing 47 changed files with 18,517 additions and 825 deletions.
510 changes: 510 additions & 0 deletions Apps/SampleData/models/CesiumBalloon/CesiumBalloon.dae

Large diffs are not rendered by default.

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Apps/SampleData/models/CesiumBalloon/FlameGrate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 25 additions & 29 deletions Apps/Sandcastle/CesiumSandcastle.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ require({
//In order for CodeMirror auto-complete to work, Cesium needs to be defined as a global.
window.Cesium = Cesium;

function defined(value) {
return value !== undefined;
}

parser.parse();

fx.fadeOut({
Expand Down Expand Up @@ -212,7 +208,7 @@ require({
}

function openDocTab(title, link) {
if (!defined(docTabs[title])) {
if (!Cesium.defined(docTabs[title])) {
docTabs[title] = new ContentPane({
title : title,
focused : true,
Expand Down Expand Up @@ -269,7 +265,7 @@ require({

function onCursorActivity() {
docNode.style.left = '-999px';
if (defined(docTimer)) {
if (Cesium.defined(docTimer)) {
window.clearTimeout(docTimer);
}
docTimer = window.setTimeout(showDocPopup, 500);
Expand All @@ -293,7 +289,7 @@ require({
}

function closeGalleryTooltip() {
if (defined(activeGalleryTooltipDemo)) {
if (Cesium.defined(activeGalleryTooltipDemo)) {
popup.close(demoTooltips[activeGalleryTooltipDemo.name]);
activeGalleryTooltipDemo = undefined;
}
Expand All @@ -310,7 +306,7 @@ require({
suffix = 'searchDemo';
}

if (defined(activeGalleryTooltipDemo)) {
if (Cesium.defined(activeGalleryTooltipDemo)) {
popup.open({
popup : demoTooltips[activeGalleryTooltipDemo.name],
around : dom.byId(activeGalleryTooltipDemo.name + suffix),
Expand All @@ -322,7 +318,7 @@ require({
function scheduleGalleryTooltip(demo) {
if (demo !== activeGalleryTooltipDemo) {
activeGalleryTooltipDemo = demo;
if (defined(galleryTooltipTimer)) {
if (Cesium.defined(galleryTooltipTimer)) {
window.clearTimeout(galleryTooltipTimer);
}
galleryTooltipTimer = window.setTimeout(openGalleryTooltip, 220);
Expand Down Expand Up @@ -369,7 +365,7 @@ require({
var hints = JSHINT.errors;
for (i = 0, len = hints.length; i < len; ++i) {
var hint = hints[i];
if (hint !== null && defined(hint.reason) && hint.line > 0) {
if (hint !== null && Cesium.defined(hint.reason) && hint.line > 0) {
line = jsEditor.setGutterMarker(scriptLineToEditorLine(hint.line), 'hintGutter', makeLineLabel(hint.reason, 'hintMarker'));
jsEditor.addLineClass(line, 'text', 'hintLine');
errorLines.push(line);
Expand All @@ -379,22 +375,22 @@ require({
}

function scheduleHint() {
if (defined(hintTimer)) {
if (Cesium.defined(hintTimer)) {
window.clearTimeout(hintTimer);
}
hintTimer = setTimeout(clearErrorsAddHints, 550);
highlightRun();
}

function scheduleHintNoChange() {
if (defined(hintTimer)) {
if (Cesium.defined(hintTimer)) {
window.clearTimeout(hintTimer);
}
hintTimer = setTimeout(clearErrorsAddHints, 550);
}

function scrollToLine(lineNumber) {
if (defined(lineNumber)) {
if (Cesium.defined(lineNumber)) {
jsEditor.setCursor(lineNumber);
// set selection twice in order to force the editor to scroll
// to this location if the cursor is already there
Expand Down Expand Up @@ -453,13 +449,13 @@ require({
function registerScroll(demoContainer) {
if (document.onmousewheel !== undefined) {
demoContainer.addEventListener('mousewheel', function(e) {
if (defined(e.wheelDelta) && e.wheelDelta) {
if (Cesium.defined(e.wheelDelta) && e.wheelDelta) {
demoContainer.scrollLeft -= e.wheelDelta * 70 / 120;
}
}, false);
} else {
demoContainer.addEventListener('DOMMouseScroll', function(e) {
if (defined(e.detail) && e.detail) {
if (Cesium.defined(e.detail) && e.detail) {
demoContainer.scrollLeft += e.detail * 70 / 3;
}
}, false);
Expand Down Expand Up @@ -657,7 +653,7 @@ require({
function loadBucket(bucketName) {
if (local.bucketName !== bucketName) {
local.bucketName = bucketName;
if (defined(bucketTypes[bucketName])) {
if (Cesium.defined(bucketTypes[bucketName])) {
local.headers = bucketTypes[bucketName];
} else {
local.headers = '<html><head></head><body data-sandcastle-bucket-loaded="no">';
Expand All @@ -681,13 +677,13 @@ require({
var gistId = ioQuery.queryToObject(window.location.search.substring(1)).gist;
if (window.location.search) {
queryObject = ioQuery.queryToObject(window.location.search.substring(1));
if (defined(gistId)) {
if (Cesium.defined(gistId)) {
queryObject.gistId = gistId;
}
} else {
queryObject.src = 'Hello World.html';
queryObject.label = 'Showcases';
if (defined(gistId)) {
if (Cesium.defined(gistId)) {
queryObject.gistId = gistId;
}
}
Expand Down Expand Up @@ -725,7 +721,7 @@ require({
var scriptCode = scriptMatch[1];
demoJs = scriptCode.replace(/\s/g, '');

if (defined(queryObject.gistId)) {
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;
Expand Down Expand Up @@ -798,14 +794,14 @@ require({
appendConsole('consoleError', 'Error loading gallery, please run the build script.', true);
}
}
} else if (defined(e.data.log)) {
} else if (Cesium.defined(e.data.log)) {
// Console log messages from the iframe display in Sandcastle.
appendConsole('consoleLog', e.data.log, false);
} else if (defined(e.data.error)) {
} else if (Cesium.defined(e.data.error)) {
// Console error messages from the iframe display in Sandcastle
var errorMsg = e.data.error;
var lineNumber = e.data.lineNumber;
if (defined(lineNumber)) {
if (Cesium.defined(lineNumber)) {
errorMsg += ' (on line ';

if (e.data.url) {
Expand All @@ -820,10 +816,10 @@ require({
}
}
appendConsole('consoleError', errorMsg, true);
} else if (defined(e.data.warn)) {
} else if (Cesium.defined(e.data.warn)) {
// Console warning messages from the iframe display in Sandcastle.
appendConsole('consoleWarn', e.data.warn, true);
} else if (defined(e.data.highlight)) {
} else if (Cesium.defined(e.data.highlight)) {
// Hovering objects in the embedded Cesium window.
highlightLine(e.data.highlight);
}
Expand Down Expand Up @@ -1070,15 +1066,15 @@ require({
demo.label = labels ? labels : '';

// Select the demo to load upon opening based on the query parameter.
if (defined(queryObject.src)) {
if (Cesium.defined(queryObject.src)) {
var gistDemo = {
name : 'Gist Import',
code : demo.code,
description: 'Code imported from GitHub Gist'
};
if (demo.name === queryObject.src.replace('.html', '')) {
loadFromGallery(demo).then(function() {
if (defined(queryObject.gistId)) {
if (Cesium.defined(queryObject.gistId)) {
window.history.replaceState(gistDemo, gistDemo.name, '?src=Hello World.html&label=' + queryObject.label + '&gist=' + queryObject.gistId);
document.title = 'Gist Import - Cesium Sandcastle';
} else {
Expand All @@ -1103,7 +1099,7 @@ require({

var loading = true;
function setSubtab(tabName) {
currentTab = defined(tabName) && !loading ? tabName : queryObject.label;
currentTab = Cesium.defined(tabName) && !loading ? tabName : queryObject.label;
queryObject.label = tabName;
loading = false;
}
Expand Down Expand Up @@ -1146,7 +1142,7 @@ require({
function createGalleryButton(index, tab, tabName) {
var demo = gallery_demos[index];
var imgSrc = 'templates/Gallery_tile.jpg';
if (defined(demo.img)) {
if (Cesium.defined(demo.img)) {
imgSrc = 'gallery/' + demo.img;
}

Expand Down Expand Up @@ -1198,7 +1194,7 @@ require({
}

var promise;
if (!defined(gallery_demos)) {
if (!Cesium.defined(gallery_demos)) {
galleryErrorMsg.textContent = 'No demos found, please run the build script.';
galleryErrorMsg.style.display = 'inline-block';
} else {
Expand Down
12 changes: 11 additions & 1 deletion Apps/Sandcastle/Sandcastle-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
return value !== undefined;
}

function print(value) {
if (value === null) {
return 'null';
} else if (defined(value)) {
return value.toString();
} else {
return 'undefined';
}
}

console.originalLog = console.log;
console.log = function(d1) {
console.originalLog.apply(console, arguments);
window.parent.postMessage({
'log' : defined(d1) ? d1.toString() : 'undefined'
'log' : print(d1)
}, '*');
};

Expand Down
5 changes: 5 additions & 0 deletions Apps/Sandcastle/gallery/3D Models.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
onselect : function() {
createModel('../../SampleData/models/CesiumGround/Cesium_Ground.glb', 0);
}
}, {
text : 'Hot Air Balloon',
onselect : function() {
createModel('../../SampleData/models/CesiumBalloon/CesiumBalloon.glb', 1000.0);
}
}, {
text : 'Milk truck',
onselect : function() {
Expand Down
Loading

0 comments on commit 3069cf1

Please sign in to comment.