diff --git a/.concierge/templates/pullRequestOpened.hbs b/.concierge/templates/pullRequestOpened.hbs index f494947adb90..8408c266f8ab 100644 --- a/.concierge/templates/pullRequestOpened.hbs +++ b/.concierge/templates/pullRequestOpened.hbs @@ -1,7 +1,7 @@ {{#if askAboutContributors}} Thank you so much for the pull request @{{ userName }}! I noticed this is your first pull request and I wanted to say welcome to the Cesium community! -The [Pull Request Guidelines](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#pull-request-guidelines) is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that. +The [Pull Request Guidelines](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md#pull-request-guidelines) is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that. * :x: Missing `CONTRIBUTORS.md` entry. * Please add yourself to the [contributors]({{ contributorsUrl }}) file! @@ -10,7 +10,7 @@ Thanks for the pull request @{{ userName }}! {{/if}} {{#if claEnabled}} {{#if errorCla}} -* :grey_exclamation: There was an error checking the CLA! If this is your first contribution, please send in a [Contributor License Agreement](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla). +* :grey_exclamation: There was an error checking the CLA! If this is your first contribution, please send in a [Contributor License Agreement](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla). * Maintainers, this was the error I ran into while attempting to process the CLA check. Please resolve it to continue CLA checking. ``` {{ errorCla }} @@ -18,7 +18,7 @@ Thanks for the pull request @{{ userName }}! {{else}} {{#if askForCla}} * :x: Missing CLA. - * Please send in a [Contributor License Agreement](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla) (CLA) and comment back here to let us know to check this! + * Please send in a [Contributor License Agreement](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla) (CLA) and comment back here to let us know to check this! {{else}} * :heavy_check_mark: Signed CLA found. {{/if}} @@ -34,7 +34,7 @@ Thanks for the pull request @{{ userName }}! {{/if}} {{#if askAboutTests}} * :grey_question: Unit tests were not updated. - * Make sure you've [updated tests](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/TestingGuide) to reflect your changes, added tests for any new code, and ran the code coverage tool. + * Make sure you've [updated tests](https://github.com/CesiumGS/cesium/tree/master/Documentation/Contributors/TestingGuide) to reflect your changes, added tests for any new code, and ran the code coverage tool. {{/if}} Reviewers, don't forget to make sure that: diff --git a/.eslintrc.json b/.eslintrc.json index 6c69dcbf3be5..514d51dab8a5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,8 +9,8 @@ "overrides": [ { "files": [ - "index.js", - "server.js", + "index.cjs", + "server.cjs", "gulpfile.js", "Source/Workers/transferTypedArrayTest.js" ], diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 4790cd680f48..bba36ec66c7d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,25 +4,25 @@ about: Let us know so we can fix it! --- +--> -Sandcastle example: +Sandcastle example: Browser: Operating System: - \ No newline at end of file +--> diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 13ea40291f83..db5de8edb56d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,12 +3,12 @@ name: Request a feature about: New ideas & improvements to Cesium are always welcome. --- - +https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md +--> diff --git a/.gulp.json b/.gulp.json new file mode 100644 index 000000000000..96507cb26cf8 --- /dev/null +++ b/.gulp.json @@ -0,0 +1,5 @@ +{ + "flags": { + "gulpfile": "gulpfile.cjs" + } +} diff --git a/.npmignore b/.npmignore index 98c5270d4a0e..b6218280c65f 100644 --- a/.npmignore +++ b/.npmignore @@ -23,7 +23,7 @@ /index.html /index.release.html /launches -/server.js +/server.cjs /Source/copyrightHeader.js /Specs /ThirdParty diff --git a/.travis.yml b/.travis.yml index ae9f7c80d9d7..0fd9153d4bb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ script: # Various Node.js smoke-screen tests - node -e "const Cesium = require('./');" - - NODE_ENV=development node index.js - - NODE_ENV=production node index.js + - NODE_ENV=development node index.cjs + - NODE_ENV=production node index.cjs - npm --silent run cloc diff --git a/.vscode/launch.json b/.vscode/launch.json index 85fb445c2db3..7e924cbc0edb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,5 +1,5 @@ { - // Use IntelliSense to learn about possible Node.js debug attributes. + // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", @@ -8,14 +8,10 @@ "type": "node", "request": "launch", "name": "Launch Program", - "program": "${workspaceRoot}\\server.js", - "cwd": "${workspaceRoot}" - }, - { - "type": "node", - "request": "attach", - "name": "Attach to Process", - "port": 5858 + "cwd": "${workspaceFolder}", + "runtimeExecutable": "npm", + "runtimeArgs": ["run-script", "start"], + "noDebug": true } ] -} \ No newline at end of file +} diff --git a/Apps/.jshintrc b/Apps/.jshintrc index ad12e9a7e032..b7b6dc60c899 100644 --- a/Apps/.jshintrc +++ b/Apps/.jshintrc @@ -21,7 +21,6 @@ "boss": false, "debug": false, "eqnull": false, - "esnext": false, "moz": false, "evil": false, "expr": false, diff --git a/Apps/Sandcastle/.jshintrc b/Apps/Sandcastle/.jshintrc index 3b38565e7618..47fbaea5fe0f 100644 --- a/Apps/Sandcastle/.jshintrc +++ b/Apps/Sandcastle/.jshintrc @@ -1,6 +1,7 @@ { "extends": "../.jshintrc", "unused": false, + "esversion": 10, "predef": [ "JSON", "require", diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js index 4627ee0e4676..762d7f00181b 100644 --- a/Apps/Sandcastle/CesiumSandcastle.js +++ b/Apps/Sandcastle/CesiumSandcastle.js @@ -15,7 +15,7 @@ require({ location: '../Apps/Sandcastle' }, { name: 'CodeMirror', - location: '../ThirdParty/codemirror-4.6' + location: '../ThirdParty/codemirror-5.52.0' }, { name: 'ThirdParty', location: '../Apps/Sandcastle/ThirdParty' @@ -1057,7 +1057,7 @@ require({ }); } - // Work around Chrome 79 bug: https://github.com/AnalyticalGraphicsInc/cesium/issues/8460 + // Work around Chrome 79 bug: https://github.com/CesiumGS/cesium/issues/8460 function waitForDoc(doc, test) { var deferred = new Deferred(); if (test()) { diff --git a/Apps/Sandcastle/Sandcastle-header.js b/Apps/Sandcastle/Sandcastle-header.js index e75def7f5ebe..ecdb0880d54f 100644 --- a/Apps/Sandcastle/Sandcastle-header.js +++ b/Apps/Sandcastle/Sandcastle-header.js @@ -100,7 +100,7 @@ if (window.location.protocol === 'file:') { if (window.confirm("You must host this app on a web server.\nSee contributor's guide for more info?")) { - window.location = 'https://github.com/AnalyticalGraphicsInc/cesium/wiki/Contributor%27s-Guide'; + window.location = 'https://github.com/CesiumGS/cesium/wiki/Contributor%27s-Guide'; } } }()); diff --git a/Apps/Sandcastle/gallery/3D Tiles BIM.html b/Apps/Sandcastle/gallery/3D Tiles BIM.html index d6b032ed6447..6dfbe1bb71f4 100644 --- a/Apps/Sandcastle/gallery/3D Tiles BIM.html +++ b/Apps/Sandcastle/gallery/3D Tiles BIM.html @@ -84,7 +84,7 @@ // In this tileset every feature has an "element" property which is a global ID. // This property is used to associate features across different tiles and LODs. -// Workaround until 3D Tiles has the concept of global batch ids: https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/265 +// Workaround until 3D Tiles has the concept of global batch ids: https://github.com/CesiumGS/3d-tiles/issues/265 var elementMap = {}; // Build a map of elements to features. var hiddenElements = [112001, 113180, 131136, 113167, 71309, 109652, 111178, 113156, 113170, 124846, 114076, 131122, 113179, 114325, 131134, 113164, 113153, 113179, 109656, 114095, 114093, 39225, 39267, 113149, 113071, 112003, 39229, 113160, 39227, 39234, 113985, 39230, 112004, 39223]; diff --git a/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html b/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html index 44a9faa97534..c976a556589b 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html +++ b/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html @@ -40,7 +40,7 @@ }); // Load the NYC buildings tileset -var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5741) }); +var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(75343) }); viewer.scene.primitives.add(tileset); // HTML overlay for showing feature name on mouseover @@ -99,10 +99,7 @@ nameOverlay.style.display = 'block'; nameOverlay.style.bottom = viewer.canvas.clientHeight - movement.endPosition.y + 'px'; nameOverlay.style.left = movement.endPosition.x + 'px'; - var name = pickedFeature.getProperty('name'); - if (!Cesium.defined(name)) { - name = pickedFeature.getProperty('id'); - } + var name = pickedFeature.getProperty('BIN'); nameOverlay.textContent = name; // Highlight the feature if it's not already selected. diff --git a/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html b/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html index e1e2b14f48c4..bfb21515b4ca 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html +++ b/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html @@ -23,7 +23,7 @@ 'use strict'; //Sandcastle_Begin // A demo of interactive 3D Tiles styling -// Styling language Documentation: https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling +// Styling language Documentation: https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling // Building data courtesy of NYC OpenData portal: http://www1.nyc.gov/site/doitt/initiatives/3d-building.page var viewer = new Cesium.Viewer('cesiumContainer', { terrainProvider: Cesium.createWorldTerrain() @@ -41,7 +41,7 @@ }); // Load the NYC buildings tileset. -var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5741) }); +var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(75343) }); viewer.scene.primitives.add(tileset); // Color buildings based on their height. @@ -49,13 +49,13 @@ 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)'], + ['${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)'] ] } @@ -66,7 +66,7 @@ function colorByLatitude() { tileset.style = new Cesium.Cesium3DTileStyle({ defines: { - latitudeRadians: 'radians(${latitude})' + latitudeRadians: 'radians(${Latitude})' }, color: { conditions: [ @@ -86,7 +86,7 @@ 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 : [ @@ -100,17 +100,17 @@ }); } -// Color buildings with a '3' in their name. -function colorByNameRegex() { +// Color buildings with a '3' in their BIN property. +function colorByStringRegex() { tileset.style = new Cesium.Cesium3DTileStyle({ - color : "(regExp('3').test(String(${name}))) ? color('cyan', 0.9) : color('purple', 0.1)" + color : "(regExp('3').test(String(${BIN}))) ? color('cyan', 0.9) : color('purple', 0.1)" }); } // Show only buildings greater than 200 meters in height. function hideByHeight() { tileset.style = new Cesium.Cesium3DTileStyle({ - show : '${height} > 200' + show : '${Height} > 200' }); } @@ -132,7 +132,7 @@ }, { text : 'Color By Name Regex', onselect : function() { - colorByNameRegex(); + colorByStringRegex(); } }, { text : 'Hide By Height', diff --git a/Apps/Sandcastle/gallery/3D Tiles Inspector.html b/Apps/Sandcastle/gallery/3D Tiles Inspector.html index 3e0938ebf97b..7391c278a8fe 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Inspector.html +++ b/Apps/Sandcastle/gallery/3D Tiles Inspector.html @@ -32,7 +32,7 @@ viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin); var inspectorViewModel = viewer.cesium3DTilesInspector.viewModel; -var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5741) }); +var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(75343) }); viewer.scene.primitives.add(tileset); tileset.readyPromise.then(function(){ diff --git a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html index f149fc146e2d..bfaf4fb0aaac 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html +++ b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html @@ -72,11 +72,11 @@ }); // Load the NYC buildings tileset. -var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5741) }); +var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(75343) }); scene.primitives.add(tileset); tileset.style = new Cesium.Cesium3DTileStyle({ meta: { - description: "'Building id ${id} has height ${height}.'" + description: "'Building ${BIN} has height ${Height}.'" } }); @@ -144,9 +144,9 @@ } function zoom(movement, feature) { - var longitude = Cesium.Math.toRadians(feature.getProperty('longitude')); - var latitude = Cesium.Math.toRadians(feature.getProperty('latitude')); - var height = feature.getProperty('height'); + var longitude = Cesium.Math.toRadians(feature.getProperty('Longitude')); + var latitude = Cesium.Math.toRadians(feature.getProperty('Latitude')); + var height = feature.getProperty('Height'); var positionCartographic = new Cesium.Cartographic(longitude, latitude, height * 0.5); var position = scene.globe.ellipsoid.cartographicToCartesian(positionCartographic); diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html index edcb589dcac2..53f68e227e49 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html @@ -35,7 +35,7 @@ // Geometry Tiles are experimental and the format is subject to change in the future. // For more details, see: -// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/3d-tiles-next/TileFormats/Geometry +// https://github.com/CesiumGS/3d-tiles/tree/3d-tiles-next/TileFormats/Geometry var classificationTileset = new Cesium.Cesium3DTileset({ url: '../../SampleData/Cesium3DTiles/Classification/PointCloud/tileset.json', classificationType: Cesium.ClassificationType.CESIUM_3D_TILE diff --git a/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html b/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html index 98c239e16ae1..31edd28f924e 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html @@ -33,7 +33,7 @@ // Vector 3D Tiles are experimental and the format is subject to change in the future. // For more details, see: -// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/3d-tiles-next/TileFormats/VectorData +// https://github.com/CesiumGS/3d-tiles/tree/3d-tiles-next/TileFormats/VectorData var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5737) }); viewer.scene.primitives.add(tileset); diff --git a/Apps/Sandcastle/gallery/Clustering.html b/Apps/Sandcastle/gallery/Clustering.html index e665667c0a33..56358aaf8b31 100644 --- a/Apps/Sandcastle/gallery/Clustering.html +++ b/Apps/Sandcastle/gallery/Clustering.html @@ -149,7 +149,7 @@ var pickedLabel = viewer.scene.pick(movement.position); if (Cesium.defined(pickedLabel)) { var ids = pickedLabel.id; - if (Cesium.isArray(ids)) { + if (Array.isArray(ids)) { for (var i = 0; i < ids.length; ++i) { ids[i].billboard.color = Cesium.Color.RED; } diff --git a/Apps/Sandcastle/gallery/FXAA.html b/Apps/Sandcastle/gallery/FXAA.html index d0b293c1cfb4..05ce4820c061 100644 --- a/Apps/Sandcastle/gallery/FXAA.html +++ b/Apps/Sandcastle/gallery/FXAA.html @@ -33,7 +33,7 @@ }); viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: Cesium.IonResource.fromAssetId(5741) + url: Cesium.IonResource.fromAssetId(75343) })); viewer.scene.postProcessStages.fxaa.enabled = true; diff --git a/Apps/Sandcastle/gallery/Offline.html b/Apps/Sandcastle/gallery/Offline.html index d66133344d0a..353e32cb57ac 100644 --- a/Apps/Sandcastle/gallery/Offline.html +++ b/Apps/Sandcastle/gallery/Offline.html @@ -25,7 +25,7 @@ // This is an example of using Cesium "Offline", meaning disconnected from the // external Internet. It must still be served from a local web server, but // does not rely on any outside resources or services. For more info, see: -// https://github.com/AnalyticalGraphicsInc/cesium/wiki/Offline-Guide +// https://github.com/CesiumGS/cesium/wiki/Offline-Guide var viewer = new Cesium.Viewer('cesiumContainer', { imageryProvider : new Cesium.TileMapServiceImageryProvider({ diff --git a/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html b/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html index 118bcdb188cf..600a6f236cce 100644 --- a/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html +++ b/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html @@ -52,7 +52,7 @@ var heatmapTileProperty = '_foveatedFactor'; var tileset = new Cesium.Cesium3DTileset({ - url: Cesium.IonResource.fromAssetId(5741), + url: Cesium.IonResource.fromAssetId(75343), debugHeatmapTilePropertyName: heatmapTileProperty }); diff --git a/Apps/Sandcastle/index.html b/Apps/Sandcastle/index.html index e67bca0867ae..8d20cfc2a56b 100644 --- a/Apps/Sandcastle/index.html +++ b/Apps/Sandcastle/index.html @@ -5,16 +5,16 @@ Cesium Sandcastle - + - + @@ -23,7 +23,7 @@ - + diff --git a/CHANGES.md b/CHANGES.md index ab7099bd4b7f..bdb953e9f767 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,28 +1,59 @@ Change Log ========== -### 1.67.0 - 2020-03-02 +### 1.68.0 - 2020-04-01 ##### Additions :tada: -* Added `Entity.tileset` for loading a 3D Tiles tileset via the Entity API using the new `Cesium3DTilesetGraphics` class. -* Added `tileset.uri`, `tileset.show`, and `tileset.maximumScreenSpaceError` properties to CZML processing for loading 3D Tiles. -* Added `Color.lerp` for linearly interpolating between two RGB colors. [#8607](https://github.com/AnalyticalGraphicsInc/cesium/pull/8607) -* `CesiumTerrainProvider` now supports terrain tiles using a `WebMercatorTilingScheme` by specifying `"projection": "EPSG:3857"` in `layer.json`. It also now supports numbering tiles from the North instead of the South by specifying `"scheme": "slippyMap"` in `layer.json`. [#8563](https://github.com/AnalyticalGraphicsInc/cesium/pull/8563) +* Added basic underground rendering support. When the camera is underground the globe will be rendered as a solid surface and underground entities will not be culled. [#8572](https://github.com/AnalyticalGraphicsInc/cesium/pull/8572) +* The `CesiumUnminified` build now includes sourcemaps. * Added the ability to edit CesiumJS shaders on-the-fly using the [SpectorJS](https://spector.babylonjs.com/) Shader Editor. ##### Fixes :wrench: -* Fixed a bug where tiles would not load if the camera was tracking a moving tileset. [#8598](https://github.com/AnalyticalGraphicsInc/cesium/pull/8598) +* Cesium can now be used in Node.JS 12 and later, with or without `--experimental-modules`. It can still be used in earlier versions as well. +* Interacting with the Cesium canvas will now blur the previously focused element. This prevents unintended modification of input elements when interacting with the globe. +* `TileMapServiceImageryProvider` will now force `minimumLevel` to 0 if the `tilemapresource.xml` metadata request fails and the `rectangle` is too large for the given detail level [#8448](https://github.com/AnalyticalGraphicsInc/cesium/pull/8448) +* Fixed ground atmosphere rendering when using a samller ellipsoid. [#8683](https://github.com/CesiumGS/cesium/issues/8683) +* Fixed globe incorrectly occluding objects when using a smaller ellipsoid. [#7124](https://github.com/CesiumGS/cesium/issues/7124) +* Fixed a regression introduced in 1.67 which caused overlapping colored ground geometry to have visual artifacts. [#8694](https://github.com/CesiumGS/cesium/pull/8694) + +### 1.67.0 - 2020-03-02 + +##### Breaking Changes :mega: +* `Cesium3DTileset.skipLevelOfDetail` is now `false` by default. [#8631](https://github.com/CesiumGS/cesium/pull/8631) +* glTF models are now rendered using the `LEQUALS` depth test function instead of `LESS`. This means that when geometry overlaps, the _later_ geometry will be visible above the earlier, where previously the opposite was true. We believe this is a more sensible default, and makes it easier to render e.g. outlined buildings with glTF. [#8646](https://github.com/CesiumGS/cesium/pull/8646) + +##### Additions :tada: + +* Massively improved performance of clamped Entity ground geometry with dynamic colors. [#8630](https://github.com/CesiumGS/cesium/pull/8630) +* Added `Entity.tileset` for loading a 3D Tiles tileset via the Entity API using the new `Cesium3DTilesetGraphics` class. [#8580](https://github.com/CesiumGS/cesium/pull/8580) +* Added `tileset.uri`, `tileset.show`, and `tileset.maximumScreenSpaceError` properties to CZML processing for loading 3D Tiles. [#8580](https://github.com/CesiumGS/cesium/pull/8580) +* Added `Color.lerp` for linearly interpolating between two RGB colors. [#8607](https://github.com/CesiumGS/cesium/pull/8607) +* `CesiumTerrainProvider` now supports terrain tiles using a `WebMercatorTilingScheme` by specifying `"projection": "EPSG:3857"` in `layer.json`. It also now supports numbering tiles from the North instead of the South by specifying `"scheme": "slippyMap"` in `layer.json`. [#8563](https://github.com/CesiumGS/cesium/pull/8563) +* Added basic support for `isNaN`, `isFinite`, `null`, and `undefined` in the 3D Tiles styling GLSL backend for point clouds. [#8621](https://github.com/CesiumGS/cesium/pull/8621) +* Added `sizeInMeters` to `ParticleSystem`. [#7746](https://github.com/CesiumGS/cesium/pull/7746) + +##### Fixes :wrench: + +* Fixed a bug that caused large, nearby geometry to be clipped when using a logarithmic depth buffer, which is the default on most systems. [#8600](https://github.com/CesiumGS/cesium/pull/8600) +* Fixed a bug where tiles would not load if the camera was tracking a moving tileset. [#8598](https://github.com/CesiumGS/cesium/pull/8598) +* Fixed a bug where applying a new 3D Tiles style during a flight would not update all existing tiles. [#8622](https://github.com/CesiumGS/cesium/pull/8622) +* Fixed a bug where Cartesian vectors could not be packed to typed arrays [#8568](https://github.com/AnalyticalGraphicsInc/cesium/pull/8568) +* Updated knockout from 3.5.0 to 3.5.1. [#8424](https://github.com/CesiumGS/cesium/pull/8424) +* Cesium's local development server now works in Node 12 & 13 [#8648](https://github.com/CesiumGS/cesium/pull/8648) + +##### Deprecated :hourglass_flowing_sand: +* The `isArray` function has been deprecated and will be removed in Cesium 1.69. Use the native `Array.isArray` function instead. [#8526](https://github.com/CesiumGS/cesium/pull/8526) ### 1.66.0 - 2020-02-03 ##### Deprecated :hourglass_flowing_sand: -* The property `Scene.sunColor` has been deprecated and will be removed in Cesium 1.69. Use `scene.light.color` and `scene.light.intensity` instead. [#8493](https://github.com/AnalyticalGraphicsInc/cesium/pull/8493) +* The property `Scene.sunColor` has been deprecated and will be removed in Cesium 1.69. Use `scene.light.color` and `scene.light.intensity` instead. [#8493](https://github.com/CesiumGS/cesium/pull/8493) ##### Additions :tada: -* `useBrowserRecommendedResolution` flag in `Viewer` and `CesiumWidget` now defaults to `true`. This ensures Cesium rendering is fast and smooth by default across all devices. Set it to `false` to always render at native device resolution instead at the cost of performance on under-powered devices. [#8548](https://github.com/AnalyticalGraphicsInc/cesium/pull/8548) +* `useBrowserRecommendedResolution` flag in `Viewer` and `CesiumWidget` now defaults to `true`. This ensures Cesium rendering is fast and smooth by default across all devices. Set it to `false` to always render at native device resolution instead at the cost of performance on under-powered devices. [#8548](https://github.com/CesiumGS/cesium/pull/8548) * Cesium now creates a WebGL context with a `powerPreference` value of `high-performance`. Some browsers use this setting to enable a second, more powerful, GPU. You can set it back to `default`, or opt-in to `low-power` mode, by passing the context option when creating a `Viewer` or `CesiumWidget` instance: ```js @@ -35,67 +66,67 @@ Change Log }); ``` -* Added more customization to Cesium's lighting system. [#8493](https://github.com/AnalyticalGraphicsInc/cesium/pull/8493) +* Added more customization to Cesium's lighting system. [#8493](https://github.com/CesiumGS/cesium/pull/8493) * Added `Light`, `DirectionalLight`, and `SunLight` classes for creating custom light sources. * Added `Scene.light` for setting the scene's light source, which defaults to a `SunLight`. * Added `Globe.dynamicAtmosphereLighting` for enabling lighting effects on atmosphere and fog, such as day/night transitions. It is true by default but may be set to false if the atmosphere should stay unchanged regardless of the scene's light direction. * Added `Globe.dynamicAtmosphereLightingFromSun` for using the sun direction instead of the scene's light direction when `Globe.dynamicAtmosphereLighting` is enabled. See the moonlight example in the [Lighting Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Lighting.html). * Primitives and the globe are now shaded with the scene light's color. -* Updated SampleData models to glTF 2.0. [#7802](https://github.com/AnalyticalGraphicsInc/cesium/issues/7802) -* Added `Globe.showSkirts` to support the ability to hide terrain skirts when viewing terrain from below the surface. [#8489](https://github.com/AnalyticalGraphicsInc/cesium/pull/8489) -* Added `minificationFilter` and `magnificationFilter` options to `Material` to control texture filtering. [#8473](https://github.com/AnalyticalGraphicsInc/cesium/pull/8473) -* Updated [earcut](https://github.com/mapbox/earcut) to 2.2.1. [#8528](https://github.com/AnalyticalGraphicsInc/cesium/pull/8528) -* Added a font cache to improve label performance. [#8537](https://github.com/AnalyticalGraphicsInc/cesium/pull/8537) +* Updated SampleData models to glTF 2.0. [#7802](https://github.com/CesiumGS/cesium/issues/7802) +* Added `Globe.showSkirts` to support the ability to hide terrain skirts when viewing terrain from below the surface. [#8489](https://github.com/CesiumGS/cesium/pull/8489) +* Added `minificationFilter` and `magnificationFilter` options to `Material` to control texture filtering. [#8473](https://github.com/CesiumGS/cesium/pull/8473) +* Updated [earcut](https://github.com/mapbox/earcut) to 2.2.1. [#8528](https://github.com/CesiumGS/cesium/pull/8528) +* Added a font cache to improve label performance. [#8537](https://github.com/CesiumGS/cesium/pull/8537) ##### Fixes :wrench: -* Fixed a bug where the camera could go underground during mouse navigation. [#8504](https://github.com/AnalyticalGraphicsInc/cesium/pull/8504) -* Fixed a bug where rapidly updating a `PolylineCollection` could result in an `instanceIndex` is out of range error. [#8546](https://github.com/AnalyticalGraphicsInc/cesium/pull/8546) -* Fixed issue where `RequestScheduler` double-counted image requests made via `createImageBitmap`. [#8162](https://github.com/AnalyticalGraphicsInc/cesium/issues/8162) -* Reduced Cesium bundle size by avoiding unnecessarily importing `Cesium3DTileset` in `Picking.js`. [#8532](https://github.com/AnalyticalGraphicsInc/cesium/pull/8532) -* Fixed a bug where files with backslashes were not loaded in KMZ files. [#8533](https://github.com/AnalyticalGraphicsInc/cesium/pull/8533) -* Fixed WebGL warning message about `EXT_float_blend` being implicitly enabled. [#8534](https://github.com/AnalyticalGraphicsInc/cesium/pull/8534) -* Fixed a bug where toggling point cloud classification visibility would result in a grey screen on Linux / Nvidia. [#8538](https://github.com/AnalyticalGraphicsInc/cesium/pull/8538) -* Fixed a bug where a point in a `PointPrimitiveCollection` was rendered in the middle of the screen instead of being clipped. [#8542](https://github.com/AnalyticalGraphicsInc/cesium/pull/8542) -* Fixed a crash when deleting and re-creating polylines from CZML. `ReferenceProperty` now returns undefined when the target entity or property does not exist, instead of throwing. [#8544](https://github.com/AnalyticalGraphicsInc/cesium/pull/8544) -* Fixed terrain tile picking in the Cesium Inspector. [#8567](https://github.com/AnalyticalGraphicsInc/cesium/pull/8567) -* Fixed a crash that could occur when an entity was deleted while the corresponding `Primitive` was being created asynchronously. [#8569](https://github.com/AnalyticalGraphicsInc/cesium/pull/8569) -* Fixed a crash when calling `camera.lookAt` with the origin (0, 0, 0) as the target. This could happen when looking at a tileset with the origin as its center. [#8571](https://github.com/AnalyticalGraphicsInc/cesium/pull/8571) -* Fixed a bug where `camera.viewBoundingSphere` was modifying the `offset` parameter. [#8438](https://github.com/AnalyticalGraphicsInc/cesium/pull/8438) -* Fixed a crash when creating a plane with both position and normal on the Z-axis. [#8576](https://github.com/AnalyticalGraphicsInc/cesium/pull/8576) -* Fixed `BoundingSphere.projectTo2D` when the bounding sphere’s center is at the origin. [#8482](https://github.com/AnalyticalGraphicsInc/cesium/pull/8482) +* Fixed a bug where the camera could go underground during mouse navigation. [#8504](https://github.com/CesiumGS/cesium/pull/8504) +* Fixed a bug where rapidly updating a `PolylineCollection` could result in an `instanceIndex` is out of range error. [#8546](https://github.com/CesiumGS/cesium/pull/8546) +* Fixed issue where `RequestScheduler` double-counted image requests made via `createImageBitmap`. [#8162](https://github.com/CesiumGS/cesium/issues/8162) +* Reduced Cesium bundle size by avoiding unnecessarily importing `Cesium3DTileset` in `Picking.js`. [#8532](https://github.com/CesiumGS/cesium/pull/8532) +* Fixed a bug where files with backslashes were not loaded in KMZ files. [#8533](https://github.com/CesiumGS/cesium/pull/8533) +* Fixed WebGL warning message about `EXT_float_blend` being implicitly enabled. [#8534](https://github.com/CesiumGS/cesium/pull/8534) +* Fixed a bug where toggling point cloud classification visibility would result in a grey screen on Linux / Nvidia. [#8538](https://github.com/CesiumGS/cesium/pull/8538) +* Fixed a bug where a point in a `PointPrimitiveCollection` was rendered in the middle of the screen instead of being clipped. [#8542](https://github.com/CesiumGS/cesium/pull/8542) +* Fixed a crash when deleting and re-creating polylines from CZML. `ReferenceProperty` now returns undefined when the target entity or property does not exist, instead of throwing. [#8544](https://github.com/CesiumGS/cesium/pull/8544) +* Fixed terrain tile picking in the Cesium Inspector. [#8567](https://github.com/CesiumGS/cesium/pull/8567) +* Fixed a crash that could occur when an entity was deleted while the corresponding `Primitive` was being created asynchronously. [#8569](https://github.com/CesiumGS/cesium/pull/8569) +* Fixed a crash when calling `camera.lookAt` with the origin (0, 0, 0) as the target. This could happen when looking at a tileset with the origin as its center. [#8571](https://github.com/CesiumGS/cesium/pull/8571) +* Fixed a bug where `camera.viewBoundingSphere` was modifying the `offset` parameter. [#8438](https://github.com/CesiumGS/cesium/pull/8438) +* Fixed a crash when creating a plane with both position and normal on the Z-axis. [#8576](https://github.com/CesiumGS/cesium/pull/8576) +* Fixed `BoundingSphere.projectTo2D` when the bounding sphere’s center is at the origin. [#8482](https://github.com/CesiumGS/cesium/pull/8482) ### 1.65.0 - 2020-01-06 ##### Breaking Changes :mega: -* `OrthographicFrustum.getPixelDimensions`, `OrthographicOffCenterFrustum.getPixelDimensions`, `PerspectiveFrustum.getPixelDimensions`, and `PerspectiveOffCenterFrustum.getPixelDimensions` now require a `pixelRatio` argument before the `result` argument. The previous function definition has been deprecated since 1.63. [#8320](https://github.com/AnalyticalGraphicsInc/cesium/pull/8320) -* The function `Matrix4.getRotation` has been renamed to `Matrix4.getMatrix3`. `Matrix4.getRotation` has been deprecated since 1.62. [#8183](https://github.com/AnalyticalGraphicsInc/cesium/pull/8183) -* `createTileMapServiceImageryProvider` and `createOpenStreetMapImageryProvider` have been removed. Instead, pass the same options to `new TileMapServiceImageryProvider` and `new OpenStreetMapImageryProvider` respectively. The old functions have been deprecated since 1.62. [#8174](https://github.com/AnalyticalGraphicsInc/cesium/pull/8174) +* `OrthographicFrustum.getPixelDimensions`, `OrthographicOffCenterFrustum.getPixelDimensions`, `PerspectiveFrustum.getPixelDimensions`, and `PerspectiveOffCenterFrustum.getPixelDimensions` now require a `pixelRatio` argument before the `result` argument. The previous function definition has been deprecated since 1.63. [#8320](https://github.com/CesiumGS/cesium/pull/8320) +* The function `Matrix4.getRotation` has been renamed to `Matrix4.getMatrix3`. `Matrix4.getRotation` has been deprecated since 1.62. [#8183](https://github.com/CesiumGS/cesium/pull/8183) +* `createTileMapServiceImageryProvider` and `createOpenStreetMapImageryProvider` have been removed. Instead, pass the same options to `new TileMapServiceImageryProvider` and `new OpenStreetMapImageryProvider` respectively. The old functions have been deprecated since 1.62. [#8174](https://github.com/CesiumGS/cesium/pull/8174) ##### Additions :tada: -* Added `Globe.backFaceCulling` to support viewing terrain from below the surface. [#8470](https://github.com/AnalyticalGraphicsInc/cesium/pull/8470) +* Added `Globe.backFaceCulling` to support viewing terrain from below the surface. [#8470](https://github.com/CesiumGS/cesium/pull/8470) ##### Fixes :wrench: -* Fixed Geocoder auto-complete suggestions when hosted inside Web Components. [#8425](https://github.com/AnalyticalGraphicsInc/cesium/pull/8425) -* Fixed terrain tile culling problems when under ellipsoid. [#8397](https://github.com/AnalyticalGraphicsInc/cesium/pull/8397) -* Fixed primitive culling when below the ellipsoid but above terrain. [#8398](https://github.com/AnalyticalGraphicsInc/cesium/pull/8398) -* Improved the translucency calculation for the Water material type. [#8455](https://github.com/AnalyticalGraphicsInc/cesium/pull/8455) -* Fixed bounding volume calculation for `GroundPrimitive`. [#4883](https://github.com/AnalyticalGraphicsInc/cesium/issues/4483) -* Fixed `OrientedBoundingBox.fromRectangle` for rectangles with width greater than 180 degrees. [#8475](https://github.com/AnalyticalGraphicsInc/cesium/pull/8475) -* Fixed globe picking so that it returns the closest intersecting triangle instead of the first intersecting triangle. [#8390](https://github.com/AnalyticalGraphicsInc/cesium/pull/8390) -* Fixed horizon culling issues with large root tiles. [#8487](https://github.com/AnalyticalGraphicsInc/cesium/pull/8487) -* Fixed a lighting bug affecting Macs with Intel integrated graphics where glTF 2.0 PBR models with double sided materials would have flipped normals. [#8494](https://github.com/AnalyticalGraphicsInc/cesium/pull/8494) +* Fixed Geocoder auto-complete suggestions when hosted inside Web Components. [#8425](https://github.com/CesiumGS/cesium/pull/8425) +* Fixed terrain tile culling problems when under ellipsoid. [#8397](https://github.com/CesiumGS/cesium/pull/8397) +* Fixed primitive culling when below the ellipsoid but above terrain. [#8398](https://github.com/CesiumGS/cesium/pull/8398) +* Improved the translucency calculation for the Water material type. [#8455](https://github.com/CesiumGS/cesium/pull/8455) +* Fixed bounding volume calculation for `GroundPrimitive`. [#4883](https://github.com/CesiumGS/cesium/issues/4483) +* Fixed `OrientedBoundingBox.fromRectangle` for rectangles with width greater than 180 degrees. [#8475](https://github.com/CesiumGS/cesium/pull/8475) +* Fixed globe picking so that it returns the closest intersecting triangle instead of the first intersecting triangle. [#8390](https://github.com/CesiumGS/cesium/pull/8390) +* Fixed horizon culling issues with large root tiles. [#8487](https://github.com/CesiumGS/cesium/pull/8487) +* Fixed a lighting bug affecting Macs with Intel integrated graphics where glTF 2.0 PBR models with double sided materials would have flipped normals. [#8494](https://github.com/CesiumGS/cesium/pull/8494) ### 1.64.0 - 2019-12-02 ##### Fixes :wrench: -* Fixed an issue in image based lighting where an invalid environment map would silently fail. [#8303](https://github.com/AnalyticalGraphicsInc/cesium/pull/8303) +* Fixed an issue in image based lighting where an invalid environment map would silently fail. [#8303](https://github.com/CesiumGS/cesium/pull/8303) * Various small internal improvements ### 1.63.1 - 2019-11-06 ##### Fixes :wrench: -* Fixed regression in 1.63 where ground atmosphere and labels rendered incorrectly on displays with `window.devicePixelRatio` greater than 1.0. [#8351](https://github.com/AnalyticalGraphicsInc/cesium/pull/8351) -* Fixed regression in 1.63 where some primitives would show through the globe when log depth is disabled. [#8368](https://github.com/AnalyticalGraphicsInc/cesium/pull/8368) +* Fixed regression in 1.63 where ground atmosphere and labels rendered incorrectly on displays with `window.devicePixelRatio` greater than 1.0. [#8351](https://github.com/CesiumGS/cesium/pull/8351) +* Fixed regression in 1.63 where some primitives would show through the globe when log depth is disabled. [#8368](https://github.com/CesiumGS/cesium/pull/8368) ### 1.63 - 2019-11-01 @@ -110,20 +141,20 @@ Change Log ##### Additions :tada: * Decreased Web Workers bundle size by a factor of 10, from 8384KB (2624KB gzipped) to 863KB (225KB gzipped). This makes Cesium load faster, especially on low-end devices and slower network connections. -* Added full UTF-8 support to labels, greatly improving support for non-latin alphabets and emoji. [#7280](https://github.com/AnalyticalGraphicsInc/cesium/pull/7280) +* Added full UTF-8 support to labels, greatly improving support for non-latin alphabets and emoji. [#7280](https://github.com/CesiumGS/cesium/pull/7280) * Added `"type": "module"` to package.json to take advantage of native ES6 module support in newer versions of Node.js. This also enables module-based front-end development for tooling that relies on Node.js module resolution. * The combined `Build/Cesium/Cesium.js` and `Build/CesiumUnminified/Cesium.js` have been upgraded from IIFE to UMD modules that support IIFE, AMD, and commonjs. -* Added `pixelRatio` parameter to `OrthographicFrustum.getPixelDimensions`, `OrthographicOffCenterFrustum.getPixelDimensions`, `PerspectiveFrustum.getPixelDimensions`, and `PerspectiveOffCenterFrustum.getPixelDimensions`. Pass in `scene.pixelRatio` for dimensions in CSS pixel units or `1.0` for dimensions in native device pixel units. [#8237](https://github.com/AnalyticalGraphicsInc/cesium/pull/8237) +* Added `pixelRatio` parameter to `OrthographicFrustum.getPixelDimensions`, `OrthographicOffCenterFrustum.getPixelDimensions`, `PerspectiveFrustum.getPixelDimensions`, and `PerspectiveOffCenterFrustum.getPixelDimensions`. Pass in `scene.pixelRatio` for dimensions in CSS pixel units or `1.0` for dimensions in native device pixel units. [#8237](https://github.com/CesiumGS/cesium/pull/8237) ##### Fixes :wrench: -* Fixed css pixel usage for polylines, point clouds, models, primitives, and post-processing. [#8113](https://github.com/AnalyticalGraphicsInc/cesium/issues/8113) -* Fixed a bug where `scene.sampleHeightMostDetailed` and `scene.clampToHeightMostDetailed` would not resolve in request render mode. [#8281](https://github.com/AnalyticalGraphicsInc/cesium/issues/8281) -* Fixed seam artifacts when log depth is disabled, `scene.globe.depthTestAgainstTerrain` is false, and primitives are under the globe. [#8205](https://github.com/AnalyticalGraphicsInc/cesium/pull/8205) -* Fix dynamic ellipsoids using `innerRadii`, `minimumClock`, `maximumClock`, `minimumCone` or `maximumCone`. [#8277](https://github.com/AnalyticalGraphicsInc/cesium/pull/8277) -* Fixed rendering billboard collections containing more than 65536 billboards. [#8325](https://github.com/AnalyticalGraphicsInc/cesium/pull/8325) +* Fixed css pixel usage for polylines, point clouds, models, primitives, and post-processing. [#8113](https://github.com/CesiumGS/cesium/issues/8113) +* Fixed a bug where `scene.sampleHeightMostDetailed` and `scene.clampToHeightMostDetailed` would not resolve in request render mode. [#8281](https://github.com/CesiumGS/cesium/issues/8281) +* Fixed seam artifacts when log depth is disabled, `scene.globe.depthTestAgainstTerrain` is false, and primitives are under the globe. [#8205](https://github.com/CesiumGS/cesium/pull/8205) +* Fix dynamic ellipsoids using `innerRadii`, `minimumClock`, `maximumClock`, `minimumCone` or `maximumCone`. [#8277](https://github.com/CesiumGS/cesium/pull/8277) +* Fixed rendering billboard collections containing more than 65536 billboards. [#8325](https://github.com/CesiumGS/cesium/pull/8325) ##### Deprecated :hourglass_flowing_sand: -* `OrthographicFrustum.getPixelDimensions`, `OrthographicOffCenterFrustum.getPixelDimensions`, `PerspectiveFrustum.getPixelDimensions`, and `PerspectiveOffCenterFrustum.getPixelDimensions` now take a `pixelRatio` argument before the `result` argument. The previous function definition will no longer work in 1.65. [#8237](https://github.com/AnalyticalGraphicsInc/cesium/pull/8237) +* `OrthographicFrustum.getPixelDimensions`, `OrthographicOffCenterFrustum.getPixelDimensions`, `PerspectiveFrustum.getPixelDimensions`, and `PerspectiveOffCenterFrustum.getPixelDimensions` now take a `pixelRatio` argument before the `result` argument. The previous function definition will no longer work in 1.65. [#8237](https://github.com/CesiumGS/cesium/pull/8237) ### 1.62 - 2019-10-01 @@ -133,81 +164,81 @@ Change Log * The function `Matrix4.getRotation` has been deprecated and renamed to `Matrix4.getMatrix3`. `Matrix4.getRotation` will be removed in version 1.65. ##### Additions :tada: -* Added ability to create partial ellipsoids using both the Entity API and CZML. New ellipsoid geometry properties: `innerRadii`, `minimumClock`, `maximumClock`, `minimumCone`, and `maximumCone`. This affects both `EllipsoidGeometry` and `EllipsoidOutlineGeometry`. See the updated [Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Partial%20Ellipsoids.html&label=Geometries). [#5995](https://github.com/AnalyticalGraphicsInc/cesium/pull/5995) -* Added `useBrowserRecommendedResolution` flag to `Viewer` and `CesiumWidget`. When true, Cesium renders at CSS pixel resolution instead of native device resolution. This replaces the workaround in the 1.61 change list. [8215](https://github.com/AnalyticalGraphicsInc/cesium/issues/8215) -* Added `TileMapResourceImageryProvider` and `OpenStreetMapImageryProvider` classes to improve API consistency: [#4812](https://github.com/AnalyticalGraphicsInc/cesium/issues/4812) -* Added `credit` parameter to `CzmlDataSource`, `GeoJsonDataSource`, `KmlDataSource` and `Model`. [#8173](https://github.com/AnalyticalGraphicsInc/cesium/pull/8173) -* Added `Matrix3.getRotation` to get the rotational component of a matrix with scaling removed. [#8182](https://github.com/AnalyticalGraphicsInc/cesium/pull/8182) +* Added ability to create partial ellipsoids using both the Entity API and CZML. New ellipsoid geometry properties: `innerRadii`, `minimumClock`, `maximumClock`, `minimumCone`, and `maximumCone`. This affects both `EllipsoidGeometry` and `EllipsoidOutlineGeometry`. See the updated [Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Partial%20Ellipsoids.html&label=Geometries). [#5995](https://github.com/CesiumGS/cesium/pull/5995) +* Added `useBrowserRecommendedResolution` flag to `Viewer` and `CesiumWidget`. When true, Cesium renders at CSS pixel resolution instead of native device resolution. This replaces the workaround in the 1.61 change list. [8215](https://github.com/CesiumGS/cesium/issues/8215) +* Added `TileMapResourceImageryProvider` and `OpenStreetMapImageryProvider` classes to improve API consistency: [#4812](https://github.com/CesiumGS/cesium/issues/4812) +* Added `credit` parameter to `CzmlDataSource`, `GeoJsonDataSource`, `KmlDataSource` and `Model`. [#8173](https://github.com/CesiumGS/cesium/pull/8173) +* Added `Matrix3.getRotation` to get the rotational component of a matrix with scaling removed. [#8182](https://github.com/CesiumGS/cesium/pull/8182) ##### Fixes :wrench: -* Fixed labels not showing for individual entities in data sources when clustering is enabled. [#6087](https://github.com/AnalyticalGraphicsInc/cesium/issues/6087) -* Fixed an issue where polygons, corridors, rectangles, and ellipses on terrain would not render on some mobile devices. [#6739](https://github.com/AnalyticalGraphicsInc/cesium/issues/6739) -* Fixed a bug where GlobeSurfaceTile would not render the tile until all layers completed loading causing globe to appear to hang. [#7974](https://github.com/AnalyticalGraphicsInc/cesium/issues/7974) -* Spread out KMl loading across multiple frames to prevent freezing. [#8195](https://github.com/AnalyticalGraphicsInc/cesium/pull/8195) -* Fixed a bug where extruded polygons would sometimes be missing segments. [#8035](https://github.com/AnalyticalGraphicsInc/cesium/pull/8035) -* Made pixel sizes consistent for polylines and point clouds when rendering at different pixel ratios. [#8113](https://github.com/AnalyticalGraphicsInc/cesium/issues/8113) -* `Camera.flyTo` flies to the correct location in 2D when the destination crosses the international date line [#7909](https://github.com/AnalyticalGraphicsInc/cesium/pull/7909) -* Fixed 3D tiles style coloring when multiple tilesets are in the scene [#8051](https://github.com/AnalyticalGraphicsInc/cesium/pull/8051) -* 3D Tiles geometric error now correctly scales with transform. [#8182](https://github.com/AnalyticalGraphicsInc/cesium/pull/8182) -* Fixed per-feature post processing from sometimes selecting the wrong feature. [#7929](https://github.com/AnalyticalGraphicsInc/cesium/pull/7929) -* Fixed a bug where dynamic polylines did not use the given arcType. [#8191](https://github.com/AnalyticalGraphicsInc/cesium/issues/8191) -* Fixed atmosphere brightness when High Dynamic Range is disabled. [#8149](https://github.com/AnalyticalGraphicsInc/cesium/issues/8149) -* Fixed brightness levels for procedural Image Based Lighting. [#7803](https://github.com/AnalyticalGraphicsInc/cesium/issues/7803) -* Fixed alpha equation for `BlendingState.ALPHA_BLEND` and `BlendingState.ADDITIVE_BLEND`. [#8202](https://github.com/AnalyticalGraphicsInc/cesium/pull/8202) -* Improved display of tile coordinates for `TileCoordinatesImageryProvider` [#8131](https://github.com/AnalyticalGraphicsInc/cesium/pull/8131) -* Reduced size of approximateTerrainHeights.json [#7959](https://github.com/AnalyticalGraphicsInc/cesium/pull/7959) -* Fixed undefined `quadDetails` error from zooming into the map really close. [#8011](https://github.com/AnalyticalGraphicsInc/cesium/pull/8011) -* Fixed a crash for 3D Tiles that have zero volume. [#7945](https://github.com/AnalyticalGraphicsInc/cesium/pull/7945) -* Fixed relative-to-center check, `depthFailAppearance` resource freeing for `Primitive` [#8044](https://github.com/AnalyticalGraphicsInc/cesium/pull/8044) +* Fixed labels not showing for individual entities in data sources when clustering is enabled. [#6087](https://github.com/CesiumGS/cesium/issues/6087) +* Fixed an issue where polygons, corridors, rectangles, and ellipses on terrain would not render on some mobile devices. [#6739](https://github.com/CesiumGS/cesium/issues/6739) +* Fixed a bug where GlobeSurfaceTile would not render the tile until all layers completed loading causing globe to appear to hang. [#7974](https://github.com/CesiumGS/cesium/issues/7974) +* Spread out KMl loading across multiple frames to prevent freezing. [#8195](https://github.com/CesiumGS/cesium/pull/8195) +* Fixed a bug where extruded polygons would sometimes be missing segments. [#8035](https://github.com/CesiumGS/cesium/pull/8035) +* Made pixel sizes consistent for polylines and point clouds when rendering at different pixel ratios. [#8113](https://github.com/CesiumGS/cesium/issues/8113) +* `Camera.flyTo` flies to the correct location in 2D when the destination crosses the international date line [#7909](https://github.com/CesiumGS/cesium/pull/7909) +* Fixed 3D tiles style coloring when multiple tilesets are in the scene [#8051](https://github.com/CesiumGS/cesium/pull/8051) +* 3D Tiles geometric error now correctly scales with transform. [#8182](https://github.com/CesiumGS/cesium/pull/8182) +* Fixed per-feature post processing from sometimes selecting the wrong feature. [#7929](https://github.com/CesiumGS/cesium/pull/7929) +* Fixed a bug where dynamic polylines did not use the given arcType. [#8191](https://github.com/CesiumGS/cesium/issues/8191) +* Fixed atmosphere brightness when High Dynamic Range is disabled. [#8149](https://github.com/CesiumGS/cesium/issues/8149) +* Fixed brightness levels for procedural Image Based Lighting. [#7803](https://github.com/CesiumGS/cesium/issues/7803) +* Fixed alpha equation for `BlendingState.ALPHA_BLEND` and `BlendingState.ADDITIVE_BLEND`. [#8202](https://github.com/CesiumGS/cesium/pull/8202) +* Improved display of tile coordinates for `TileCoordinatesImageryProvider` [#8131](https://github.com/CesiumGS/cesium/pull/8131) +* Reduced size of approximateTerrainHeights.json [#7959](https://github.com/CesiumGS/cesium/pull/7959) +* Fixed undefined `quadDetails` error from zooming into the map really close. [#8011](https://github.com/CesiumGS/cesium/pull/8011) +* Fixed a crash for 3D Tiles that have zero volume. [#7945](https://github.com/CesiumGS/cesium/pull/7945) +* Fixed relative-to-center check, `depthFailAppearance` resource freeing for `Primitive` [#8044](https://github.com/CesiumGS/cesium/pull/8044) ### 1.61 - 2019-09-03 ##### Additions :tada: -* Added optional `index` parameter to `PrimitiveCollection.add`. [#8041](https://github.com/AnalyticalGraphicsInc/cesium/pull/8041) -* Cesium now renders at native device resolution by default instead of CSS pixel resolution, to go back to the old behavior, set `viewer.resolutionScale = 1.0 / window.devicePixelRatio`. [#8082](https://github.com/AnalyticalGraphicsInc/cesium/issues/8082) +* Added optional `index` parameter to `PrimitiveCollection.add`. [#8041](https://github.com/CesiumGS/cesium/pull/8041) +* Cesium now renders at native device resolution by default instead of CSS pixel resolution, to go back to the old behavior, set `viewer.resolutionScale = 1.0 / window.devicePixelRatio`. [#8082](https://github.com/CesiumGS/cesium/issues/8082) * Added `getByName` method to `DataSourceCollection` allowing to retrieve `DataSource`s by their name property from the collection ##### Fixes :wrench: -* Disable FXAA by default. To re-enable, set `scene.postProcessStages.fxaa.enabled = true` [#7875](https://github.com/AnalyticalGraphicsInc/cesium/issues/7875) -* Fixed a crash when a glTF model used `KHR_texture_transform` without a sampler defined. [#7916](https://github.com/AnalyticalGraphicsInc/cesium/issues/7916) -* Fixed post-processing selection filtering to work for bloom. [#7984](https://github.com/AnalyticalGraphicsInc/cesium/issues/7984) -* Disabled HDR by default to improve visual quality in most standard use cases. Set `viewer.scene.highDynamicRange = true` to re-enable. [#7966](https://github.com/AnalyticalGraphicsInc/cesium/issues/7966) -* Fixed a bug that causes hidden point primitives to still appear on some operating systems. [#8043](https://github.com/AnalyticalGraphicsInc/cesium/issues/8043) -* Fix negative altitude altitude handling in `GoogleEarthEnterpriseTerrainProvider`. [#8109](https://github.com/AnalyticalGraphicsInc/cesium/pull/8109) -* Fixed issue where KTX or CRN files would not be properly identified. [#7979](https://github.com/AnalyticalGraphicsInc/cesium/issues/7979) -* Fixed multiple globe materials making the globe darker. [#7726](https://github.com/AnalyticalGraphicsInc/cesium/issues/7726) +* Disable FXAA by default. To re-enable, set `scene.postProcessStages.fxaa.enabled = true` [#7875](https://github.com/CesiumGS/cesium/issues/7875) +* Fixed a crash when a glTF model used `KHR_texture_transform` without a sampler defined. [#7916](https://github.com/CesiumGS/cesium/issues/7916) +* Fixed post-processing selection filtering to work for bloom. [#7984](https://github.com/CesiumGS/cesium/issues/7984) +* Disabled HDR by default to improve visual quality in most standard use cases. Set `viewer.scene.highDynamicRange = true` to re-enable. [#7966](https://github.com/CesiumGS/cesium/issues/7966) +* Fixed a bug that causes hidden point primitives to still appear on some operating systems. [#8043](https://github.com/CesiumGS/cesium/issues/8043) +* Fix negative altitude altitude handling in `GoogleEarthEnterpriseTerrainProvider`. [#8109](https://github.com/CesiumGS/cesium/pull/8109) +* Fixed issue where KTX or CRN files would not be properly identified. [#7979](https://github.com/CesiumGS/cesium/issues/7979) +* Fixed multiple globe materials making the globe darker. [#7726](https://github.com/CesiumGS/cesium/issues/7726) ### 1.60 - 2019-08-01 ##### Additions :tada: -* Reworked label rendering to use signed distance fields (SDF) for crisper text. [#7730](https://github.com/AnalyticalGraphicsInc/cesium/pull/7730) +* Reworked label rendering to use signed distance fields (SDF) for crisper text. [#7730](https://github.com/CesiumGS/cesium/pull/7730) * Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Labels%20SDF.html) to showcase the new SDF labels. -* Added support for polygon holes to CZML. [#7991](https://github.com/AnalyticalGraphicsInc/cesium/pull/7991) +* Added support for polygon holes to CZML. [#7991](https://github.com/CesiumGS/cesium/pull/7991) * Added `totalScale` property to `Label` which is the total scale of the label taking into account the label's scale and the relative size of the desired font compared to the generated glyph size. ##### Fixes :wrench: -* Fixed crash when using ArcGIS terrain with clipping planes. [#7998](https://github.com/AnalyticalGraphicsInc/cesium/pull/7998) +* Fixed crash when using ArcGIS terrain with clipping planes. [#7998](https://github.com/CesiumGS/cesium/pull/7998) * `PolygonGraphics.hierarchy` now converts constant array values to a `PolygonHierarchy` when set, so code that accesses the value of the property can rely on it always being a `PolygonHierarchy`. -* Fixed a bug with lengthwise texture coordinates in the first segment of ground polylines, as observed in some WebGL implementations such as Chrome on Linux. [#8017](https://github.com/AnalyticalGraphicsInc/cesium/issues/8017) +* Fixed a bug with lengthwise texture coordinates in the first segment of ground polylines, as observed in some WebGL implementations such as Chrome on Linux. [#8017](https://github.com/CesiumGS/cesium/issues/8017) ### 1.59 - 2019-07-01 ##### Additions :tada: -* Adds `ArcGISTiledElevationTerrainProvider` to support LERC encoded terrain from ArcGIS ImageServer. [#7940](https://github.com/AnalyticalGraphicsInc/cesium/pull/7940) -* Added CZML support for `heightReference` to `box`, `cylinder`, and `ellipsoid`, and added CZML support for `classificationType` to `corridor`, `ellipse`, `polygon`, `polyline`, and `rectangle`. [#7899](https://github.com/AnalyticalGraphicsInc/cesium/pull/7899) -* Adds `exportKML` function to export `Entity` instances with Point, Billboard, Model, Label, Polyline and Polygon graphics. [#7921](https://github.com/AnalyticalGraphicsInc/cesium/pull/7921) -* Added support for new Mapbox Style API. [#7698](https://github.com/AnalyticalGraphicsInc/cesium/pull/7698) -* Added support for the [AGI_articulations](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations) vendor extension of glTF 2.0 to the Entity API and CZML. [#7907](https://github.com/AnalyticalGraphicsInc/cesium/pull/7907) +* Adds `ArcGISTiledElevationTerrainProvider` to support LERC encoded terrain from ArcGIS ImageServer. [#7940](https://github.com/CesiumGS/cesium/pull/7940) +* Added CZML support for `heightReference` to `box`, `cylinder`, and `ellipsoid`, and added CZML support for `classificationType` to `corridor`, `ellipse`, `polygon`, `polyline`, and `rectangle`. [#7899](https://github.com/CesiumGS/cesium/pull/7899) +* Adds `exportKML` function to export `Entity` instances with Point, Billboard, Model, Label, Polyline and Polygon graphics. [#7921](https://github.com/CesiumGS/cesium/pull/7921) +* Added support for new Mapbox Style API. [#7698](https://github.com/CesiumGS/cesium/pull/7698) +* Added support for the [AGI_articulations](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations) vendor extension of glTF 2.0 to the Entity API and CZML. [#7907](https://github.com/CesiumGS/cesium/pull/7907) ##### Fixes :wrench: -* Fixed a bug that caused missing segments for ground polylines with coplanar points over large distances and problems with polylines containing duplicate points. [#7885](https://github.com/AnalyticalGraphicsInc/cesium//pull/7885) -* Fixed a bug where billboards were not pickable when zoomed out completely in 2D View. [#7908](https://github.com/AnalyticalGraphicsInc/cesium/pull/7908) -* Fixed a bug where image requests that returned HTTP code 204 would prevent any future request from succeeding on browsers that supported ImageBitmap. [#7914](https://github.com/AnalyticalGraphicsInc/cesium/pull/7914/) -* Fixed polyline colors when `scene.highDynamicRange` is enabled. [#7924](https://github.com/AnalyticalGraphicsInc/cesium/pull/7924) -* Fixed a bug in the inspector where the min/max height values of a picked tile were undefined. [#7904](https://github.com/AnalyticalGraphicsInc/cesium/pull/7904) -* Fixed `Math.factorial` to return the correct values. (https://github.com/AnalyticalGraphicsInc/cesium/pull/7969) -* Fixed a bug that caused 3D models to appear darker on Android devices. [#7944](https://github.com/AnalyticalGraphicsInc/cesium/pull/7944) +* Fixed a bug that caused missing segments for ground polylines with coplanar points over large distances and problems with polylines containing duplicate points. [#7885](https://github.com/CesiumGS/cesium//pull/7885) +* Fixed a bug where billboards were not pickable when zoomed out completely in 2D View. [#7908](https://github.com/CesiumGS/cesium/pull/7908) +* Fixed a bug where image requests that returned HTTP code 204 would prevent any future request from succeeding on browsers that supported ImageBitmap. [#7914](https://github.com/CesiumGS/cesium/pull/7914/) +* Fixed polyline colors when `scene.highDynamicRange` is enabled. [#7924](https://github.com/CesiumGS/cesium/pull/7924) +* Fixed a bug in the inspector where the min/max height values of a picked tile were undefined. [#7904](https://github.com/CesiumGS/cesium/pull/7904) +* Fixed `Math.factorial` to return the correct values. (https://github.com/CesiumGS/cesium/pull/7969) +* Fixed a bug that caused 3D models to appear darker on Android devices. [#7944](https://github.com/CesiumGS/cesium/pull/7944) ### 1.58.1 - 2018-06-03 _This is an npm-only release to fix a publishing issue_. @@ -215,23 +246,23 @@ _This is an npm-only release to fix a publishing issue_. ### 1.58 - 2019-06-03 ##### Additions :tada: -* Added support for new `BingMapsStyle` values `ROAD_ON_DEMAND` and `AERIAL_WITH_LABELS_ON_DEMAND`. The older versions of these, `ROAD` and `AERIAL_WITH_LABELS`, have been deprecated by Bing. [#7808](https://github.com/AnalyticalGraphicsInc/cesium/pull/7808) -* Added syntax to delete data from existing properties via CZML. [#7818](https://github.com/AnalyticalGraphicsInc/cesium/pull/7818) -* Added `checkerboard` material to CZML. [#7845](https://github.com/AnalyticalGraphicsInc/cesium/pull/7845) -* `BingMapsImageryProvider` now uses `DiscardEmptyTileImagePolicy` by default to detect missing tiles as zero-length responses instead of inspecting pixel values. [#7810](https://github.com/AnalyticalGraphicsInc/cesium/pull/7810) -* Added support for the [AGI_articulations](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations) vendor extension of glTF 2.0 to the Model primitive graphics API. [#7835](https://github.com/AnalyticalGraphicsInc/cesium/pull/7835) -* Reduce the number of Bing transactions and ion Bing sessions used when destroying and recreating the same imagery layer to 1. [#7848](https://github.com/AnalyticalGraphicsInc/cesium/pull/7848) +* Added support for new `BingMapsStyle` values `ROAD_ON_DEMAND` and `AERIAL_WITH_LABELS_ON_DEMAND`. The older versions of these, `ROAD` and `AERIAL_WITH_LABELS`, have been deprecated by Bing. [#7808](https://github.com/CesiumGS/cesium/pull/7808) +* Added syntax to delete data from existing properties via CZML. [#7818](https://github.com/CesiumGS/cesium/pull/7818) +* Added `checkerboard` material to CZML. [#7845](https://github.com/CesiumGS/cesium/pull/7845) +* `BingMapsImageryProvider` now uses `DiscardEmptyTileImagePolicy` by default to detect missing tiles as zero-length responses instead of inspecting pixel values. [#7810](https://github.com/CesiumGS/cesium/pull/7810) +* Added support for the [AGI_articulations](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations) vendor extension of glTF 2.0 to the Model primitive graphics API. [#7835](https://github.com/CesiumGS/cesium/pull/7835) +* Reduce the number of Bing transactions and ion Bing sessions used when destroying and recreating the same imagery layer to 1. [#7848](https://github.com/CesiumGS/cesium/pull/7848) ##### Fixes :wrench: -* Fixed an edge case where Cesium would provide ion access token credentials to non-ion servers if the actual asset entrypoint was being hosted by ion. [#7839](https://github.com/AnalyticalGraphicsInc/cesium/pull/7839) +* Fixed an edge case where Cesium would provide ion access token credentials to non-ion servers if the actual asset entrypoint was being hosted by ion. [#7839](https://github.com/CesiumGS/cesium/pull/7839) * Fixed a bug that caused Cesium to request non-existent tiles for terrain tilesets lacking tile availability, i.e. a `layer.json` file. * Fixed memory leak when removing entities that had a `HeightReference` of `CLAMP_TO_GROUND` or `RELATIVE_TO_GROUND`. This includes when removing a `DataSource`. -* Fixed 3D Tiles credits not being shown in the data attribution box. [#7877](https://github.com/AnalyticalGraphicsInc/cesium/pull/7877) +* Fixed 3D Tiles credits not being shown in the data attribution box. [#7877](https://github.com/CesiumGS/cesium/pull/7877) ### 1.57 - 2019-05-01 ##### Additions :tada: -* Improved 3D Tiles streaming performance, resulting in ~67% camera tour load time reduction, ~44% camera tour load count reduction. And for general camera movement, ~20% load time reduction with ~27% tile load count reduction. Tile load priority changed to focus on loading tiles in the center of the screen first. Added the following tileset optimizations, which unless stated otherwise are enabled by default. [#7774](https://github.com/AnalyticalGraphicsInc/cesium/pull/7774) +* Improved 3D Tiles streaming performance, resulting in ~67% camera tour load time reduction, ~44% camera tour load count reduction. And for general camera movement, ~20% load time reduction with ~27% tile load count reduction. Tile load priority changed to focus on loading tiles in the center of the screen first. Added the following tileset optimizations, which unless stated otherwise are enabled by default. [#7774](https://github.com/CesiumGS/cesium/pull/7774) * Added `Cesium3DTileset.cullRequestsWhileMoving` option to ignore requests for tiles that will likely be out-of-view due to the camera's movement when they come back from the server. * Added `Cesium3DTileset.cullRequestsWhileMovingMultiplier` option to act as a multiplier when used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling. * Added `Cesium3DTileset.preloadFlightDestinations` option to preload tiles at the camera's flight destination while the camera is in flight. @@ -242,23 +273,23 @@ _This is an npm-only release to fix a publishing issue_. * Added `Cesium3DTileset.foveatedMinimumScreenSpaceErrorRelaxation` option to control the starting screen space error relaxation for tiles outside the foveated cone. * Added `Cesium3DTileset.foveatedInterpolationCallback` option to control how screen space error threshold is interpolated for tiles outside the foveated cone. * Added `Cesium3DTileset.foveatedTimeDelay` option to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. -* Added new parameter to `PolylineGlowMaterial` called `taperPower`, that works similar to the existing `glowPower` parameter, to taper the back of the line away. [#7626](https://github.com/AnalyticalGraphicsInc/cesium/pull/7626) -* Added `Cesium3DTileset.preloadWhenHidden` tileset option to preload tiles when `tileset.show` is false. Loads tiles as if the tileset is visible but does not render them. [#7774](https://github.com/AnalyticalGraphicsInc/cesium/pull/7774) -* Added support for the `KHR_texture_transform` glTF extension. [#7549](https://github.com/AnalyticalGraphicsInc/cesium/pull/7549) -* Added functions to remove samples from `SampledProperty` and `SampledPositionProperty`. [#7723](https://github.com/AnalyticalGraphicsInc/cesium/pull/7723) -* Added support for color-to-alpha with a threshold on imagery layers. [#7727](https://github.com/AnalyticalGraphicsInc/cesium/pull/7727) +* Added new parameter to `PolylineGlowMaterial` called `taperPower`, that works similar to the existing `glowPower` parameter, to taper the back of the line away. [#7626](https://github.com/CesiumGS/cesium/pull/7626) +* Added `Cesium3DTileset.preloadWhenHidden` tileset option to preload tiles when `tileset.show` is false. Loads tiles as if the tileset is visible but does not render them. [#7774](https://github.com/CesiumGS/cesium/pull/7774) +* Added support for the `KHR_texture_transform` glTF extension. [#7549](https://github.com/CesiumGS/cesium/pull/7549) +* Added functions to remove samples from `SampledProperty` and `SampledPositionProperty`. [#7723](https://github.com/CesiumGS/cesium/pull/7723) +* Added support for color-to-alpha with a threshold on imagery layers. [#7727](https://github.com/CesiumGS/cesium/pull/7727) * Add CZML processing for `heightReference` and `extrudedHeightReference` for geoemtry types that support it. -* `CesiumMath.toSNorm` documentation changed to reflect the function's implementation. [#7774](https://github.com/AnalyticalGraphicsInc/cesium/pull/7774) -* Added `CesiumMath.normalize` to convert a scalar value in an arbitrary range to a scalar in the range [0.0, 1.0]. [#7774](https://github.com/AnalyticalGraphicsInc/cesium/pull/7774) +* `CesiumMath.toSNorm` documentation changed to reflect the function's implementation. [#7774](https://github.com/CesiumGS/cesium/pull/7774) +* Added `CesiumMath.normalize` to convert a scalar value in an arbitrary range to a scalar in the range [0.0, 1.0]. [#7774](https://github.com/CesiumGS/cesium/pull/7774) ##### Fixes :wrench: -* Fixed an error when loading the same glTF model in two separate viewers. [#7688](https://github.com/AnalyticalGraphicsInc/cesium/issues/7688) -* Fixed an error where `clampToHeightMostDetailed` or `sampleHeightMostDetailed` would crash if entities were created when the promise resolved. [#7690](https://github.com/AnalyticalGraphicsInc/cesium/pull/7690) -* Fixed an issue with compositing merged entity availability. [#7717](https://github.com/AnalyticalGraphicsInc/cesium/issues/7717) -* Fixed an error where many imagery layers within a single tile would cause parts of the tile to render as black on some platforms. [#7649](https://github.com/AnalyticalGraphicsInc/cesium/issues/7649) -* Fixed a bug that could cause terrain with a single, global root tile (e.g. that uses `WebMercatorTilingScheme`) to be culled unexpectedly in some views. [#7702](https://github.com/AnalyticalGraphicsInc/cesium/issues/7702) -* Fixed a problem where instanced 3D models were incorrectly lit when using physically based materials. [#7775](https://github.com/AnalyticalGraphicsInc/cesium/issues/7775) -* Fixed a bug where glTF models with certain blend modes were rendered incorrectly in browsers that support ImageBitmap. [#7795](https://github.com/AnalyticalGraphicsInc/cesium/issues/7795) +* Fixed an error when loading the same glTF model in two separate viewers. [#7688](https://github.com/CesiumGS/cesium/issues/7688) +* Fixed an error where `clampToHeightMostDetailed` or `sampleHeightMostDetailed` would crash if entities were created when the promise resolved. [#7690](https://github.com/CesiumGS/cesium/pull/7690) +* Fixed an issue with compositing merged entity availability. [#7717](https://github.com/CesiumGS/cesium/issues/7717) +* Fixed an error where many imagery layers within a single tile would cause parts of the tile to render as black on some platforms. [#7649](https://github.com/CesiumGS/cesium/issues/7649) +* Fixed a bug that could cause terrain with a single, global root tile (e.g. that uses `WebMercatorTilingScheme`) to be culled unexpectedly in some views. [#7702](https://github.com/CesiumGS/cesium/issues/7702) +* Fixed a problem where instanced 3D models were incorrectly lit when using physically based materials. [#7775](https://github.com/CesiumGS/cesium/issues/7775) +* Fixed a bug where glTF models with certain blend modes were rendered incorrectly in browsers that support ImageBitmap. [#7795](https://github.com/CesiumGS/cesium/issues/7795) ### 1.56.1 - 2019-04-02 @@ -273,26 +304,26 @@ _This is an npm-only release to fix a publishing issue_. ### 1.56 - 2019-04-01 ##### Breaking Changes :mega: -* `Resource.fetchImage` now returns an `ImageBitmap` instead of `Image` when supported. This allows for decoding images while fetching using `createImageBitmap` to greatly speed up texture upload and decrease frame drops when loading models with large textures. [#7579](https://github.com/AnalyticalGraphicsInc/cesium/pull/7579) -* `Cesium3DTileStyle.style` now has an empty `Object` as its default value, instead of `undefined`. [#7567](https://github.com/AnalyticalGraphicsInc/cesium/issues/7567) -* `Scene.clampToHeight` now takes an optional `width` argument before the `result` argument. [#7693](https://github.com/AnalyticalGraphicsInc/cesium/pull/7693) -* In the `Resource` class, `addQueryParameters` and `addTemplateValues` have been removed. Please use `setQueryParameters` and `setTemplateValues` instead. [#7695](https://github.com/AnalyticalGraphicsInc/cesium/issues/7695) +* `Resource.fetchImage` now returns an `ImageBitmap` instead of `Image` when supported. This allows for decoding images while fetching using `createImageBitmap` to greatly speed up texture upload and decrease frame drops when loading models with large textures. [#7579](https://github.com/CesiumGS/cesium/pull/7579) +* `Cesium3DTileStyle.style` now has an empty `Object` as its default value, instead of `undefined`. [#7567](https://github.com/CesiumGS/cesium/issues/7567) +* `Scene.clampToHeight` now takes an optional `width` argument before the `result` argument. [#7693](https://github.com/CesiumGS/cesium/pull/7693) +* In the `Resource` class, `addQueryParameters` and `addTemplateValues` have been removed. Please use `setQueryParameters` and `setTemplateValues` instead. [#7695](https://github.com/CesiumGS/cesium/issues/7695) ##### Deprecated :hourglass_flowing_sand: -* `Resource.fetchImage` now takes an options object. Use `resource.fetchImage({ preferBlob: true })` instead of `resource.fetchImage(true)`. The previous function definition will no longer work in 1.57. [#7579](https://github.com/AnalyticalGraphicsInc/cesium/pull/7579) +* `Resource.fetchImage` now takes an options object. Use `resource.fetchImage({ preferBlob: true })` instead of `resource.fetchImage(true)`. The previous function definition will no longer work in 1.57. [#7579](https://github.com/CesiumGS/cesium/pull/7579) ##### Additions :tada: -* Added support for touch and hold gesture. The touch and hold delay can be customized by updating `ScreenSpaceEventHandler.touchHoldDelayMilliseconds`. [#7286](https://github.com/AnalyticalGraphicsInc/cesium/pull/7286) -* `Resource.fetchImage` now has a `flipY` option to vertically flip an image during fetch & decode. It is only valid when `ImageBitmapOptions` is supported by the browser. [#7579](https://github.com/AnalyticalGraphicsInc/cesium/pull/7579) -* Added `backFaceCulling` and `normalShading` options to `PointCloudShading`. Both options are only applicable for point clouds containing normals. [#7399](https://github.com/AnalyticalGraphicsInc/cesium/pull/7399) -* `Cesium3DTileStyle.style` reacts to updates and represents the current state of the style. [#7567](https://github.com/AnalyticalGraphicsInc/cesium/issues/7567) +* Added support for touch and hold gesture. The touch and hold delay can be customized by updating `ScreenSpaceEventHandler.touchHoldDelayMilliseconds`. [#7286](https://github.com/CesiumGS/cesium/pull/7286) +* `Resource.fetchImage` now has a `flipY` option to vertically flip an image during fetch & decode. It is only valid when `ImageBitmapOptions` is supported by the browser. [#7579](https://github.com/CesiumGS/cesium/pull/7579) +* Added `backFaceCulling` and `normalShading` options to `PointCloudShading`. Both options are only applicable for point clouds containing normals. [#7399](https://github.com/CesiumGS/cesium/pull/7399) +* `Cesium3DTileStyle.style` reacts to updates and represents the current state of the style. [#7567](https://github.com/CesiumGS/cesium/issues/7567) ##### Fixes :wrench: -* Fixed the value for `BlendFunction.ONE_MINUS_CONSTANT_COLOR`. [#7624](https://github.com/AnalyticalGraphicsInc/cesium/pull/7624) -* Fixed `HeadingPitchRoll.pitch` being `NaN` when using `.fromQuaternion` due to a rounding error for pitches close to +/- 90°. [#7654](https://github.com/AnalyticalGraphicsInc/cesium/pull/7654) -* Fixed a type of crash caused by the camera being rotated through terrain. [#6783](https://github.com/AnalyticalGraphicsInc/cesium/issues/6783) -* Fixed an error in `Resource` when used with template replacements using numeric keys. [#7668](https://github.com/AnalyticalGraphicsInc/cesium/pull/7668) -* Fixed an error in `Cesium3DTilePointFeature` where `anchorLineColor` used the same color instance instead of cloning the color [#7686](https://github.com/AnalyticalGraphicsInc/cesium/pull/7686) +* Fixed the value for `BlendFunction.ONE_MINUS_CONSTANT_COLOR`. [#7624](https://github.com/CesiumGS/cesium/pull/7624) +* Fixed `HeadingPitchRoll.pitch` being `NaN` when using `.fromQuaternion` due to a rounding error for pitches close to +/- 90°. [#7654](https://github.com/CesiumGS/cesium/pull/7654) +* Fixed a type of crash caused by the camera being rotated through terrain. [#6783](https://github.com/CesiumGS/cesium/issues/6783) +* Fixed an error in `Resource` when used with template replacements using numeric keys. [#7668](https://github.com/CesiumGS/cesium/pull/7668) +* Fixed an error in `Cesium3DTilePointFeature` where `anchorLineColor` used the same color instance instead of cloning the color [#7686](https://github.com/CesiumGS/cesium/pull/7686) ### 1.55 - 2019-03-01 @@ -300,81 +331,81 @@ _This is an npm-only release to fix a publishing issue_. * `czm_materialInput.slope` is now an angle in radians between 0 and pi/2 (flat to vertical), rather than a projected length 1 to 0 (flat to vertical). ##### Additions :tada: -* Updated terrain and imagery rendering, resulting in terrain/imagery loading ~33% faster and using ~33% less data [#7061](https://github.com/AnalyticalGraphicsInc/cesium/pull/7061) +* Updated terrain and imagery rendering, resulting in terrain/imagery loading ~33% faster and using ~33% less data [#7061](https://github.com/CesiumGS/cesium/pull/7061) * `czm_materialInput.aspect` was added as an angle in radians between 0 and 2pi (east, north, west to south). -* Added CZML `arcType` support for `polyline` and `polygon`, which supersedes `followSurface`. `followSurface` is still supported for compatibility with existing documents. [#7582](https://github.com/AnalyticalGraphicsInc/cesium/pull/7582) +* Added CZML `arcType` support for `polyline` and `polygon`, which supersedes `followSurface`. `followSurface` is still supported for compatibility with existing documents. [#7582](https://github.com/CesiumGS/cesium/pull/7582) ##### Fixes :wrench: -* Fixed an issue where models would cause a crash on load if some primitives were Draco encoded and others were not. [#7383](https://github.com/AnalyticalGraphicsInc/cesium/issues/7383) -* Fixed an issue where RTL labels not reversing correctly non alphabetic characters [#7501](https://github.com/AnalyticalGraphicsInc/cesium/pull/7501) +* Fixed an issue where models would cause a crash on load if some primitives were Draco encoded and others were not. [#7383](https://github.com/CesiumGS/cesium/issues/7383) +* Fixed an issue where RTL labels not reversing correctly non alphabetic characters [#7501](https://github.com/CesiumGS/cesium/pull/7501) * Fixed Node.js support for the `Resource` class and any functionality using it internally. -* Fixed an issue where some ground polygons crossing the Prime Meridian would have incorrect bounding rectangles. [#7533](https://github.com/AnalyticalGraphicsInc/cesium/pull/7533) -* Fixed an issue where polygons on terrain using rhumb lines where being rendered incorrectly. [#7538](https://github.com/AnalyticalGraphicsInc/cesium/pulls/7538) -* Fixed an issue with `EllipsoidRhumbLines.findIntersectionWithLongitude` when longitude was IDL. [#7551](https://github.com/AnalyticalGraphicsInc/cesium/issues/7551) -* Fixed model silhouette colors when rendering with high dynamic range. [#7563](https://github.com/AnalyticalGraphicsInc/cesium/pull/7563) -* Fixed an issue with ground polylines on globes that use ellipsoids other than WGS84. [#7552](https://github.com/AnalyticalGraphicsInc/cesium/issues/7552) -* Fixed an issue where Draco compressed models with RGB per-vertex color would not load in Cesium. [#7576](https://github.com/AnalyticalGraphicsInc/cesium/issues/7576) -* Fixed an issue where the outline geometry for extruded Polygons didn't calculate the correct indices. [#7599](https://github.com/AnalyticalGraphicsInc/cesium/issues/7599) +* Fixed an issue where some ground polygons crossing the Prime Meridian would have incorrect bounding rectangles. [#7533](https://github.com/CesiumGS/cesium/pull/7533) +* Fixed an issue where polygons on terrain using rhumb lines where being rendered incorrectly. [#7538](https://github.com/CesiumGS/cesium/pulls/7538) +* Fixed an issue with `EllipsoidRhumbLines.findIntersectionWithLongitude` when longitude was IDL. [#7551](https://github.com/CesiumGS/cesium/issues/7551) +* Fixed model silhouette colors when rendering with high dynamic range. [#7563](https://github.com/CesiumGS/cesium/pull/7563) +* Fixed an issue with ground polylines on globes that use ellipsoids other than WGS84. [#7552](https://github.com/CesiumGS/cesium/issues/7552) +* Fixed an issue where Draco compressed models with RGB per-vertex color would not load in Cesium. [#7576](https://github.com/CesiumGS/cesium/issues/7576) +* Fixed an issue where the outline geometry for extruded Polygons didn't calculate the correct indices. [#7599](https://github.com/CesiumGS/cesium/issues/7599) ### 1.54 - 2019-02-01 ##### Highlights :sparkler: -* Added support for polylines and textured entities on 3D Tiles. [#7437](https://github.com/AnalyticalGraphicsInc/cesium/pull/7437) and [#7434](https://github.com/AnalyticalGraphicsInc/cesium/pull/7434) -* Added support for loading models and 3D tilesets with WebP images using the [`EXT_texture_webp`](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_texture_webp/README.md) glTF extension. [#7486](https://github.com/AnalyticalGraphicsInc/cesium/pull/7486) -* Added support for rhumb lines to polygon and polyline geometries. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492) +* Added support for polylines and textured entities on 3D Tiles. [#7437](https://github.com/CesiumGS/cesium/pull/7437) and [#7434](https://github.com/CesiumGS/cesium/pull/7434) +* Added support for loading models and 3D tilesets with WebP images using the [`EXT_texture_webp`](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_texture_webp/README.md) glTF extension. [#7486](https://github.com/CesiumGS/cesium/pull/7486) +* Added support for rhumb lines to polygon and polyline geometries. [#7492](https://github.com/CesiumGS/cesium/pull/7492) ##### Breaking Changes :mega: -* Billboards with `HeightReference.CLAMP_TO_GROUND` are now clamped to both terrain and 3D Tiles. [#7434](https://github.com/AnalyticalGraphicsInc/cesium/pull/7434) -* The default `classificationType` for `GroundPrimitive`, `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics` is now `ClassificationType.BOTH`. [#7434](https://github.com/AnalyticalGraphicsInc/cesium/pull/7434) -* The properties `ModelAnimation.speedup` and `ModelAnimationCollection.speedup` have been removed. Use `ModelAnimation.multiplier` and `ModelAnimationCollection.multiplier` respectively instead. [#7494](https://github.com/AnalyticalGraphicsInc/cesium/issues/7394) +* Billboards with `HeightReference.CLAMP_TO_GROUND` are now clamped to both terrain and 3D Tiles. [#7434](https://github.com/CesiumGS/cesium/pull/7434) +* The default `classificationType` for `GroundPrimitive`, `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics` is now `ClassificationType.BOTH`. [#7434](https://github.com/CesiumGS/cesium/pull/7434) +* The properties `ModelAnimation.speedup` and `ModelAnimationCollection.speedup` have been removed. Use `ModelAnimation.multiplier` and `ModelAnimationCollection.multiplier` respectively instead. [#7494](https://github.com/CesiumGS/cesium/issues/7394) ##### Deprecated :hourglass_flowing_sand: -* `Scene.clampToHeight` now takes an optional `width` argument before the `result` argument. The previous function definition will no longer work in 1.56. [#7287](https://github.com/AnalyticalGraphicsInc/cesium/pull/7287) -* `PolylineGeometry.followSurface` has been superceded by `PolylineGeometry.arcType`. The previous definition will no longer work in 1.57. Replace `followSurface: false` with `arcType: Cesium.ArcType.NONE` and `followSurface: true` with `arcType: Cesium.ArcType.GEODESIC`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492) -* `SimplePolylineGeometry.followSurface` has been superceded by `SimplePolylineGeometry.arcType`. The previous definition will no longer work in 1.57. Replace `followSurface: false` with `arcType: Cesium.ArcType.NONE` and `followSurface: true` with `arcType: Cesium.ArcType.GEODESIC`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492) +* `Scene.clampToHeight` now takes an optional `width` argument before the `result` argument. The previous function definition will no longer work in 1.56. [#7287](https://github.com/CesiumGS/cesium/pull/7287) +* `PolylineGeometry.followSurface` has been superceded by `PolylineGeometry.arcType`. The previous definition will no longer work in 1.57. Replace `followSurface: false` with `arcType: Cesium.ArcType.NONE` and `followSurface: true` with `arcType: Cesium.ArcType.GEODESIC`. [#7492](https://github.com/CesiumGS/cesium/pull/7492) +* `SimplePolylineGeometry.followSurface` has been superceded by `SimplePolylineGeometry.arcType`. The previous definition will no longer work in 1.57. Replace `followSurface: false` with `arcType: Cesium.ArcType.NONE` and `followSurface: true` with `arcType: Cesium.ArcType.GEODESIC`. [#7492](https://github.com/CesiumGS/cesium/pull/7492) ##### Additions :tada: -* Added support for textured ground entities (entities with unspecified `height`) and `GroundPrimitives` on 3D Tiles. [#7434](https://github.com/AnalyticalGraphicsInc/cesium/pull/7434) -* Added support for polylines on 3D Tiles. [#7437](https://github.com/AnalyticalGraphicsInc/cesium/pull/7437) -* Added `classificationType` property to `PolylineGraphics` and `GroundPolylinePrimitive` which specifies whether a polyline clamped to ground should be clamped to terrain, 3D Tiles, or both. [#7437](https://github.com/AnalyticalGraphicsInc/cesium/pull/7437) -* Added the ability to specify the width of the intersection volume for `Scene.sampleHeight`, `Scene.clampToHeight`, `Scene.sampleHeightMostDetailed`, and `Scene.clampToHeightMostDetailed`. [#7287](https://github.com/AnalyticalGraphicsInc/cesium/pull/7287) -* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Time%20Dynamic%20Wheels.html) on using `nodeTransformations` to rotate a model's wheels based on its velocity. [#7361](https://github.com/AnalyticalGraphicsInc/cesium/pull/7361) -* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Polylines%20on%203D%20Tiles.html) for drawing polylines on 3D Tiles [#7522](https://github.com/AnalyticalGraphicsInc/cesium/pull/7522) -* Added `EllipsoidRhumbLine` class as a rhumb line counterpart to `EllipsoidGeodesic`. [#7484](https://github.com/AnalyticalGraphicsInc/cesium/pull/7484) -* Added rhumb line support to `PolygonGeometry`, `PolygonOutlineGeometry`, `PolylineGeometry`, `GroundPolylineGeometry`, and `SimplePolylineGeometry`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492) +* Added support for textured ground entities (entities with unspecified `height`) and `GroundPrimitives` on 3D Tiles. [#7434](https://github.com/CesiumGS/cesium/pull/7434) +* Added support for polylines on 3D Tiles. [#7437](https://github.com/CesiumGS/cesium/pull/7437) +* Added `classificationType` property to `PolylineGraphics` and `GroundPolylinePrimitive` which specifies whether a polyline clamped to ground should be clamped to terrain, 3D Tiles, or both. [#7437](https://github.com/CesiumGS/cesium/pull/7437) +* Added the ability to specify the width of the intersection volume for `Scene.sampleHeight`, `Scene.clampToHeight`, `Scene.sampleHeightMostDetailed`, and `Scene.clampToHeightMostDetailed`. [#7287](https://github.com/CesiumGS/cesium/pull/7287) +* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Time%20Dynamic%20Wheels.html) on using `nodeTransformations` to rotate a model's wheels based on its velocity. [#7361](https://github.com/CesiumGS/cesium/pull/7361) +* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Polylines%20on%203D%20Tiles.html) for drawing polylines on 3D Tiles [#7522](https://github.com/CesiumGS/cesium/pull/7522) +* Added `EllipsoidRhumbLine` class as a rhumb line counterpart to `EllipsoidGeodesic`. [#7484](https://github.com/CesiumGS/cesium/pull/7484) +* Added rhumb line support to `PolygonGeometry`, `PolygonOutlineGeometry`, `PolylineGeometry`, `GroundPolylineGeometry`, and `SimplePolylineGeometry`. [#7492](https://github.com/CesiumGS/cesium/pull/7492) * When using Cesium in Node.js, we now use the combined and minified version for improved performance unless `NODE_ENV` is specifically set to `development`. -* Improved the performance of `QuantizedMeshTerrainData.interpolateHeight`. [#7508](https://github.com/AnalyticalGraphicsInc/cesium/pull/7508) -* Added support for glTF models with WebP textures using the `EXT_texture_webp` extension. [#7486](https://github.com/AnalyticalGraphicsInc/cesium/pull/7486) +* Improved the performance of `QuantizedMeshTerrainData.interpolateHeight`. [#7508](https://github.com/CesiumGS/cesium/pull/7508) +* Added support for glTF models with WebP textures using the `EXT_texture_webp` extension. [#7486](https://github.com/CesiumGS/cesium/pull/7486) ##### Fixes :wrench: -* Fixed 3D Tiles performance regression. [#7482](https://github.com/AnalyticalGraphicsInc/cesium/pull/7482) -* Fixed an issue where classification primitives with the `CESIUM_3D_TILE` classification type would render on terrain. [#7422](https://github.com/AnalyticalGraphicsInc/cesium/pull/7422) -* Fixed an issue where 3D Tiles would show through the globe. [#7422](https://github.com/AnalyticalGraphicsInc/cesium/pull/7422) -* Fixed crash when entity geometry show value is an interval that only covered part of the entity availability range [#7458](https://github.com/AnalyticalGraphicsInc/cesium/pull/7458) -* Fix rectangle positions at the north and south poles. [#7451](https://github.com/AnalyticalGraphicsInc/cesium/pull/7451) -* Fixed image size issue when using multiple particle systems. [#7412](https://github.com/AnalyticalGraphicsInc/cesium/pull/7412) -* Fixed Sandcastle's "Open in New Window" button not displaying imagery due to blob URI limitations. [#7250](https://github.com/AnalyticalGraphicsInc/cesium/pull/7250) -* Fixed an issue where setting `scene.globe.cartographicLimitRectangle` to `undefined` would cause a crash. [#7477](https://github.com/AnalyticalGraphicsInc/cesium/issues/7477) -* Fixed `PrimitiveCollection.removeAll` to no longer `contain` removed primitives. [#7491](https://github.com/AnalyticalGraphicsInc/cesium/pull/7491) -* Fixed `GeoJsonDataSource` to use polygons and polylines that use rhumb lines. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492) -* Fixed an issue where some ground polygons would be cut off along circles of latitude. [#7507](https://github.com/AnalyticalGraphicsInc/cesium/issues/7507) -* Fixed an issue that would cause IE 11 to crash when enabling image-based lighting. [#7485](https://github.com/AnalyticalGraphicsInc/cesium/issues/7485) +* Fixed 3D Tiles performance regression. [#7482](https://github.com/CesiumGS/cesium/pull/7482) +* Fixed an issue where classification primitives with the `CESIUM_3D_TILE` classification type would render on terrain. [#7422](https://github.com/CesiumGS/cesium/pull/7422) +* Fixed an issue where 3D Tiles would show through the globe. [#7422](https://github.com/CesiumGS/cesium/pull/7422) +* Fixed crash when entity geometry show value is an interval that only covered part of the entity availability range [#7458](https://github.com/CesiumGS/cesium/pull/7458) +* Fix rectangle positions at the north and south poles. [#7451](https://github.com/CesiumGS/cesium/pull/7451) +* Fixed image size issue when using multiple particle systems. [#7412](https://github.com/CesiumGS/cesium/pull/7412) +* Fixed Sandcastle's "Open in New Window" button not displaying imagery due to blob URI limitations. [#7250](https://github.com/CesiumGS/cesium/pull/7250) +* Fixed an issue where setting `scene.globe.cartographicLimitRectangle` to `undefined` would cause a crash. [#7477](https://github.com/CesiumGS/cesium/issues/7477) +* Fixed `PrimitiveCollection.removeAll` to no longer `contain` removed primitives. [#7491](https://github.com/CesiumGS/cesium/pull/7491) +* Fixed `GeoJsonDataSource` to use polygons and polylines that use rhumb lines. [#7492](https://github.com/CesiumGS/cesium/pull/7492) +* Fixed an issue where some ground polygons would be cut off along circles of latitude. [#7507](https://github.com/CesiumGS/cesium/issues/7507) +* Fixed an issue that would cause IE 11 to crash when enabling image-based lighting. [#7485](https://github.com/CesiumGS/cesium/issues/7485) ### 1.53 - 2019-01-02 ##### Additions :tada: -* Added image-based lighting for PBR models and 3D Tiles. [#7172](https://github.com/AnalyticalGraphicsInc/cesium/pull/7172) +* Added image-based lighting for PBR models and 3D Tiles. [#7172](https://github.com/CesiumGS/cesium/pull/7172) * `Scene.specularEnvironmentMaps` is a url to a KTX file that contains the specular environment map and convoluted mipmaps for image-based lighting of all PBR models in the scene. * `Scene.sphericalHarmonicCoefficients` is an array of 9 `Cartesian3` spherical harmonics coefficients for the diffuse irradiance of all PBR models in the scene. * The `specularEnvironmentMaps` and `sphericalHarmonicCoefficients` properties of `Model` and `Cesium3DTileset` can be used to override the values from the scene for specific models and tilesets. * The `luminanceAtZenith` property of `Model` and `Cesium3DTileset` adjusts the luminance of the procedural image-based lighting. -* Double click away from an entity to un-track it [#7285](https://github.com/AnalyticalGraphicsInc/cesium/pull/7285) +* Double click away from an entity to un-track it [#7285](https://github.com/CesiumGS/cesium/pull/7285) ##### Fixes :wrench: -* Fixed 3D Tiles visibility checking when running multiple passes within the same frame. [#7289](https://github.com/AnalyticalGraphicsInc/cesium/pull/7289) -* Fixed contrast on imagery layers. [#7382](https://github.com/AnalyticalGraphicsInc/cesium/issues/7382) -* Fixed rendering transparent background color when `highDynamicRange` is enabled. [#7427](https://github.com/AnalyticalGraphicsInc/cesium/issues/7427) -* Fixed translucent geometry when `highDynamicRange` is toggled. [#7451](https://github.com/AnalyticalGraphicsInc/cesium/pull/7451) +* Fixed 3D Tiles visibility checking when running multiple passes within the same frame. [#7289](https://github.com/CesiumGS/cesium/pull/7289) +* Fixed contrast on imagery layers. [#7382](https://github.com/CesiumGS/cesium/issues/7382) +* Fixed rendering transparent background color when `highDynamicRange` is enabled. [#7427](https://github.com/CesiumGS/cesium/issues/7427) +* Fixed translucent geometry when `highDynamicRange` is toggled. [#7451](https://github.com/CesiumGS/cesium/pull/7451) ### 1.52 - 2018-12-03 @@ -382,54 +413,54 @@ _This is an npm-only release to fix a publishing issue_. * `TerrainProviders` that implement `availability` must now also implement the `loadTileDataAvailability` method. ##### Deprecated :hourglass_flowing_sand: -* The property `ModelAnimation.speedup` has been deprecated and renamed to `ModelAnimation.multiplier`. `speedup` will be removed in version 1.54. [#7393](https://github.com/AnalyticalGraphicsInc/cesium/pull/7393) +* The property `ModelAnimation.speedup` has been deprecated and renamed to `ModelAnimation.multiplier`. `speedup` will be removed in version 1.54. [#7393](https://github.com/CesiumGS/cesium/pull/7393) ##### Additions :tada: -* Added functions to get the most detailed height of 3D Tiles on-screen or off-screen. [#7115](https://github.com/AnalyticalGraphicsInc/cesium/pull/7115) +* Added functions to get the most detailed height of 3D Tiles on-screen or off-screen. [#7115](https://github.com/CesiumGS/cesium/pull/7115) * Added `Scene.sampleHeightMostDetailed`, an asynchronous version of `Scene.sampleHeight` that uses the maximum level of detail for 3D Tiles. * Added `Scene.clampToHeightMostDetailed`, an asynchronous version of `Scene.clampToHeight` that uses the maximum level of detail for 3D Tiles. -* Added support for high dynamic range rendering. It is enabled by default when supported, but can be disabled with `Scene.highDynamicRange`. [#7017](https://github.com/AnalyticalGraphicsInc/cesium/pull/7017) +* Added support for high dynamic range rendering. It is enabled by default when supported, but can be disabled with `Scene.highDynamicRange`. [#7017](https://github.com/CesiumGS/cesium/pull/7017) * Added `Scene.invertClassificationSupported` for checking if invert classification is supported. -* Added `computeLineSegmentLineSegmentIntersection` to `Intersections2D`. [#7228](https://github.com/AnalyticalGraphicsInc/Cesium/pull/7228) -* Added ability to load availability progressively from a quantized mesh extension instead of upfront. This will speed up load time and reduce memory usage. [#7196](https://github.com/AnalyticalGraphicsInc/cesium/pull/7196) -* Added the ability to apply styles to 3D Tilesets that don't contain features. [#7255](https://github.com/AnalyticalGraphicsInc/Cesium/pull/7255) +* Added `computeLineSegmentLineSegmentIntersection` to `Intersections2D`. [#7228](https://github.com/CesiumGS/Cesium/pull/7228) +* Added ability to load availability progressively from a quantized mesh extension instead of upfront. This will speed up load time and reduce memory usage. [#7196](https://github.com/CesiumGS/cesium/pull/7196) +* Added the ability to apply styles to 3D Tilesets that don't contain features. [#7255](https://github.com/CesiumGS/Cesium/pull/7255) ##### Fixes :wrench: -* Fixed issue causing polyline to look wavy depending on the position of the camera [#7209](https://github.com/AnalyticalGraphicsInc/cesium/pull/7209) -* Fixed translucency issues for dynamic geometry entities. [#7364](https://github.com/AnalyticalGraphicsInc/cesium/issues/7364) +* Fixed issue causing polyline to look wavy depending on the position of the camera [#7209](https://github.com/CesiumGS/cesium/pull/7209) +* Fixed translucency issues for dynamic geometry entities. [#7364](https://github.com/CesiumGS/cesium/issues/7364) ### 1.51 - 2018-11-01 ##### Additions :tada: -* Added WMS-T (time) support in WebMapServiceImageryProvider [#2581](https://github.com/AnalyticalGraphicsInc/cesium/issues/2581) -* Added `cutoutRectangle` to `ImageryLayer`, which allows cutting out rectangular areas in imagery layers to reveal underlying imagery. [#7056](https://github.com/AnalyticalGraphicsInc/cesium/pull/7056) -* Added `atmosphereHueShift`, `atmosphereSaturationShift`, and `atmosphereBrightnessShift` properties to `Globe` which shift the color of the ground atmosphere to match the hue, saturation, and brightness shifts of the sky atmosphere. [#4195](https://github.com/AnalyticalGraphicsInc/cesium/issues/4195) -* Shrink minified and gzipped Cesium.js by 27 KB (~3.7%) by delay loading seldom-used third-party dependencies. [#7140](https://github.com/AnalyticalGraphicsInc/cesium/pull/7140) -* Added `lightColor` property to `Cesium3DTileset`, `Model`, and `ModelGraphics` to change the intensity of the light used when shading model. [#7025](https://github.com/AnalyticalGraphicsInc/cesium/pull/7025) -* Added `imageBasedLightingFactor` property to `Cesium3DTileset`, `Model`, and `ModelGraphics` to scale the diffuse and specular image-based lighting contributions to the final color. [#7025](https://github.com/AnalyticalGraphicsInc/cesium/pull/7025) -* Added per-feature selection to the 3D Tiles BIM Sandcastle example. [#7181](https://github.com/AnalyticalGraphicsInc/cesium/pull/7181) -* Added `Transforms.fixedFrameToHeadingPitchRoll`, a helper function for extracting a `HeadingPitchRoll` from a fixed frame transform. [#7164](https://github.com/AnalyticalGraphicsInc/cesium/pull/7164) -* Added `Ray.clone`. [#7174](https://github.com/AnalyticalGraphicsInc/cesium/pull/7174) +* Added WMS-T (time) support in WebMapServiceImageryProvider [#2581](https://github.com/CesiumGS/cesium/issues/2581) +* Added `cutoutRectangle` to `ImageryLayer`, which allows cutting out rectangular areas in imagery layers to reveal underlying imagery. [#7056](https://github.com/CesiumGS/cesium/pull/7056) +* Added `atmosphereHueShift`, `atmosphereSaturationShift`, and `atmosphereBrightnessShift` properties to `Globe` which shift the color of the ground atmosphere to match the hue, saturation, and brightness shifts of the sky atmosphere. [#4195](https://github.com/CesiumGS/cesium/issues/4195) +* Shrink minified and gzipped Cesium.js by 27 KB (~3.7%) by delay loading seldom-used third-party dependencies. [#7140](https://github.com/CesiumGS/cesium/pull/7140) +* Added `lightColor` property to `Cesium3DTileset`, `Model`, and `ModelGraphics` to change the intensity of the light used when shading model. [#7025](https://github.com/CesiumGS/cesium/pull/7025) +* Added `imageBasedLightingFactor` property to `Cesium3DTileset`, `Model`, and `ModelGraphics` to scale the diffuse and specular image-based lighting contributions to the final color. [#7025](https://github.com/CesiumGS/cesium/pull/7025) +* Added per-feature selection to the 3D Tiles BIM Sandcastle example. [#7181](https://github.com/CesiumGS/cesium/pull/7181) +* Added `Transforms.fixedFrameToHeadingPitchRoll`, a helper function for extracting a `HeadingPitchRoll` from a fixed frame transform. [#7164](https://github.com/CesiumGS/cesium/pull/7164) +* Added `Ray.clone`. [#7174](https://github.com/CesiumGS/cesium/pull/7174) ##### Fixes :wrench: -* Fixed issue removing geometry entities with different materials. [#7163](https://github.com/AnalyticalGraphicsInc/cesium/pull/7163) -* Fixed texture coordinate calculation for polygon entities with `perPositionHeight`. [#7188](https://github.com/AnalyticalGraphicsInc/cesium/pull/7188) -* Fixed crash when updating polyline attributes twice in one frame. [#7155](https://github.com/AnalyticalGraphicsInc/cesium/pull/7155) -* Fixed entity visibility issue related to setting an entity show property and altering or adding entity geometry. [#7156](https://github.com/AnalyticalGraphicsInc/cesium/pull/7156) -* Fixed an issue where dynamic Entities on terrain would cause a crash in platforms that do not support depth textures such as Internet Explorer. [#7103](https://github.com/AnalyticalGraphicsInc/cesium/issues/7103) -* Fixed an issue that would cause a crash when removing a post process stage. [#7210](https://github.com/AnalyticalGraphicsInc/cesium/issues/7210) -* Fixed an issue where `pickPosition` would return incorrect results when called after `sampleHeight` or `clampToHeight`. [#7113](https://github.com/AnalyticalGraphicsInc/cesium/pull/7113) -* Fixed an issue where `sampleHeight` and `clampToHeight` would crash if picking a primitive that doesn't write depth. [#7120](https://github.com/AnalyticalGraphicsInc/cesium/issues/7120) -* Fixed a crash when using `BingMapsGeocoderService`. [#7143](https://github.com/AnalyticalGraphicsInc/cesium/issues/7143) -* Fixed accuracy of rotation matrix generated by `VelocityOrientationProperty`. [#6641](https://github.com/AnalyticalGraphicsInc/cesium/pull/6641) -* Fixed clipping plane crash when adding a plane to an empty collection. [#7168](https://github.com/AnalyticalGraphicsInc/cesium/pull/7168) -* Fixed clipping planes on tilesets not taking into account the tileset model matrix. [#7182](https://github.com/AnalyticalGraphicsInc/cesium/pull/7182) -* Fixed incorrect rendering of models using the `KHR_materials_common` lights extension. [#7206](https://github.com/AnalyticalGraphicsInc/cesium/pull/7206) +* Fixed issue removing geometry entities with different materials. [#7163](https://github.com/CesiumGS/cesium/pull/7163) +* Fixed texture coordinate calculation for polygon entities with `perPositionHeight`. [#7188](https://github.com/CesiumGS/cesium/pull/7188) +* Fixed crash when updating polyline attributes twice in one frame. [#7155](https://github.com/CesiumGS/cesium/pull/7155) +* Fixed entity visibility issue related to setting an entity show property and altering or adding entity geometry. [#7156](https://github.com/CesiumGS/cesium/pull/7156) +* Fixed an issue where dynamic Entities on terrain would cause a crash in platforms that do not support depth textures such as Internet Explorer. [#7103](https://github.com/CesiumGS/cesium/issues/7103) +* Fixed an issue that would cause a crash when removing a post process stage. [#7210](https://github.com/CesiumGS/cesium/issues/7210) +* Fixed an issue where `pickPosition` would return incorrect results when called after `sampleHeight` or `clampToHeight`. [#7113](https://github.com/CesiumGS/cesium/pull/7113) +* Fixed an issue where `sampleHeight` and `clampToHeight` would crash if picking a primitive that doesn't write depth. [#7120](https://github.com/CesiumGS/cesium/issues/7120) +* Fixed a crash when using `BingMapsGeocoderService`. [#7143](https://github.com/CesiumGS/cesium/issues/7143) +* Fixed accuracy of rotation matrix generated by `VelocityOrientationProperty`. [#6641](https://github.com/CesiumGS/cesium/pull/6641) +* Fixed clipping plane crash when adding a plane to an empty collection. [#7168](https://github.com/CesiumGS/cesium/pull/7168) +* Fixed clipping planes on tilesets not taking into account the tileset model matrix. [#7182](https://github.com/CesiumGS/cesium/pull/7182) +* Fixed incorrect rendering of models using the `KHR_materials_common` lights extension. [#7206](https://github.com/CesiumGS/cesium/pull/7206) ### 1.50 - 2018-10-01 ##### Breaking Changes :mega: -* Clipping planes on tilesets now use the root tile's transform, or the root tile's bounding sphere if a transform is not defined. [#7034](https://github.com/AnalyticalGraphicsInc/cesium/pull/7034) +* Clipping planes on tilesets now use the root tile's transform, or the root tile's bounding sphere if a transform is not defined. [#7034](https://github.com/CesiumGS/cesium/pull/7034) * This is to make clipping planes' coordinates always relative to the object they're attached to. So if you were positioning the clipping planes as in the example below, this is no longer necessary: ```javascript clippingPlanes.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(tileset.boundingSphere.center); @@ -437,155 +468,155 @@ _This is an npm-only release to fix a publishing issue_. * This also fixes several issues with clipping planes not using the correct transform for tilesets with children. ##### Additions :tada: -* Initial support for clamping to 3D Tiles. [#6934](https://github.com/AnalyticalGraphicsInc/cesium/pull/6934) +* Initial support for clamping to 3D Tiles. [#6934](https://github.com/CesiumGS/cesium/pull/6934) * Added `Scene.sampleHeight` to get the height of geometry in the scene. May be used to clamp objects to the globe, 3D Tiles, or primitives in the scene. * Added `Scene.clampToHeight` to clamp a cartesian position to the scene geometry. * Requires depth texture support (`WEBGL_depth_texture` or `WEBKIT_WEBGL_depth_texture`). Added `Scene.sampleHeightSupported` and `Scene.clampToHeightSupported` functions for checking if height sampling is supported. -* Added `Cesium3DTileset.initialTilesLoaded` to indicate that all tiles in the initial view are loaded. [#6934](https://github.com/AnalyticalGraphicsInc/cesium/pull/6934) -* Added support for glTF extension [KHR_materials_pbrSpecularGlossiness](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness) [#7006](https://github.com/AnalyticalGraphicsInc/cesium/pull/7006). -* Added support for glTF extension [KHR_materials_unlit](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit) [#6977](https://github.com/AnalyticalGraphicsInc/cesium/pull/6977). -* Added support for glTF extensions [KHR_techniques_webgl](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_techniques_webgl) and [KHR_blend](https://github.com/KhronosGroup/glTF/pull/1302). [#6805](https://github.com/AnalyticalGraphicsInc/cesium/pull/6805) -* Update [gltf-pipeline](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/) to 2.0. [#6805](https://github.com/AnalyticalGraphicsInc/cesium/pull/6805) -* Added `cartographicLimitRectangle` to `Globe`. Use this to limit terrain and imagery to a specific `Rectangle` area. [#6987](https://github.com/AnalyticalGraphicsInc/cesium/pull/6987) -* Added `OpenCageGeocoderService`, which provides geocoding via [OpenCage](https://opencagedata.com/). [#7015](https://github.com/AnalyticalGraphicsInc/cesium/pull/7015) -* Added ground atmosphere lighting in 3D. This can be toggled with `Globe.showGroundAtmosphere`. [6877](https://github.com/AnalyticalGraphicsInc/cesium/pull/6877) - * Added `Globe.nightFadeOutDistance` and `Globe.nightFadeInDistance` to configure when ground atmosphere night lighting fades in and out. [6877](https://github.com/AnalyticalGraphicsInc/cesium/pull/6877) -* Added `onStop` event to `Clock` that fires each time stopTime is reached. [#7066](https://github.com/AnalyticalGraphicsInc/cesium/pull/7066) +* Added `Cesium3DTileset.initialTilesLoaded` to indicate that all tiles in the initial view are loaded. [#6934](https://github.com/CesiumGS/cesium/pull/6934) +* Added support for glTF extension [KHR_materials_pbrSpecularGlossiness](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness) [#7006](https://github.com/CesiumGS/cesium/pull/7006). +* Added support for glTF extension [KHR_materials_unlit](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit) [#6977](https://github.com/CesiumGS/cesium/pull/6977). +* Added support for glTF extensions [KHR_techniques_webgl](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_techniques_webgl) and [KHR_blend](https://github.com/KhronosGroup/glTF/pull/1302). [#6805](https://github.com/CesiumGS/cesium/pull/6805) +* Update [gltf-pipeline](https://github.com/CesiumGS/gltf-pipeline/) to 2.0. [#6805](https://github.com/CesiumGS/cesium/pull/6805) +* Added `cartographicLimitRectangle` to `Globe`. Use this to limit terrain and imagery to a specific `Rectangle` area. [#6987](https://github.com/CesiumGS/cesium/pull/6987) +* Added `OpenCageGeocoderService`, which provides geocoding via [OpenCage](https://opencagedata.com/). [#7015](https://github.com/CesiumGS/cesium/pull/7015) +* Added ground atmosphere lighting in 3D. This can be toggled with `Globe.showGroundAtmosphere`. [6877](https://github.com/CesiumGS/cesium/pull/6877) + * Added `Globe.nightFadeOutDistance` and `Globe.nightFadeInDistance` to configure when ground atmosphere night lighting fades in and out. [6877](https://github.com/CesiumGS/cesium/pull/6877) +* Added `onStop` event to `Clock` that fires each time stopTime is reached. [#7066](https://github.com/CesiumGS/cesium/pull/7066) ##### Fixes :wrench: -* Fixed picking for overlapping translucent primitives. [#7039](https://github.com/AnalyticalGraphicsInc/cesium/pull/7039) -* Fixed an issue in the 3D Tiles traversal where tilesets would render with mixed level of detail if an external tileset was visible but its root tile was not. [#7099](https://github.com/AnalyticalGraphicsInc/cesium/pull/7099) -* Fixed an issue in the 3D Tiles traversal where external tilesets would not always traverse to their root tile. [#7035](https://github.com/AnalyticalGraphicsInc/cesium/pull/7035) -* Fixed an issue in the 3D Tiles traversal where empty tiles would be selected instead of their nearest loaded ancestors. [#7011](https://github.com/AnalyticalGraphicsInc/cesium/pull/7011) -* Fixed an issue where scaling near zero with an model animation could cause rendering to stop. [#6954](https://github.com/AnalyticalGraphicsInc/cesium/pull/6954) -* Fixed bug where credits weren't displaying correctly if more than one viewer was initialized [#6965](expect(https://github.com/AnalyticalGraphicsInc/cesium/issues/6965) -* Fixed entity show issues. [#7048](https://github.com/AnalyticalGraphicsInc/cesium/issues/7048) -* Fixed a bug where polylines on terrain covering very large portions of the globe would cull incorrectly in 3d-only scenes. [#7043](https://github.com/AnalyticalGraphicsInc/cesium/issues/7043) -* Fixed bug causing crash on entity geometry material change. [#7047](https://github.com/AnalyticalGraphicsInc/cesium/pull/7047) -* Fixed MIME type behavior for `Resource` requests in recent versions of Edge [#7085](https://github.com/AnalyticalGraphicsInc/cesium/issues/7085). +* Fixed picking for overlapping translucent primitives. [#7039](https://github.com/CesiumGS/cesium/pull/7039) +* Fixed an issue in the 3D Tiles traversal where tilesets would render with mixed level of detail if an external tileset was visible but its root tile was not. [#7099](https://github.com/CesiumGS/cesium/pull/7099) +* Fixed an issue in the 3D Tiles traversal where external tilesets would not always traverse to their root tile. [#7035](https://github.com/CesiumGS/cesium/pull/7035) +* Fixed an issue in the 3D Tiles traversal where empty tiles would be selected instead of their nearest loaded ancestors. [#7011](https://github.com/CesiumGS/cesium/pull/7011) +* Fixed an issue where scaling near zero with an model animation could cause rendering to stop. [#6954](https://github.com/CesiumGS/cesium/pull/6954) +* Fixed bug where credits weren't displaying correctly if more than one viewer was initialized [#6965](expect(https://github.com/CesiumGS/cesium/issues/6965) +* Fixed entity show issues. [#7048](https://github.com/CesiumGS/cesium/issues/7048) +* Fixed a bug where polylines on terrain covering very large portions of the globe would cull incorrectly in 3d-only scenes. [#7043](https://github.com/CesiumGS/cesium/issues/7043) +* Fixed bug causing crash on entity geometry material change. [#7047](https://github.com/CesiumGS/cesium/pull/7047) +* Fixed MIME type behavior for `Resource` requests in recent versions of Edge [#7085](https://github.com/CesiumGS/cesium/issues/7085). ### 1.49 - 2018-09-04 ##### Breaking Changes :mega: -* Removed `ClippingPlaneCollection.clone`. [#6872](https://github.com/AnalyticalGraphicsInc/cesium/pull/6872) -* Changed `Globe.pick` to return a position in ECEF coordinates regardless of the current scene mode. This will only effect you if you were working around a bug to make `Globe.pick` work in 2D and Columbus View. Use `Globe.pickWorldCoordinates` to get the position in world coordinates that correlate to the current scene mode. [#6859](https://github.com/AnalyticalGraphicsInc/cesium/pull/6859) -* Removed the unused `frameState` parameter in `evaluate` and `evaluateColor` functions in `Expression`, `StyleExpression`, `ConditionsExpression` and all other places that call the functions. [#6890](https://github.com/AnalyticalGraphicsInc/cesium/pull/6890) -* Removed `PostProcessStageLibrary.createLensFlarStage`. Use `PostProcessStageLibrary.createLensFlareStage` instead. [#6972](https://github.com/AnalyticalGraphicsInc/cesium/pull/6972) -* Removed `Scene.fxaa`. Use `Scene.postProcessStages.fxaa.enabled` instead. [#6980](https://github.com/AnalyticalGraphicsInc/cesium/pull/6980) +* Removed `ClippingPlaneCollection.clone`. [#6872](https://github.com/CesiumGS/cesium/pull/6872) +* Changed `Globe.pick` to return a position in ECEF coordinates regardless of the current scene mode. This will only effect you if you were working around a bug to make `Globe.pick` work in 2D and Columbus View. Use `Globe.pickWorldCoordinates` to get the position in world coordinates that correlate to the current scene mode. [#6859](https://github.com/CesiumGS/cesium/pull/6859) +* Removed the unused `frameState` parameter in `evaluate` and `evaluateColor` functions in `Expression`, `StyleExpression`, `ConditionsExpression` and all other places that call the functions. [#6890](https://github.com/CesiumGS/cesium/pull/6890) +* Removed `PostProcessStageLibrary.createLensFlarStage`. Use `PostProcessStageLibrary.createLensFlareStage` instead. [#6972](https://github.com/CesiumGS/cesium/pull/6972) +* Removed `Scene.fxaa`. Use `Scene.postProcessStages.fxaa.enabled` instead. [#6980](https://github.com/CesiumGS/cesium/pull/6980) ##### Additions :tada: -* Added `heightReference` to `BoxGraphics`, `CylinderGraphics` and `EllipsoidGraphics`, which can be used to clamp these entity types to terrain. [#6932](https://github.com/AnalyticalGraphicsInc/cesium/pull/6932) -* Added `GeocoderViewModel.destinationFound` for specifying a function that is called upon a successful geocode. The default behavior is to fly to the destination found by the geocoder. [#6915](https://github.com/AnalyticalGraphicsInc/cesium/pull/6915) -* Added `ClippingPlaneCollection.planeAdded` and `ClippingPlaneCollection.planeRemoved` events. `planeAdded` is raised when a new plane is added to the collection and `planeRemoved` is raised when a plane is removed. [#6875](https://github.com/AnalyticalGraphicsInc/cesium/pull/6875) -* Added `Matrix4.setScale` for setting the scale on an affine transformation matrix [#6888](https://github.com/AnalyticalGraphicsInc/cesium/pull/6888) -* Added optional `width` and `height` to `Scene.drillPick` for specifying a search area. [#6922](https://github.com/AnalyticalGraphicsInc/cesium/pull/6922) -* Added `Cesium3DTileset.root` for getting the root tile of a tileset. [#6944](https://github.com/AnalyticalGraphicsInc/cesium/pull/6944) -* Added `Cesium3DTileset.extras` and `Cesium3DTile.extras` for getting application specific metadata from 3D Tiles. [#6974](https://github.com/AnalyticalGraphicsInc/cesium/pull/6974) +* Added `heightReference` to `BoxGraphics`, `CylinderGraphics` and `EllipsoidGraphics`, which can be used to clamp these entity types to terrain. [#6932](https://github.com/CesiumGS/cesium/pull/6932) +* Added `GeocoderViewModel.destinationFound` for specifying a function that is called upon a successful geocode. The default behavior is to fly to the destination found by the geocoder. [#6915](https://github.com/CesiumGS/cesium/pull/6915) +* Added `ClippingPlaneCollection.planeAdded` and `ClippingPlaneCollection.planeRemoved` events. `planeAdded` is raised when a new plane is added to the collection and `planeRemoved` is raised when a plane is removed. [#6875](https://github.com/CesiumGS/cesium/pull/6875) +* Added `Matrix4.setScale` for setting the scale on an affine transformation matrix [#6888](https://github.com/CesiumGS/cesium/pull/6888) +* Added optional `width` and `height` to `Scene.drillPick` for specifying a search area. [#6922](https://github.com/CesiumGS/cesium/pull/6922) +* Added `Cesium3DTileset.root` for getting the root tile of a tileset. [#6944](https://github.com/CesiumGS/cesium/pull/6944) +* Added `Cesium3DTileset.extras` and `Cesium3DTile.extras` for getting application specific metadata from 3D Tiles. [#6974](https://github.com/CesiumGS/cesium/pull/6974) ##### Fixes :wrench: -* Several performance improvements and fixes to the 3D Tiles traversal code. [#6390](https://github.com/AnalyticalGraphicsInc/cesium/pull/6390) +* Several performance improvements and fixes to the 3D Tiles traversal code. [#6390](https://github.com/CesiumGS/cesium/pull/6390) * Improved load performance when `skipLevelOfDetail` is false. * Fixed a bug that caused some skipped tiles to load when `skipLevelOfDetail` is true. * Fixed pick statistics in the 3D Tiles Inspector. * Fixed drawing of debug labels for external tilesets. * Fixed drawing of debug outlines for empty tiles. -* The Geocoder widget now takes terrain altitude into account when calculating its final destination. [#6876](https://github.com/AnalyticalGraphicsInc/cesium/pull/6876) -* The Viewer widget now takes terrain altitude into account when zooming or flying to imagery layers. [#6895](https://github.com/AnalyticalGraphicsInc/cesium/pull/6895) -* Fixed Firefox camera control issues with mouse and touch events. [#6372](https://github.com/AnalyticalGraphicsInc/cesium/issues/6372) -* Fixed `getPickRay` in 2D. [#2480](https://github.com/AnalyticalGraphicsInc/cesium/issues/2480) -* Fixed `Globe.pick` for 2D and Columbus View. [#6859](https://github.com/AnalyticalGraphicsInc/cesium/pull/6859) -* Fixed imagery layer feature picking in 2D and Columbus view. [#6859](https://github.com/AnalyticalGraphicsInc/cesium/pull/6859) -* Fixed intermittent ground clamping issues for all entity types that use a height reference. [#6930](https://github.com/AnalyticalGraphicsInc/cesium/pull/6930) -* Fixed bug that caused a new `ClippingPlaneCollection` to be created every frame when used with a model entity. [#6872](https://github.com/AnalyticalGraphicsInc/cesium/pull/6872) -* Improved `Plane` entities so they are better aligned with the globe surface. [#6887](https://github.com/AnalyticalGraphicsInc/cesium/pull/6887) -* Fixed crash when rendering translucent objects when all shadow maps in the scene set `fromLightSource` to false. [#6883](https://github.com/AnalyticalGraphicsInc/cesium/pull/6883) -* Fixed night shading in 2D and Columbus view. [#4122](https://github.com/AnalyticalGraphicsInc/cesium/issues/4122) -* Fixed model loading failure when a glTF 2.0 primitive does not have a material. [6906](https://github.com/AnalyticalGraphicsInc/cesium/pull/6906) -* Fixed a crash when setting show to `false` on a polyline clamped to the ground. [#6912](https://github.com/AnalyticalGraphicsInc/cesium/issues/6912) -* Fixed a bug where `Cesium3DTileset` wasn't using the correct `tilesetVersion`. [#6933](https://github.com/AnalyticalGraphicsInc/cesium/pull/6933) -* Fixed crash that happened when calling `scene.pick` after setting a new terrain provider. [#6918](https://github.com/AnalyticalGraphicsInc/cesium/pull/6918) -* Fixed an issue that caused the browser to hang when using `drillPick` on a polyline clamped to the ground. [6907](https://github.com/AnalyticalGraphicsInc/cesium/issues/6907) -* Fixed an issue where color wasn't updated properly for polylines clamped to ground. [#6927](https://github.com/AnalyticalGraphicsInc/cesium/pull/6927) -* Fixed an excessive memory use bug that occurred when a data URI was used to specify a glTF model. [#6928](https://github.com/AnalyticalGraphicsInc/cesium/issues/6928) -* Fixed an issue where switching from 2D to 3D could cause a crash. [#6929](https://github.com/AnalyticalGraphicsInc/cesium/issues/6929) -* Fixed an issue where point primitives behind the camera would appear in view. [#6904](https://github.com/AnalyticalGraphicsInc/cesium/issues/6904) -* The `createGroundPolylineGeometry` web worker no longer depends on `GroundPolylinePrimitive`, making the worker smaller and potentially avoiding a hanging build in some webpack configurations. [#6946](https://github.com/AnalyticalGraphicsInc/cesium/pull/6946) -* Fixed an issue that cause terrain entities (entities with unspecified `height`) and `GroundPrimitives` to fail when crossing the international date line. [#6951](https://github.com/AnalyticalGraphicsInc/cesium/issues/6951) -* Fixed normal calculation for `CylinderGeometry` when the top radius is not equal to the bottom radius [#6863](https://github.com/AnalyticalGraphicsInc/cesium/pull/6863) +* The Geocoder widget now takes terrain altitude into account when calculating its final destination. [#6876](https://github.com/CesiumGS/cesium/pull/6876) +* The Viewer widget now takes terrain altitude into account when zooming or flying to imagery layers. [#6895](https://github.com/CesiumGS/cesium/pull/6895) +* Fixed Firefox camera control issues with mouse and touch events. [#6372](https://github.com/CesiumGS/cesium/issues/6372) +* Fixed `getPickRay` in 2D. [#2480](https://github.com/CesiumGS/cesium/issues/2480) +* Fixed `Globe.pick` for 2D and Columbus View. [#6859](https://github.com/CesiumGS/cesium/pull/6859) +* Fixed imagery layer feature picking in 2D and Columbus view. [#6859](https://github.com/CesiumGS/cesium/pull/6859) +* Fixed intermittent ground clamping issues for all entity types that use a height reference. [#6930](https://github.com/CesiumGS/cesium/pull/6930) +* Fixed bug that caused a new `ClippingPlaneCollection` to be created every frame when used with a model entity. [#6872](https://github.com/CesiumGS/cesium/pull/6872) +* Improved `Plane` entities so they are better aligned with the globe surface. [#6887](https://github.com/CesiumGS/cesium/pull/6887) +* Fixed crash when rendering translucent objects when all shadow maps in the scene set `fromLightSource` to false. [#6883](https://github.com/CesiumGS/cesium/pull/6883) +* Fixed night shading in 2D and Columbus view. [#4122](https://github.com/CesiumGS/cesium/issues/4122) +* Fixed model loading failure when a glTF 2.0 primitive does not have a material. [6906](https://github.com/CesiumGS/cesium/pull/6906) +* Fixed a crash when setting show to `false` on a polyline clamped to the ground. [#6912](https://github.com/CesiumGS/cesium/issues/6912) +* Fixed a bug where `Cesium3DTileset` wasn't using the correct `tilesetVersion`. [#6933](https://github.com/CesiumGS/cesium/pull/6933) +* Fixed crash that happened when calling `scene.pick` after setting a new terrain provider. [#6918](https://github.com/CesiumGS/cesium/pull/6918) +* Fixed an issue that caused the browser to hang when using `drillPick` on a polyline clamped to the ground. [6907](https://github.com/CesiumGS/cesium/issues/6907) +* Fixed an issue where color wasn't updated properly for polylines clamped to ground. [#6927](https://github.com/CesiumGS/cesium/pull/6927) +* Fixed an excessive memory use bug that occurred when a data URI was used to specify a glTF model. [#6928](https://github.com/CesiumGS/cesium/issues/6928) +* Fixed an issue where switching from 2D to 3D could cause a crash. [#6929](https://github.com/CesiumGS/cesium/issues/6929) +* Fixed an issue where point primitives behind the camera would appear in view. [#6904](https://github.com/CesiumGS/cesium/issues/6904) +* The `createGroundPolylineGeometry` web worker no longer depends on `GroundPolylinePrimitive`, making the worker smaller and potentially avoiding a hanging build in some webpack configurations. [#6946](https://github.com/CesiumGS/cesium/pull/6946) +* Fixed an issue that cause terrain entities (entities with unspecified `height`) and `GroundPrimitives` to fail when crossing the international date line. [#6951](https://github.com/CesiumGS/cesium/issues/6951) +* Fixed normal calculation for `CylinderGeometry` when the top radius is not equal to the bottom radius [#6863](https://github.com/CesiumGS/cesium/pull/6863) ### 1.48 - 2018-08-01 ##### Additions :tada: -* Added support for loading Draco compressed Point Cloud tiles for 2-3x better compression. [#6559](https://github.com/AnalyticalGraphicsInc/cesium/pull/6559) -* Added `TimeDynamicPointCloud` for playback of time-dynamic point cloud data, where each frame is a 3D Tiles Point Cloud tile. [#6721](https://github.com/AnalyticalGraphicsInc/cesium/pull/6721) -* Added `CoplanarPolygonGeometry` and `CoplanarPolygonGeometryOutline` for drawing polygons composed of coplanar positions that are not necessarily on the ellipsoid surface. [#6769](https://github.com/AnalyticalGraphicsInc/cesium/pull/6769) -* Improved support for polygon entities using `perPositionHeight`, including supporting vertical polygons. This also improves KML compatibility. [#6791](https://github.com/AnalyticalGraphicsInc/cesium/pull/6791) -* Added `Cartesian3.midpoint` to compute the midpoint between two `Cartesian3` positions [#6836](https://github.com/AnalyticalGraphicsInc/cesium/pull/6836) +* Added support for loading Draco compressed Point Cloud tiles for 2-3x better compression. [#6559](https://github.com/CesiumGS/cesium/pull/6559) +* Added `TimeDynamicPointCloud` for playback of time-dynamic point cloud data, where each frame is a 3D Tiles Point Cloud tile. [#6721](https://github.com/CesiumGS/cesium/pull/6721) +* Added `CoplanarPolygonGeometry` and `CoplanarPolygonGeometryOutline` for drawing polygons composed of coplanar positions that are not necessarily on the ellipsoid surface. [#6769](https://github.com/CesiumGS/cesium/pull/6769) +* Improved support for polygon entities using `perPositionHeight`, including supporting vertical polygons. This also improves KML compatibility. [#6791](https://github.com/CesiumGS/cesium/pull/6791) +* Added `Cartesian3.midpoint` to compute the midpoint between two `Cartesian3` positions [#6836](https://github.com/CesiumGS/cesium/pull/6836) * Added `equalsEpsilon` methods to `OrthographicFrustum`, `PerspectiveFrustum`, `OrthographicOffCenterFrustum` and `PerspectiveOffCenterFrustum`. ##### Deprecated :hourglass_flowing_sand: -* Support for 3D Tiles `content.url` is deprecated to reflect updates to the [3D Tiles spec](https://github.com/AnalyticalGraphicsInc/3d-tiles/pull/301). Use `content.uri instead`. Support for `content.url` will remain for backwards compatibility. [#6744](https://github.com/AnalyticalGraphicsInc/cesium/pull/6744) -* Support for the 3D Tiles pre-version 1.0 Batch Table Hierarchy is deprecated to reflect updates to the [3D Tiles spec](https://github.com/AnalyticalGraphicsInc/3d-tiles/pull/301). Use the [`3DTILES_batch_table_hierarchy`](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy) extension instead. Support for the deprecated batch table hierarchy will remain for backwards compatibility. [#6780](https://github.com/AnalyticalGraphicsInc/cesium/pull/6780) +* Support for 3D Tiles `content.url` is deprecated to reflect updates to the [3D Tiles spec](https://github.com/CesiumGS/3d-tiles/pull/301). Use `content.uri instead`. Support for `content.url` will remain for backwards compatibility. [#6744](https://github.com/CesiumGS/cesium/pull/6744) +* Support for the 3D Tiles pre-version 1.0 Batch Table Hierarchy is deprecated to reflect updates to the [3D Tiles spec](https://github.com/CesiumGS/3d-tiles/pull/301). Use the [`3DTILES_batch_table_hierarchy`](https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy) extension instead. Support for the deprecated batch table hierarchy will remain for backwards compatibility. [#6780](https://github.com/CesiumGS/cesium/pull/6780) * `PostProcessStageLibrary.createLensFlarStage` is deprecated due to misspelling and will be removed in Cesium 1.49. Use `PostProcessStageLibrary.createLensFlareStage` instead. ##### Fixes :wrench: -* Fixed a bug where 3D Tilesets using the `region` bounding volume don't get transformed when the tileset's `modelMatrix` changes. [#6755](https://github.com/AnalyticalGraphicsInc/cesium/pull/6755) -* Fixed a bug that caused eye dome lighting for point clouds to fail in Safari on macOS and Edge on Windows by removing the dependency on floating point color textures. [#6792](https://github.com/AnalyticalGraphicsInc/cesium/issues/6792) -* Fixed a bug that caused polylines on terrain to render incorrectly in 2D and Columbus View with a `WebMercatorProjection`. [#6809](https://github.com/AnalyticalGraphicsInc/cesium/issues/6809) -* Fixed bug causing billboards and labels to appear the wrong size when switching scene modes [#6745](https://github.com/AnalyticalGraphicsInc/cesium/issues/6745) -* Fixed `PolygonGeometry` when using `VertexFormat.POSITION_ONLY`, `perPositionHeight` and `extrudedHeight` [#6790](expect(https://github.com/AnalyticalGraphicsInc/cesium/pull/6790) -* Fixed an issue where tiles were missing in VR mode. [#6612](https://github.com/AnalyticalGraphicsInc/cesium/issues/6612) -* Fixed issues related to updating entity show and geometry color [#6835](https://github.com/AnalyticalGraphicsInc/cesium/pull/6835) -* Fixed `PolygonGeometry` and `EllipseGeometry` tangent and bitangent attributes when a texture rotation is used [#6788](https://github.com/AnalyticalGraphicsInc/cesium/pull/6788) -* Fixed bug where entities with a height reference weren't being updated correctly when the terrain provider was changed. [#6820](https://github.com/AnalyticalGraphicsInc/cesium/pull/6820) -* Fixed an issue where glTF 2.0 models sometimes wouldn't be centered in the view after putting the camera on them. [#6784](https://github.com/AnalyticalGraphicsInc/cesium/issues/6784) -* Fixed the geocoder when `Viewer` is passed the option `geocoder: true` [#6833](https://github.com/AnalyticalGraphicsInc/cesium/pull/6833) -* Improved performance for billboards and labels clamped to terrain [#6781](https://github.com/AnalyticalGraphicsInc/cesium/pull/6781) [#6844](https://github.com/AnalyticalGraphicsInc/cesium/pull/6844) -* Fixed a bug that caused billboard positions to be set incorrectly when using a `CallbackProperty`. [#6815](https://github.com/AnalyticalGraphicsInc/cesium/pull/6815) -* Improved support for generating a TypeScript typings file using `tsd-jsdoc` [#6767](https://github.com/AnalyticalGraphicsInc/cesium/pull/6767) -* Updated viewBoundingSphere to use correct zoomOptions [#6848](https://github.com/AnalyticalGraphicsInc/cesium/issues/6848) -* Fixed a bug that caused the scene to continuously render after resizing the viewer when `requestRenderMode` was enabled. [#6812](https://github.com/AnalyticalGraphicsInc/cesium/issues/6812) +* Fixed a bug where 3D Tilesets using the `region` bounding volume don't get transformed when the tileset's `modelMatrix` changes. [#6755](https://github.com/CesiumGS/cesium/pull/6755) +* Fixed a bug that caused eye dome lighting for point clouds to fail in Safari on macOS and Edge on Windows by removing the dependency on floating point color textures. [#6792](https://github.com/CesiumGS/cesium/issues/6792) +* Fixed a bug that caused polylines on terrain to render incorrectly in 2D and Columbus View with a `WebMercatorProjection`. [#6809](https://github.com/CesiumGS/cesium/issues/6809) +* Fixed bug causing billboards and labels to appear the wrong size when switching scene modes [#6745](https://github.com/CesiumGS/cesium/issues/6745) +* Fixed `PolygonGeometry` when using `VertexFormat.POSITION_ONLY`, `perPositionHeight` and `extrudedHeight` [#6790](expect(https://github.com/CesiumGS/cesium/pull/6790) +* Fixed an issue where tiles were missing in VR mode. [#6612](https://github.com/CesiumGS/cesium/issues/6612) +* Fixed issues related to updating entity show and geometry color [#6835](https://github.com/CesiumGS/cesium/pull/6835) +* Fixed `PolygonGeometry` and `EllipseGeometry` tangent and bitangent attributes when a texture rotation is used [#6788](https://github.com/CesiumGS/cesium/pull/6788) +* Fixed bug where entities with a height reference weren't being updated correctly when the terrain provider was changed. [#6820](https://github.com/CesiumGS/cesium/pull/6820) +* Fixed an issue where glTF 2.0 models sometimes wouldn't be centered in the view after putting the camera on them. [#6784](https://github.com/CesiumGS/cesium/issues/6784) +* Fixed the geocoder when `Viewer` is passed the option `geocoder: true` [#6833](https://github.com/CesiumGS/cesium/pull/6833) +* Improved performance for billboards and labels clamped to terrain [#6781](https://github.com/CesiumGS/cesium/pull/6781) [#6844](https://github.com/CesiumGS/cesium/pull/6844) +* Fixed a bug that caused billboard positions to be set incorrectly when using a `CallbackProperty`. [#6815](https://github.com/CesiumGS/cesium/pull/6815) +* Improved support for generating a TypeScript typings file using `tsd-jsdoc` [#6767](https://github.com/CesiumGS/cesium/pull/6767) +* Updated viewBoundingSphere to use correct zoomOptions [#6848](https://github.com/CesiumGS/cesium/issues/6848) +* Fixed a bug that caused the scene to continuously render after resizing the viewer when `requestRenderMode` was enabled. [#6812](https://github.com/CesiumGS/cesium/issues/6812) ### 1.47 - 2018-07-02 ##### Highlights :sparkler: -* Added support for polylines on terrain [#6689](https://github.com/AnalyticalGraphicsInc/cesium/pull/6689) [#6615](https://github.com/AnalyticalGraphicsInc/cesium/pull/6615) -* Added `heightReference` and `extrudedHeightReference` properties to `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics`. [#6717](https://github.com/AnalyticalGraphicsInc/cesium/pull/6717) -* `PostProcessStage` has a `selected` property which is an array of primitives used for selectively applying a post-process stage. [#6476](https://github.com/AnalyticalGraphicsInc/cesium/pull/6476) +* Added support for polylines on terrain [#6689](https://github.com/CesiumGS/cesium/pull/6689) [#6615](https://github.com/CesiumGS/cesium/pull/6615) +* Added `heightReference` and `extrudedHeightReference` properties to `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics`. [#6717](https://github.com/CesiumGS/cesium/pull/6717) +* `PostProcessStage` has a `selected` property which is an array of primitives used for selectively applying a post-process stage. [#6476](https://github.com/CesiumGS/cesium/pull/6476) ##### Breaking Changes :mega: * glTF 2.0 models corrected to face +Z forwards per specification. Internally Cesium uses +X as forward, so a new +Z to +X rotation was added for 2.0 models only. To fix models that are oriented incorrectly after this change: * If the model faces +X forwards update the glTF to face +Z forwards. This can be done by loading the glTF in a model editor and applying a 90 degree clockwise rotation about the up-axis. Alternatively, add a new root node to the glTF node hierarchy whose `matrix` is `[0,0,1,0,0,1,0,0,-1,0,0,0,0,0,0,1]`. - * Apply a -90 degree rotation to the model's heading. This can be done by setting the model's `orientation` using the Entity API or from within CZML. See [#6738](https://github.com/AnalyticalGraphicsInc/cesium/pull/6738) for more details. -* Dropped support for directory URLs when loading tilesets to match the updated [3D Tiles spec](https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/272). [#6502](https://github.com/AnalyticalGraphicsInc/cesium/issues/6502) -* KML and GeoJSON now use `PolylineGraphics` instead of `CorridorGraphics` for polylines on terrain. [#6706](https://github.com/AnalyticalGraphicsInc/cesium/pull/6706) + * Apply a -90 degree rotation to the model's heading. This can be done by setting the model's `orientation` using the Entity API or from within CZML. See [#6738](https://github.com/CesiumGS/cesium/pull/6738) for more details. +* Dropped support for directory URLs when loading tilesets to match the updated [3D Tiles spec](https://github.com/CesiumGS/3d-tiles/issues/272). [#6502](https://github.com/CesiumGS/cesium/issues/6502) +* KML and GeoJSON now use `PolylineGraphics` instead of `CorridorGraphics` for polylines on terrain. [#6706](https://github.com/CesiumGS/cesium/pull/6706) ##### Additions :tada: -* Added support for polylines on terrain [#6689](https://github.com/AnalyticalGraphicsInc/cesium/pull/6689) [#6615](https://github.com/AnalyticalGraphicsInc/cesium/pull/6615) +* Added support for polylines on terrain [#6689](https://github.com/CesiumGS/cesium/pull/6689) [#6615](https://github.com/CesiumGS/cesium/pull/6615) * Use the `clampToGround` option for `PolylineGraphics` (polyline entities). * Requires depth texture support (`WEBGL_depth_texture` or `WEBKIT_WEBGL_depth_texture`), otherwise `clampToGround` will be ignored. Use `Entity.supportsPolylinesOnTerrain` to check for support. * Added `GroundPolylinePrimitive` and `GroundPolylineGeometry`. -* `PostProcessStage` has a `selected` property which is an array of primitives used for selectively applying a post-process stage. [#6476](https://github.com/AnalyticalGraphicsInc/cesium/pull/6476) +* `PostProcessStage` has a `selected` property which is an array of primitives used for selectively applying a post-process stage. [#6476](https://github.com/CesiumGS/cesium/pull/6476) * The `PostProcessStageLibrary.createBlackAndWhiteStage` and `PostProcessStageLibrary.createSilhouetteStage` have per-feature support. -* Added CZML support for `zIndex` with `corridor`, `ellipse`, `polygon`, `polyline` and `rectangle`. [#6708](https://github.com/AnalyticalGraphicsInc/cesium/pull/6708) -* Added CZML `clampToGround` option for `polyline`. [#6706](https://github.com/AnalyticalGraphicsInc/cesium/pull/6706) -* Added support for `RTC_CENTER` property in batched 3D model tilesets to conform to the updated [3D Tiles spec](https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/263). [#6488](https://github.com/AnalyticalGraphicsInc/cesium/issues/6488) -* Added `heightReference` and `extrudedHeightReference` properties to `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics`. [#6717](https://github.com/AnalyticalGraphicsInc/cesium/pull/6717) +* Added CZML support for `zIndex` with `corridor`, `ellipse`, `polygon`, `polyline` and `rectangle`. [#6708](https://github.com/CesiumGS/cesium/pull/6708) +* Added CZML `clampToGround` option for `polyline`. [#6706](https://github.com/CesiumGS/cesium/pull/6706) +* Added support for `RTC_CENTER` property in batched 3D model tilesets to conform to the updated [3D Tiles spec](https://github.com/CesiumGS/3d-tiles/issues/263). [#6488](https://github.com/CesiumGS/cesium/issues/6488) +* Added `heightReference` and `extrudedHeightReference` properties to `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics`. [#6717](https://github.com/CesiumGS/cesium/pull/6717) * This can be used in conjunction with the `height` and/or `extrudedHeight` properties to clamp the geometry to terrain or set the height relative to terrain. * Note, this will not make the geometry conform to terrain. Extruded geoemtry that is clamped to the ground will have a flat top will sinks into the terrain at the base. ##### Fixes :wrench: -* Fixed a bug that caused Cesium to be unable to load local resources in Electron. [#6726](https://github.com/AnalyticalGraphicsInc/cesium/pull/6726) -* Fixed a bug causing crashes with custom vertex attributes on `Geometry` crossing the IDL. Attributes will be barycentrically interpolated. [#6644](https://github.com/AnalyticalGraphicsInc/cesium/pull/6644) -* Fixed a bug causing Point Cloud tiles with unsigned int batch-ids to not load. [#6666](https://github.com/AnalyticalGraphicsInc/cesium/pull/6666) -* Fixed a bug with Draco encoded i3dm tiles, and loading two Draco models with the same url. [#6668](https://github.com/AnalyticalGraphicsInc/cesium/issues/6668) -* Fixed a bug caused by creating a polygon with positions at the same longitude/latitude position but different heights [#6731](https://github.com/AnalyticalGraphicsInc/cesium/pull/6731) -* Fixed terrain clipping when the camera was close to flat terrain and was using logarithmic depth. [#6701](https://github.com/AnalyticalGraphicsInc/cesium/pull/6701) -* Fixed KML bug that constantly requested the same image if it failed to load. [#6710](https://github.com/AnalyticalGraphicsInc/cesium/pull/6710) -* Improved billboard and label rendering so they no longer sink into terrain when clamped to ground. [#6621](https://github.com/AnalyticalGraphicsInc/cesium/pull/6621) +* Fixed a bug that caused Cesium to be unable to load local resources in Electron. [#6726](https://github.com/CesiumGS/cesium/pull/6726) +* Fixed a bug causing crashes with custom vertex attributes on `Geometry` crossing the IDL. Attributes will be barycentrically interpolated. [#6644](https://github.com/CesiumGS/cesium/pull/6644) +* Fixed a bug causing Point Cloud tiles with unsigned int batch-ids to not load. [#6666](https://github.com/CesiumGS/cesium/pull/6666) +* Fixed a bug with Draco encoded i3dm tiles, and loading two Draco models with the same url. [#6668](https://github.com/CesiumGS/cesium/issues/6668) +* Fixed a bug caused by creating a polygon with positions at the same longitude/latitude position but different heights [#6731](https://github.com/CesiumGS/cesium/pull/6731) +* Fixed terrain clipping when the camera was close to flat terrain and was using logarithmic depth. [#6701](https://github.com/CesiumGS/cesium/pull/6701) +* Fixed KML bug that constantly requested the same image if it failed to load. [#6710](https://github.com/CesiumGS/cesium/pull/6710) +* Improved billboard and label rendering so they no longer sink into terrain when clamped to ground. [#6621](https://github.com/CesiumGS/cesium/pull/6621) * Fixed an issue where KMLs containing a `colorMode` of `random` could return the exact same color on successive calls to `Color.fromRandom()`. * `Iso8601.MAXIMUM_VALUE` now formats to a string which can be parsed by `fromIso8601`. -* Fixed material support when using an image that is already loaded [#6729](https://github.com/AnalyticalGraphicsInc/cesium/pull/6729) +* Fixed material support when using an image that is already loaded [#6729](https://github.com/CesiumGS/cesium/pull/6729) ### 1.46.1 - 2018-06-01 @@ -594,28 +625,28 @@ _This is an npm-only release to fix a publishing issue_. ### 1.46 - 2018-06-01 ##### Highlights :sparkler: -* Added support for materials on terrain entities (entities with unspecified `height`) and `GroundPrimitives`. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393) -* Added a post-processing framework. [#5615](https://github.com/AnalyticalGraphicsInc/cesium/pull/5615) -* Added `zIndex` for ground geometry, including corridor, ellipse, polygon and rectangle entities. [#6362](https://github.com/AnalyticalGraphicsInc/cesium/pull/6362) +* Added support for materials on terrain entities (entities with unspecified `height`) and `GroundPrimitives`. [#6393](https://github.com/CesiumGS/cesium/pull/6393) +* Added a post-processing framework. [#5615](https://github.com/CesiumGS/cesium/pull/5615) +* Added `zIndex` for ground geometry, including corridor, ellipse, polygon and rectangle entities. [#6362](https://github.com/CesiumGS/cesium/pull/6362) ##### Breaking Changes :mega: -* `ParticleSystem` no longer uses `forces`. [#6510](https://github.com/AnalyticalGraphicsInc/cesium/pull/6510) -* `Particle` no longer uses `size`, `rate`, `lifeTime`, `life`, `minimumLife`, `maximumLife`, `minimumWidth`, `minimumHeight`, `maximumWidth`, and `maximumHeight`. [#6510](https://github.com/AnalyticalGraphicsInc/cesium/pull/6510) -* Removed `Scene.copyGlobeDepth`. Globe depth will now be copied by default when supported. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393) +* `ParticleSystem` no longer uses `forces`. [#6510](https://github.com/CesiumGS/cesium/pull/6510) +* `Particle` no longer uses `size`, `rate`, `lifeTime`, `life`, `minimumLife`, `maximumLife`, `minimumWidth`, `minimumHeight`, `maximumWidth`, and `maximumHeight`. [#6510](https://github.com/CesiumGS/cesium/pull/6510) +* Removed `Scene.copyGlobeDepth`. Globe depth will now be copied by default when supported. [#6393](https://github.com/CesiumGS/cesium/pull/6393) * The default `classificationType` for `GroundPrimitive`, `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics` is now `ClassificationType.TERRAIN`. If you wish the geometry to color both terrain and 3D tiles, pass in the option `classificationType: Cesium.ClassificationType.BOTH`. -* Removed support for the `options` argument for `Credit` [#6373](https://github.com/AnalyticalGraphicsInc/cesium/issues/6373). Pass in an html string instead. -* glTF 2.0 models corrected to face +Z forwards per specification. Internally Cesium uses +X as forward, so a new +Z to +X rotation was added for 2.0 models only. [#6632](https://github.com/AnalyticalGraphicsInc/cesium/pull/6632) +* Removed support for the `options` argument for `Credit` [#6373](https://github.com/CesiumGS/cesium/issues/6373). Pass in an html string instead. +* glTF 2.0 models corrected to face +Z forwards per specification. Internally Cesium uses +X as forward, so a new +Z to +X rotation was added for 2.0 models only. [#6632](https://github.com/CesiumGS/cesium/pull/6632) ##### Deprecated :hourglass_flowing_sand: * The `Scene.fxaa` property has been deprecated and will be removed in Cesium 1.47. Use `Scene.postProcessStages.fxaa.enabled`. ##### Additions :tada: -* Added support for materials on terrain entities (entities with unspecified `height`) and `GroundPrimitives`. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393) +* Added support for materials on terrain entities (entities with unspecified `height`) and `GroundPrimitives`. [#6393](https://github.com/CesiumGS/cesium/pull/6393) * Only available for `ClassificationType.TERRAIN` at this time. Adding a material to a terrain `Entity` will cause it to behave as if it is `ClassificationType.TERRAIN`. * Requires depth texture support (`WEBGL_depth_texture` or `WEBKIT_WEBGL_depth_texture`), so materials on terrain entities and `GroundPrimitives` are not supported in Internet Explorer. * Best suited for notational patterns and not intended for precisely mapping textures to terrain - for that use case, use `SingleTileImageryProvider`. -* Added `GroundPrimitive.supportsMaterials` and `Entity.supportsMaterialsforEntitiesOnTerrain`, both of which can be used to check if materials on terrain entities and `GroundPrimitives` is supported. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393) -* Added a post-processing framework. [#5615](https://github.com/AnalyticalGraphicsInc/cesium/pull/5615) +* Added `GroundPrimitive.supportsMaterials` and `Entity.supportsMaterialsforEntitiesOnTerrain`, both of which can be used to check if materials on terrain entities and `GroundPrimitives` is supported. [#6393](https://github.com/CesiumGS/cesium/pull/6393) +* Added a post-processing framework. [#5615](https://github.com/CesiumGS/cesium/pull/5615) * Added `Scene.postProcessStages` which is a collection of post-process stages to be run in order. * Has a built-in `ambientOcclusion` property which will apply screen space ambient occlusion to the scene and run before all stages. * Has a built-in `bloom` property which applies a bloom filter to the scene before all other stages but after the ambient occlusion stage. @@ -623,21 +654,21 @@ _This is an npm-only release to fix a publishing issue_. * Added `PostProcessStageLibrary` which contains several built-in stages that can be added to the collection. * Added `PostProcessStageComposite` for multi-stage post-processes like depth of field. * Added a new Sandcastle label `Post Processing` to showcase the different built-in post-process stages. - * Added `zIndex` for ground geometry, including corridor, ellipse, polygon and rectangle entities. [#6362](https://github.com/AnalyticalGraphicsInc/cesium/pull/6362) - * Added `Rectangle.equalsEpsilon` for comparing the equality of two rectangles [#6533](https://github.com/AnalyticalGraphicsInc/cesium/pull/6533) + * Added `zIndex` for ground geometry, including corridor, ellipse, polygon and rectangle entities. [#6362](https://github.com/CesiumGS/cesium/pull/6362) + * Added `Rectangle.equalsEpsilon` for comparing the equality of two rectangles [#6533](https://github.com/CesiumGS/cesium/pull/6533) ##### Fixes :wrench: -* Fixed a bug causing custom TilingScheme classes to not be able to use a GeographicProjection. [#6524](https://github.com/AnalyticalGraphicsInc/cesium/pull/6524) -* Fixed incorrect 3D Tiles statistics when a tile fails during processing. [#6558](https://github.com/AnalyticalGraphicsInc/cesium/pull/6558) -* Fixed race condition causing intermittent crash when changing geometry show value [#3061](https://github.com/AnalyticalGraphicsInc/cesium/issues/3061) -* `ProviderViewModel`s with no category are displayed in an untitled group in `BaseLayerPicker` instead of being labeled as `'Other'` [#6574](https://github.com/AnalyticalGraphicsInc/cesium/pull/6574) -* Fixed a bug causing intermittent crashes with clipping planes due to uninitialized textures. [#6576](https://github.com/AnalyticalGraphicsInc/cesium/pull/6576) -* Added a workaround for clipping planes causing a picking shader compilation failure for gltf models and 3D Tilesets in Internet Explorer [#6575](https://github.com/AnalyticalGraphicsInc/cesium/issues/6575) -* Allowed Bing Maps servers with a subpath (instead of being at the root) to work correctly. [#6597](https://github.com/AnalyticalGraphicsInc/cesium/pull/6597) -* Added support for loading of Draco compressed glTF assets in IE11 [#6404](https://github.com/AnalyticalGraphicsInc/cesium/issues/6404) -* Fixed polygon outline when using `perPositionHeight` and `extrudedHeight`. [#6595](https://github.com/AnalyticalGraphicsInc/cesium/issues/6595) -* Fixed broken links in documentation of `createTileMapServiceImageryProvider`. [#5818](https://github.com/AnalyticalGraphicsInc/cesium/issues/5818) -* Transitioning from 2 touches to 1 touch no longer triggers a new pan gesture. [#6479](https://github.com/AnalyticalGraphicsInc/cesium/pull/6479) +* Fixed a bug causing custom TilingScheme classes to not be able to use a GeographicProjection. [#6524](https://github.com/CesiumGS/cesium/pull/6524) +* Fixed incorrect 3D Tiles statistics when a tile fails during processing. [#6558](https://github.com/CesiumGS/cesium/pull/6558) +* Fixed race condition causing intermittent crash when changing geometry show value [#3061](https://github.com/CesiumGS/cesium/issues/3061) +* `ProviderViewModel`s with no category are displayed in an untitled group in `BaseLayerPicker` instead of being labeled as `'Other'` [#6574](https://github.com/CesiumGS/cesium/pull/6574) +* Fixed a bug causing intermittent crashes with clipping planes due to uninitialized textures. [#6576](https://github.com/CesiumGS/cesium/pull/6576) +* Added a workaround for clipping planes causing a picking shader compilation failure for gltf models and 3D Tilesets in Internet Explorer [#6575](https://github.com/CesiumGS/cesium/issues/6575) +* Allowed Bing Maps servers with a subpath (instead of being at the root) to work correctly. [#6597](https://github.com/CesiumGS/cesium/pull/6597) +* Added support for loading of Draco compressed glTF assets in IE11 [#6404](https://github.com/CesiumGS/cesium/issues/6404) +* Fixed polygon outline when using `perPositionHeight` and `extrudedHeight`. [#6595](https://github.com/CesiumGS/cesium/issues/6595) +* Fixed broken links in documentation of `createTileMapServiceImageryProvider`. [#5818](https://github.com/CesiumGS/cesium/issues/5818) +* Transitioning from 2 touches to 1 touch no longer triggers a new pan gesture. [#6479](https://github.com/CesiumGS/cesium/pull/6479) ### 1.45 - 2018-05-01 @@ -647,7 +678,7 @@ _This is an npm-only release to fix a publishing issue_. * Cesium now uses ion services by default for base imagery, terrain, and geocoding. A demo key is provided, but to use them in your own apps you must [sign up](https://cesium.com/ion/signup) for a free ion Commmunity account. ##### Breaking Changes :mega: -* `ClippingPlaneCollection` now uses `ClippingPlane` objects instead of `Plane` objects. [#6498](https://github.com/AnalyticalGraphicsInc/cesium/pull/6498) +* `ClippingPlaneCollection` now uses `ClippingPlane` objects instead of `Plane` objects. [#6498](https://github.com/CesiumGS/cesium/pull/6498) * Cesium no longer ships with a demo Bing Maps API key. * `BingMapsImageryProvider` is no longer the default base imagery layer. (Bing imagery itself is still the default, however it is provided through Cesium ion) * `BingMapsGeocoderService` is no longer the default geocoding service. @@ -671,7 +702,7 @@ _This is an npm-only release to fix a publishing issue_. * Any width and height variables in `ParticleSystem` will no longer be individual components. `ParticleSystem.minimumWidth` and `ParticleSystem.minimumHeight` will now be `ParticleSystem.minimumImageSize`, `ParticleSystem.maximumWidth` and `ParticleSystem.maximumHeight` will now be `ParticleSystem.maximumImageSize`, and `ParticleSystem.width` and `ParticleSystem.height` will now be `ParticleSystem.imageSize`. Use of the `minimumWidth`, `minimumHeight`, `maximumWidth`, `maximumHeight`, `width`, and `height` parameters is deprecated and will be removed in Cesium 1.46. ##### Additions :tada: -* Added option `logarithmicDepthBuffer` to `Scene`. With this option there is typically a single frustum using logarithmic depth rendered. This increases performance by issuing less draw calls to the GPU and helps to avoid artifacts on the connection of two frustums. [#5851](https://github.com/AnalyticalGraphicsInc/cesium/pull/5851) +* Added option `logarithmicDepthBuffer` to `Scene`. With this option there is typically a single frustum using logarithmic depth rendered. This increases performance by issuing less draw calls to the GPU and helps to avoid artifacts on the connection of two frustums. [#5851](https://github.com/CesiumGS/cesium/pull/5851) * When a log depth buffer is supported, the frustum near and far planes default to `0.1` and `1e10` respectively. * Added `IonGeocoderService` and made it the default geocoding service for the `Geocoder` widget. * Added `createWorldImagery` which provides Bing Maps imagery via a Cesium ion account. @@ -679,45 +710,45 @@ _This is an npm-only release to fix a publishing issue_. * Added the ability for `BaseLayerPicker` to group layers by category. `ProviderViewModel.category` was also added to support this feature. * Added `Math.log2` to compute the base 2 logarithm of a number. * Added `GeocodeType` enum and use it as an optional parameter to all `GeocoderService` instances to differentiate between autocomplete and search requests. -* Added `initWebAssemblyModule` function to `TaskProcessor` to load a Web Assembly module in a web worker. [#6420](https://github.com/AnalyticalGraphicsInc/cesium/pull/6420) -* Added `supportsWebAssembly` function to `FeatureDetection` to check if a browser supports loading Web Assembly modules. [#6420](https://github.com/AnalyticalGraphicsInc/cesium/pull/6420) -* Improved `MapboxImageryProvider` performance by 300% via `tiles.mapbox.com` subdomain switching. [#6426](https://github.com/AnalyticalGraphicsInc/cesium/issues/6426) +* Added `initWebAssemblyModule` function to `TaskProcessor` to load a Web Assembly module in a web worker. [#6420](https://github.com/CesiumGS/cesium/pull/6420) +* Added `supportsWebAssembly` function to `FeatureDetection` to check if a browser supports loading Web Assembly modules. [#6420](https://github.com/CesiumGS/cesium/pull/6420) +* Improved `MapboxImageryProvider` performance by 300% via `tiles.mapbox.com` subdomain switching. [#6426](https://github.com/CesiumGS/cesium/issues/6426) * Added ability to invoke `sampleTerrain` from node.js to enable offline terrain sampling -* Added more ParticleSystem Sandcastle examples for rocket and comet tails and weather. [#6375](https://github.com/AnalyticalGraphicsInc/cesium/pull/6375) -* Added color and scale attributes to the `ParticleSystem` class constructor. When defined the variables override startColor and endColor and startScale and endScale. [#6429](https://github.com/AnalyticalGraphicsInc/cesium/pull/6429) +* Added more ParticleSystem Sandcastle examples for rocket and comet tails and weather. [#6375](https://github.com/CesiumGS/cesium/pull/6375) +* Added color and scale attributes to the `ParticleSystem` class constructor. When defined the variables override startColor and endColor and startScale and endScale. [#6429](https://github.com/CesiumGS/cesium/pull/6429) ##### Fixes :wrench: -* Fixed bugs in `TimeIntervalCollection.removeInterval`. [#6418](https://github.com/AnalyticalGraphicsInc/cesium/pull/6418). -* Fixed glTF support to handle meshes with and without tangent vectors, and with/without morph targets, sharing one material. [#6421](https://github.com/AnalyticalGraphicsInc/cesium/pull/6421) -* Fixed glTF support to handle skinned meshes when no skin is supplied. [#6061](https://github.com/AnalyticalGraphicsInc/cesium/issues/6061) -* Updated glTF 2.0 PBR shader to have brighter lighting. [#6430](https://github.com/AnalyticalGraphicsInc/cesium/pull/6430) +* Fixed bugs in `TimeIntervalCollection.removeInterval`. [#6418](https://github.com/CesiumGS/cesium/pull/6418). +* Fixed glTF support to handle meshes with and without tangent vectors, and with/without morph targets, sharing one material. [#6421](https://github.com/CesiumGS/cesium/pull/6421) +* Fixed glTF support to handle skinned meshes when no skin is supplied. [#6061](https://github.com/CesiumGS/cesium/issues/6061) +* Updated glTF 2.0 PBR shader to have brighter lighting. [#6430](https://github.com/CesiumGS/cesium/pull/6430) * Allow loadWithXhr to work with string URLs in a web worker. -* Updated to Draco 1.3.0 and implemented faster loading of Draco compressed glTF assets in browsers that support Web Assembly. [#6420](https://github.com/AnalyticalGraphicsInc/cesium/pull/6420) -* `GroundPrimitive`s and `ClassificationPrimitive`s will become ready when `show` is `false`. [#6428](https://github.com/AnalyticalGraphicsInc/cesium/pull/6428) -* Fix Firefox WebGL console warnings. [#5912](https://github.com/AnalyticalGraphicsInc/cesium/issues/5912) -* Fix parsing Cesium.js in older browsers that do not support all TypedArray types. [#6396](https://github.com/AnalyticalGraphicsInc/cesium/pull/6396) -* Fixed a bug causing crashes when setting colors on un-pickable models. [$6442](https://github.com/AnalyticalGraphicsInc/cesium/issues/6442) -* Fix flicker when adding, removing, or modifying entities. [#3945](https://github.com/AnalyticalGraphicsInc/cesium/issues/3945) -* Fixed crash bug in PolylineCollection when a polyline was updated and removed at the same time. [#6455](https://github.com/AnalyticalGraphicsInc/cesium/pull/6455) -* Fixed crash when animating a glTF model with a single keyframe. [#6422](https://github.com/AnalyticalGraphicsInc/cesium/pull/6422) -* Fixed Imagery Layers Texture Filters Sandcastle example. [#6472](https://github.com/AnalyticalGraphicsInc/cesium/pull/6472). -* Fixed a bug causing Cesium 3D Tilesets to not clip properly when tiles were unloaded and reloaded. [#6484](https://github.com/AnalyticalGraphicsInc/cesium/issues/6484) -* Fixed `TimeInterval` so now it throws if `fromIso8601` is given an ISO 8601 string with improper formatting. [#6164](https://github.com/AnalyticalGraphicsInc/cesium/issues/6164) -* Improved rendering of glTF models that don't contain normals with a temporary unlit shader workaround. [#6501](https://github.com/AnalyticalGraphicsInc/cesium/pull/6501) -* Fixed rendering of glTF models with emissive-only materials. [#6501](https://github.com/AnalyticalGraphicsInc/cesium/pull/6501) -* Fixed a bug in shader modification for glTF 1.0 quantized attributes and Draco quantized attributes. [#6523](https://github.com/AnalyticalGraphicsInc/cesium/pull/6523) +* Updated to Draco 1.3.0 and implemented faster loading of Draco compressed glTF assets in browsers that support Web Assembly. [#6420](https://github.com/CesiumGS/cesium/pull/6420) +* `GroundPrimitive`s and `ClassificationPrimitive`s will become ready when `show` is `false`. [#6428](https://github.com/CesiumGS/cesium/pull/6428) +* Fix Firefox WebGL console warnings. [#5912](https://github.com/CesiumGS/cesium/issues/5912) +* Fix parsing Cesium.js in older browsers that do not support all TypedArray types. [#6396](https://github.com/CesiumGS/cesium/pull/6396) +* Fixed a bug causing crashes when setting colors on un-pickable models. [$6442](https://github.com/CesiumGS/cesium/issues/6442) +* Fix flicker when adding, removing, or modifying entities. [#3945](https://github.com/CesiumGS/cesium/issues/3945) +* Fixed crash bug in PolylineCollection when a polyline was updated and removed at the same time. [#6455](https://github.com/CesiumGS/cesium/pull/6455) +* Fixed crash when animating a glTF model with a single keyframe. [#6422](https://github.com/CesiumGS/cesium/pull/6422) +* Fixed Imagery Layers Texture Filters Sandcastle example. [#6472](https://github.com/CesiumGS/cesium/pull/6472). +* Fixed a bug causing Cesium 3D Tilesets to not clip properly when tiles were unloaded and reloaded. [#6484](https://github.com/CesiumGS/cesium/issues/6484) +* Fixed `TimeInterval` so now it throws if `fromIso8601` is given an ISO 8601 string with improper formatting. [#6164](https://github.com/CesiumGS/cesium/issues/6164) +* Improved rendering of glTF models that don't contain normals with a temporary unlit shader workaround. [#6501](https://github.com/CesiumGS/cesium/pull/6501) +* Fixed rendering of glTF models with emissive-only materials. [#6501](https://github.com/CesiumGS/cesium/pull/6501) +* Fixed a bug in shader modification for glTF 1.0 quantized attributes and Draco quantized attributes. [#6523](https://github.com/CesiumGS/cesium/pull/6523) ### 1.44 - 2018-04-02 ##### Highlights :sparkler: -* Added a new Sandcastle label, `New in X.X` which will include all new Sandcastle demos added for the current release. [#6384](https://github.com/AnalyticalGraphicsInc/cesium/issues/6384) -* Added support for glTF models with [Draco geometry compression](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md). [#5120](https://github.com/AnalyticalGraphicsInc/cesium/issues/5120) -* Added support for ordering in `DataSourceCollection`. [#6316](https://github.com/AnalyticalGraphicsInc/cesium/pull/6316) +* Added a new Sandcastle label, `New in X.X` which will include all new Sandcastle demos added for the current release. [#6384](https://github.com/CesiumGS/cesium/issues/6384) +* Added support for glTF models with [Draco geometry compression](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md). [#5120](https://github.com/CesiumGS/cesium/issues/5120) +* Added support for ordering in `DataSourceCollection`. [#6316](https://github.com/CesiumGS/cesium/pull/6316) ##### Breaking Changes :mega: -* `GeometryVisualizer` now requires `primitive` and `groundPrimitive` parameters. [#6316](https://github.com/AnalyticalGraphicsInc/cesium/pull/6316) -* For all classes/functions that take a `Resource` instance, all additional parameters that are part of the `Resource` class have been removed. This generally includes `proxy`, `headers` and `query` parameters. [#6368](https://github.com/AnalyticalGraphicsInc/cesium/pull/6368) -* All low level load functions including `loadArrayBuffer`, `loadBlob`, `loadImage`, `loadJson`, `loadJsonp`, `loadText`, `loadXML` and `loadWithXhr` have been removed. Please use the equivalent `fetch` functions on the `Resource` class. [#6368](https://github.com/AnalyticalGraphicsInc/cesium/pull/6368) +* `GeometryVisualizer` now requires `primitive` and `groundPrimitive` parameters. [#6316](https://github.com/CesiumGS/cesium/pull/6316) +* For all classes/functions that take a `Resource` instance, all additional parameters that are part of the `Resource` class have been removed. This generally includes `proxy`, `headers` and `query` parameters. [#6368](https://github.com/CesiumGS/cesium/pull/6368) +* All low level load functions including `loadArrayBuffer`, `loadBlob`, `loadImage`, `loadJson`, `loadJsonp`, `loadText`, `loadXML` and `loadWithXhr` have been removed. Please use the equivalent `fetch` functions on the `Resource` class. [#6368](https://github.com/CesiumGS/cesium/pull/6368) ##### Deprecated :hourglass_flowing_sand: * `ClippingPlaneCollection` is now supported in Internet Explorer, so `ClippingPlaneCollection.isSupported` has been deprecated and will be removed in Cesium 1.45. @@ -727,39 +758,39 @@ _This is an npm-only release to fix a publishing issue_. * `Credit.hasImage` and `Credit.hasLink` functions have been deprecated and will be removed in Cesium 1.46. ##### Additions :tada: -* Added a new Sandcastle label, `New in X.X` which will include all new Sandcastle demos added for the current release. [#6384](https://github.com/AnalyticalGraphicsInc/cesium/issues/6384) -* Added support for glTF models with [Draco geometry compression](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md). [#5120](https://github.com/AnalyticalGraphicsInc/cesium/issues/5120) +* Added a new Sandcastle label, `New in X.X` which will include all new Sandcastle demos added for the current release. [#6384](https://github.com/CesiumGS/cesium/issues/6384) +* Added support for glTF models with [Draco geometry compression](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md). [#5120](https://github.com/CesiumGS/cesium/issues/5120) * Added `dequantizeInShader` option parameter to `Model` and `Model.fromGltf` to specify if Draco compressed glTF assets should be dequantized on the GPU. -* Added support for ordering in `DataSourceCollection`. [#6316](https://github.com/AnalyticalGraphicsInc/cesium/pull/6316) +* Added support for ordering in `DataSourceCollection`. [#6316](https://github.com/CesiumGS/cesium/pull/6316) * All ground geometry from one `DataSource` will render in front of all ground geometry from another `DataSource` in the same collection with a lower index. * Use `DataSourceCollection.raise`, `DataSourceCollection.lower`, `DataSourceCollection.raiseToTop` and `DataSourceCollection.lowerToBottom` functions to change the ordering of a `DataSource` in the collection. -* `ClippingPlaneCollection` updates [#6201](https://github.com/AnalyticalGraphicsInc/cesium/pull/6201): +* `ClippingPlaneCollection` updates [#6201](https://github.com/CesiumGS/cesium/pull/6201): * Removed the 6-clipping-plane limit. * Added support for Internet Explorer. * Added a `ClippingPlane` object to be used with `ClippingPlaneCollection`. * Added 3D Tiles use-case to the Terrain Clipping Planes Sandcastle. -* `Credit` has been modified to take an HTML string as the credit content. [#6331](https://github.com/AnalyticalGraphicsInc/cesium/pull/6331) -* Sharing Sandcastle examples now works by storing the full example directly in the URL instead of creating GitHub gists, because anonymous gist creation was removed by GitHub. Loading existing gists will still work. [#6342](https://github.com/AnalyticalGraphicsInc/cesium/pull/6342) -* Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/AnalyticalGraphicsInc/cesium/issues/6223) -* Added additional query parameter options to the CesiumViewer demo application [#6328](https://github.com/AnalyticalGraphicsInc/cesium/pull/6328): +* `Credit` has been modified to take an HTML string as the credit content. [#6331](https://github.com/CesiumGS/cesium/pull/6331) +* Sharing Sandcastle examples now works by storing the full example directly in the URL instead of creating GitHub gists, because anonymous gist creation was removed by GitHub. Loading existing gists will still work. [#6342](https://github.com/CesiumGS/cesium/pull/6342) +* Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/CesiumGS/cesium/issues/6223) +* Added additional query parameter options to the CesiumViewer demo application [#6328](https://github.com/CesiumGS/cesium/pull/6328): * `sourceType` specifies the type of data source if the URL doesn't have a known file extension. * `flyTo=false` optionally disables the automatic `flyTo` after loading the data source. -* Added a multi-part CZML example to Sandcastle. [#6320](https://github.com/AnalyticalGraphicsInc/cesium/pull/6320) -* Improved processing order of 3D tiles. [#6364](https://github.com/AnalyticalGraphicsInc/cesium/pull/6364) +* Added a multi-part CZML example to Sandcastle. [#6320](https://github.com/CesiumGS/cesium/pull/6320) +* Improved processing order of 3D tiles. [#6364](https://github.com/CesiumGS/cesium/pull/6364) ##### Fixes :wrench: -* Fixed Cesium ion browser caching. [#6353](https://github.com/AnalyticalGraphicsInc/cesium/pull/6353). -* Fixed formula for Weighted Blended Order-Independent Transparency. [#6340](https://github.com/AnalyticalGraphicsInc/cesium/pull/6340) -* Fixed support of glTF-supplied tangent vectors. [#6302](https://github.com/AnalyticalGraphicsInc/cesium/pull/6302) -* Fixed model loading failure when containing unused materials. [6315](https://github.com/AnalyticalGraphicsInc/cesium/pull/6315) -* Fixed default value of `alphaCutoff` in glTF models. [#6346](https://github.com/AnalyticalGraphicsInc/cesium/pull/6346) -* Fixed double-sided flag for glTF materials with `BLEND` enabled. [#6371](https://github.com/AnalyticalGraphicsInc/cesium/pull/6371) -* Fixed animation for glTF models with missing animation targets. [#6351](https://github.com/AnalyticalGraphicsInc/cesium/pull/6351) -* Fixed improper zoom during model load failure. [#6305](https://github.com/AnalyticalGraphicsInc/cesium/pull/6305) -* Fixed rendering vector tiles when using `invertClassification`. [#6349](https://github.com/AnalyticalGraphicsInc/cesium/pull/6349) -* Fixed occlusion when `globe.show` is `false`. [#6374](https://github.com/AnalyticalGraphicsInc/cesium/pull/6374) -* Fixed crash for entities with static geometry and time-dynamic attributes. [#6377](https://github.com/AnalyticalGraphicsInc/cesium/pull/6377) -* Fixed geometry tile rendering in IE. [#6406](https://github.com/AnalyticalGraphicsInc/cesium/pull/6406) +* Fixed Cesium ion browser caching. [#6353](https://github.com/CesiumGS/cesium/pull/6353). +* Fixed formula for Weighted Blended Order-Independent Transparency. [#6340](https://github.com/CesiumGS/cesium/pull/6340) +* Fixed support of glTF-supplied tangent vectors. [#6302](https://github.com/CesiumGS/cesium/pull/6302) +* Fixed model loading failure when containing unused materials. [6315](https://github.com/CesiumGS/cesium/pull/6315) +* Fixed default value of `alphaCutoff` in glTF models. [#6346](https://github.com/CesiumGS/cesium/pull/6346) +* Fixed double-sided flag for glTF materials with `BLEND` enabled. [#6371](https://github.com/CesiumGS/cesium/pull/6371) +* Fixed animation for glTF models with missing animation targets. [#6351](https://github.com/CesiumGS/cesium/pull/6351) +* Fixed improper zoom during model load failure. [#6305](https://github.com/CesiumGS/cesium/pull/6305) +* Fixed rendering vector tiles when using `invertClassification`. [#6349](https://github.com/CesiumGS/cesium/pull/6349) +* Fixed occlusion when `globe.show` is `false`. [#6374](https://github.com/CesiumGS/cesium/pull/6374) +* Fixed crash for entities with static geometry and time-dynamic attributes. [#6377](https://github.com/CesiumGS/cesium/pull/6377) +* Fixed geometry tile rendering in IE. [#6406](https://github.com/CesiumGS/cesium/pull/6406) ### 1.43 - 2018-03-01 @@ -770,9 +801,9 @@ _This is an npm-only release to fix a publishing issue_. * The STK World Terrain tileset is deprecated and will be available until September 1, 2018. Check out the new high-resolution [Cesium World Terrain](https://cesium.com/blog/2018/03/01/introducing-cesium-world-terrain/) ##### Breaking Changes :mega: -* Removed `GeometryUpdater.perInstanceColorAppearanceType` and `GeometryUpdater.materialAppearanceType`. [#6239](https://github.com/AnalyticalGraphicsInc/cesium/pull/6239) -* `GeometryVisualizer` no longer uses a `type` parameter. [#6239](https://github.com/AnalyticalGraphicsInc/cesium/pull/6239) -* `GeometryVisualizer` no longer displays polylines. Use `PolylineVisualizer` instead. [#6239](https://github.com/AnalyticalGraphicsInc/cesium/pull/6239) +* Removed `GeometryUpdater.perInstanceColorAppearanceType` and `GeometryUpdater.materialAppearanceType`. [#6239](https://github.com/CesiumGS/cesium/pull/6239) +* `GeometryVisualizer` no longer uses a `type` parameter. [#6239](https://github.com/CesiumGS/cesium/pull/6239) +* `GeometryVisualizer` no longer displays polylines. Use `PolylineVisualizer` instead. [#6239](https://github.com/CesiumGS/cesium/pull/6239) * The experimental `CesiumIon` object has been completely refactored and renamed to `Ion`. ##### Deprecated :hourglass_flowing_sand: @@ -782,42 +813,42 @@ _This is an npm-only release to fix a publishing issue_. ##### Additions :tada: * Added new `Ion`, `IonResource`, and `IonImageryProvider` objects for loading data hosted on [Cesium ion](https://cesium.com/blog/2018/03/01/hello-cesium-ion/). * Added `createWorldTerrain` helper function for easily constructing the new Cesium World Terrain. -* Added support for a promise to a resource for `CesiumTerrainProvider`, `createTileMapServiceImageryProvider` and `Cesium3DTileset` [#6204](https://github.com/AnalyticalGraphicsInc/cesium/pull/6204) -* Added `Cesium.Math.cbrt`. [#6222](https://github.com/AnalyticalGraphicsInc/cesium/pull/6222) -* Added `PolylineVisualizer` for displaying polyline entities [#6239](https://github.com/AnalyticalGraphicsInc/cesium/pull/6239) -* `Resource` class [#6205](https://github.com/AnalyticalGraphicsInc/cesium/issues/6205) +* Added support for a promise to a resource for `CesiumTerrainProvider`, `createTileMapServiceImageryProvider` and `Cesium3DTileset` [#6204](https://github.com/CesiumGS/cesium/pull/6204) +* Added `Cesium.Math.cbrt`. [#6222](https://github.com/CesiumGS/cesium/pull/6222) +* Added `PolylineVisualizer` for displaying polyline entities [#6239](https://github.com/CesiumGS/cesium/pull/6239) +* `Resource` class [#6205](https://github.com/CesiumGS/cesium/issues/6205) * Added `put`, `patch`, `delete`, `options` and `head` methods, so it can be used for all XHR requests. * Added `preserveQueryParameters` parameter to `getDerivedResource`, to allow us to append query parameters instead of always replacing them. * Added `setQueryParameters` and `appendQueryParameters` to allow for better handling of query strings. -* Enable terrain in the `CesiumViewer` demo application [#6198](https://github.com/AnalyticalGraphicsInc/cesium/pull/6198) -* Added `Globe.tilesLoaded` getter property to determine if all terrain and imagery is loaded. [#6194](https://github.com/AnalyticalGraphicsInc/cesium/pull/6194) -* Added `classificationType` property to entities which specifies whether an entity on the ground, like a polygon or rectangle, should be clamped to terrain, 3D Tiles, or both. [#6195](https://github.com/AnalyticalGraphicsInc/cesium/issues/6195) +* Enable terrain in the `CesiumViewer` demo application [#6198](https://github.com/CesiumGS/cesium/pull/6198) +* Added `Globe.tilesLoaded` getter property to determine if all terrain and imagery is loaded. [#6194](https://github.com/CesiumGS/cesium/pull/6194) +* Added `classificationType` property to entities which specifies whether an entity on the ground, like a polygon or rectangle, should be clamped to terrain, 3D Tiles, or both. [#6195](https://github.com/CesiumGS/cesium/issues/6195) ##### Fixes :wrench: -* Fixed bug where KmlDataSource did not use Ellipsoid to convert coordinates. Use `options.ellipsoid` to pass the ellipsoid to KmlDataSource constructors / loaders. [#6176](https://github.com/AnalyticalGraphicsInc/cesium/pull/6176) -* Fixed bug where 3D Tiles Point Clouds would fail in Internet Explorer. [#6220](https://github.com/AnalyticalGraphicsInc/cesium/pull/6220) -* Fixed issue where `CESIUM_BASE_URL` wouldn't work without a trailing `/`. [#6225](https://github.com/AnalyticalGraphicsInc/cesium/issues/6225) -* Fixed coloring for polyline entities with a dynamic color for the depth fail material [#6245](https://github.com/AnalyticalGraphicsInc/cesium/pull/6245) -* Fixed bug with zooming to dynamic geometry. [#6269](https://github.com/AnalyticalGraphicsInc/cesium/issues/6269) -* Fixed bug where `AxisAlignedBoundingBox` did not copy over center value when cloning an undefined result. [#6183](https://github.com/AnalyticalGraphicsInc/cesium/pull/6183) -* Fixed a bug where imagery stops loading when changing terrain in request render mode. [#6193](https://github.com/AnalyticalGraphicsInc/cesium/issues/6193) -* Fixed `Resource.fetch` when called with no arguments [#6206](https://github.com/AnalyticalGraphicsInc/cesium/issues/6206) -* Fixed `Resource.clone` to clone the `Request` object, so resource can be used in parallel. [#6208](https://github.com/AnalyticalGraphicsInc/cesium/issues/6208) -* Fixed `Material` so it can now take a `Resource` object as an image. [#6199](https://github.com/AnalyticalGraphicsInc/cesium/issues/6199) -* Fixed an issue causing the Bing Maps key to be sent unnecessarily with every tile request. [#6250](https://github.com/AnalyticalGraphicsInc/cesium/pull/6250) -* Fixed documentation issue for the `Cesium.Math` class. [#6233](https://github.com/AnalyticalGraphicsInc/cesium/issues/6233) -* Fixed rendering 3D Tiles as classification volumes. [#6295](https://github.com/AnalyticalGraphicsInc/cesium/pull/6295) +* Fixed bug where KmlDataSource did not use Ellipsoid to convert coordinates. Use `options.ellipsoid` to pass the ellipsoid to KmlDataSource constructors / loaders. [#6176](https://github.com/CesiumGS/cesium/pull/6176) +* Fixed bug where 3D Tiles Point Clouds would fail in Internet Explorer. [#6220](https://github.com/CesiumGS/cesium/pull/6220) +* Fixed issue where `CESIUM_BASE_URL` wouldn't work without a trailing `/`. [#6225](https://github.com/CesiumGS/cesium/issues/6225) +* Fixed coloring for polyline entities with a dynamic color for the depth fail material [#6245](https://github.com/CesiumGS/cesium/pull/6245) +* Fixed bug with zooming to dynamic geometry. [#6269](https://github.com/CesiumGS/cesium/issues/6269) +* Fixed bug where `AxisAlignedBoundingBox` did not copy over center value when cloning an undefined result. [#6183](https://github.com/CesiumGS/cesium/pull/6183) +* Fixed a bug where imagery stops loading when changing terrain in request render mode. [#6193](https://github.com/CesiumGS/cesium/issues/6193) +* Fixed `Resource.fetch` when called with no arguments [#6206](https://github.com/CesiumGS/cesium/issues/6206) +* Fixed `Resource.clone` to clone the `Request` object, so resource can be used in parallel. [#6208](https://github.com/CesiumGS/cesium/issues/6208) +* Fixed `Material` so it can now take a `Resource` object as an image. [#6199](https://github.com/CesiumGS/cesium/issues/6199) +* Fixed an issue causing the Bing Maps key to be sent unnecessarily with every tile request. [#6250](https://github.com/CesiumGS/cesium/pull/6250) +* Fixed documentation issue for the `Cesium.Math` class. [#6233](https://github.com/CesiumGS/cesium/issues/6233) +* Fixed rendering 3D Tiles as classification volumes. [#6295](https://github.com/CesiumGS/cesium/pull/6295) ### 1.42.1 - 2018-02-01 _This is an npm-only release to fix an issue with using Cesium in Node.js.__ -* Fixed a bug where Cesium would fail to load under Node.js. [#6177](https://github.com/AnalyticalGraphicsInc/cesium/pull/6177) +* Fixed a bug where Cesium would fail to load under Node.js. [#6177](https://github.com/CesiumGS/cesium/pull/6177) ### 1.42 - 2018-02-01 ##### Highlights :sparkler: -* Added experimental support for [3D Tiles Vector and Geometry data](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/3d-tiles-next/TileFormats/VectorData). ([#4665](https://github.com/AnalyticalGraphicsInc/cesium/pull/4665)) -* Added optional mode to reduce CPU usage. See [Improving Performance with Explicit Rendering](https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/). ([#6115](https://github.com/AnalyticalGraphicsInc/cesium/pull/6115)) -* Added experimental `CesiumIon` utility class for working with the Cesium ion beta API. [#6136](https://github.com/AnalyticalGraphicsInc/cesium/pull/6136) +* Added experimental support for [3D Tiles Vector and Geometry data](https://github.com/CesiumGS/3d-tiles/tree/3d-tiles-next/TileFormats/VectorData). ([#4665](https://github.com/CesiumGS/cesium/pull/4665)) +* Added optional mode to reduce CPU usage. See [Improving Performance with Explicit Rendering](https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/). ([#6115](https://github.com/CesiumGS/cesium/pull/6115)) +* Added experimental `CesiumIon` utility class for working with the Cesium ion beta API. [#6136](https://github.com/CesiumGS/cesium/pull/6136) * Major refactor of URL handling. All classes that take a url parameter, can now take a Resource or a String. This includes all imagery providers, all terrain providers, `Cesium3DTileset`, `KMLDataSource`, `CZMLDataSource`, `GeoJsonDataSource`, `Model`, and `Billboard`. ##### Breaking Changes :mega: @@ -828,11 +859,11 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * All low level load functions including `loadArrayBuffer`, `loadBlob`, `loadImage`, `loadJson`, `loadJsonp`, `loadText`, `loadXML` and `loadWithXhr` have been deprecated and will be removed in Cesium 1.44. Please use the equivalent `fetch` functions on the `Resource` class. ##### Additions :tada: -* Added experimental support for [3D Tiles Vector and Geometry data](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/3d-tiles-next/TileFormats/VectorData) ([#4665](https://github.com/AnalyticalGraphicsInc/cesium/pull/4665)). The new and modified Cesium APIs are: - * `Cesium3DTileStyle` has expanded to include styling point features. See the [styling specification](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/vector-tiles/Styling#vector-data) for details. +* Added experimental support for [3D Tiles Vector and Geometry data](https://github.com/CesiumGS/3d-tiles/tree/3d-tiles-next/TileFormats/VectorData) ([#4665](https://github.com/CesiumGS/cesium/pull/4665)). The new and modified Cesium APIs are: + * `Cesium3DTileStyle` has expanded to include styling point features. See the [styling specification](https://github.com/CesiumGS/3d-tiles/tree/vector-tiles/Styling#vector-data) for details. * `Cesium3DTileFeature` can modify `color` and `show` properties for polygon, polyline, and geometry features. * `Cesium3DTilePointFeature` can modify the styling options for a point feature. -* Added optional mode to reduce CPU usage. [#6115](https://github.com/AnalyticalGraphicsInc/cesium/pull/6115) +* Added optional mode to reduce CPU usage. [#6115](https://github.com/CesiumGS/cesium/pull/6115) * `Scene.requestRenderMode` enables a mode which will only request new render frames on changes to the scene, or when the simulation time change exceeds `scene.maximumRenderTimeChange`. * `Scene.requestRender` will explicitly request a new render frame when in request render mode. * Added `Scene.preUpdate` and `Scene.postUpdate` events that are raised before and after the scene updates respectively. The scene is always updated before executing a potential render. Continue to listen to `Scene.preRender` and `Scene.postRender` events for when the scene renders a frame. @@ -846,85 +877,85 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Only one node is supported. * Only one mesh per node is supported. * Only one primitive per mesh is supported. -* Added geometric-error-based point cloud attenuation and eye dome lighting for point clouds using replacement refinement. [#6069](https://github.com/AnalyticalGraphicsInc/cesium/pull/6069) -* Updated `Viewer.zoomTo` and `Viewer.flyTo` to take a `Cesium3DTileset` as a target. [#6104](https://github.com/AnalyticalGraphicsInc/cesium/pull/6104) -* Added `shouldAnimate` option to the `Viewer` constructor to indicate if the clock should begin animating on startup. [#6154](https://github.com/AnalyticalGraphicsInc/cesium/pull/6154) +* Added geometric-error-based point cloud attenuation and eye dome lighting for point clouds using replacement refinement. [#6069](https://github.com/CesiumGS/cesium/pull/6069) +* Updated `Viewer.zoomTo` and `Viewer.flyTo` to take a `Cesium3DTileset` as a target. [#6104](https://github.com/CesiumGS/cesium/pull/6104) +* Added `shouldAnimate` option to the `Viewer` constructor to indicate if the clock should begin animating on startup. [#6154](https://github.com/CesiumGS/cesium/pull/6154) * Added `Cesium3DTileset.ellipsoid` determining the size and shape of the globe. This can be set at construction and defaults to a WGS84 ellipsoid. -* Added `Plane.projectPointOntoPlane` for projecting a `Cartesian3` position onto a `Plane`. [#6092](https://github.com/AnalyticalGraphicsInc/cesium/pull/6092) -* Added `Cartesian3.projectVector` for projecting one vector to another. [#6093](https://github.com/AnalyticalGraphicsInc/cesium/pull/6093) -* Added `Cesium3DTileset.tileFailed` event that will be raised when a tile fails to load. The object passed to the event listener will have a url and message property. If there are no event listeners, error messages will be logged to the console. [#6088](https://github.com/AnalyticalGraphicsInc/cesium/pull/6088) +* Added `Plane.projectPointOntoPlane` for projecting a `Cartesian3` position onto a `Plane`. [#6092](https://github.com/CesiumGS/cesium/pull/6092) +* Added `Cartesian3.projectVector` for projecting one vector to another. [#6093](https://github.com/CesiumGS/cesium/pull/6093) +* Added `Cesium3DTileset.tileFailed` event that will be raised when a tile fails to load. The object passed to the event listener will have a url and message property. If there are no event listeners, error messages will be logged to the console. [#6088](https://github.com/CesiumGS/cesium/pull/6088) * Added `AttributeCompression.zigZagDeltaDecode` which will decode delta and ZigZag encoded buffers in place. * Added `pack` and `unpack` functions to `OrientedBoundingBox` for packing to and unpacking from a flat buffer. -* Added support for vertex shader uniforms when `tileset.colorBlendMode` is `MIX` or `REPLACE`. [#5874](https://github.com/AnalyticalGraphicsInc/cesium/pull/5874) -* Added `ClippingPlaneCollection.isSupported` function for checking if rendering with clipping planes is supported.[#6084](https://github.com/AnalyticalGraphicsInc/cesium/pull/6084) -* Added `Cartographic.toCartesian` to convert from `Cartographic` to `Cartesian3`. [#6163](https://github.com/AnalyticalGraphicsInc/cesium/pull/6163) -* Added `BoundingSphere.volume` for computing the volume of a `BoundingSphere`. [#6069](https://github.com/AnalyticalGraphicsInc/cesium/pull/6069) -* Added new file for the Cesium [Code of Conduct](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CODE_OF_CONDUCT.md). [#6129](https://github.com/AnalyticalGraphicsInc/cesium/pull/6129) +* Added support for vertex shader uniforms when `tileset.colorBlendMode` is `MIX` or `REPLACE`. [#5874](https://github.com/CesiumGS/cesium/pull/5874) +* Added `ClippingPlaneCollection.isSupported` function for checking if rendering with clipping planes is supported.[#6084](https://github.com/CesiumGS/cesium/pull/6084) +* Added `Cartographic.toCartesian` to convert from `Cartographic` to `Cartesian3`. [#6163](https://github.com/CesiumGS/cesium/pull/6163) +* Added `BoundingSphere.volume` for computing the volume of a `BoundingSphere`. [#6069](https://github.com/CesiumGS/cesium/pull/6069) +* Added new file for the Cesium [Code of Conduct](https://github.com/CesiumGS/cesium/blob/master/CODE_OF_CONDUCT.md). [#6129](https://github.com/CesiumGS/cesium/pull/6129) ##### Fixes :wrench: -* Fixed a bug that could cause tiles to be missing from the globe surface, especially when starting with the camera zoomed close to the surface. [#4969](https://github.com/AnalyticalGraphicsInc/cesium/pull/4969) -* Fixed applying a translucent style to a point cloud tileset. [#6113](https://github.com/AnalyticalGraphicsInc/cesium/pull/6113) -* Fixed Sandcastle error in IE 11. [#6169](https://github.com/AnalyticalGraphicsInc/cesium/pull/6169) -* Fixed a glTF animation bug that caused certain animations to jitter. [#5740](https://github.com/AnalyticalGraphicsInc/cesium/pull/5740) -* Fixed a bug when creating billboard and model entities without a globe. [#6109](https://github.com/AnalyticalGraphicsInc/cesium/pull/6109) -* Improved CZML Custom Properties Sandcastle example. [#6086](https://github.com/AnalyticalGraphicsInc/cesium/pull/6086) -* Improved Particle System Sandcastle example for better visual. [#6132](https://github.com/AnalyticalGraphicsInc/cesium/pull/6132) -* Fixed behavior of `Camera.move*` and `Camera.look*` functions in 2D mode. [#5884](https://github.com/AnalyticalGraphicsInc/cesium/issues/5884) -* Fixed `Camera.moveStart` and `Camera.moveEnd` events not being raised when camera is close to the ground. [#4753](https://github.com/AnalyticalGraphicsInc/cesium/issues/4753) -* Fixed `OrientedBoundingBox` documentation. [#6147](https://github.com/AnalyticalGraphicsInc/cesium/pull/6147) +* Fixed a bug that could cause tiles to be missing from the globe surface, especially when starting with the camera zoomed close to the surface. [#4969](https://github.com/CesiumGS/cesium/pull/4969) +* Fixed applying a translucent style to a point cloud tileset. [#6113](https://github.com/CesiumGS/cesium/pull/6113) +* Fixed Sandcastle error in IE 11. [#6169](https://github.com/CesiumGS/cesium/pull/6169) +* Fixed a glTF animation bug that caused certain animations to jitter. [#5740](https://github.com/CesiumGS/cesium/pull/5740) +* Fixed a bug when creating billboard and model entities without a globe. [#6109](https://github.com/CesiumGS/cesium/pull/6109) +* Improved CZML Custom Properties Sandcastle example. [#6086](https://github.com/CesiumGS/cesium/pull/6086) +* Improved Particle System Sandcastle example for better visual. [#6132](https://github.com/CesiumGS/cesium/pull/6132) +* Fixed behavior of `Camera.move*` and `Camera.look*` functions in 2D mode. [#5884](https://github.com/CesiumGS/cesium/issues/5884) +* Fixed `Camera.moveStart` and `Camera.moveEnd` events not being raised when camera is close to the ground. [#4753](https://github.com/CesiumGS/cesium/issues/4753) +* Fixed `OrientedBoundingBox` documentation. [#6147](https://github.com/CesiumGS/cesium/pull/6147) * Updated documentation links to reflect new locations on `https://cesiumjs.org` and `https://cesium.com`. ### 1.41 - 2018-01-02 * Breaking changes * Removed the `text`, `imageUrl`, and `link` parameters from `Credit`, which were deprecated in Cesium 1.40. Use `options.text`, `options.imageUrl`, and `options.link` instead. -* Added support for clipping planes. [#5913](https://github.com/AnalyticalGraphicsInc/cesium/pull/5913), [#5996](https://github.com/AnalyticalGraphicsInc/cesium/pull/5996) +* Added support for clipping planes. [#5913](https://github.com/CesiumGS/cesium/pull/5913), [#5996](https://github.com/CesiumGS/cesium/pull/5996) * Added `clippingPlanes` property to `ModelGraphics`, `Model`, `Cesium3DTileset`, and `Globe`, which specifies a `ClippingPlaneCollection` to selectively disable rendering. * Added `PlaneGeometry`, `PlaneOutlineGeometry`, `PlaneGeometryUpdater`, `PlaneOutlineGeometryUpdater`, `PlaneGraphics`, and `Entity.plane` to visualize planes. * Added `Plane.transformPlane` to apply a transformation to a plane. -* Fixed point cloud exception in IE. [#6051](https://github.com/AnalyticalGraphicsInc/cesium/pull/6051) -* Fixed globe materials when `Globe.enableLighting` was `false`. [#6042](https://github.com/AnalyticalGraphicsInc/cesium/issues/6042) -* Fixed shader compilation failure on pick when globe materials were enabled. [#6039](https://github.com/AnalyticalGraphicsInc/cesium/issues/6039) -* Fixed exception when `invertClassification` was enabled, the invert color had an alpha less than `1.0`, and the window was resized. [#6046](https://github.com/AnalyticalGraphicsInc/cesium/issues/6046) +* Fixed point cloud exception in IE. [#6051](https://github.com/CesiumGS/cesium/pull/6051) +* Fixed globe materials when `Globe.enableLighting` was `false`. [#6042](https://github.com/CesiumGS/cesium/issues/6042) +* Fixed shader compilation failure on pick when globe materials were enabled. [#6039](https://github.com/CesiumGS/cesium/issues/6039) +* Fixed exception when `invertClassification` was enabled, the invert color had an alpha less than `1.0`, and the window was resized. [#6046](https://github.com/CesiumGS/cesium/issues/6046) ### 1.40 - 2017-12-01 * Deprecated * The `text`, `imageUrl` and `link` parameters from `Credit` have been deprecated and will be removed in Cesium 1.41. Use `options.text`, `options.imageUrl` and `options.link` instead. -* Added `Globe.material` to apply materials to the globe/terrain for shading such as height- or slope-based color ramps. See the new [Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Globe%20Materials.html&label=Showcases). [#5919](https://github.com/AnalyticalGraphicsInc/cesium/pull/5919/files) -* Added CZML support for `polyline.depthFailMaterial`, `label.scaleByDistance`, `distanceDisplayCondition`, and `disableDepthTestDistance`. [#5986](https://github.com/AnalyticalGraphicsInc/cesium/pull/5986) -* Fixed a bug where drill picking a polygon clamped to ground would cause the browser to hang. [#5971](https://github.com/AnalyticalGraphicsInc/cesium/issues/5971) -* Fixed bug in KML LookAt bug where degrees and radians were mixing in a subtraction. [#5992](https://github.com/AnalyticalGraphicsInc/cesium/issues/5992) -* Fixed handling of KMZ files with missing `xsi` namespace declarations. [#6003](https://github.com/AnalyticalGraphicsInc/cesium/pull/6003) -* Added function that removes duplicate namespace declarations while loading a KML or a KMZ. [#5972](https://github.com/AnalyticalGraphicsInc/cesium/pull/5972) -* Fixed a language detection issue. [#6016](https://github.com/AnalyticalGraphicsInc/cesium/pull/6016) -* Fixed a bug where glTF models with animations of different lengths would cause an error. [#5694](https://github.com/AnalyticalGraphicsInc/cesium/issues/5694) +* Added `Globe.material` to apply materials to the globe/terrain for shading such as height- or slope-based color ramps. See the new [Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Globe%20Materials.html&label=Showcases). [#5919](https://github.com/CesiumGS/cesium/pull/5919/files) +* Added CZML support for `polyline.depthFailMaterial`, `label.scaleByDistance`, `distanceDisplayCondition`, and `disableDepthTestDistance`. [#5986](https://github.com/CesiumGS/cesium/pull/5986) +* Fixed a bug where drill picking a polygon clamped to ground would cause the browser to hang. [#5971](https://github.com/CesiumGS/cesium/issues/5971) +* Fixed bug in KML LookAt bug where degrees and radians were mixing in a subtraction. [#5992](https://github.com/CesiumGS/cesium/issues/5992) +* Fixed handling of KMZ files with missing `xsi` namespace declarations. [#6003](https://github.com/CesiumGS/cesium/pull/6003) +* Added function that removes duplicate namespace declarations while loading a KML or a KMZ. [#5972](https://github.com/CesiumGS/cesium/pull/5972) +* Fixed a language detection issue. [#6016](https://github.com/CesiumGS/cesium/pull/6016) +* Fixed a bug where glTF models with animations of different lengths would cause an error. [#5694](https://github.com/CesiumGS/cesium/issues/5694) * Added a `clampAnimations` parameter to `Model` and `Entity.model`. Setting this to `false` allows different length animations to loop asynchronously over the duration of the longest animation. -* Fixed `Invalid asm.js: Invalid member of stdlib` console error by recompiling crunch.js with latest emscripten toolchain. [#5847](https://github.com/AnalyticalGraphicsInc/cesium/issues/5847) -* Added `file:` scheme compatibility to `joinUrls`. [#5989](https://github.com/AnalyticalGraphicsInc/cesium/pull/5989) -* Added a Reverse Geocoder [Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Reverse%20Geocoder.html&label=Showcases). [#5976](https://github.com/AnalyticalGraphicsInc/cesium/pull/5976) -* Added ability to support touch event in Imagery Layers Split Sandcastle example. [#5948](https://github.com/AnalyticalGraphicsInc/cesium/pull/5948) -* Added a new `@experimental` tag to the documentation. A small subset of the Cesium API tagged as such are subject to breaking changes without deprecation. See the [Coding Guide](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/CodingGuide#deprecation-and-breaking-changes) for further explanation. [#6010](https://github.com/AnalyticalGraphicsInc/cesium/pull/6010) -* Moved terrain and imagery credits to a lightbox that pops up when you click a link in the onscreen credits [#3013](https://github.com/AnalyticalGraphicsInc/cesium/issues/3013) +* Fixed `Invalid asm.js: Invalid member of stdlib` console error by recompiling crunch.js with latest emscripten toolchain. [#5847](https://github.com/CesiumGS/cesium/issues/5847) +* Added `file:` scheme compatibility to `joinUrls`. [#5989](https://github.com/CesiumGS/cesium/pull/5989) +* Added a Reverse Geocoder [Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Reverse%20Geocoder.html&label=Showcases). [#5976](https://github.com/CesiumGS/cesium/pull/5976) +* Added ability to support touch event in Imagery Layers Split Sandcastle example. [#5948](https://github.com/CesiumGS/cesium/pull/5948) +* Added a new `@experimental` tag to the documentation. A small subset of the Cesium API tagged as such are subject to breaking changes without deprecation. See the [Coding Guide](https://github.com/CesiumGS/cesium/tree/master/Documentation/Contributors/CodingGuide#deprecation-and-breaking-changes) for further explanation. [#6010](https://github.com/CesiumGS/cesium/pull/6010) +* Moved terrain and imagery credits to a lightbox that pops up when you click a link in the onscreen credits [#3013](https://github.com/CesiumGS/cesium/issues/3013) ### 1.39 - 2017-11-01 * Cesium now officially supports webpack. See our [Integrating Cesium and webpack blog post](https://cesium.com/blog/2017/10/18/cesium-and-webpack/) for more details. -* Added support for right-to-left language detection in labels, currently Hebrew and Arabic are supported. To enable it, set `Cesium.Label.enableRightToLeftDetection = true` at the start of your application. [#5771](https://github.com/AnalyticalGraphicsInc/cesium/pull/5771) -* Fixed handling of KML files with missing `xsi` namespace declarations. [#5860](https://github.com/AnalyticalGraphicsInc/cesium/pull/5860) -* Fixed a bug that caused KML ground overlays to appear distorted when rotation was applied. [#5914](https://github.com/AnalyticalGraphicsInc/cesium/issues/5914) -* Fixed a bug where KML placemarks with no specified icon would be displayed with default icon. [#5819](https://github.com/AnalyticalGraphicsInc/cesium/issues/5819) -* Changed KML loading to ignore NetworkLink failures and continue to load the rest of the document. [#5871](https://github.com/AnalyticalGraphicsInc/cesium/pull/5871) -* Added the ability to load Cesium's assets from the local file system if security permissions allow it. [#5830](https://github.com/AnalyticalGraphicsInc/cesium/issues/5830) -* Added two new properties to `ImageryLayer` that allow for adjusting the texture sampler used for up and down-sampling of imagery tiles, namely `minificationFilter` and `magnificationFilter` with possible values `LINEAR` (the default) and `NEAREST` defined in `TextureMinificationFilter` and `TextureMagnificationFilter`. [#5846](https://github.com/AnalyticalGraphicsInc/cesium/issues/5846) -* Fixed flickering artifacts with 3D Tiles tilesets with thin walls. [#5940](https://github.com/AnalyticalGraphicsInc/cesium/pull/5940) -* Fixed bright fog when terrain lighting is enabled and added `Fog.minimumBrightness` to affect how bright the fog will be when in complete darkness. [#5934](https://github.com/AnalyticalGraphicsInc/cesium/pull/5934) -* Fixed using arrow keys in geocoder widget to select search suggestions. [#5943](https://github.com/AnalyticalGraphicsInc/cesium/issues/5943) -* Added support for the layer.json `parentUrl` property in `CesiumTerrainProvider` to allow for compositing of tilesets. [#5864](https://github.com/AnalyticalGraphicsInc/cesium/pull/5864) -* Added `invertClassification` and `invertClassificationColor` to `Scene`. When `invertClassification` is `true`, any 3D Tiles geometry that is not classified by a `ClassificationPrimitive` or `GroundPrimitive` will have its color multiplied by `invertClassificationColor`. [#5836](https://github.com/AnalyticalGraphicsInc/cesium/pull/5836) -* Added `customTags` property to the UrlTemplateImageryProvider to allow custom keywords in the template URL. [#5696](https://github.com/AnalyticalGraphicsInc/cesium/pull/5696) -* Added `eyeSeparation` and `focalLength` properties to `Scene` to configure VR settings. [#5917](https://github.com/AnalyticalGraphicsInc/cesium/pull/5917) -* Improved CZML Reference Properties example [#5754](https://github.com/AnalyticalGraphicsInc/cesium/pull/5754) +* Added support for right-to-left language detection in labels, currently Hebrew and Arabic are supported. To enable it, set `Cesium.Label.enableRightToLeftDetection = true` at the start of your application. [#5771](https://github.com/CesiumGS/cesium/pull/5771) +* Fixed handling of KML files with missing `xsi` namespace declarations. [#5860](https://github.com/CesiumGS/cesium/pull/5860) +* Fixed a bug that caused KML ground overlays to appear distorted when rotation was applied. [#5914](https://github.com/CesiumGS/cesium/issues/5914) +* Fixed a bug where KML placemarks with no specified icon would be displayed with default icon. [#5819](https://github.com/CesiumGS/cesium/issues/5819) +* Changed KML loading to ignore NetworkLink failures and continue to load the rest of the document. [#5871](https://github.com/CesiumGS/cesium/pull/5871) +* Added the ability to load Cesium's assets from the local file system if security permissions allow it. [#5830](https://github.com/CesiumGS/cesium/issues/5830) +* Added two new properties to `ImageryLayer` that allow for adjusting the texture sampler used for up and down-sampling of imagery tiles, namely `minificationFilter` and `magnificationFilter` with possible values `LINEAR` (the default) and `NEAREST` defined in `TextureMinificationFilter` and `TextureMagnificationFilter`. [#5846](https://github.com/CesiumGS/cesium/issues/5846) +* Fixed flickering artifacts with 3D Tiles tilesets with thin walls. [#5940](https://github.com/CesiumGS/cesium/pull/5940) +* Fixed bright fog when terrain lighting is enabled and added `Fog.minimumBrightness` to affect how bright the fog will be when in complete darkness. [#5934](https://github.com/CesiumGS/cesium/pull/5934) +* Fixed using arrow keys in geocoder widget to select search suggestions. [#5943](https://github.com/CesiumGS/cesium/issues/5943) +* Added support for the layer.json `parentUrl` property in `CesiumTerrainProvider` to allow for compositing of tilesets. [#5864](https://github.com/CesiumGS/cesium/pull/5864) +* Added `invertClassification` and `invertClassificationColor` to `Scene`. When `invertClassification` is `true`, any 3D Tiles geometry that is not classified by a `ClassificationPrimitive` or `GroundPrimitive` will have its color multiplied by `invertClassificationColor`. [#5836](https://github.com/CesiumGS/cesium/pull/5836) +* Added `customTags` property to the UrlTemplateImageryProvider to allow custom keywords in the template URL. [#5696](https://github.com/CesiumGS/cesium/pull/5696) +* Added `eyeSeparation` and `focalLength` properties to `Scene` to configure VR settings. [#5917](https://github.com/CesiumGS/cesium/pull/5917) +* Improved CZML Reference Properties example [#5754](https://github.com/CesiumGS/cesium/pull/5754) ### 1.38 - 2017-10-02 @@ -934,17 +965,17 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * `Scene/OrthographicOffCenterFrustum` has been removed. Use `Core/OrthographicOffCenterFrustum`. * `Scene/PerspectiveFrustum` has been removed. Use `Core/PerspectiveFrustum`. * `Scene/PerspectiveOffCenterFrustum` has been removed. Use `Core/PerspectiveOffCenterFrustum`. -* Added support in CZML for expressing `orientation` as the velocity vector of an entity, using `velocityReference` syntax. [#5807](https://github.com/AnalyticalGraphicsInc/cesium/pull/5807) -* Fixed CZML processing of `velocityReference` within an interval. [#5738](https://github.com/AnalyticalGraphicsInc/cesium/issues/5738) -* Added ability to add an animation to `ModelAnimationCollection` by its index. [#5815](https://github.com/AnalyticalGraphicsInc/cesium/pull/5815) -* Fixed a bug in `ModelAnimationCollection` that caused adding an animation by its name to throw an error. [#5815](https://github.com/AnalyticalGraphicsInc/cesium/pull/5815) +* Added support in CZML for expressing `orientation` as the velocity vector of an entity, using `velocityReference` syntax. [#5807](https://github.com/CesiumGS/cesium/pull/5807) +* Fixed CZML processing of `velocityReference` within an interval. [#5738](https://github.com/CesiumGS/cesium/issues/5738) +* Added ability to add an animation to `ModelAnimationCollection` by its index. [#5815](https://github.com/CesiumGS/cesium/pull/5815) +* Fixed a bug in `ModelAnimationCollection` that caused adding an animation by its name to throw an error. [#5815](https://github.com/CesiumGS/cesium/pull/5815) * Fixed issue in Internet Explorer and Edge with loading unicode strings in typed arrays that impacted 3D Tiles Batch Table values. -* Zoom now maintains camera heading, pitch, and roll. [#4639](https://github.com/AnalyticalGraphicsInc/cesium/pull/5603) -* Fixed a bug in `PolylineCollection` preventing the display of more than 16K points in a single collection. [#5538](https://github.com/AnalyticalGraphicsInc/cesium/pull/5782) -* Fixed a 3D Tiles point cloud bug causing a stray point to appear at the center of the screen on certain hardware. [#5599](https://github.com/AnalyticalGraphicsInc/cesium/issues/5599) -* Fixed removing multiple event listeners within event callbacks. [#5827](https://github.com/AnalyticalGraphicsInc/cesium/issues/5827) +* Zoom now maintains camera heading, pitch, and roll. [#4639](https://github.com/CesiumGS/cesium/pull/5603) +* Fixed a bug in `PolylineCollection` preventing the display of more than 16K points in a single collection. [#5538](https://github.com/CesiumGS/cesium/pull/5782) +* Fixed a 3D Tiles point cloud bug causing a stray point to appear at the center of the screen on certain hardware. [#5599](https://github.com/CesiumGS/cesium/issues/5599) +* Fixed removing multiple event listeners within event callbacks. [#5827](https://github.com/CesiumGS/cesium/issues/5827) * Running `buildApps` now creates a built version of Sandcastle which uses the built version of Cesium for better performance. -* Fixed a tileset traversal bug when the `skipLevelOfDetail` optimization is off. [#5869](https://github.com/AnalyticalGraphicsInc/cesium/issues/5869) +* Fixed a tileset traversal bug when the `skipLevelOfDetail` optimization is off. [#5869](https://github.com/CesiumGS/cesium/issues/5869) ### 1.37 - 2017-09-01 @@ -953,24 +984,24 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Removed `GoogleEarthImageryProvider`, use `GoogleEarthEnterpriseMapsProvider` instead. * Removed the `throttleRequest` parameter from `TerrainProvider.requestTileGeometry` and inherited terrain providers. It is replaced with an optional `Request` object. Set the request's `throttle` property to `true` to throttle requests. * Removed the ability to provide a Promise for the `options.url` parameter of `loadWithXhr` and for the `url` parameter of `loadArrayBuffer`, `loadBlob`, `loadImageViaBlob`, `loadText`, `loadJson`, `loadXML`, `loadImage`, `loadCRN`, `loadKTX`, and `loadCubeMap`. Instead `url` must be a string. -* Added `classificationType` to `ClassificationPrimitive` and `GroundPrimitive` to choose whether terrain, 3D Tiles, or both are classified. [#5770](https://github.com/AnalyticalGraphicsInc/cesium/pull/5770) -* Fixed depth picking on 3D Tiles. [#5676](https://github.com/AnalyticalGraphicsInc/cesium/issues/5676) -* Fixed glTF model translucency bug. [#5731](https://github.com/AnalyticalGraphicsInc/cesium/issues/5731) -* Fixed `replaceState` bug that was causing the `CesiumViewer` demo application to crash in Safari and iOS. [#5691](https://github.com/AnalyticalGraphicsInc/cesium/issues/5691) -* Fixed a 3D Tiles traversal bug for tilesets using additive refinement. [#5766](https://github.com/AnalyticalGraphicsInc/cesium/issues/5766) -* Fixed a 3D Tiles traversal bug where out-of-view children were being loaded unnecessarily. [#5477](https://github.com/AnalyticalGraphicsInc/cesium/issues/5477) -* Fixed `Entity` id type to be `String` in `EntityCollection` and `CompositeEntityCollection` [#5791](https://github.com/AnalyticalGraphicsInc/cesium/pull/5791) -* Fixed issue where `Model` and `BillboardCollection` would throw an error if the globe is undefined. [#5638](https://github.com/AnalyticalGraphicsInc/cesium/issues/5638) -* Fixed issue where the `Model` glTF cache loses reference to the model's buffer data. [#5720](https://github.com/AnalyticalGraphicsInc/cesium/issues/5720) -* Fixed some issues with `disableDepthTestDistance`. [#5501](https://github.com/AnalyticalGraphicsInc/cesium/issues/5501) [#5331](https://github.com/AnalyticalGraphicsInc/cesium/issues/5331) [#5621](https://github.com/AnalyticalGraphicsInc/cesium/issues/5621) -* Added several new Bing Maps styles: `CANVAS_DARK`, `CANVAS_LIGHT`, and `CANVAS_GRAY`. [#5737](https://github.com/AnalyticalGraphicsInc/cesium/pull/5737) -* Added small improvements to the atmosphere. [#5741](https://github.com/AnalyticalGraphicsInc/cesium/pull/5741) -* Fixed a bug that caused imagery splitting to work incorrectly when CSS pixels were not equivalent to WebGL drawing buffer pixels, such as on high DPI displays in Microsoft Edge and Internet Explorer. [#5743](https://github.com/AnalyticalGraphicsInc/cesium/pull/5743) -* Added `Cesium3DTileset.loadJson` to support overriding the default tileset loading behavior. [#5685](https://github.com/AnalyticalGraphicsInc/cesium/pull/5685) -* Fixed loading of binary glTFs containing CRN or KTX textures. [#5753](https://github.com/AnalyticalGraphicsInc/cesium/pull/5753) -* Fixed specular computation for certain models using the `KHR_materials_common` extension. [#5773](https://github.com/AnalyticalGraphicsInc/cesium/pull/5773) -* Fixed a picking bug in the `3D Tiles Interactivity` Sandcastle demo. [#5703](https://github.com/AnalyticalGraphicsInc/cesium/issues/5703) -* Updated knockout from 3.4.0 to 3.4.2 [#5703](https://github.com/AnalyticalGraphicsInc/cesium/pull/5829) +* Added `classificationType` to `ClassificationPrimitive` and `GroundPrimitive` to choose whether terrain, 3D Tiles, or both are classified. [#5770](https://github.com/CesiumGS/cesium/pull/5770) +* Fixed depth picking on 3D Tiles. [#5676](https://github.com/CesiumGS/cesium/issues/5676) +* Fixed glTF model translucency bug. [#5731](https://github.com/CesiumGS/cesium/issues/5731) +* Fixed `replaceState` bug that was causing the `CesiumViewer` demo application to crash in Safari and iOS. [#5691](https://github.com/CesiumGS/cesium/issues/5691) +* Fixed a 3D Tiles traversal bug for tilesets using additive refinement. [#5766](https://github.com/CesiumGS/cesium/issues/5766) +* Fixed a 3D Tiles traversal bug where out-of-view children were being loaded unnecessarily. [#5477](https://github.com/CesiumGS/cesium/issues/5477) +* Fixed `Entity` id type to be `String` in `EntityCollection` and `CompositeEntityCollection` [#5791](https://github.com/CesiumGS/cesium/pull/5791) +* Fixed issue where `Model` and `BillboardCollection` would throw an error if the globe is undefined. [#5638](https://github.com/CesiumGS/cesium/issues/5638) +* Fixed issue where the `Model` glTF cache loses reference to the model's buffer data. [#5720](https://github.com/CesiumGS/cesium/issues/5720) +* Fixed some issues with `disableDepthTestDistance`. [#5501](https://github.com/CesiumGS/cesium/issues/5501) [#5331](https://github.com/CesiumGS/cesium/issues/5331) [#5621](https://github.com/CesiumGS/cesium/issues/5621) +* Added several new Bing Maps styles: `CANVAS_DARK`, `CANVAS_LIGHT`, and `CANVAS_GRAY`. [#5737](https://github.com/CesiumGS/cesium/pull/5737) +* Added small improvements to the atmosphere. [#5741](https://github.com/CesiumGS/cesium/pull/5741) +* Fixed a bug that caused imagery splitting to work incorrectly when CSS pixels were not equivalent to WebGL drawing buffer pixels, such as on high DPI displays in Microsoft Edge and Internet Explorer. [#5743](https://github.com/CesiumGS/cesium/pull/5743) +* Added `Cesium3DTileset.loadJson` to support overriding the default tileset loading behavior. [#5685](https://github.com/CesiumGS/cesium/pull/5685) +* Fixed loading of binary glTFs containing CRN or KTX textures. [#5753](https://github.com/CesiumGS/cesium/pull/5753) +* Fixed specular computation for certain models using the `KHR_materials_common` extension. [#5773](https://github.com/CesiumGS/cesium/pull/5773) +* Fixed a picking bug in the `3D Tiles Interactivity` Sandcastle demo. [#5703](https://github.com/CesiumGS/cesium/issues/5703) +* Updated knockout from 3.4.0 to 3.4.2 [#5703](https://github.com/CesiumGS/cesium/pull/5829) ### 1.36 - 2017-08-01 @@ -985,35 +1016,35 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * `Scene/OrthographicOffCenterFrustum` is deprecated and will be removed in 1.38. Use `Core/OrthographicOffCenterFrustum`. * `Scene/PerspectiveFrustum` is deprecated and will be removed in 1.38. Use `Core/PerspectiveFrustum`. * `Scene/PerspectiveOffCenterFrustum` is deprecated and will be removed in 1.38. Use `Core/PerspectiveOffCenterFrustum`. -* Added glTF 2.0 support, including physically-based material rendering, morph targets, and appropriate updating of glTF 1.0 models to 2.0. [#5641](https://github.com/AnalyticalGraphicsInc/cesium/pull/5641) -* Added `ClassificationPrimitive` which defines a volume and draws the intersection of the volume and terrain or 3D Tiles. [#5625](https://github.com/AnalyticalGraphicsInc/cesium/pull/5625) -* Added `tileLoad` event to `Cesium3DTileset`. [#5628](https://github.com/AnalyticalGraphicsInc/cesium/pull/5628) -* Fixed issue where scene would blink when labels were added. [#5537](https://github.com/AnalyticalGraphicsInc/cesium/issues/5537) -* Fixed label positioning when height reference changes [#5609](https://github.com/AnalyticalGraphicsInc/cesium/issues/5609) -* Fixed label positioning when using `HeightReference.CLAMP_TO_GROUND` and no position [#5648](https://github.com/AnalyticalGraphicsInc/cesium/pull/5648) -* Fix for dynamic polylines with polyline dash material [#5681](https://github.com/AnalyticalGraphicsInc/cesium/pull/5681) -* Added ability to provide a `width` and `height` to `scene.pick`. [#5602](https://github.com/AnalyticalGraphicsInc/cesium/pull/5602) -* Fixed `Viewer.flyTo` not respecting zoom limits, and resetting minimumZoomDistance if the camera zoomed past the minimumZoomDistance. [5573](https://github.com/AnalyticalGraphicsInc/cesium/issues/5573) -* Added ability to show tile urls in the 3D Tiles Inspector. [#5592](https://github.com/AnalyticalGraphicsInc/cesium/pull/5592) -* Fixed a bug when reading CRN compressed textures with multiple mip levels. [#5618](https://github.com/AnalyticalGraphicsInc/cesium/pull/5618) +* Added glTF 2.0 support, including physically-based material rendering, morph targets, and appropriate updating of glTF 1.0 models to 2.0. [#5641](https://github.com/CesiumGS/cesium/pull/5641) +* Added `ClassificationPrimitive` which defines a volume and draws the intersection of the volume and terrain or 3D Tiles. [#5625](https://github.com/CesiumGS/cesium/pull/5625) +* Added `tileLoad` event to `Cesium3DTileset`. [#5628](https://github.com/CesiumGS/cesium/pull/5628) +* Fixed issue where scene would blink when labels were added. [#5537](https://github.com/CesiumGS/cesium/issues/5537) +* Fixed label positioning when height reference changes [#5609](https://github.com/CesiumGS/cesium/issues/5609) +* Fixed label positioning when using `HeightReference.CLAMP_TO_GROUND` and no position [#5648](https://github.com/CesiumGS/cesium/pull/5648) +* Fix for dynamic polylines with polyline dash material [#5681](https://github.com/CesiumGS/cesium/pull/5681) +* Added ability to provide a `width` and `height` to `scene.pick`. [#5602](https://github.com/CesiumGS/cesium/pull/5602) +* Fixed `Viewer.flyTo` not respecting zoom limits, and resetting minimumZoomDistance if the camera zoomed past the minimumZoomDistance. [5573](https://github.com/CesiumGS/cesium/issues/5573) +* Added ability to show tile urls in the 3D Tiles Inspector. [#5592](https://github.com/CesiumGS/cesium/pull/5592) +* Fixed a bug when reading CRN compressed textures with multiple mip levels. [#5618](https://github.com/CesiumGS/cesium/pull/5618) * Fixed issue where composite 3D Tiles that contained instanced 3D Tiles with an external model reference would fail to download the model. -* Added behavior to `Cesium3DTilesInspector` that selects the first tileset hovered over if no tilest is specified. [#5139](https://github.com/AnalyticalGraphicsInc/cesium/issues/5139) -* Added `Entity.computeModelMatrix` which returns the model matrix representing the entity's transformation. [#5584](https://github.com/AnalyticalGraphicsInc/cesium/pull/5584) -* Added ability to set a style's `color`, `show`, or `pointSize` with a string or object literal. `show` may also take a boolean and `pointSize` may take a number. [#5412](https://github.com/AnalyticalGraphicsInc/cesium/pull/5412) -* Added setter for `KmlDataSource.name` to specify a name for the datasource [#5660](https://github.com/AnalyticalGraphicsInc/cesium/pull/5660). -* Added setter for `GeoJsonDataSource.name` to specify a name for the datasource [#5653](https://github.com/AnalyticalGraphicsInc/cesium/issues/5653) -* Fixed crash when using the `Cesium3DTilesInspectorViewModel` and removing a tileset [#5607](https://github.com/AnalyticalGraphicsInc/cesium/issues/5607) -* Fixed polygon outline in Polygon Sandcastle demo [#5642](https://github.com/AnalyticalGraphicsInc/cesium/issues/5642) -* Updated `Billboard`, `Label` and `PointPrimitive` constructors to clone `NearFarScale` parameters [#5654](https://github.com/AnalyticalGraphicsInc/cesium/pull/5654) -* Added `FrustumGeometry` and `FrustumOutlineGeometry`. [#5649](https://github.com/AnalyticalGraphicsInc/cesium/pull/5649) -* Added an `options` parameter to the constructors of `PerspectiveFrustum`, `PerspectiveOffCenterFrustum`, `OrthographicFrustum`, and `OrthographicOffCenterFrustum` to set properties. [#5649](https://github.com/AnalyticalGraphicsInc/cesium/pull/5649) +* Added behavior to `Cesium3DTilesInspector` that selects the first tileset hovered over if no tilest is specified. [#5139](https://github.com/CesiumGS/cesium/issues/5139) +* Added `Entity.computeModelMatrix` which returns the model matrix representing the entity's transformation. [#5584](https://github.com/CesiumGS/cesium/pull/5584) +* Added ability to set a style's `color`, `show`, or `pointSize` with a string or object literal. `show` may also take a boolean and `pointSize` may take a number. [#5412](https://github.com/CesiumGS/cesium/pull/5412) +* Added setter for `KmlDataSource.name` to specify a name for the datasource [#5660](https://github.com/CesiumGS/cesium/pull/5660). +* Added setter for `GeoJsonDataSource.name` to specify a name for the datasource [#5653](https://github.com/CesiumGS/cesium/issues/5653) +* Fixed crash when using the `Cesium3DTilesInspectorViewModel` and removing a tileset [#5607](https://github.com/CesiumGS/cesium/issues/5607) +* Fixed polygon outline in Polygon Sandcastle demo [#5642](https://github.com/CesiumGS/cesium/issues/5642) +* Updated `Billboard`, `Label` and `PointPrimitive` constructors to clone `NearFarScale` parameters [#5654](https://github.com/CesiumGS/cesium/pull/5654) +* Added `FrustumGeometry` and `FrustumOutlineGeometry`. [#5649](https://github.com/CesiumGS/cesium/pull/5649) +* Added an `options` parameter to the constructors of `PerspectiveFrustum`, `PerspectiveOffCenterFrustum`, `OrthographicFrustum`, and `OrthographicOffCenterFrustum` to set properties. [#5649](https://github.com/CesiumGS/cesium/pull/5649) ### 1.35.2 - 2017-07-11 * This is an npm-only release to fix an issue with using Cesium in Node.js. -* Fixed a bug where Cesium would fail to load under Node.js and some webpack configurations. [#5593](https://github.com/AnalyticalGraphicsInc/cesium/issues/5593) -* Fixed a bug where a Model's compressed textures were not being displayed. [#5596](https://github.com/AnalyticalGraphicsInc/cesium/pull/5596) -* Fixed documentation for `OrthographicFrustum`. [#5586](https://github.com/AnalyticalGraphicsInc/cesium/issues/5586) +* Fixed a bug where Cesium would fail to load under Node.js and some webpack configurations. [#5593](https://github.com/CesiumGS/cesium/issues/5593) +* Fixed a bug where a Model's compressed textures were not being displayed. [#5596](https://github.com/CesiumGS/cesium/pull/5596) +* Fixed documentation for `OrthographicFrustum`. [#5586](https://github.com/CesiumGS/cesium/issues/5586) ### 1.35.1 - 2017-07-05 @@ -1027,7 +1058,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * `GoogleEarthImageryProvider` has been deprecated and will be removed in Cesium 1.37, use `GoogleEarthEnterpriseMapsProvider` instead. * The `throttleRequest` parameter for `TerrainProvider.requestTileGeometry`, `CesiumTerrainProvider.requestTileGeometry`, `VRTheWorldTerrainProvider.requestTileGeometry`, and `EllipsoidTerrainProvider.requestTileGeometry` is deprecated and will be replaced with an optional `Request` object. The `throttleRequests` parameter will be removed in 1.37. Instead set the request's `throttle` property to `true` to throttle requests. * The ability to provide a Promise for the `options.url` parameter of `loadWithXhr` and for the `url` parameter of `loadArrayBuffer`, `loadBlob`, `loadImageViaBlob`, `loadText`, `loadJson`, `loadXML`, `loadImage`, `loadCRN`, `loadKTX`, and `loadCubeMap` is deprecated. This will be removed in 1.37, instead `url` must be a string. -* Added support for [3D Tiles](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/README.md) for streaming massive heterogeneous 3D geospatial datasets ([#5308](https://github.com/AnalyticalGraphicsInc/cesium/pull/5308)). See the new [Sandcastle examples](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Tiles%20Photogrammetry&label=3D%20Tiles). The new Cesium APIs are: +* Added support for [3D Tiles](https://github.com/CesiumGS/3d-tiles/blob/master/README.md) for streaming massive heterogeneous 3D geospatial datasets ([#5308](https://github.com/CesiumGS/cesium/pull/5308)). See the new [Sandcastle examples](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Tiles%20Photogrammetry&label=3D%20Tiles). The new Cesium APIs are: * `Cesium3DTileset` * `Cesium3DTileStyle`, `StyleExpression`, `Expression`, and `ConditionsExpression` * `Cesium3DTile` @@ -1035,63 +1066,63 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * `Cesium3DTileFeature` * `Cesium3DTilesInspector`, `Cesium3DTilesInspectorViewModel`, and `viewerCesium3DTilesInspectorMixin` * `Cesium3DTileColorBlendMode` -* Added a particle system for effects like smoke, fire, sparks, etc. See `ParticleSystem`, `Particle`, `ParticleBurst`, `BoxEmitter`, `CircleEmitter`, `ConeEmitter`, `ParticleEmitter`, and `SphereEmitter`, and the new Sandcastle examples: [Particle System](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Particle%20System.html&label=Showcases) and [Particle System Fireworks](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Particle%20System%20Fireworks.html&label=Showcases). [#5212](https://github.com/AnalyticalGraphicsInc/cesium/pull/5212) +* Added a particle system for effects like smoke, fire, sparks, etc. See `ParticleSystem`, `Particle`, `ParticleBurst`, `BoxEmitter`, `CircleEmitter`, `ConeEmitter`, `ParticleEmitter`, and `SphereEmitter`, and the new Sandcastle examples: [Particle System](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Particle%20System.html&label=Showcases) and [Particle System Fireworks](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Particle%20System%20Fireworks.html&label=Showcases). [#5212](https://github.com/CesiumGS/cesium/pull/5212) * Added `options.clock`, `options.times` and `options.dimensions` to `WebMapTileServiceImageryProvider` in order to handle time dynamic and static values for dimensions. * Added an `options.request` parameter to `loadWithXhr` and a `request` parameter to `loadArrayBuffer`, `loadBlob`, `loadImageViaBlob`, `loadText`, `loadJson`, `loadJsonp`, `loadXML`, `loadImageFromTypedArray`, `loadImage`, `loadCRN`, and `loadKTX`. -* `CzmlDataSource` and `KmlDataSource` load functions now take an optional `query` object, which will append query parameters to all network requests. [#5419](https://github.com/AnalyticalGraphicsInc/cesium/pull/5419), [#5434](https://github.com/AnalyticalGraphicsInc/cesium/pull/5434) -* Added Sandcastle demo for setting time with the Clock API [#5457](https://github.com/AnalyticalGraphicsInc/cesium/pull/5457); -* Added Sandcastle demo for ArcticDEM data. [#5224](https://github.com/AnalyticalGraphicsInc/cesium/issues/5224) +* `CzmlDataSource` and `KmlDataSource` load functions now take an optional `query` object, which will append query parameters to all network requests. [#5419](https://github.com/CesiumGS/cesium/pull/5419), [#5434](https://github.com/CesiumGS/cesium/pull/5434) +* Added Sandcastle demo for setting time with the Clock API [#5457](https://github.com/CesiumGS/cesium/pull/5457); +* Added Sandcastle demo for ArcticDEM data. [#5224](https://github.com/CesiumGS/cesium/issues/5224) * Added `fromIso8601`, `fromIso8601DateArray`, and `fromIso8601DurationArray` to `TimeIntervalCollection` for handling various ways groups of intervals can be specified in ISO8601 format. * Added `fromJulianDateArray` to `TimeIntervalCollection` for generating intervals from a list of dates. -* Fixed geocoder bug so geocoder can accurately handle NSEW inputs [#5407](https://github.com/AnalyticalGraphicsInc/cesium/pull/5407) -* Fixed a bug where picking would break when the Sun came into view [#5478](https://github.com/AnalyticalGraphicsInc/cesium/issues/5478) -* Fixed a bug where picking clusters would return undefined instead of a list of the clustered entities. [#5286](https://github.com/AnalyticalGraphicsInc/cesium/issues/5286) -* Fixed bug where if polylines were set to follow the surface of an undefined globe, Cesium would throw an exception. [#5413](https://github.com/AnalyticalGraphicsInc/cesium/pull/5413) -* Reduced the amount of Sun bloom post-process effect near the horizon. [#5381](https://github.com/AnalyticalGraphicsInc/cesium/issues/5381) -* Fixed a bug where camera zooming worked incorrectly when the display height was greater than the display width [#5421](https://github.com/AnalyticalGraphicsInc/cesium/pull/5421) -* Updated glTF/glb MIME types. [#5420](https://github.com/AnalyticalGraphicsInc/cesium/issues/5420) +* Fixed geocoder bug so geocoder can accurately handle NSEW inputs [#5407](https://github.com/CesiumGS/cesium/pull/5407) +* Fixed a bug where picking would break when the Sun came into view [#5478](https://github.com/CesiumGS/cesium/issues/5478) +* Fixed a bug where picking clusters would return undefined instead of a list of the clustered entities. [#5286](https://github.com/CesiumGS/cesium/issues/5286) +* Fixed bug where if polylines were set to follow the surface of an undefined globe, Cesium would throw an exception. [#5413](https://github.com/CesiumGS/cesium/pull/5413) +* Reduced the amount of Sun bloom post-process effect near the horizon. [#5381](https://github.com/CesiumGS/cesium/issues/5381) +* Fixed a bug where camera zooming worked incorrectly when the display height was greater than the display width [#5421](https://github.com/CesiumGS/cesium/pull/5421) +* Updated glTF/glb MIME types. [#5420](https://github.com/CesiumGS/cesium/issues/5420) * Added `Cesium.Math.randomBetween`. -* Modified `defaultValue` to check for both `undefined` and `null`. [#5551](https://github.com/AnalyticalGraphicsInc/cesium/pull/5551) +* Modified `defaultValue` to check for both `undefined` and `null`. [#5551](https://github.com/CesiumGS/cesium/pull/5551) * The `throttleRequestByServer` function has been removed. Instead pass a `Request` object with `throttleByServer` set to `true` to any of following load functions: `loadWithXhr`, `loadArrayBuffer`, `loadBlob`, `loadImageViaBlob`, `loadText`, `loadJson`, `loadJsonp`, `loadXML`, `loadImageFromTypedArray`, `loadImage`, `loadCRN`, and `loadKTX`. ### 1.34 - 2017-06-01 * Deprecated * Passing `options.clock` when creating a new `Viewer` instance has been deprecated and will be removed in Cesium 1.37, pass `options.clockViewModel` instead. -* Fix issue where polylines in a `PolylineCollection` would ignore the far distance when updating the distance display condition. [#5283](https://github.com/AnalyticalGraphicsInc/cesium/pull/5283) +* Fix issue where polylines in a `PolylineCollection` would ignore the far distance when updating the distance display condition. [#5283](https://github.com/CesiumGS/cesium/pull/5283) * Fixed a crash when calling `Camera.pickEllipsoid` with a canvas of size 0. -* Fix `BoundingSphere.fromOrientedBoundingBox`. [#5334](https://github.com/AnalyticalGraphicsInc/cesium/issues/5334) -* Fixed bug where polylines would not update when `PolylineCollection` model matrix was updated. [#5327](https://github.com/AnalyticalGraphicsInc/cesium/pull/5327) -* Fixed a bug where adding a ground clamped label without a position would show up at a previous label's clamped position. [#5338](https://github.com/AnalyticalGraphicsInc/cesium/issues/5338) -* Fixed translucency bug for certain material types. [#5335](https://github.com/AnalyticalGraphicsInc/cesium/pull/5335) -* Fix picking polylines that use a depth fail appearance. [#5337](https://github.com/AnalyticalGraphicsInc/cesium/pull/5337) -* Fixed a crash when morphing from Columbus view to 3D. [#5311](https://github.com/AnalyticalGraphicsInc/cesium/issues/5311) -* Fixed a bug which prevented KML descriptions with relative paths from loading. [#5352](https://github.com/AnalyticalGraphicsInc/cesium/pull/5352) -* Fixed an issue where camera view could be invalid at the last frame of animation. [#4949](https://github.com/AnalyticalGraphicsInc/cesium/issues/4949) -* Fixed an issue where using the depth fail material for polylines would cause a crash in Edge. [#5359](https://github.com/AnalyticalGraphicsInc/cesium/pull/5359) -* Fixed a crash where `EllipsoidGeometry` and `EllipsoidOutlineGeometry` were given floating point values when expecting integers. [#5260](https://github.com/AnalyticalGraphicsInc/cesium/issues/5260) -* Fixed an issue where billboards were not properly aligned. [#2487](https://github.com/AnalyticalGraphicsInc/cesium/issues/2487) -* Fixed an issue where translucent objects could flicker when picking on mouse move. [#5307](https://github.com/AnalyticalGraphicsInc/cesium/issues/5307) -* Fixed a bug where billboards with `sizeInMeters` set to true would move upwards when zooming out. [#5373](https://github.com/AnalyticalGraphicsInc/cesium/issues/5373) -* Fixed a bug where `SampledProperty.setInterpolationOptions` does not ignore undefined `options`. [#3575](https://github.com/AnalyticalGraphicsInc/cesium/issues/3575) -* Added `basePath` option to `Cesium.Model.fromGltf`. [#5320](https://github.com/AnalyticalGraphicsInc/cesium/issues/5320) +* Fix `BoundingSphere.fromOrientedBoundingBox`. [#5334](https://github.com/CesiumGS/cesium/issues/5334) +* Fixed bug where polylines would not update when `PolylineCollection` model matrix was updated. [#5327](https://github.com/CesiumGS/cesium/pull/5327) +* Fixed a bug where adding a ground clamped label without a position would show up at a previous label's clamped position. [#5338](https://github.com/CesiumGS/cesium/issues/5338) +* Fixed translucency bug for certain material types. [#5335](https://github.com/CesiumGS/cesium/pull/5335) +* Fix picking polylines that use a depth fail appearance. [#5337](https://github.com/CesiumGS/cesium/pull/5337) +* Fixed a crash when morphing from Columbus view to 3D. [#5311](https://github.com/CesiumGS/cesium/issues/5311) +* Fixed a bug which prevented KML descriptions with relative paths from loading. [#5352](https://github.com/CesiumGS/cesium/pull/5352) +* Fixed an issue where camera view could be invalid at the last frame of animation. [#4949](https://github.com/CesiumGS/cesium/issues/4949) +* Fixed an issue where using the depth fail material for polylines would cause a crash in Edge. [#5359](https://github.com/CesiumGS/cesium/pull/5359) +* Fixed a crash where `EllipsoidGeometry` and `EllipsoidOutlineGeometry` were given floating point values when expecting integers. [#5260](https://github.com/CesiumGS/cesium/issues/5260) +* Fixed an issue where billboards were not properly aligned. [#2487](https://github.com/CesiumGS/cesium/issues/2487) +* Fixed an issue where translucent objects could flicker when picking on mouse move. [#5307](https://github.com/CesiumGS/cesium/issues/5307) +* Fixed a bug where billboards with `sizeInMeters` set to true would move upwards when zooming out. [#5373](https://github.com/CesiumGS/cesium/issues/5373) +* Fixed a bug where `SampledProperty.setInterpolationOptions` does not ignore undefined `options`. [#3575](https://github.com/CesiumGS/cesium/issues/3575) +* Added `basePath` option to `Cesium.Model.fromGltf`. [#5320](https://github.com/CesiumGS/cesium/issues/5320) ### 1.33 - 2017-05-01 * Breaking changes - * Removed left, right, bottom and top properties from `OrthographicFrustum`. Use `OrthographicOffCenterFrustum` instead. [#5109](https://github.com/AnalyticalGraphicsInc/cesium/issues/5109) -* Added `GoogleEarthEnterpriseTerrainProvider` and `GoogleEarthEnterpriseImageryProvider` to read data from Google Earth Enterprise servers. [#5189](https://github.com/AnalyticalGraphicsInc/cesium/pull/5189). -* Support for dashed polylines [#5159](https://github.com/AnalyticalGraphicsInc/cesium/pull/5159). + * Removed left, right, bottom and top properties from `OrthographicFrustum`. Use `OrthographicOffCenterFrustum` instead. [#5109](https://github.com/CesiumGS/cesium/issues/5109) +* Added `GoogleEarthEnterpriseTerrainProvider` and `GoogleEarthEnterpriseImageryProvider` to read data from Google Earth Enterprise servers. [#5189](https://github.com/CesiumGS/cesium/pull/5189). +* Support for dashed polylines [#5159](https://github.com/CesiumGS/cesium/pull/5159). * Added `PolylineDash` Material type. * Added `PolylineDashMaterialProperty` to the Entity API. * Added CZML `polylineDash` property . -* Added `disableDepthTestDistance` to billboards, points and labels. This sets the distance to the camera where the depth test will be disabled. Setting it to zero (the default) will always enable the depth test. Setting it to `Number.POSITVE_INFINITY` will never enabled the depth test. Also added `scene.minimumDisableDepthTestDistance` to change the default value from zero. [#5166](https://github.com/AnalyticalGraphicsInc/cesium/pull/5166) -* Added a `depthFailMaterial` property to line entities, which is the material used to render the line when it fails the depth test. [#5160](https://github.com/AnalyticalGraphicsInc/cesium/pull/5160) -* Fixed billboards not initially clustering. [#5208](https://github.com/AnalyticalGraphicsInc/cesium/pull/5208) -* Fixed issue with displaying `MapboxImageryProvider` default token error message. [#5191](https://github.com/AnalyticalGraphicsInc/cesium/pull/5191) -* Fixed bug in conversion formula in `Matrix3.fromHeadingPitchRoll`. [#5195](https://github.com/AnalyticalGraphicsInc/cesium/issues/5195) -* Upgrade FXAA to version 3.11. [#5200](https://github.com/AnalyticalGraphicsInc/cesium/pull/5200) -* `Scene.pickPosition` now caches results per frame to increase performance. [#5117](https://github.com/AnalyticalGraphicsInc/cesium/issues/5117) +* Added `disableDepthTestDistance` to billboards, points and labels. This sets the distance to the camera where the depth test will be disabled. Setting it to zero (the default) will always enable the depth test. Setting it to `Number.POSITVE_INFINITY` will never enabled the depth test. Also added `scene.minimumDisableDepthTestDistance` to change the default value from zero. [#5166](https://github.com/CesiumGS/cesium/pull/5166) +* Added a `depthFailMaterial` property to line entities, which is the material used to render the line when it fails the depth test. [#5160](https://github.com/CesiumGS/cesium/pull/5160) +* Fixed billboards not initially clustering. [#5208](https://github.com/CesiumGS/cesium/pull/5208) +* Fixed issue with displaying `MapboxImageryProvider` default token error message. [#5191](https://github.com/CesiumGS/cesium/pull/5191) +* Fixed bug in conversion formula in `Matrix3.fromHeadingPitchRoll`. [#5195](https://github.com/CesiumGS/cesium/issues/5195) +* Upgrade FXAA to version 3.11. [#5200](https://github.com/CesiumGS/cesium/pull/5200) +* `Scene.pickPosition` now caches results per frame to increase performance. [#5117](https://github.com/CesiumGS/cesium/issues/5117) ### 1.32 - 2017-04-03 @@ -1101,168 +1132,168 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Removed `ArcGisImageServerTerrainProvider`. * The top-level `properties` in an `Entity` created by `GeoJsonDataSource` are now instances of `ConstantProperty` instead of raw values. * Added support for an orthographic projection in 3D and Columbus view. - * Set `projectionPicker` to `true` in the options when creating a `Viewer` to add a widget that will switch projections. [#5021](https://github.com/AnalyticalGraphicsInc/cesium/pull/5021) + * Set `projectionPicker` to `true` in the options when creating a `Viewer` to add a widget that will switch projections. [#5021](https://github.com/CesiumGS/cesium/pull/5021) * Call `switchToOrthographicFrustum` or `switchToPerspectiveFrustum` on `Camera` to change projections. -* Added support for custom time-varying properties in CZML. [#5105](https:/github.com/AnalyticalGraphicsInc/cesium/pull/5105). -* Added new flight parameters to `Camera.flyTo` and `Camera.flyToBoundingSphere`: `flyOverLongitude`, `flyOverLongitudeWeight`, and `pitchAdjustHeight`. [#5070](https://github.com/AnalyticalGraphicsInc/cesium/pull/5070) -* Added the event `Viewer.trackedEntityChanged`, which is raised when the value of `viewer.trackedEntity` changes. [#5060](https://github.com/AnalyticalGraphicsInc/cesium/pull/5060) -* Added `Camera.DEFAULT_OFFSET` for default view of objects with bounding spheres. [#4936](https://github.com/AnalyticalGraphicsInc/cesium/pull/4936) -* Fixed an issue with `TileBoundingBox` that caused the terrain to disappear in certain places [4032](https://github.com/AnalyticalGraphicsInc/cesium/issues/4032) -* Fixed overlapping billboard blending. [#5066](https://github.com/AnalyticalGraphicsInc/cesium/pull/5066) -* Fixed an issue with `PinBuilder` where inset images could have low-alpha fringes against an opaque background. [#5099](https://github.com/AnalyticalGraphicsInc/cesium/pull/5099) -* Fix billboard, point and label clustering in 2D and Columbus view. [#5136](https://github.com/AnalyticalGraphicsInc/cesium/pull/5136) -* Fixed `GroundPrimitive` rendering in 2D and Columbus View. [#5078](https://github.com/AnalyticalGraphicsInc/cesium/pull/5078) -* Fixed an issue with camera tracking of dynamic ellipsoids. [#5133](https://github.com/AnalyticalGraphicsInc/cesium/pull/5133) -* Fixed issues with imagerySplitPosition and the international date line in 2D mode. [#5151](https://github.com/AnalyticalGraphicsInc/cesium/pull/5151) -* Fixed a bug in `ModelAnimationCache` causing different animations to reference the same animation. [#5064](https://github.com/AnalyticalGraphicsInc/cesium/pull/5064) +* Added support for custom time-varying properties in CZML. [#5105](https:/github.com/CesiumGS/cesium/pull/5105). +* Added new flight parameters to `Camera.flyTo` and `Camera.flyToBoundingSphere`: `flyOverLongitude`, `flyOverLongitudeWeight`, and `pitchAdjustHeight`. [#5070](https://github.com/CesiumGS/cesium/pull/5070) +* Added the event `Viewer.trackedEntityChanged`, which is raised when the value of `viewer.trackedEntity` changes. [#5060](https://github.com/CesiumGS/cesium/pull/5060) +* Added `Camera.DEFAULT_OFFSET` for default view of objects with bounding spheres. [#4936](https://github.com/CesiumGS/cesium/pull/4936) +* Fixed an issue with `TileBoundingBox` that caused the terrain to disappear in certain places [4032](https://github.com/CesiumGS/cesium/issues/4032) +* Fixed overlapping billboard blending. [#5066](https://github.com/CesiumGS/cesium/pull/5066) +* Fixed an issue with `PinBuilder` where inset images could have low-alpha fringes against an opaque background. [#5099](https://github.com/CesiumGS/cesium/pull/5099) +* Fix billboard, point and label clustering in 2D and Columbus view. [#5136](https://github.com/CesiumGS/cesium/pull/5136) +* Fixed `GroundPrimitive` rendering in 2D and Columbus View. [#5078](https://github.com/CesiumGS/cesium/pull/5078) +* Fixed an issue with camera tracking of dynamic ellipsoids. [#5133](https://github.com/CesiumGS/cesium/pull/5133) +* Fixed issues with imagerySplitPosition and the international date line in 2D mode. [#5151](https://github.com/CesiumGS/cesium/pull/5151) +* Fixed a bug in `ModelAnimationCache` causing different animations to reference the same animation. [#5064](https://github.com/CesiumGS/cesium/pull/5064) * `ConstantProperty` now provides `valueOf` and `toString` methods that return the constant value. -* Improved depth artifacts between opaque and translucent primitives. [#5116](https://github.com/AnalyticalGraphicsInc/cesium/pull/5116) -* Fixed crunch compressed textures in IE11. [#5057](https://github.com/AnalyticalGraphicsInc/cesium/pull/5057) +* Improved depth artifacts between opaque and translucent primitives. [#5116](https://github.com/CesiumGS/cesium/pull/5116) +* Fixed crunch compressed textures in IE11. [#5057](https://github.com/CesiumGS/cesium/pull/5057) * Fixed a bug in `Quaternion.fromHeadingPitchRoll` that made it erroneously throw an exception when passed individual angles in an unminified / debug build. * Fixed a bug that caused an exception in `CesiumInspectorViewModel` when using the NW / NE / SW / SE / Parent buttons to navigate to a terrain tile that is not yet loaded. -* `QuadtreePrimitive` now uses `frameState.afterRender` to fire `tileLoadProgressEvent` [#3450](https://github.com/AnalyticalGraphicsInc/cesium/issues/3450) +* `QuadtreePrimitive` now uses `frameState.afterRender` to fire `tileLoadProgressEvent` [#3450](https://github.com/CesiumGS/cesium/issues/3450) ### 1.31 - 2017-03-01 * Deprecated - * The function `Quaternion.fromHeadingPitchRoll(heading, pitch, roll, result)` will be removed in 1.33. Use `Quaternion.fromHeadingPitchRoll(hpr, result)` instead where `hpr` is a `HeadingPitchRoll`. [#4896](https://github.com/AnalyticalGraphicsInc/cesium/pull/4896) - * The function `Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)` will be removed in 1.33. Use `Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)` instead where `fixedFrameTransform` is a a 4x4 transformation matrix (see `Transforms.localFrameToFixedFrameGenerator`). [#4896](https://github.com/AnalyticalGraphicsInc/cesium/pull/4896) - * The function `Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)` will be removed in 1.33. Use `Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)` instead where `fixedFrameTransform` is a a 4x4 transformation matrix (see `Transforms.localFrameToFixedFrameGenerator`). [#4896](https://github.com/AnalyticalGraphicsInc/cesium/pull/4896) - * `ArcGisImageServerTerrainProvider` will be removed in 1.32 due to missing TIFF support in web browsers. [#4981](https://github.com/AnalyticalGraphicsInc/cesium/pull/4981) + * The function `Quaternion.fromHeadingPitchRoll(heading, pitch, roll, result)` will be removed in 1.33. Use `Quaternion.fromHeadingPitchRoll(hpr, result)` instead where `hpr` is a `HeadingPitchRoll`. [#4896](https://github.com/CesiumGS/cesium/pull/4896) + * The function `Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)` will be removed in 1.33. Use `Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)` instead where `fixedFrameTransform` is a a 4x4 transformation matrix (see `Transforms.localFrameToFixedFrameGenerator`). [#4896](https://github.com/CesiumGS/cesium/pull/4896) + * The function `Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)` will be removed in 1.33. Use `Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)` instead where `fixedFrameTransform` is a a 4x4 transformation matrix (see `Transforms.localFrameToFixedFrameGenerator`). [#4896](https://github.com/CesiumGS/cesium/pull/4896) + * `ArcGisImageServerTerrainProvider` will be removed in 1.32 due to missing TIFF support in web browsers. [#4981](https://github.com/CesiumGS/cesium/pull/4981) * Breaking changes - * Corrected spelling of `Color.FUCHSIA` from `Color.FUSCHIA`. [#4977](https://github.com/AnalyticalGraphicsInc/cesium/pull/4977) - * The enums `MIDDLE_DOUBLE_CLICK` and `RIGHT_DOUBLE_CLICK` from `ScreenSpaceEventType` have been removed. [#5052](https://github.com/AnalyticalGraphicsInc/cesium/pull/5052) - * Removed the function `GeometryPipeline.computeBinormalAndTangent`. Use `GeometryPipeline.computeTangentAndBitangent` instead. [#5053](https://github.com/AnalyticalGraphicsInc/cesium/pull/5053) - * Removed the `url` and `key` properties from `GeocoderViewModel`. [#5056](https://github.com/AnalyticalGraphicsInc/cesium/pull/5056) - * `BingMapsGeocoderServices` now requires `options.scene`. [#5056](https://github.com/AnalyticalGraphicsInc/cesium/pull/5056) -* Added compressed texture support. [#4758](https://github.com/AnalyticalGraphicsInc/cesium/pull/4758) + * Corrected spelling of `Color.FUCHSIA` from `Color.FUSCHIA`. [#4977](https://github.com/CesiumGS/cesium/pull/4977) + * The enums `MIDDLE_DOUBLE_CLICK` and `RIGHT_DOUBLE_CLICK` from `ScreenSpaceEventType` have been removed. [#5052](https://github.com/CesiumGS/cesium/pull/5052) + * Removed the function `GeometryPipeline.computeBinormalAndTangent`. Use `GeometryPipeline.computeTangentAndBitangent` instead. [#5053](https://github.com/CesiumGS/cesium/pull/5053) + * Removed the `url` and `key` properties from `GeocoderViewModel`. [#5056](https://github.com/CesiumGS/cesium/pull/5056) + * `BingMapsGeocoderServices` now requires `options.scene`. [#5056](https://github.com/CesiumGS/cesium/pull/5056) +* Added compressed texture support. [#4758](https://github.com/CesiumGS/cesium/pull/4758) * glTF models and imagery layers can now reference [KTX](https://www.khronos.org/opengles/sdk/tools/KTX/) textures and textures compressed with [crunch](https://github.com/BinomialLLC/crunch). * Added `loadKTX`, to load KTX textures, and `loadCRN` to load crunch compressed textures. * Added new `PixelFormat` and `WebGLConstants` enums from WebGL extensions `WEBGL_compressed_s3tc`, `WEBGL_compressed_texture_pvrtc`, and `WEBGL_compressed_texture_etc1`. * Added `CompressedTextureBuffer`. -* Added support for `Scene.pickPosition` in Columbus view and 2D. [#4990](https://github.com/AnalyticalGraphicsInc/cesium/pull/4990) -* Added support for depth picking translucent primitives when `Scene.pickTranslucentDepth` is `true`. [#4979](https://github.com/AnalyticalGraphicsInc/cesium/pull/4979) -* Fixed an issue where the camera would zoom past an object and flip to the other side of the globe. [#4967](https://github.com/AnalyticalGraphicsInc/cesium/pull/4967) and [#4982](https://github.com/AnalyticalGraphicsInc/cesium/pull/4982) -* Enable rendering `GroundPrimitives` on hardware without the `EXT_frag_depth` extension; however, this could cause artifacts for certain viewing angles. [#4930](https://github.com/AnalyticalGraphicsInc/cesium/pull/4930) -* Added `Transforms.localFrameToFixedFrameGenerator` to generate a function that computes a 4x4 transformation matrix from a local reference frame to fixed reference frame. [#4896](https://github.com/AnalyticalGraphicsInc/cesium/pull/4896) -* Added `Label.scaleByDistance` to control minimum/maximum label size based on distance from the camera. [#5019](https://github.com/AnalyticalGraphicsInc/cesium/pull/5019) -* Added support to `DebugCameraPrimitive` to draw multifrustum planes. The attribute `debugShowFrustumPlanes` of `Scene` and `frustumPlanes` of `CesiumInspector` toggle this. [#4932](https://github.com/AnalyticalGraphicsInc/cesium/pull/4932) -* Added fix to always outline KML line extrusions so that they show up properly in 2D and other straight down views. [#4961](https://github.com/AnalyticalGraphicsInc/cesium/pull/4961) -* Improved `RectangleGeometry` by skipping unnecessary logic in the code. [#4948](https://github.com/AnalyticalGraphicsInc/cesium/pull/4948) -* Fixed exception for polylines in 2D when rotating the map. [#4619](https://github.com/AnalyticalGraphicsInc/cesium/issues/4619) -* Fixed an issue with constant `VertexArray` attributes not being set correctly. [#4995](https://github.com/AnalyticalGraphicsInc/cesium/pull/4995) -* Added the event `Viewer.selectedEntityChanged`, which is raised when the value of `viewer.selectedEntity` changes. [#5043](https://github.com/AnalyticalGraphicsInc/cesium/pull/5043) +* Added support for `Scene.pickPosition` in Columbus view and 2D. [#4990](https://github.com/CesiumGS/cesium/pull/4990) +* Added support for depth picking translucent primitives when `Scene.pickTranslucentDepth` is `true`. [#4979](https://github.com/CesiumGS/cesium/pull/4979) +* Fixed an issue where the camera would zoom past an object and flip to the other side of the globe. [#4967](https://github.com/CesiumGS/cesium/pull/4967) and [#4982](https://github.com/CesiumGS/cesium/pull/4982) +* Enable rendering `GroundPrimitives` on hardware without the `EXT_frag_depth` extension; however, this could cause artifacts for certain viewing angles. [#4930](https://github.com/CesiumGS/cesium/pull/4930) +* Added `Transforms.localFrameToFixedFrameGenerator` to generate a function that computes a 4x4 transformation matrix from a local reference frame to fixed reference frame. [#4896](https://github.com/CesiumGS/cesium/pull/4896) +* Added `Label.scaleByDistance` to control minimum/maximum label size based on distance from the camera. [#5019](https://github.com/CesiumGS/cesium/pull/5019) +* Added support to `DebugCameraPrimitive` to draw multifrustum planes. The attribute `debugShowFrustumPlanes` of `Scene` and `frustumPlanes` of `CesiumInspector` toggle this. [#4932](https://github.com/CesiumGS/cesium/pull/4932) +* Added fix to always outline KML line extrusions so that they show up properly in 2D and other straight down views. [#4961](https://github.com/CesiumGS/cesium/pull/4961) +* Improved `RectangleGeometry` by skipping unnecessary logic in the code. [#4948](https://github.com/CesiumGS/cesium/pull/4948) +* Fixed exception for polylines in 2D when rotating the map. [#4619](https://github.com/CesiumGS/cesium/issues/4619) +* Fixed an issue with constant `VertexArray` attributes not being set correctly. [#4995](https://github.com/CesiumGS/cesium/pull/4995) +* Added the event `Viewer.selectedEntityChanged`, which is raised when the value of `viewer.selectedEntity` changes. [#5043](https://github.com/CesiumGS/cesium/pull/5043) ### 1.30 - 2017-02-01 * Deprecated * The properties `url` and `key` will be removed from `GeocoderViewModel` in 1.31. These properties will be available on geocoder services that support them, like `BingMapsGeocoderService`. - * The function `GeometryPipeline.computeBinormalAndTangent` will be removed in 1.31. Use `GeometryPipeline.createTangentAndBitangent` instead. [#4856](https://github.com/AnalyticalGraphicsInc/cesium/pull/4856) - * The enums `MIDDLE_DOUBLE_CLICK` and `RIGHT_DOUBLE_CLICK` from `ScreenSpaceEventType` have been deprecated and will be removed in 1.31. [#4910](https://github.com/AnalyticalGraphicsInc/cesium/pull/4910) + * The function `GeometryPipeline.computeBinormalAndTangent` will be removed in 1.31. Use `GeometryPipeline.createTangentAndBitangent` instead. [#4856](https://github.com/CesiumGS/cesium/pull/4856) + * The enums `MIDDLE_DOUBLE_CLICK` and `RIGHT_DOUBLE_CLICK` from `ScreenSpaceEventType` have been deprecated and will be removed in 1.31. [#4910](https://github.com/CesiumGS/cesium/pull/4910) * Breaking changes - * Removed separate `heading`, `pitch`, `roll` parameters from `Transform.headingPitchRollToFixedFrame` and `Transform.headingPitchRollQuaternion`. Pass a `HeadingPitchRoll` object instead. [#4843](https://github.com/AnalyticalGraphicsInc/cesium/pull/4843) - * The property `binormal` has been renamed to `bitangent` for `Geometry` and `VertexFormat`. [#4856](https://github.com/AnalyticalGraphicsInc/cesium/pull/4856) - * A handful of `CesiumInspectorViewModel` properties were removed or changed from variables to functions. [#4857](https://github.com/AnalyticalGraphicsInc/cesium/pull/4857) - * The `ShadowMap` constructor has been made private. [#4010](https://github.com/AnalyticalGraphicsInc/cesium/issues/4010) + * Removed separate `heading`, `pitch`, `roll` parameters from `Transform.headingPitchRollToFixedFrame` and `Transform.headingPitchRollQuaternion`. Pass a `HeadingPitchRoll` object instead. [#4843](https://github.com/CesiumGS/cesium/pull/4843) + * The property `binormal` has been renamed to `bitangent` for `Geometry` and `VertexFormat`. [#4856](https://github.com/CesiumGS/cesium/pull/4856) + * A handful of `CesiumInspectorViewModel` properties were removed or changed from variables to functions. [#4857](https://github.com/CesiumGS/cesium/pull/4857) + * The `ShadowMap` constructor has been made private. [#4010](https://github.com/CesiumGS/cesium/issues/4010) * Added `sampleTerrainMostDetailed` to sample the height of an array of positions using the best available terrain data at each point. This requires a `TerrainProvider` with the `availability` property. -* Transparent parts of billboards, labels, and points no longer overwrite parts of the scene behind them. [#4886](https://github.com/AnalyticalGraphicsInc/cesium/pull/4886) +* Transparent parts of billboards, labels, and points no longer overwrite parts of the scene behind them. [#4886](https://github.com/CesiumGS/cesium/pull/4886) * Added `blendOption` property to `BillboardCollection`, `LabelCollection`, and `PointPrimitiveCollection`. The default is `BlendOption.OPAQUE_AND_TRANSLUCENT`; however, if all billboards, labels, or points are either completely opaque or completely translucent, `blendOption` can be changed to `BlendOption.OPAQUE` or `BlendOption.TRANSLUCENT`, respectively, to increase performance by up to 2x. -* Added support for custom geocoder services and autocomplete, see the [Sandcastle example](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Custom%20Geocoder.html). Added `GeocoderService`, an interface for geocoders, and `BingMapsGeocoderService` and `CartographicGeocoderService` implementations. [#4723](https://github.com/AnalyticalGraphicsInc/cesium/pull/4723) +* Added support for custom geocoder services and autocomplete, see the [Sandcastle example](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Custom%20Geocoder.html). Added `GeocoderService`, an interface for geocoders, and `BingMapsGeocoderService` and `CartographicGeocoderService` implementations. [#4723](https://github.com/CesiumGS/cesium/pull/4723) * Added ability to draw an `ImageryLayer` with a splitter to allow layers to only display to the left or right of a splitter. See `ImageryLayer.splitDirection`, `Scene.imagerySplitPosition`, and the [Sandcastle example](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Imagery%20Layers%20Split.html&label=Showcases). -* Fixed bug where `GroundPrimitives` where rendering incorrectly or disappearing at different zoom levels. [#4161](https://github.com/AnalyticalGraphicsInc/cesium/issues/4161), [#4326](https://github.com/AnalyticalGraphicsInc/cesium/issues/4326) +* Fixed bug where `GroundPrimitives` where rendering incorrectly or disappearing at different zoom levels. [#4161](https://github.com/CesiumGS/cesium/issues/4161), [#4326](https://github.com/CesiumGS/cesium/issues/4326) * `TerrainProvider` now optionally exposes an `availability` property that can be used to query the terrain level that is available at a location or in a rectangle. Currently only `CesiumTerrainProvider` exposes this property. * Added support for WMS version 1.3 by using CRS vice SRS query string parameter to request projection. SRS is still used for older versions. -* Fixed a bug that caused all models to use the same highlight color. [#4798] (https://github.com/AnalyticalGraphicsInc/cesium/pull/4798) -* Fixed sky atmosphere from causing incorrect picking and hanging drill picking. [#4783](https://github.com/AnalyticalGraphicsInc/cesium/issues/4783) and [#4784](https://github.com/AnalyticalGraphicsInc/cesium/issues/4784) -* Fixed KML loading when color is an empty string. [#4826](https://github.com/AnalyticalGraphicsInc/cesium/pull/4826) +* Fixed a bug that caused all models to use the same highlight color. [#4798] (https://github.com/CesiumGS/cesium/pull/4798) +* Fixed sky atmosphere from causing incorrect picking and hanging drill picking. [#4783](https://github.com/CesiumGS/cesium/issues/4783) and [#4784](https://github.com/CesiumGS/cesium/issues/4784) +* Fixed KML loading when color is an empty string. [#4826](https://github.com/CesiumGS/cesium/pull/4826) * Fixed a bug that could cause a "readyImagery is not actually ready" exception when quickly zooming past the maximum available imagery level of an imagery layer near the poles. -* Fixed a bug that affected dynamic graphics with time-dynamic modelMatrix. [#4907](https://github.com/AnalyticalGraphicsInc/cesium/pull/4907) -* Fixed `Geocoder` autocomplete drop down visibility in Firefox. [#4916](https://github.com/AnalyticalGraphicsInc/cesium/issues/4916) +* Fixed a bug that affected dynamic graphics with time-dynamic modelMatrix. [#4907](https://github.com/CesiumGS/cesium/pull/4907) +* Fixed `Geocoder` autocomplete drop down visibility in Firefox. [#4916](https://github.com/CesiumGS/cesium/issues/4916) * Added `Rectangle.fromRadians`. -* Updated the morph so the default view in Columbus View is now angled. [#3878](https://github.com/AnalyticalGraphicsInc/cesium/issues/3878) -* Added 2D and Columbus View support for models using the RTC extension or whose vertices are in WGS84 coordinates. [#4922](https://github.com/AnalyticalGraphicsInc/cesium/pull/4922) +* Updated the morph so the default view in Columbus View is now angled. [#3878](https://github.com/CesiumGS/cesium/issues/3878) +* Added 2D and Columbus View support for models using the RTC extension or whose vertices are in WGS84 coordinates. [#4922](https://github.com/CesiumGS/cesium/pull/4922) * The attribute `perInstanceAttribute` of `DebugAppearance` has been made optional and defaults to `false`. -* Fixed a bug that would cause a crash when `debugShowFrustums` is enabled with OIT. [#4864](https://github.com/AnalyticalGraphicsInc/cesium/pull/4864) -* Added the ability to run the unit tests with a [WebGL Stub](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/TestingGuide#run-with-webgl-stub), which makes all WebGL calls a noop and ignores test expectations that rely on reading back from WebGL. Use the web link from the main index.html or run with `npm run test-webgl-stub`. +* Fixed a bug that would cause a crash when `debugShowFrustums` is enabled with OIT. [#4864](https://github.com/CesiumGS/cesium/pull/4864) +* Added the ability to run the unit tests with a [WebGL Stub](https://github.com/CesiumGS/cesium/tree/master/Documentation/Contributors/TestingGuide#run-with-webgl-stub), which makes all WebGL calls a noop and ignores test expectations that rely on reading back from WebGL. Use the web link from the main index.html or run with `npm run test-webgl-stub`. ### 1.29 - 2017-01-02 * Improved 3D Models - * Added the ability to blend a `Model` with a color/translucency. Added `color`, `colorBlendMode`, and `colorBlendAmount` properties to `Model`, `ModelGraphics`, and CZML. Also added `ColorBlendMode` enum. [#4547](https://github.com/AnalyticalGraphicsInc/cesium/pull/4547) - * Added the ability to render a `Model` with a silhouette. Added `silhouetteColor` and `silhouetteSize` properties to `Model`, `ModelGraphics`, and CZML. [#4314](https://github.com/AnalyticalGraphicsInc/cesium/pull/4314) + * Added the ability to blend a `Model` with a color/translucency. Added `color`, `colorBlendMode`, and `colorBlendAmount` properties to `Model`, `ModelGraphics`, and CZML. Also added `ColorBlendMode` enum. [#4547](https://github.com/CesiumGS/cesium/pull/4547) + * Added the ability to render a `Model` with a silhouette. Added `silhouetteColor` and `silhouetteSize` properties to `Model`, `ModelGraphics`, and CZML. [#4314](https://github.com/CesiumGS/cesium/pull/4314) * Improved Labels * Added new `Label` properties `showBackground`, `backgroundColor`, and `backgroundPadding` to the primitive, Entity, and CZML layers. * Added support for newlines (`\n`) in Cesium `Label`s and CZML. [#2402] * Added new enum `VerticalOrigin.BASELINE`. Previously, `VerticalOrigin.BOTTOM` would sometimes align to the baseline depending on the contents of a label. -(https://github.com/AnalyticalGraphicsInc/cesium/issues/2402) -* Fixed translucency in Firefox 50. [#4762](https://github.com/AnalyticalGraphicsInc/cesium/pull/4762) -* Fixed texture rotation for `RectangleGeometry`. [#2737](https://github.com/AnalyticalGraphicsInc/cesium/issues/2737) -* Fixed issue where billboards on terrain had an incorrect offset. [#4598](https://github.com/AnalyticalGraphicsInc/cesium/issues/4598) -* Fixed issue where `globe.getHeight` incorrectly returned `undefined`. [#3411](https://github.com/AnalyticalGraphicsInc/cesium/issues/3411) -* Fixed a crash when using Entity path visualization with reference properties. [#4915](https://github.com/AnalyticalGraphicsInc/cesium/issues/4915) -* Fixed a bug that caused `GroundPrimitive` to render incorrectly on systems without the `WEBGL_depth_texture` extension. [#4747](https://github.com/AnalyticalGraphicsInc/cesium/pull/4747) +(https://github.com/CesiumGS/cesium/issues/2402) +* Fixed translucency in Firefox 50. [#4762](https://github.com/CesiumGS/cesium/pull/4762) +* Fixed texture rotation for `RectangleGeometry`. [#2737](https://github.com/CesiumGS/cesium/issues/2737) +* Fixed issue where billboards on terrain had an incorrect offset. [#4598](https://github.com/CesiumGS/cesium/issues/4598) +* Fixed issue where `globe.getHeight` incorrectly returned `undefined`. [#3411](https://github.com/CesiumGS/cesium/issues/3411) +* Fixed a crash when using Entity path visualization with reference properties. [#4915](https://github.com/CesiumGS/cesium/issues/4915) +* Fixed a bug that caused `GroundPrimitive` to render incorrectly on systems without the `WEBGL_depth_texture` extension. [#4747](https://github.com/CesiumGS/cesium/pull/4747) * Fixed default Mapbox token and added a watermark to notify users that they need to sign up for their own token. -* Fixed glTF models with skinning that used `bindShapeMatrix`. [#4722](https://github.com/AnalyticalGraphicsInc/cesium/issues/4722) +* Fixed glTF models with skinning that used `bindShapeMatrix`. [#4722](https://github.com/CesiumGS/cesium/issues/4722) * Fixed a bug that could cause a "readyImagery is not actually ready" exception with some configurations of imagery layers. -* Fixed `Rectangle.union` to correctly account for rectangles that cross the IDL. [#4732](https://github.com/AnalyticalGraphicsInc/cesium/pull/4732) -* Fixed tooltips for gallery thumbnails in Sandcastle [#4702].(https://github.com/AnalyticalGraphicsInc/cesium/pull/4702) -* DataSourceClock.getValue now preserves the provided `result` properties when its properties are `undefined`. [#4029](https://github.com/AnalyticalGraphicsInc/cesium/issues/4029) -* Added `divideComponents` function to `Cartesian2`, `Cartesian3`, and `Cartesian4`. [#4750](https://github.com/AnalyticalGraphicsInc/cesium/pull/4750) -* Added `WebGLConstants` enum. Previously, this was part of the private Renderer API. [#4731](https://github.com/AnalyticalGraphicsInc/cesium/pull/4731) +* Fixed `Rectangle.union` to correctly account for rectangles that cross the IDL. [#4732](https://github.com/CesiumGS/cesium/pull/4732) +* Fixed tooltips for gallery thumbnails in Sandcastle [#4702].(https://github.com/CesiumGS/cesium/pull/4702) +* DataSourceClock.getValue now preserves the provided `result` properties when its properties are `undefined`. [#4029](https://github.com/CesiumGS/cesium/issues/4029) +* Added `divideComponents` function to `Cartesian2`, `Cartesian3`, and `Cartesian4`. [#4750](https://github.com/CesiumGS/cesium/pull/4750) +* Added `WebGLConstants` enum. Previously, this was part of the private Renderer API. [#4731](https://github.com/CesiumGS/cesium/pull/4731) ### 1.28 - 2016-12-01 -* Improved terrain/imagery load ordering, especially when the terrain is already fully loaded and a new imagery layer is loaded. This results in a 25% reduction in load times in many cases. [#4616](https://github.com/AnalyticalGraphicsInc/cesium/pull/4616) -* Improved `Billboard`, `Label`, and `PointPrimitive` visual quality. [#4675](https://github.com/AnalyticalGraphicsInc/cesium/pull/4675) +* Improved terrain/imagery load ordering, especially when the terrain is already fully loaded and a new imagery layer is loaded. This results in a 25% reduction in load times in many cases. [#4616](https://github.com/CesiumGS/cesium/pull/4616) +* Improved `Billboard`, `Label`, and `PointPrimitive` visual quality. [#4675](https://github.com/CesiumGS/cesium/pull/4675) * Corrected odd-width and odd-height billboard sizes from being incorrectly rounded up. * Changed depth testing from `LESS` to `LEQUAL`, allowing label glyphs of equal depths to overlap. * Label glyph positions have been adjusted and corrected. * `TextureAtlas.borderWidthInPixels` has always been applied to the upper and right edges of each internal texture, but is now also applied to the bottom and left edges of the entire TextureAtlas, guaranteeing borders on all sides regardless of position within the atlas. -* Fall back to packing floats into an unsigned byte texture when floating point textures are unsupported. [#4563](https://github.com/AnalyticalGraphicsInc/cesium/issues/4563) -* Added support for saving html and css in GitHub Gists. [#4125](https://github.com/AnalyticalGraphicsInc/cesium/issues/4125) -* Fixed `Cartographic.fromCartesian` when the cartesian is not on the ellipsoid surface. [#4611](https://github.com/AnalyticalGraphicsInc/cesium/issues/4611) +* Fall back to packing floats into an unsigned byte texture when floating point textures are unsupported. [#4563](https://github.com/CesiumGS/cesium/issues/4563) +* Added support for saving html and css in GitHub Gists. [#4125](https://github.com/CesiumGS/cesium/issues/4125) +* Fixed `Cartographic.fromCartesian` when the cartesian is not on the ellipsoid surface. [#4611](https://github.com/CesiumGS/cesium/issues/4611) ### 1.27 - 2016-11-01 * Deprecated - * Individual heading, pitch, and roll options to `Transforms.headingPitchRollToFixedFrame` and `Transforms.headingPitchRollQuaternion` have been deprecated and will be removed in 1.30. Pass the new `HeadingPitchRoll` object instead. [#4498](https://github.com/AnalyticalGraphicsInc/cesium/pull/4498) + * Individual heading, pitch, and roll options to `Transforms.headingPitchRollToFixedFrame` and `Transforms.headingPitchRollQuaternion` have been deprecated and will be removed in 1.30. Pass the new `HeadingPitchRoll` object instead. [#4498](https://github.com/CesiumGS/cesium/pull/4498) * Breaking changes - * The `scene` parameter for creating `BillboardVisualizer`, `LabelVisualizer`, and `PointVisualizer` has been removed. Instead, pass an instance of `EntityCluster`. [#4514](https://github.com/AnalyticalGraphicsInc/cesium/pull/4514) -* Fixed an issue where a billboard entity would not render after toggling the show property. [#4408](https://github.com/AnalyticalGraphicsInc/cesium/issues/4408) -* Fixed a crash when zooming from touch input on viewer initialization. [#4177](https://github.com/AnalyticalGraphicsInc/cesium/issues/4177) -* Fixed a crash when clustering is enabled, an entity has a label graphics defined, but the label isn't visible. [#4414](https://github.com/AnalyticalGraphicsInc/cesium/issues/4414) -* Added the ability for KML files to load network links to other KML files within the same KMZ archive. [#4477](https://github.com/AnalyticalGraphicsInc/cesium/issues/4477) -* `KmlDataSource` and `GeoJsonDataSource` were not honoring the `clampToGround` option for billboards and labels and was instead always clamping, reducing performance in cases when it was unneeded. [#4459](https://github.com/AnalyticalGraphicsInc/cesium/pull/4459) -* Fixed `KmlDataSource` features to respect `timespan` and `timestamp` properties of its parents (e.g. Folders or NetworkLinks). [#4041](https://github.com/AnalyticalGraphicsInc/cesium/issues/4041) -* Fixed a `KmlDataSource` bug where features had duplicate IDs and only one was drawn. [#3941](https://github.com/AnalyticalGraphicsInc/cesium/issues/3941) -* `GeoJsonDataSource` now treats null crs values as a no-op instead of failing to load. [#4456](https://github.com/AnalyticalGraphicsInc/cesium/pull/4456) -* `GeoJsonDataSource` now gracefully handles missing style icons instead of failing to load. [#4452](https://github.com/AnalyticalGraphicsInc/cesium/pull/4452) -* Added `HeadingPitchRoll` [#4047](https://github.com/AnalyticalGraphicsInc/cesium/pull/4047) + * The `scene` parameter for creating `BillboardVisualizer`, `LabelVisualizer`, and `PointVisualizer` has been removed. Instead, pass an instance of `EntityCluster`. [#4514](https://github.com/CesiumGS/cesium/pull/4514) +* Fixed an issue where a billboard entity would not render after toggling the show property. [#4408](https://github.com/CesiumGS/cesium/issues/4408) +* Fixed a crash when zooming from touch input on viewer initialization. [#4177](https://github.com/CesiumGS/cesium/issues/4177) +* Fixed a crash when clustering is enabled, an entity has a label graphics defined, but the label isn't visible. [#4414](https://github.com/CesiumGS/cesium/issues/4414) +* Added the ability for KML files to load network links to other KML files within the same KMZ archive. [#4477](https://github.com/CesiumGS/cesium/issues/4477) +* `KmlDataSource` and `GeoJsonDataSource` were not honoring the `clampToGround` option for billboards and labels and was instead always clamping, reducing performance in cases when it was unneeded. [#4459](https://github.com/CesiumGS/cesium/pull/4459) +* Fixed `KmlDataSource` features to respect `timespan` and `timestamp` properties of its parents (e.g. Folders or NetworkLinks). [#4041](https://github.com/CesiumGS/cesium/issues/4041) +* Fixed a `KmlDataSource` bug where features had duplicate IDs and only one was drawn. [#3941](https://github.com/CesiumGS/cesium/issues/3941) +* `GeoJsonDataSource` now treats null crs values as a no-op instead of failing to load. [#4456](https://github.com/CesiumGS/cesium/pull/4456) +* `GeoJsonDataSource` now gracefully handles missing style icons instead of failing to load. [#4452](https://github.com/CesiumGS/cesium/pull/4452) +* Added `HeadingPitchRoll` [#4047](https://github.com/CesiumGS/cesium/pull/4047) * `HeadingPitchRoll.fromQuaternion` function for retrieving heading-pitch-roll angles from a quaternion. * `HeadingPitchRoll.fromDegrees` function that returns a new HeadingPitchRoll instance from angles given in degrees. * `HeadingPitchRoll.clone` function to duplicate HeadingPitchRoll instance. * `HeadingPitchRoll.equals` and `HeadingPitchRoll.equalsEpsilon` functions for comparing two instances. * Added `Matrix3.fromHeadingPitchRoll` Computes a 3x3 rotation matrix from the provided headingPitchRoll. -* Fixed primitive bounding sphere bug that would cause a crash when loading data sources. [#4431](https://github.com/AnalyticalGraphicsInc/cesium/issues/4431) -* Fixed `BoundingSphere` computation for `Primitive` instances with a modelMatrix. [#4428](https://github.com/AnalyticalGraphicsInc/cesium/issues/4428) -* Fixed a bug with rotated, textured rectangles. [#4430](https://github.com/AnalyticalGraphicsInc/cesium/pull/4430) -* Added the ability to specify retina options, such as `@2x.png`, via the `MapboxImageryProvider` `format` option. [#4453](https://github.com/AnalyticalGraphicsInc/cesium/pull/4453). -* Fixed a crash that could occur when specifying an imagery provider's `rectangle` option. [https://github.com/AnalyticalGraphicsInc/cesium/issues/4377](https://github.com/AnalyticalGraphicsInc/cesium/issues/4377) -* Fixed a crash that would occur when using dynamic `distanceDisplayCondition` properties. [#4403](https://github.com/AnalyticalGraphicsInc/cesium/pull/4403) -* Fixed several bugs that lead to billboards and labels being improperly clamped to terrain. [#4396](https://github.com/AnalyticalGraphicsInc/cesium/issues/4396), [#4062](https://github.com/AnalyticalGraphicsInc/cesium/issues/4062) -* Fixed a bug affected models with multiple meshes without indices. [#4237](https://github.com/AnalyticalGraphicsInc/cesium/issues/4237) -* Fixed a glTF transparency bug where `blendFuncSeparate` parameters were loaded in the wrong order. [#4435](https://github.com/AnalyticalGraphicsInc/cesium/pull/4435) -* Fixed a bug where creating a custom geometry with attributes and indices that have values that are not a typed array would cause a crash. [#4419](https://github.com/AnalyticalGraphicsInc/cesium/pull/4419) -* Fixed a bug when morphing from 2D to 3D. [#4388](https://github.com/AnalyticalGraphicsInc/cesium/pull/4388) -* Fixed `RectangleGeometry` rotation when the rectangle is close to the international date line [#3874](https://github.com/AnalyticalGraphicsInc/cesium/issues/3874) +* Fixed primitive bounding sphere bug that would cause a crash when loading data sources. [#4431](https://github.com/CesiumGS/cesium/issues/4431) +* Fixed `BoundingSphere` computation for `Primitive` instances with a modelMatrix. [#4428](https://github.com/CesiumGS/cesium/issues/4428) +* Fixed a bug with rotated, textured rectangles. [#4430](https://github.com/CesiumGS/cesium/pull/4430) +* Added the ability to specify retina options, such as `@2x.png`, via the `MapboxImageryProvider` `format` option. [#4453](https://github.com/CesiumGS/cesium/pull/4453). +* Fixed a crash that could occur when specifying an imagery provider's `rectangle` option. [https://github.com/CesiumGS/cesium/issues/4377](https://github.com/CesiumGS/cesium/issues/4377) +* Fixed a crash that would occur when using dynamic `distanceDisplayCondition` properties. [#4403](https://github.com/CesiumGS/cesium/pull/4403) +* Fixed several bugs that lead to billboards and labels being improperly clamped to terrain. [#4396](https://github.com/CesiumGS/cesium/issues/4396), [#4062](https://github.com/CesiumGS/cesium/issues/4062) +* Fixed a bug affected models with multiple meshes without indices. [#4237](https://github.com/CesiumGS/cesium/issues/4237) +* Fixed a glTF transparency bug where `blendFuncSeparate` parameters were loaded in the wrong order. [#4435](https://github.com/CesiumGS/cesium/pull/4435) +* Fixed a bug where creating a custom geometry with attributes and indices that have values that are not a typed array would cause a crash. [#4419](https://github.com/CesiumGS/cesium/pull/4419) +* Fixed a bug when morphing from 2D to 3D. [#4388](https://github.com/CesiumGS/cesium/pull/4388) +* Fixed `RectangleGeometry` rotation when the rectangle is close to the international date line [#3874](https://github.com/CesiumGS/cesium/issues/3874) * Added `clusterBillboards`, `clusterLabels`, and `cluserPoints` properties to `EntityCluster` to selectively cluster screen space entities. -* Prevent execution of default device/browser behavior when handling "pinch" touch event/gesture. [#4518](https://github.com/AnalyticalGraphicsInc/cesium/pull/4518). -* Fixed a shadow aliasing issue where polygon offset was not being applied. [#4559](https://github.com/AnalyticalGraphicsInc/cesium/pull/4559) -* Removed an unnecessary reprojection of Web Mercator imagery tiles to the Geographic projection on load. This should improve both visual quality and load performance slightly. [#4339](https://github.com/AnalyticalGraphicsInc/cesium/pull/4339) +* Prevent execution of default device/browser behavior when handling "pinch" touch event/gesture. [#4518](https://github.com/CesiumGS/cesium/pull/4518). +* Fixed a shadow aliasing issue where polygon offset was not being applied. [#4559](https://github.com/CesiumGS/cesium/pull/4559) +* Removed an unnecessary reprojection of Web Mercator imagery tiles to the Geographic projection on load. This should improve both visual quality and load performance slightly. [#4339](https://github.com/CesiumGS/cesium/pull/4339) * Added `Transforms.northUpEastToFixedFrame` to compute a 4x4 local transformation matrix from a reference frame with a north-west-up axes. -* Improved `Geocoder` usability by selecting text on click [#4464](https://github.com/AnalyticalGraphicsInc/cesium/pull/4464) -* Added `Rectangle.simpleIntersection` which is an optimized version of `Rectangle.intersection` for more constrained input. [#4339](https://github.com/AnalyticalGraphicsInc/cesium/pull/4339) -* Fixed warning when using Webpack. [#4467](https://github.com/AnalyticalGraphicsInc/cesium/pull/4467) +* Improved `Geocoder` usability by selecting text on click [#4464](https://github.com/CesiumGS/cesium/pull/4464) +* Added `Rectangle.simpleIntersection` which is an optimized version of `Rectangle.intersection` for more constrained input. [#4339](https://github.com/CesiumGS/cesium/pull/4339) +* Fixed warning when using Webpack. [#4467](https://github.com/CesiumGS/cesium/pull/4467) ### 1.26 - 2016-10-03 @@ -1272,16 +1303,16 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Vertex texture fetch is now required to be supported to render polylines. Maximum vertex texture image units must be greater than zero. * Removed `castShadows` and `receiveShadows` properties from `Model`, `Primitive`, and `Globe`. Instead, use `shadows` with the `ShadowMode` enum, e.g. `model.shadows = ShadowMode.ENABLED`. * `Viewer.terrainShadows` now uses the `ShadowMode` enum instead of a Boolean, e.g. `viewer.terrainShadows = ShadowMode.RECEIVE_ONLY`. -* Added support for clustering `Billboard`, `Label` and `Point` entities. [#4240](https://github.com/AnalyticalGraphicsInc/cesium/pull/4240) +* Added support for clustering `Billboard`, `Label` and `Point` entities. [#4240](https://github.com/CesiumGS/cesium/pull/4240) * Added `DistanceDisplayCondition`s to all primitives to determine the range interval from the camera for when it will be visible. * Removed the default gamma correction for Bing Maps aerial imagery, because it is no longer an improvement to current versions of the tiles. To restore the previous look, set the `defaultGamma` property of your `BingMapsImageryProvider` instance to 1.3. * Fixed a bug that could lead to incorrect terrain heights when using `HeightmapTerrainData` with an encoding in which actual heights were equal to the minimum representable height. * Fixed a bug in `AttributeCompression.compressTextureCoordinates` and `decompressTextureCoordinates` that could cause a small inaccuracy in the encoded texture coordinates. -* Fixed a bug where viewing a model with transparent geometry would cause a crash. [#4378](https://github.com/AnalyticalGraphicsInc/cesium/issues/4378) +* Fixed a bug where viewing a model with transparent geometry would cause a crash. [#4378](https://github.com/CesiumGS/cesium/issues/4378) * Added `TrustedServer` collection that controls which servers should have `withCredential` set to `true` on XHR Requests. -* Fixed billboard rotation when sized in meters. [#3979](https://github.com/AnalyticalGraphicsInc/cesium/issues/3979) +* Fixed billboard rotation when sized in meters. [#3979](https://github.com/CesiumGS/cesium/issues/3979) * Added `backgroundColor` and `borderWidth` properties to `writeTextToCanvas`. -* Fixed timeline touch events. [#4305](https://github.com/AnalyticalGraphicsInc/cesium/pull/4305) +* Fixed timeline touch events. [#4305](https://github.com/CesiumGS/cesium/pull/4305) * Fixed a bug that was incorrectly clamping Latitudes in KML (s) to the range -PI..PI. Now correctly clamps to -PI/2..PI/2. * Added `CesiumMath.clampToLatitudeRange`. A convenience function to clamp a passed radian angle to valid Latitudes. * Added `DebugCameraPrimitive` to visualize the view frustum of a camera. @@ -1294,33 +1325,33 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Deprecated * Deprecated `castShadows` and `receiveShadows` properties from `Model`, `Primitive`, and `Globe`. They will be removed in 1.26. Use `shadows` instead with the `ShadowMode` enum, e.g. `model.shadows = ShadowMode.ENABLED`. * `Viewer.terrainShadows` now uses the `ShadowMode` enum instead of a Boolean, e.g. `viewer.terrainShadows = ShadowMode.RECEIVE_ONLY`. Boolean support will be removed in 1.26. -* Updated the online [model converter](http://cesiumjs.org/convertmodel.html) to convert OBJ models to glTF with [obj2gltf](https://github.com/AnalyticalGraphicsInc/OBJ2GLTF), as well as optimize existing glTF models with the [gltf-pipeline](https://github.com/AnalyticalGraphicsInc/gltf-pipeline). Added an option to bake ambient occlusion onto the glTF model. Also added an option to compress geometry using the glTF [WEB3D_quantized_attributes](https://github.com/KhronosGroup/glTF/blob/master/extensions/Vendor/WEB3D_quantized_attributes/README.md) extension. -* Improve label quality for oblique and italic fonts. [#3782](https://github.com/AnalyticalGraphicsInc/cesium/issues/3782) -* Added `shadows` property to the entity API for `Box`, `Corridor`, `Cylinder`, `Ellipse`, `Ellipsoid`, `Polygon`, `Polyline`, `PoylineVolume`, `Rectangle`, and `Wall`. [#4005](https://github.com/AnalyticalGraphicsInc/cesium/pull/4005) +* Updated the online [model converter](http://cesiumjs.org/convertmodel.html) to convert OBJ models to glTF with [obj2gltf](https://github.com/CesiumGS/OBJ2GLTF), as well as optimize existing glTF models with the [gltf-pipeline](https://github.com/CesiumGS/gltf-pipeline). Added an option to bake ambient occlusion onto the glTF model. Also added an option to compress geometry using the glTF [WEB3D_quantized_attributes](https://github.com/KhronosGroup/glTF/blob/master/extensions/Vendor/WEB3D_quantized_attributes/README.md) extension. +* Improve label quality for oblique and italic fonts. [#3782](https://github.com/CesiumGS/cesium/issues/3782) +* Added `shadows` property to the entity API for `Box`, `Corridor`, `Cylinder`, `Ellipse`, `Ellipsoid`, `Polygon`, `Polyline`, `PoylineVolume`, `Rectangle`, and `Wall`. [#4005](https://github.com/CesiumGS/cesium/pull/4005) * Added `Camera.cancelFlight` to cancel the existing camera flight if it exists. * Fix overlapping camera flights by always cancelling the previous flight when a new one is created. -* Camera flights now disable collision with the terrain until all of the terrain in the area has finished loading. This prevents the camera from being moved to be above lower resolution terrain when flying to a position close to higher resolution terrain. [#4075](https://github.com/AnalyticalGraphicsInc/cesium/issues/4075) -* Fixed a crash that would occur if quickly toggling imagery visibility. [#4083](https://github.com/AnalyticalGraphicsInc/cesium/issues/4083) -* Fixed an issue causing an error if KML has a clamped to ground LineString with color. [#4131](https://github.com/AnalyticalGraphicsInc/cesium/issues/4131) +* Camera flights now disable collision with the terrain until all of the terrain in the area has finished loading. This prevents the camera from being moved to be above lower resolution terrain when flying to a position close to higher resolution terrain. [#4075](https://github.com/CesiumGS/cesium/issues/4075) +* Fixed a crash that would occur if quickly toggling imagery visibility. [#4083](https://github.com/CesiumGS/cesium/issues/4083) +* Fixed an issue causing an error if KML has a clamped to ground LineString with color. [#4131](https://github.com/CesiumGS/cesium/issues/4131) * Added logic to `KmlDataSource` defaulting KML Feature node to hidden unless all ancestors are visible. This better matches the KML specification. * Fixed position of KML point features with an altitude mode of `relativeToGround` and `clampToGround`. * Added `GeocoderViewModel.keepExpanded` which when set to true will always keep the Geocoder in its expanded state. * Added support for `INT` and `UNSIGNED_INT` in `ComponentDatatype`. * Added `ComponentDatatype.fromName` for getting a `ComponentDatatype` from its name. -* Fixed a crash caused by draping dynamic geometry over terrain. [#4255](https://github.com/AnalyticalGraphicsInc/cesium/pull/4255) +* Fixed a crash caused by draping dynamic geometry over terrain. [#4255](https://github.com/CesiumGS/cesium/pull/4255) ### 1.24 - 2016-08-01 * Added support in CZML for expressing `BillboardGraphics.alignedAxis` as the velocity vector of an entity, using `velocityReference` syntax. * Added `urlSchemeZeroPadding` property to `UrlTemplateImageryProvider` to allow the numeric parts of a URL, such as `{x}`, to be padded with zeros to make them a fixed width. -* Added leap second just prior to January 2017. [#4092](https://github.com/AnalyticalGraphicsInc/cesium/issues/4092) -* Fixed an exception that would occur when switching to 2D view when shadows are enabled. [#4051](https://github.com/AnalyticalGraphicsInc/cesium/issues/4051) -* Fixed an issue causing entities to disappear when updating multiple entities simultaneously. [#4096](https://github.com/AnalyticalGraphicsInc/cesium/issues/4096) +* Added leap second just prior to January 2017. [#4092](https://github.com/CesiumGS/cesium/issues/4092) +* Fixed an exception that would occur when switching to 2D view when shadows are enabled. [#4051](https://github.com/CesiumGS/cesium/issues/4051) +* Fixed an issue causing entities to disappear when updating multiple entities simultaneously. [#4096](https://github.com/CesiumGS/cesium/issues/4096) * Normalizing the velocity vector produced by `VelocityVectorProperty` is now optional. -* Pack functions now return the result array [#4156](https://github.com/AnalyticalGraphicsInc/cesium/pull/4156) -* Added optional `rangeMax` parameter to `Math.toSNorm` and `Math.fromSNorm`. [#4121](https://github.com/AnalyticalGraphicsInc/cesium/pull/4121) +* Pack functions now return the result array [#4156](https://github.com/CesiumGS/cesium/pull/4156) +* Added optional `rangeMax` parameter to `Math.toSNorm` and `Math.fromSNorm`. [#4121](https://github.com/CesiumGS/cesium/pull/4121) * Removed `MapQuest OpenStreetMap` from the list of demo base layers since direct tile access has been discontinued. See the [MapQuest Developer Blog](http://devblog.mapquest.com/2016/06/15/modernization-of-mapquest-results-in-changes-to-open-tile-access/) for details. -* Fixed PolylinePipeline.generateArc to accept an array of heights when there's only one position [#4155](https://github.com/AnalyticalGraphicsInc/cesium/pull/4155) +* Fixed PolylinePipeline.generateArc to accept an array of heights when there's only one position [#4155](https://github.com/CesiumGS/cesium/pull/4155) ### 1.23 - 2016-07-01 @@ -1337,26 +1368,26 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Added `clampToGround` property. When `true`, clamps `Polygon` and `LineString` features to the ground. For this case, lines use a corridor instead of a polyline. * Added [Ground Clamping Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Ground%20Clamping.html&label=Showcases). * Improved performance and accuracy of polygon triangulation by using the [earcut](https://github.com/mapbox/earcut) library. Loading a GeoJSON with polygons for each country was 2x faster. -* Fix some large polygon triangulations. [#2788](https://github.com/AnalyticalGraphicsInc/cesium/issues/2788) -* Added support for the glTF extension [WEB3D_quantized_attributes](https://github.com/KhronosGroup/glTF/blob/master/extensions/Vendor/WEB3D_quantized_attributes/README.md). [#3241](https://github.com/AnalyticalGraphicsInc/cesium/issues/3241) +* Fix some large polygon triangulations. [#2788](https://github.com/CesiumGS/cesium/issues/2788) +* Added support for the glTF extension [WEB3D_quantized_attributes](https://github.com/KhronosGroup/glTF/blob/master/extensions/Vendor/WEB3D_quantized_attributes/README.md). [#3241](https://github.com/CesiumGS/cesium/issues/3241) * Added CZML support for `Box`, `Corridor` and `Cylinder`. Added new CZML properties: * `Billboard`: `width`, `height`, `heightReference`, `scaleByDistance`, `translucencyByDistance`, `pixelOffsetScaleByDistance`, `imageSubRegion` * `Label`: `heightReference`, `translucencyByDistance`, `pixelOffsetScaleByDistance` * `Model`: `heightReference`, `maximumScale` * `Point`: `heightReference`, `scaleByDistance`, `translucencyByDistance` * `Ellipsoid`: `subdivisions`, `stackPartitions`, `slicePartitions` -* Added `rotatable2D` property to to `Scene`, `CesiumWidget` and `Viewer` to enable map rotation in 2D mode. [#3897](https://github.com/AnalyticalGraphicsInc/cesium/issues/3897) +* Added `rotatable2D` property to to `Scene`, `CesiumWidget` and `Viewer` to enable map rotation in 2D mode. [#3897](https://github.com/CesiumGS/cesium/issues/3897) * `Camera.setView` and `Camera.flyTo` now use the `orientation.heading` parameter in 2D if the map is rotatable. * Added `Camera.changed` event that will fire whenever the camera has changed more than `Camera.percentageChanged`. `percentageChanged` is in the range [0, 1]. -* Zooming in toward a target point now keeps the target point at the same screen position. [#4016](https://github.com/AnalyticalGraphicsInc/cesium/pull/4016) +* Zooming in toward a target point now keeps the target point at the same screen position. [#4016](https://github.com/CesiumGS/cesium/pull/4016) * Improved `GroundPrimitive` performance. * Some incorrect KML (specifically KML that reuses IDs) is now parsed correctly. * Added `unsupportedNodeEvent` to `KmlDataSource` that is fired whenever an unsupported node is encountered. -* `Clock` now keeps its configuration settings self-consistent. Previously, this was done by `AnimationViewModel` and could become inconsistent in certain cases. [#4007](https://github.com/AnalyticalGraphicsInc/cesium/pull/4007) +* `Clock` now keeps its configuration settings self-consistent. Previously, this was done by `AnimationViewModel` and could become inconsistent in certain cases. [#4007](https://github.com/CesiumGS/cesium/pull/4007) * Updated [Google Cardboard Sandcastle example](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Cardboard.html&label=Showcase). -* Added [hot air balloon](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Apps/SampleData/models/CesiumBalloon) sample model. -* Fixed handling of sampled Rectangle coordinates in CZML. [#4033](https://github.com/AnalyticalGraphicsInc/cesium/pull/4033) -* Fix "Cannot read property 'x' of undefined" error when calling SceneTransforms.wgs84ToWindowCoordinates in certain cases. [#4022](https://github.com/AnalyticalGraphicsInc/cesium/pull/4022) +* Added [hot air balloon](https://github.com/CesiumGS/cesium/tree/master/Apps/SampleData/models/CesiumBalloon) sample model. +* Fixed handling of sampled Rectangle coordinates in CZML. [#4033](https://github.com/CesiumGS/cesium/pull/4033) +* Fix "Cannot read property 'x' of undefined" error when calling SceneTransforms.wgs84ToWindowCoordinates in certain cases. [#4022](https://github.com/CesiumGS/cesium/pull/4022) * Re-enabled mouse inputs after a specified number of milliseconds past the most recent touch event. * Exposed a parametric ray-triangle intersection test to the API as `IntersectionTests.rayTriangleParametric`. * Added `packArray` and `unpackArray` functions to `Cartesian2`, `Cartesian3`, and `Cartesian4`. @@ -1382,42 +1413,42 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Added `castShadows` and `receiveShadows` properties to `Globe`. * Added `heightReference` to models so they can be drawn on terrain. * Added support for rendering models in 2D and Columbus view. -* Added option to enable sun position based atmosphere color when `Globe.enableLighting` is `true`. [3439](https://github.com/AnalyticalGraphicsInc/cesium/issues/3439) -* Improved KML NetworkLink compatibility by supporting the `Url` tag. [#3895](https://github.com/AnalyticalGraphicsInc/cesium/pull/3895). -* Added `VelocityVectorProperty` so billboard's aligned axis can follow the velocity vector. [#3908](https://github.com/AnalyticalGraphicsInc/cesium/issues/3908) +* Added option to enable sun position based atmosphere color when `Globe.enableLighting` is `true`. [3439](https://github.com/CesiumGS/cesium/issues/3439) +* Improved KML NetworkLink compatibility by supporting the `Url` tag. [#3895](https://github.com/CesiumGS/cesium/pull/3895). +* Added `VelocityVectorProperty` so billboard's aligned axis can follow the velocity vector. [#3908](https://github.com/CesiumGS/cesium/issues/3908) * Improve memory management for entity billboard/label/point/path visualization. * Added `terrainProviderChanged` event to `Scene` and `Globe` -* Added support for hue, saturation, and brightness color shifts in the atmosphere in `SkyAtmosphere`. See the new Sandcastle example: [Atmosphere Color](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Atmosphere%20Color.html&label=Showcases). [#3439](https://github.com/AnalyticalGraphicsInc/cesium/issues/3439) -* Fixed exaggerated terrain tiles disappearing. [#3676](https://github.com/AnalyticalGraphicsInc/cesium/issues/3676) -* Fixed a bug that could cause incorrect normals to be computed for exaggerated terrain, especially for low-detail tiles. [#3904](https://github.com/AnalyticalGraphicsInc/cesium/pull/3904) -* Fixed a bug that was causing errors to be thrown when picking and terrain was enabled. [#3779](https://github.com/AnalyticalGraphicsInc/cesium/issues/3779) -* Fixed a bug that was causing the atmosphere to disappear when only atmosphere is visible. [#3347](https://github.com/AnalyticalGraphicsInc/cesium/issues/3347) -* Fixed infinite horizontal 2D scrolling in IE/Edge. [#3893](https://github.com/AnalyticalGraphicsInc/cesium/issues/3893) -* Fixed a bug that would cause a crash is the camera was on the IDL in 2D. [#3951](https://github.com/AnalyticalGraphicsInc/cesium/issues/3951) -* Fixed issue where a repeating model animation doesn't play when the clock is set to a time before the model was created. [#3932](https://github.com/AnalyticalGraphicsInc/cesium/issues/3932) -* Fixed `Billboard.computeScreenSpacePosition` returning the wrong y coordinate. [#3920](https://github.com/AnalyticalGraphicsInc/cesium/issues/3920) -* Fixed issue where labels were disappearing. [#3730](https://github.com/AnalyticalGraphicsInc/cesium/issues/3730) -* Fixed issue where billboards on terrain didn't always update when the terrain provider was changed. [#3921](https://github.com/AnalyticalGraphicsInc/cesium/issues/3921) -* Fixed issue where `Matrix4.fromCamera` was taking eye/target instead of position/direction. [#3927](https://github.com/AnalyticalGraphicsInc/cesium/issues/3927) +* Added support for hue, saturation, and brightness color shifts in the atmosphere in `SkyAtmosphere`. See the new Sandcastle example: [Atmosphere Color](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Atmosphere%20Color.html&label=Showcases). [#3439](https://github.com/CesiumGS/cesium/issues/3439) +* Fixed exaggerated terrain tiles disappearing. [#3676](https://github.com/CesiumGS/cesium/issues/3676) +* Fixed a bug that could cause incorrect normals to be computed for exaggerated terrain, especially for low-detail tiles. [#3904](https://github.com/CesiumGS/cesium/pull/3904) +* Fixed a bug that was causing errors to be thrown when picking and terrain was enabled. [#3779](https://github.com/CesiumGS/cesium/issues/3779) +* Fixed a bug that was causing the atmosphere to disappear when only atmosphere is visible. [#3347](https://github.com/CesiumGS/cesium/issues/3347) +* Fixed infinite horizontal 2D scrolling in IE/Edge. [#3893](https://github.com/CesiumGS/cesium/issues/3893) +* Fixed a bug that would cause a crash is the camera was on the IDL in 2D. [#3951](https://github.com/CesiumGS/cesium/issues/3951) +* Fixed issue where a repeating model animation doesn't play when the clock is set to a time before the model was created. [#3932](https://github.com/CesiumGS/cesium/issues/3932) +* Fixed `Billboard.computeScreenSpacePosition` returning the wrong y coordinate. [#3920](https://github.com/CesiumGS/cesium/issues/3920) +* Fixed issue where labels were disappearing. [#3730](https://github.com/CesiumGS/cesium/issues/3730) +* Fixed issue where billboards on terrain didn't always update when the terrain provider was changed. [#3921](https://github.com/CesiumGS/cesium/issues/3921) +* Fixed issue where `Matrix4.fromCamera` was taking eye/target instead of position/direction. [#3927](https://github.com/CesiumGS/cesium/issues/3927) * Added `Scene.nearToFarDistance2D` that determines the size of each frustum of the multifrustum in 2D. * Added `Matrix4.computeView`. * Added `CullingVolume.fromBoundingSphere`. * Added `debugShowShadowVolume` to `GroundPrimitive`. -* Fix issue with disappearing tiles on Linux. [#3889](https://github.com/AnalyticalGraphicsInc/cesium/issues/3889) +* Fix issue with disappearing tiles on Linux. [#3889](https://github.com/CesiumGS/cesium/issues/3889) ### 1.21 - 2016-05-02 * Breaking changes * Removed `ImageryMaterialProperty.alpha`. Use `ImageryMaterialProperty.color.alpha` instead. * Removed `OpenStreetMapImageryProvider`. Use `createOpenStreetMapImageryProvider` instead. -* Added ability to import and export Sandcastle example using GitHub Gists. [#3795](https://github.com/AnalyticalGraphicsInc/cesium/pull/3795) -* Added `PolygonGraphics.closeTop`, `PolygonGraphics.closeBottom`, and `PolygonGeometry` options for creating an extruded polygon without a top or bottom. [#3879](https://github.com/AnalyticalGraphicsInc/cesium/pull/3879) -* Added support for polyline arrow material to `CzmlDataSource` [#3860](https://github.com/AnalyticalGraphicsInc/cesium/pull/3860) -* Fixed issue causing the sun not to render. [#3801](https://github.com/AnalyticalGraphicsInc/cesium/pull/3801) -* Fixed issue where `Camera.flyTo` would not work with a rectangle in 2D. [#3688](https://github.com/AnalyticalGraphicsInc/cesium/issues/3688) -* Fixed issue causing the fog to go dark and the atmosphere to flicker when the camera clips the globe. [#3178](https://github.com/AnalyticalGraphicsInc/cesium/issues/3178) -* Fixed a bug that caused an exception and rendering to stop when using `ArcGisMapServerImageryProvider` to connect to a MapServer specifying the Web Mercator projection and a fullExtent bigger than the valid extent of the projection. [#3854](https://github.com/AnalyticalGraphicsInc/cesium/pull/3854) -* Fixed issue causing an exception when switching scene modes with an active KML network link. [#3865](https://github.com/AnalyticalGraphicsInc/cesium/issues/3865) +* Added ability to import and export Sandcastle example using GitHub Gists. [#3795](https://github.com/CesiumGS/cesium/pull/3795) +* Added `PolygonGraphics.closeTop`, `PolygonGraphics.closeBottom`, and `PolygonGeometry` options for creating an extruded polygon without a top or bottom. [#3879](https://github.com/CesiumGS/cesium/pull/3879) +* Added support for polyline arrow material to `CzmlDataSource` [#3860](https://github.com/CesiumGS/cesium/pull/3860) +* Fixed issue causing the sun not to render. [#3801](https://github.com/CesiumGS/cesium/pull/3801) +* Fixed issue where `Camera.flyTo` would not work with a rectangle in 2D. [#3688](https://github.com/CesiumGS/cesium/issues/3688) +* Fixed issue causing the fog to go dark and the atmosphere to flicker when the camera clips the globe. [#3178](https://github.com/CesiumGS/cesium/issues/3178) +* Fixed a bug that caused an exception and rendering to stop when using `ArcGisMapServerImageryProvider` to connect to a MapServer specifying the Web Mercator projection and a fullExtent bigger than the valid extent of the projection. [#3854](https://github.com/CesiumGS/cesium/pull/3854) +* Fixed issue causing an exception when switching scene modes with an active KML network link. [#3865](https://github.com/CesiumGS/cesium/issues/3865) ### 1.20 - 2016-04-01 @@ -1434,19 +1465,19 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Fixed handling of non-standard KML `styleUrl` references within a `StyleMap`. * Fixed issue in KML where StyleMaps from external documents fail to load. * Added translucent and colored image support to KML ground overlays -* Fix bug when upsampling exaggerated terrain where the terrain heights were exaggerated at twice the value. [#3607](https://github.com/AnalyticalGraphicsInc/cesium/issues/3607) -* All external urls are now https by default to make Cesium work better with non-server-based applications. [#3650](https://github.com/AnalyticalGraphicsInc/cesium/issues/3650) +* Fix bug when upsampling exaggerated terrain where the terrain heights were exaggerated at twice the value. [#3607](https://github.com/CesiumGS/cesium/issues/3607) +* All external urls are now https by default to make Cesium work better with non-server-based applications. [#3650](https://github.com/CesiumGS/cesium/issues/3650) * `GeoJsonDataSource` now handles CRS `urn:ogc:def:crs:EPSG::4326` * Fixed `TimeIntervalCollection.removeInterval` bug that resulted in too many intervals being removed. * `GroundPrimitive` throws a `DeveloperError` when passed an unsupported geometry type instead of crashing. -* Fix issue with billboard collections that have at least one billboard with an aligned axis and at least one billboard without an aligned axis. [#3318](https://github.com/AnalyticalGraphicsInc/cesium/issues/3318) -* Fix a race condition that would cause the terrain to continue loading and unloading or cause a crash when changing terrain providers. [#3690](https://github.com/AnalyticalGraphicsInc/cesium/issues/3690) -* Fix issue where the `GroundPrimitive` volume was being clipped by the far plane. [#3706](https://github.com/AnalyticalGraphicsInc/cesium/issues/3706) -* Fixed issue where `Camera.computeViewRectangle` was incorrect when crossing the international date line. [#3717](https://github.com/AnalyticalGraphicsInc/cesium/issues/3717) +* Fix issue with billboard collections that have at least one billboard with an aligned axis and at least one billboard without an aligned axis. [#3318](https://github.com/CesiumGS/cesium/issues/3318) +* Fix a race condition that would cause the terrain to continue loading and unloading or cause a crash when changing terrain providers. [#3690](https://github.com/CesiumGS/cesium/issues/3690) +* Fix issue where the `GroundPrimitive` volume was being clipped by the far plane. [#3706](https://github.com/CesiumGS/cesium/issues/3706) +* Fixed issue where `Camera.computeViewRectangle` was incorrect when crossing the international date line. [#3717](https://github.com/CesiumGS/cesium/issues/3717) * Added `Rectangle` result parameter to `Camera.computeViewRectangle`. -* Fixed a reentrancy bug in `EntityCollection.collectionChanged`. [#3739](https://github.com/AnalyticalGraphicsInc/cesium/pull/3739) -* Fixed a crash that would occur if you added and removed an `Entity` with a path without ever actually rendering it. [#3738](https://github.com/AnalyticalGraphicsInc/cesium/pull/3738) -* Fixed issue causing parts of geometry and billboards/labels to be clipped. [#3748](https://github.com/AnalyticalGraphicsInc/cesium/issues/3748) +* Fixed a reentrancy bug in `EntityCollection.collectionChanged`. [#3739](https://github.com/CesiumGS/cesium/pull/3739) +* Fixed a crash that would occur if you added and removed an `Entity` with a path without ever actually rendering it. [#3738](https://github.com/CesiumGS/cesium/pull/3738) +* Fixed issue causing parts of geometry and billboards/labels to be clipped. [#3748](https://github.com/CesiumGS/cesium/issues/3748) * Fixed bug where transparent image materials were drawn black. * Fixed `Color.fromCssColorString` from reusing the input `result` alpha value in some cases. @@ -1470,7 +1501,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Added `show` property to `CzmlDataSource`, `GeoJsonDataSource`, `KmlDataSource`, `CustomDataSource`, and `EntityCollection` for easily toggling display of entire data sources. * Added `owner` property to `CompositeEntityCollection`. * Added `DataSouceDisplay.ready` for determining whether or not static data associated with the Entity API has been rendered. -* Fix an issue when changing a billboard's position property multiple times per frame. [#3511](https://github.com/AnalyticalGraphicsInc/cesium/pull/3511) +* Fix an issue when changing a billboard's position property multiple times per frame. [#3511](https://github.com/CesiumGS/cesium/pull/3511) * Fixed texture coordinates for polygon with position heights. * Fixed issue that kept `GroundPrimitive` with an `EllipseGeometry` from having a `rotation`. * Fixed crash caused when drawing `CorridorGeometry` and `CorridorOutlineGeometry` synchronously. @@ -1505,15 +1536,15 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Improved compatibility with glTF KHR_binary_glTF and KHR_materials_common extensions * Added `ImageryLayer.getViewableRectangle` to make it easy to get the effective bounds of an imagery layer. * Improved compatibility with glTF KHR_binary_glTF and KHR_materials_common extensions -* Fixed a picking issue that sometimes prevented objects being selected. [#3386](https://github.com/AnalyticalGraphicsInc/cesium/issues/3386) -* Fixed cracking between tiles in 2D. [#3486](https://github.com/AnalyticalGraphicsInc/cesium/pull/3486) +* Fixed a picking issue that sometimes prevented objects being selected. [#3386](https://github.com/CesiumGS/cesium/issues/3386) +* Fixed cracking between tiles in 2D. [#3486](https://github.com/CesiumGS/cesium/pull/3486) * Fixed creating bounding volumes for `GroundPrimitive`s whose containing rectangle has a width greater than pi. * Fixed incorrect texture coordinates for polygons with large height. * Fixed camera.flyTo not working when in 2D mode and only orientation changes * Added `UrlTemplateImageryProvider.reinitialize` for changing imagery provider options without creating a new instance. * `UrlTemplateImageryProvider` now accepts a promise to an `options` object in addition to taking the object directly. * Fixed a bug that prevented WMS feature picking from working with THREDDS XML and msGMLOutput in Internet Explorer 11. -* Added `Scene.useDepthPicking` to enable or disable picking using the depth buffer. [#3390](https://github.com/AnalyticalGraphicsInc/cesium/pull/3390) +* Added `Scene.useDepthPicking` to enable or disable picking using the depth buffer. [#3390](https://github.com/CesiumGS/cesium/pull/3390) * Added `BoundingSphere.fromEncodedCartesianVertices` to create bounding volumes from parallel arrays of the upper and lower bits of `EncodedCartesian3`s. * Added helper functions: `getExtensionFromUri`, `getAbsoluteUri`, and `Math.logBase`. * Added `Rectangle.union` and `Rectangle.expand`. @@ -1533,15 +1564,15 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Removed `HeightmapTessellator` from the public API. It is an implementation details. * Removed `TerrainMesh` from the public API. It is an implementation details. * Reduced the amount of GPU and CPU memory used by terrain by using [compression](http://cesiumjs.org/2015/12/18/Terrain-Quantization/). The CPU memory was reduced by up to 40%. -* Added the ability to manipulate `Model` node transformations via CZML and the Entity API. See the new Sandcastle example: [CZML Model - Node Transformations](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=CZML%20Model%20-%20Node%20Transformations.html&label=CZML). [#3316](https://github.com/AnalyticalGraphicsInc/cesium/pull/3316) +* Added the ability to manipulate `Model` node transformations via CZML and the Entity API. See the new Sandcastle example: [CZML Model - Node Transformations](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=CZML%20Model%20-%20Node%20Transformations.html&label=CZML). [#3316](https://github.com/CesiumGS/cesium/pull/3316) * Added `Globe.tileLoadProgressEvent`, which is raised when the length of the tile load queue changes, enabling incremental loading indicators. * Added support for msGMLOutput and Thredds server feature information formats to `GetFeatureInfoFormat` and `WebMapServiceImageryProvider`. * Added dynamic `enableFeaturePicking` toggle to all ImageryProviders that support feature picking. -* Fixed disappearing terrain while fog is active. [#3335](https://github.com/AnalyticalGraphicsInc/cesium/issues/3335) -* Fixed short segments in `CorridorGeometry` and `PolylineVolumeGeometry`. [#3293](https://github.com/AnalyticalGraphicsInc/cesium/issues/3293) -* Fixed `CorridorGeometry` with nearly colinear points. [#3320](https://github.com/AnalyticalGraphicsInc/cesium/issues/3320) -* Added missing points to `EllipseGeometry` and `EllipseOutlineGeometry`. [#3078](https://github.com/AnalyticalGraphicsInc/cesium/issues/3078) -* `Rectangle.fromCartographicArray` now uses the smallest rectangle regardess of whether or not it crosses the international date line. [#3227](https://github.com/AnalyticalGraphicsInc/cesium/issues/3227) +* Fixed disappearing terrain while fog is active. [#3335](https://github.com/CesiumGS/cesium/issues/3335) +* Fixed short segments in `CorridorGeometry` and `PolylineVolumeGeometry`. [#3293](https://github.com/CesiumGS/cesium/issues/3293) +* Fixed `CorridorGeometry` with nearly colinear points. [#3320](https://github.com/CesiumGS/cesium/issues/3320) +* Added missing points to `EllipseGeometry` and `EllipseOutlineGeometry`. [#3078](https://github.com/CesiumGS/cesium/issues/3078) +* `Rectangle.fromCartographicArray` now uses the smallest rectangle regardess of whether or not it crosses the international date line. [#3227](https://github.com/CesiumGS/cesium/issues/3227) * Added `TranslationRotationScale` property, which represents an affine transformation defined by a translation, rotation, and scale. * Added `Matrix4.fromTranslationRotationScale`. * Added `NodeTransformationProperty`, which is a `Property` value that is defined by independent `translation`, `rotation`, and `scale` `Property` instances. @@ -1556,21 +1587,21 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Deprecated `HeightmapTessellator`. It will be removed in 1.17. * Deprecated `TerrainMesh`. It will be removed in 1.17. * Deprecated `OpenStreetMapImageryProvider`. It will be removed in 1.18. Use `createOpenStreetMapImageryProvider` instead. -* Improved terrain performance by up to 35%. Added support for fog near the horizon, which improves performance by rendering less terrain tiles and reduces terrain tile requests. This is enabled by default. See `Scene.fog` for options. [#3154](https://github.com/AnalyticalGraphicsInc/cesium/pull/3154) +* Improved terrain performance by up to 35%. Added support for fog near the horizon, which improves performance by rendering less terrain tiles and reduces terrain tile requests. This is enabled by default. See `Scene.fog` for options. [#3154](https://github.com/CesiumGS/cesium/pull/3154) * Added terrain exaggeration. Enabled on viewer creation with the exaggeration scalar as the `terrainExaggeration` option. * Added support for incrementally loading textures after a Model is ready. This allows the Model to be visible as soon as possible while its textures are loaded in the background. * `ImageMaterialProperty.image` now accepts an `HTMLVideoElement`. You can also assign a video element directly to an Entity `material` property. * `Material` image uniforms now accept and `HTMLVideoElement` anywhere it could previously take a `Canvas` element. * Added `VideoSynchronizer` helper object for keeping an `HTMLVideoElement` in sync with a scene's clock. -* Fixed an issue with loading skeletons for skinned glTF models. [#3224](https://github.com/AnalyticalGraphicsInc/cesium/pull/3224) -* Fixed an issue with tile selection when below the surface of the ellipsoid. [#3170](https://github.com/AnalyticalGraphicsInc/cesium/issues/3170) +* Fixed an issue with loading skeletons for skinned glTF models. [#3224](https://github.com/CesiumGS/cesium/pull/3224) +* Fixed an issue with tile selection when below the surface of the ellipsoid. [#3170](https://github.com/CesiumGS/cesium/issues/3170) * Added `Cartographic.fromCartesian` function. * Added `createOpenStreetMapImageryProvider` function to replace the `OpenStreetMapImageryProvider` class. This function returns a constructed `UrlTemplateImageryProvider`. -* `GeoJsonDataSource.load` now takes an optional `describeProperty` function for generating feature description properties. [#3140](https://github.com/AnalyticalGraphicsInc/cesium/pull/3140) -* Added `ImageryProvider.readyPromise` and `TerrainProvider.readyPromise` and implemented it in all terrain and imagery providers. This is a promise which resolves when `ready` becomes true and rejected if there is an error during initialization. [#3175](https://github.com/AnalyticalGraphicsInc/cesium/pull/3175) -* Fixed an issue where the sun texture is not generated correctly on some mobile devices. [#3141](https://github.com/AnalyticalGraphicsInc/cesium/issues/3141) -* Fixed a bug that caused setting `Entity.parent` to `undefined` to throw an exception. [#3169](https://github.com/AnalyticalGraphicsInc/cesium/issues/3169) -* Fixed a bug which caused `Entity` polyline graphics to be incorrect when a scene's ellipsoid was not WGS84. [#3174](https://github.com/AnalyticalGraphicsInc/cesium/pull/3174) +* `GeoJsonDataSource.load` now takes an optional `describeProperty` function for generating feature description properties. [#3140](https://github.com/CesiumGS/cesium/pull/3140) +* Added `ImageryProvider.readyPromise` and `TerrainProvider.readyPromise` and implemented it in all terrain and imagery providers. This is a promise which resolves when `ready` becomes true and rejected if there is an error during initialization. [#3175](https://github.com/CesiumGS/cesium/pull/3175) +* Fixed an issue where the sun texture is not generated correctly on some mobile devices. [#3141](https://github.com/CesiumGS/cesium/issues/3141) +* Fixed a bug that caused setting `Entity.parent` to `undefined` to throw an exception. [#3169](https://github.com/CesiumGS/cesium/issues/3169) +* Fixed a bug which caused `Entity` polyline graphics to be incorrect when a scene's ellipsoid was not WGS84. [#3174](https://github.com/CesiumGS/cesium/pull/3174) * Entities have a reference to their entity collection and to their owner (usually a data source, but can be a `CompositeEntityCollection`). * Added `ImageMaterialProperty.alpha` and a `alpha` uniform to `Image` and `Material` types to control overall image opacity. It defaults to 1.0, fully opaque. * Added `Camera.getPixelSize` function to get the size of a pixel in meters based on the current view. @@ -1609,42 +1640,42 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Added support for the glTF extensions [KHR_binary_glTF](https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_binary_glTF) and [KHR_materials_common](https://github.com/KhronosGroup/glTF/tree/KHR_materials_common/extensions/Khronos/KHR_materials_common). * Decreased GPU memory usage in `BillboardCollection` and `LabelCollection` by using WebGL instancing. * Added CZML examples to Sandcastle. See the new CZML tab. -* Changed `Camera.setView` to take the same parameter options as `Camera.flyTo`. `options.destination` takes a rectangle, `options.orientation` works with heading/pitch/roll or direction/up, and `options.endTransform` was added. [#3100](https://github.com/AnalyticalGraphicsInc/cesium/pull/3100) +* Changed `Camera.setView` to take the same parameter options as `Camera.flyTo`. `options.destination` takes a rectangle, `options.orientation` works with heading/pitch/roll or direction/up, and `options.endTransform` was added. [#3100](https://github.com/CesiumGS/cesium/pull/3100) * Fixed token issue in `ArcGisMapServerImageryProvider`. * `ImageryLayerFeatureInfo` now has an `imageryLayer` property, indicating the layer that contains the feature. * Made `TileMapServiceImageryProvider` and `CesiumTerrainProvider` work properly when the provided base url contains query parameters and fragments. -* The WebGL setting of `failIfMajorPerformanceCaveat` now defaults to `false`, which is the WebGL default. This improves compatibility with out-of-date drivers and remote desktop sessions. Cesium will run slower in these cases instead of simply failing to load. [#3108](https://github.com/AnalyticalGraphicsInc/cesium/pull/3108) -* Fixed the issue where the camera inertia takes too long to finish causing the camera move events to fire after it appears to. [#2839](https://github.com/AnalyticalGraphicsInc/cesium/issues/2839) -* Make KML invalid coordinate processing match Google Earth behavior. [#3124](https://github.com/AnalyticalGraphicsInc/cesium/pull/3124) +* The WebGL setting of `failIfMajorPerformanceCaveat` now defaults to `false`, which is the WebGL default. This improves compatibility with out-of-date drivers and remote desktop sessions. Cesium will run slower in these cases instead of simply failing to load. [#3108](https://github.com/CesiumGS/cesium/pull/3108) +* Fixed the issue where the camera inertia takes too long to finish causing the camera move events to fire after it appears to. [#2839](https://github.com/CesiumGS/cesium/issues/2839) +* Make KML invalid coordinate processing match Google Earth behavior. [#3124](https://github.com/CesiumGS/cesium/pull/3124) * Added `BoxOutlineGeometry.fromAxisAlignedBoundingBox` and `BoxGeometry.fromAxisAlignedBoundingBox` functions. -* Switched to [gulp](http://gulpjs.com/) for all build tasks. `Java` and `ant` are no longer required to develop Cesium. [#3106](https://github.com/AnalyticalGraphicsInc/cesium/pull/3106) -* Updated `requirejs` from 2.1.9 to 2.1.20. [#3107](https://github.com/AnalyticalGraphicsInc/cesium/pull/3107) -* Updated `almond` from 0.2.6 to 0.3.1. [#3107](https://github.com/AnalyticalGraphicsInc/cesium/pull/3107) +* Switched to [gulp](http://gulpjs.com/) for all build tasks. `Java` and `ant` are no longer required to develop Cesium. [#3106](https://github.com/CesiumGS/cesium/pull/3106) +* Updated `requirejs` from 2.1.9 to 2.1.20. [#3107](https://github.com/CesiumGS/cesium/pull/3107) +* Updated `almond` from 0.2.6 to 0.3.1. [#3107](https://github.com/CesiumGS/cesium/pull/3107) ### 1.14 - 2015-10-01 -* Fixed issues causing the terrain and sky to disappear when the camera is near the surface. [#2415](https://github.com/AnalyticalGraphicsInc/cesium/issues/2415) and [#2271](https://github.com/AnalyticalGraphicsInc/cesium/issues/2271) +* Fixed issues causing the terrain and sky to disappear when the camera is near the surface. [#2415](https://github.com/CesiumGS/cesium/issues/2415) and [#2271](https://github.com/CesiumGS/cesium/issues/2271) * Changed the `ScreenSpaceCameraController.minimumZoomDistance` default from `20.0` to `1.0`. * Added `Billboard.sizeInMeters`. `true` sets the billboard size to be measured in meters; otherwise, the size of the billboard is measured in pixels. Also added support for billboard `sizeInMeters` to entities and CZML. * Fixed a bug in `AssociativeArray` that would cause unbounded memory growth when adding and removing lots of items. -* Provided a workaround for Safari 9 where WebGL constants can't be accessed through `WebGLRenderingContext`. Now constants are hard-coded in `WebGLConstants`. [#2989](https://github.com/AnalyticalGraphicsInc/cesium/issues/2989) -* Added a workaround for Chrome 45, where the first character in a label with a small font size would not appear. [#3011](https://github.com/AnalyticalGraphicsInc/cesium/pull/3011) +* Provided a workaround for Safari 9 where WebGL constants can't be accessed through `WebGLRenderingContext`. Now constants are hard-coded in `WebGLConstants`. [#2989](https://github.com/CesiumGS/cesium/issues/2989) +* Added a workaround for Chrome 45, where the first character in a label with a small font size would not appear. [#3011](https://github.com/CesiumGS/cesium/pull/3011) * Added `subdomains` option to the `WebMapTileServiceImageryProvider` constructor. * Added `subdomains` option to the `WebMapServiceImageryProvider` constructor. -* Fix zooming in 2D when tracking an object. The zoom was based on location rather than the tracked object. [#2991](https://github.com/AnalyticalGraphicsInc/cesium/issues/2991) +* Fix zooming in 2D when tracking an object. The zoom was based on location rather than the tracked object. [#2991](https://github.com/CesiumGS/cesium/issues/2991) * Added `options.credit` parameter to `MapboxImageryProvider`. -* Fixed an issue with drill picking at low frame rates that would cause a crash. [#3010](https://github.com/AnalyticalGraphicsInc/cesium/pull/3010) +* Fixed an issue with drill picking at low frame rates that would cause a crash. [#3010](https://github.com/CesiumGS/cesium/pull/3010) * Fixed a bug that prevented `setView` from working across all scene modes. * Fixed a bug that caused `camera.positionWC` to occasionally return the incorrect value. -* Used all the template urls defined in the CesiumTerrain provider.[#3038](https://github.com/AnalyticalGraphicsInc/cesium/pull/3038) +* Used all the template urls defined in the CesiumTerrain provider.[#3038](https://github.com/CesiumGS/cesium/pull/3038) ### 1.13 - 2015-09-01 * Breaking changes * Remove deprecated `AxisAlignedBoundingBox.intersect` and `BoundingSphere.intersect`. Use `BoundingSphere.intersectPlane` instead. * Remove deprecated `getFeatureInfoAsGeoJson` and `getFeatureInfoAsXml` constructor parameters from `WebMapServiceImageryProvider`. -* Added support for `GroundPrimitive` which works much like `Primitive` but drapes geometry over terrain. Valid geometries that can be draped on terrain are `CircleGeometry`, `CorridorGeometry`, `EllipseGeometry`, `PolygonGeometry`, and `RectangleGeometry`. Because of the cutting edge nature of this feature in WebGL, it requires the [EXT_frag_depth](https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/) extension, which is currently only supported in Chrome, Firefox, and Edge. Apple support is expected in iOS 9 and MacOS Safari 9. Android support varies by hardware and IE11 will most likely never support it. You can use [webglreport.com](http://webglreport.com) to verify support for your hardware. Finally, this feature is currently only supported in Primitives and not yet available via the Entity API. [#2865](https://github.com/AnalyticalGraphicsInc/cesium/pull/2865) -* Added `Scene.groundPrimitives`, which is a primitive collection like `Scene.primitives`, but for `GroundPrimitive` instances. It allows custom z-ordering. [#2960](https://github.com/AnalyticalGraphicsInc/cesium/pull/2960) For example: +* Added support for `GroundPrimitive` which works much like `Primitive` but drapes geometry over terrain. Valid geometries that can be draped on terrain are `CircleGeometry`, `CorridorGeometry`, `EllipseGeometry`, `PolygonGeometry`, and `RectangleGeometry`. Because of the cutting edge nature of this feature in WebGL, it requires the [EXT_frag_depth](https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/) extension, which is currently only supported in Chrome, Firefox, and Edge. Apple support is expected in iOS 9 and MacOS Safari 9. Android support varies by hardware and IE11 will most likely never support it. You can use [webglreport.com](http://webglreport.com) to verify support for your hardware. Finally, this feature is currently only supported in Primitives and not yet available via the Entity API. [#2865](https://github.com/CesiumGS/cesium/pull/2865) +* Added `Scene.groundPrimitives`, which is a primitive collection like `Scene.primitives`, but for `GroundPrimitive` instances. It allows custom z-ordering. [#2960](https://github.com/CesiumGS/cesium/pull/2960) For example: // draws the ellipse on top of the rectangle var ellipse = scene.groundPrimitives.add(new Cesium.GroundPrimitive({...})); @@ -1653,32 +1684,32 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ // move the rectangle to draw on top of the ellipse scene.groundPrimitives.raise(rectangle); -* Added `reverseZ` tag to `UrlTemplateImageryProvider`. [#2961](https://github.com/AnalyticalGraphicsInc/cesium/pull/2961) +* Added `reverseZ` tag to `UrlTemplateImageryProvider`. [#2961](https://github.com/CesiumGS/cesium/pull/2961) * Added `BoundingSphere.isOccluded` and `OrientedBoundingBox.isOccluded` to determine if the volumes are occluded by an `Occluder`. * Added `distanceSquaredTo` and `computePlaneDistances` functions to `OrientedBoundingBox`. -* Fixed a GLSL precision issue that enables Cesium to support Mali-400MP GPUs and other mobile GPUs where GLSL shaders did not previously compile. [#2984](https://github.com/AnalyticalGraphicsInc/cesium/pull/2984) -* Fixed an issue where extruded `PolygonGeometry` was always extruding to the ellipsoid surface instead of specified height. [#2923](https://github.com/AnalyticalGraphicsInc/cesium/pull/2923) -* Fixed an issue where non-feature nodes prevented KML documents from loading. [#2945](https://github.com/AnalyticalGraphicsInc/cesium/pull/2945) -* Fixed an issue where `JulianDate` would not parse certain dates properly. [#405](https://github.com/AnalyticalGraphicsInc/cesium/issues/405) -* Removed [es5-shim](https://github.com/kriskowal/es5-shim), which is no longer being used. [#2933](https://github.com/AnalyticalGraphicsInc/cesium/pull/2945) +* Fixed a GLSL precision issue that enables Cesium to support Mali-400MP GPUs and other mobile GPUs where GLSL shaders did not previously compile. [#2984](https://github.com/CesiumGS/cesium/pull/2984) +* Fixed an issue where extruded `PolygonGeometry` was always extruding to the ellipsoid surface instead of specified height. [#2923](https://github.com/CesiumGS/cesium/pull/2923) +* Fixed an issue where non-feature nodes prevented KML documents from loading. [#2945](https://github.com/CesiumGS/cesium/pull/2945) +* Fixed an issue where `JulianDate` would not parse certain dates properly. [#405](https://github.com/CesiumGS/cesium/issues/405) +* Removed [es5-shim](https://github.com/kriskowal/es5-shim), which is no longer being used. [#2933](https://github.com/CesiumGS/cesium/pull/2945) ### 1.12 - 2015-08-03 * Breaking changes * Remove deprecated `ObjectOrientedBoundingBox`. Use `OrientedBoundingBox` instead. * Added `MapboxImageryProvider` to load imagery from [Mapbox](https://www.mapbox.com). -* Added `maximumHeight` option to `Viewer.flyTo`. [#2868](https://github.com/AnalyticalGraphicsInc/cesium/issues/2868) +* Added `maximumHeight` option to `Viewer.flyTo`. [#2868](https://github.com/CesiumGS/cesium/issues/2868) * Added picking support to `UrlTemplateImageryProvider`. * Added ArcGIS token-based authentication support to `ArcGisMapServerImageryProvider`. * Added proxy support to `ArcGisMapServerImageryProvider` for `pickFeatures` requests. -* The default `CTRL + Left Click Drag` mouse behavior is now duplicated for `CTRL + Right Click Drag` for better compatibility with Firefox on Mac OS [#2872](https://github.com/AnalyticalGraphicsInc/cesium/pull/2913). -* Fixed incorrect texture coordinates for `WallGeometry` [#2872](https://github.com/AnalyticalGraphicsInc/cesium/issues/2872) -* Fixed `WallGeometry` bug that caused walls covering a short distance not to render. [#2897](https://github.com/AnalyticalGraphicsInc/cesium/issues/2897) +* The default `CTRL + Left Click Drag` mouse behavior is now duplicated for `CTRL + Right Click Drag` for better compatibility with Firefox on Mac OS [#2872](https://github.com/CesiumGS/cesium/pull/2913). +* Fixed incorrect texture coordinates for `WallGeometry` [#2872](https://github.com/CesiumGS/cesium/issues/2872) +* Fixed `WallGeometry` bug that caused walls covering a short distance not to render. [#2897](https://github.com/CesiumGS/cesium/issues/2897) * Fixed `PolygonGeometry` clockwise winding order bug. -* Fixed extruded `RectangleGeometry` bug for small heights. [#2823](https://github.com/AnalyticalGraphicsInc/cesium/issues/2823) -* Fixed `BillboardCollection` bounding sphere for billboards with a non-center vertical origin. [#2894](https://github.com/AnalyticalGraphicsInc/cesium/issues/2894) -* Fixed a bug that caused `Camera.positionCartographic` to be incorrect. [#2838](https://github.com/AnalyticalGraphicsInc/cesium/issues/2838) -* Fixed calling `Scene.pickPosition` after calling `Scene.drillPick`. [#2813](https://github.com/AnalyticalGraphicsInc/cesium/issues/2813) +* Fixed extruded `RectangleGeometry` bug for small heights. [#2823](https://github.com/CesiumGS/cesium/issues/2823) +* Fixed `BillboardCollection` bounding sphere for billboards with a non-center vertical origin. [#2894](https://github.com/CesiumGS/cesium/issues/2894) +* Fixed a bug that caused `Camera.positionCartographic` to be incorrect. [#2838](https://github.com/CesiumGS/cesium/issues/2838) +* Fixed calling `Scene.pickPosition` after calling `Scene.drillPick`. [#2813](https://github.com/CesiumGS/cesium/issues/2813) * The globe depth is now rendered during picking when `Scene.depthTestAgainstTerrain` is `true` so objects behind terrain are not picked. * Fixed Cesium.js failing to parse in IE 8 and 9. While Cesium doesn't work in IE versions less than 11, this allows for more graceful error handling. @@ -1691,26 +1722,26 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * The STK World Terrain url `cesiumjs.org/stk-terrain/world` has been deprecated, use `assets.agi.com/stk-terrain/world` instead. A redirect will be in place until 1.14. * Deprecated `AxisAlignedBoundingBox.intersect` and `BoundingSphere.intersect`. These will be removed in 1.13. Use `AxisAlignedBoundingBox.intersectPlane` and `BoundingSphere.intersectPlane` instead. * Deprecated `ObjectOrientedBoundingBox`. It will be removed in 1.12. Use `OrientedBoundingBox` instead. -* Improved camera flights. [#2825](https://github.com/AnalyticalGraphicsInc/cesium/pull/2825) +* Improved camera flights. [#2825](https://github.com/CesiumGS/cesium/pull/2825) * The camera now zooms to the point under the mouse cursor. * Added a new camera mode for horizon views. When the camera is looking at the horizon and a point on terrain above the camera is picked, the camera moves in the plane containing the camera position, up and right vectors. * Improved terrain and imagery performance and reduced tile loading by up to 50%, depending on the camera view, by using the new `OrientedBoundingBox` for view frustum culling. See [Terrain Culling with Oriented Bounding Boxes](http://cesiumjs.org/2015/06/24/Oriented-Bounding-Boxes/). * Added `UrlTemplateImageryProvider`. This new imagery provider allows access to a wide variety of imagery sources, including OpenStreetMap, TMS, WMTS, WMS, WMS-C, and various custom schemes, by specifying a URL template to use to request imagery tiles. -* Fixed flash/streak rendering artifacts when picking. [#2790](https://github.com/AnalyticalGraphicsInc/cesium/issues/2790), [#2811](https://github.com/AnalyticalGraphicsInc/cesium/issues/2811) -* Fixed 2D and Columbus view lighting issue. [#2635](https://github.com/AnalyticalGraphicsInc/cesium/issues/2635). -* Fixed issues with material caching which resulted in the inability to use an image-based material multiple times. [#2821](https://github.com/AnalyticalGraphicsInc/cesium/issues/2821) -* Improved `Camera.viewRectangle` so that the specified rectangle is now better centered on the screen. [#2764](https://github.com/AnalyticalGraphicsInc/cesium/issues/2764) -* Fixed a crash when `viewer.zoomTo` or `viewer.flyTo` were called immediately before or during a scene morph. [#2775](https://github.com/AnalyticalGraphicsInc/cesium/issues/2775) -* Fixed an issue where `Camera` functions would throw an exception if used from within a `Scene.morphComplete` callback. [#2776](https://github.com/AnalyticalGraphicsInc/cesium/issues/2776) -* Fixed camera flights that ended up at the wrong position in Columbus view. [#802](https://github.com/AnalyticalGraphicsInc/cesium/issues/802) -* Fixed camera flights through the map in 2D. [#804](https://github.com/AnalyticalGraphicsInc/cesium/issues/804) -* Fixed strange camera flights from opposite sides of the globe. [#1158](https://github.com/AnalyticalGraphicsInc/cesium/issues/1158) -* Fixed camera flights that wouldn't fly to the home view after zooming out past it. [#1400](https://github.com/AnalyticalGraphicsInc/cesium/issues/1400) -* Fixed flying to rectangles that cross the IDL in Columbus view and 2D. [#2093](https://github.com/AnalyticalGraphicsInc/cesium/issues/2093) -* Fixed flights with a pitch of -90 degrees. [#2468](https://github.com/AnalyticalGraphicsInc/cesium/issues/2468) +* Fixed flash/streak rendering artifacts when picking. [#2790](https://github.com/CesiumGS/cesium/issues/2790), [#2811](https://github.com/CesiumGS/cesium/issues/2811) +* Fixed 2D and Columbus view lighting issue. [#2635](https://github.com/CesiumGS/cesium/issues/2635). +* Fixed issues with material caching which resulted in the inability to use an image-based material multiple times. [#2821](https://github.com/CesiumGS/cesium/issues/2821) +* Improved `Camera.viewRectangle` so that the specified rectangle is now better centered on the screen. [#2764](https://github.com/CesiumGS/cesium/issues/2764) +* Fixed a crash when `viewer.zoomTo` or `viewer.flyTo` were called immediately before or during a scene morph. [#2775](https://github.com/CesiumGS/cesium/issues/2775) +* Fixed an issue where `Camera` functions would throw an exception if used from within a `Scene.morphComplete` callback. [#2776](https://github.com/CesiumGS/cesium/issues/2776) +* Fixed camera flights that ended up at the wrong position in Columbus view. [#802](https://github.com/CesiumGS/cesium/issues/802) +* Fixed camera flights through the map in 2D. [#804](https://github.com/CesiumGS/cesium/issues/804) +* Fixed strange camera flights from opposite sides of the globe. [#1158](https://github.com/CesiumGS/cesium/issues/1158) +* Fixed camera flights that wouldn't fly to the home view after zooming out past it. [#1400](https://github.com/CesiumGS/cesium/issues/1400) +* Fixed flying to rectangles that cross the IDL in Columbus view and 2D. [#2093](https://github.com/CesiumGS/cesium/issues/2093) +* Fixed flights with a pitch of -90 degrees. [#2468](https://github.com/CesiumGS/cesium/issues/2468) * `Model` can now load Binary glTF from a `Uint8Array`. * Fixed a bug in `ImageryLayer` that could cause an exception and the render loop to stop when the base layer did not cover the entire globe. -* The performance statistics displayed when `scene.debugShowFramesPerSecond === true` can now be styled using the `cesium-performanceDisplay` CSS classes in `shared.css` [#2779](https://github.com/AnalyticalGraphicsInc/cesium/issues/2779). +* The performance statistics displayed when `scene.debugShowFramesPerSecond === true` can now be styled using the `cesium-performanceDisplay` CSS classes in `shared.css` [#2779](https://github.com/CesiumGS/cesium/issues/2779). * Added `Plane.fromCartesian4`. * Added `Plane.ORIGIN_XY_PLANE`/`ORIGIN_YZ_PLANE`/`ORIGIN_ZX_PLANE` constants for commonly-used planes. * Added `Matrix2`/`Matrix3`/`Matrix4.ZERO` constants. @@ -1724,7 +1755,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ ### 1.10 - 2015-06-01 * Breaking changes - * Existing bookmarks to documentation of static members have changed [#2757](https://github.com/AnalyticalGraphicsInc/cesium/issues/2757). + * Existing bookmarks to documentation of static members have changed [#2757](https://github.com/CesiumGS/cesium/issues/2757). * Removed `InfoBoxViewModel.defaultSanitizer`, `InfoBoxViewModel.sanitizer`, and `Cesium.sanitize`, which was deprecated in 1.7. * Removed `InfoBoxViewModel.descriptionRawHtml`, which was deprecated in 1.7. Use `InfoBoxViewModel.description` instead. * Removed `GeoJsonDataSource.fromUrl`, which was deprecated in 1.7. Use `GeoJsonDataSource.load` instead. Unlike fromUrl, load can take either a url or parsed JSON object and returns a promise to a new instance, rather than a new instance. @@ -1733,7 +1764,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Removed `CzmlDataSource.prototype.processUrl`, which was deprecated in 1.7. Instead, pass a url as the first parameter to `CzmlDataSource.prototype.process`. * Removed the `sourceUri` parameter to all `CzmlDataSource` load and process functions, which was deprecated in 1.7. Instead pass an `options` object with `sourceUri` property. * Removed `PolygonGraphics.positions` which was deprecated in 1.6. Instead, use `PolygonGraphics.hierarchy`. - * Existing bookmarks to documentation of static members changed. [#2757](https://github.com/AnalyticalGraphicsInc/cesium/issues/2757) + * Existing bookmarks to documentation of static members changed. [#2757](https://github.com/CesiumGS/cesium/issues/2757) * Deprecated * `WebMapServiceImageryProvider` constructor parameters `options.getFeatureInfoAsGeoJson` and `options.getFeatureInfoAsXml` were deprecated and will be removed in Cesium 1.13. Use `options.getFeatureInfoFormats` instead. * Deprecated `Camera.clone`. It will be removed in 1.11. @@ -1751,10 +1782,10 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Added `GeocoderViewModel.complete` event. Triggered after the camera flight is completed. * `KmlDataSource` can now load a KML file that uses explicit XML namespacing, e.g. `kml:Document`. * Setting `Entity.show` now properly toggles the display of all descendant entities, previously it only affected its direct children. -* Fixed a bug that sometimes caused `Entity` instances with `show` set to false to reappear when new `Entity` geometry is added. [#2686](https://github.com/AnalyticalGraphicsInc/cesium/issues/2686) +* Fixed a bug that sometimes caused `Entity` instances with `show` set to false to reappear when new `Entity` geometry is added. [#2686](https://github.com/CesiumGS/cesium/issues/2686) * Added a `Rotation` object which, when passed to `SampledProperty`, always interpolates values towards the shortest angle. Also hooked up CZML to use `Rotation` for all time-dynamic rotations. -* Fixed a bug where moon rendered in front of foreground geometry. [#1964](https://github.com/AnalyticalGraphicsInc/cesium/issue/1964) -* Fixed a bug where the sun was smeared when the skybox/stars was disabled. [#1829](https://github.com/AnalyticalGraphicsInc/cesium/issue/1829) +* Fixed a bug where moon rendered in front of foreground geometry. [#1964](https://github.com/CesiumGS/cesium/issue/1964) +* Fixed a bug where the sun was smeared when the skybox/stars was disabled. [#1829](https://github.com/CesiumGS/cesium/issue/1829) * `TileProviderError` now optionally takes an `error` parameter with more details of the error or exception that occurred. `ImageryLayer` passes that information through when tiles fail to load. This allows tile provider error handling to take a different action when a tile returns a 404 versus a 500, for example. * `ArcGisMapServerImageryProvider` now has a `maximumLevel` constructor parameter. * `ArcGisMapServerImageryProvider` picking now works correctly when the `layers` parameter is specified. Previously, it would pick from all layers even if only displaying a subset. @@ -1781,14 +1812,14 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Removed `DataSourceDisplay.getScene` and `DataSourceDisplay.getDataSources`, both previously deprecated in 1.6. Use `DataSourceDisplay.scene` and `DataSourceDisplay.dataSources` instead. * `Entity` no longer takes a string id as its constructor argument. Pass an options object with `id` property instead. This was previously deprecated in 1.6. * Removed `Model.readyToRender`, previously deprecated in 1.6. Use `Model.readyPromise` instead. -* Entity `material` properties and `Material` uniform values can now take a `canvas` element in addition to an image or url. [#2667](https://github.com/AnalyticalGraphicsInc/cesium/pull/2667) -* Fixed a bug which caused `Entity.viewFrom` to be ignored when flying to, zooming to, or tracking an Entity. [#2628](https://github.com/AnalyticalGraphicsInc/cesium/issues/2628) -* Fixed a bug that caused `Corridor` and `PolylineVolume` geometry to be incorrect for sharp corners [#2626](https://github.com/AnalyticalGraphicsInc/cesium/pull/2626) -* Fixed crash when modifying a translucent entity geometry outline. [#2630](https://github.com/AnalyticalGraphicsInc/cesium/pull/2630) -* Fixed crash when loading KML GroundOverlays that spanned 360 degrees. [#2639](https://github.com/AnalyticalGraphicsInc/cesium/pull/2639) -* Fixed `Geocoder` styling issue in Safari. [#2658](https://github.com/AnalyticalGraphicsInc/cesium/pull/2658). -* Fixed a crash that would occur when the `Viewer` or `CesiumWidget` was resized to 0 while the camera was in motion. [#2662](https://github.com/AnalyticalGraphicsInc/cesium/issues/2662) -* Fixed a bug that prevented the `InfoBox` title from updating if the name of `viewer.selectedEntity` changed. [#2644](https://github.com/AnalyticalGraphicsInc/cesium/pull/2644) +* Entity `material` properties and `Material` uniform values can now take a `canvas` element in addition to an image or url. [#2667](https://github.com/CesiumGS/cesium/pull/2667) +* Fixed a bug which caused `Entity.viewFrom` to be ignored when flying to, zooming to, or tracking an Entity. [#2628](https://github.com/CesiumGS/cesium/issues/2628) +* Fixed a bug that caused `Corridor` and `PolylineVolume` geometry to be incorrect for sharp corners [#2626](https://github.com/CesiumGS/cesium/pull/2626) +* Fixed crash when modifying a translucent entity geometry outline. [#2630](https://github.com/CesiumGS/cesium/pull/2630) +* Fixed crash when loading KML GroundOverlays that spanned 360 degrees. [#2639](https://github.com/CesiumGS/cesium/pull/2639) +* Fixed `Geocoder` styling issue in Safari. [#2658](https://github.com/CesiumGS/cesium/pull/2658). +* Fixed a crash that would occur when the `Viewer` or `CesiumWidget` was resized to 0 while the camera was in motion. [#2662](https://github.com/CesiumGS/cesium/issues/2662) +* Fixed a bug that prevented the `InfoBox` title from updating if the name of `viewer.selectedEntity` changed. [#2644](https://github.com/CesiumGS/cesium/pull/2644) * Added an optional `result` parameter to `computeScreenSpacePosition` on both `Billboard` and `Label`. * Added number of cached shaders to the `CesiumInspector` debugging widget. * An exception is now thrown if `Primitive.modelMatrix` is not the identity matrix when in in 2D or Columbus View. @@ -1811,7 +1842,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Added a new Sandcastle demo, [Interpolation](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Interpolation.html&label=Showcases), which illustrates time-dynamic position interpolation options and uses the new `VelocityOrientationProperty` to orient an aircraft in flight. * Improved `viewer.zoomTo` and `viewer.flyTo` so they are now "best effort" and work even if some entities being zoomed to are not currently in the scene. * Fixed `PointerEvent` detection so that it works with older implementations of the specification. This also fixes lack of mouse handling when detection failed, such as when using Cesium in the Windows `WebBrowser` control. -* Fixed an issue with transparency. [#2572](https://github.com/AnalyticalGraphicsInc/cesium/issues/2572) +* Fixed an issue with transparency. [#2572](https://github.com/CesiumGS/cesium/issues/2572) * Fixed improper handling of null values when loading `GeoJSON` data. * Added support for automatic raster feature picking from `ArcGisMapServerImagerProvider`. * Added the ability to specify the desired tiling scheme, rectangle, and width and height of tiles to the `ArcGisMapServerImagerProvider` constructor. @@ -1850,14 +1881,14 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * `InfoBox` sanitization now relies on [iframe sandboxing](http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/). This allows for much more content to be displayed in the InfoBox (and still be secure). * Added `InfoBox.frame` which is the instance of the iframe that is used to host description content. Sanitization can be controlled via the frame's `sandbox` attribute. See the above link for additional information. * Worked around a bug in Safari that caused most of Cesium to be broken. Cesium should now work much better on Safari for both desktop and mobile. -* Fixed incorrect ellipse texture coordinates. [#2363](https://github.com/AnalyticalGraphicsInc/cesium/issues/2363) and [#2465](https://github.com/AnalyticalGraphicsInc/cesium/issues/2465) -* Fixed a bug that would cause incorrect geometry for long Corridors and Polyline Volumes. [#2513](https://github.com/AnalyticalGraphicsInc/cesium/issues/2513) +* Fixed incorrect ellipse texture coordinates. [#2363](https://github.com/CesiumGS/cesium/issues/2363) and [#2465](https://github.com/CesiumGS/cesium/issues/2465) +* Fixed a bug that would cause incorrect geometry for long Corridors and Polyline Volumes. [#2513](https://github.com/CesiumGS/cesium/issues/2513) * Fixed a bug in imagery loading that could cause some or all of the globe to be missing when using an imagery layer that does not cover the entire globe. -* Fixed a bug that caused `ElipseOutlineGeometry` and `CircleOutlineGeometry` to be extruded to the ground when they should have instead been drawn at height. [#2499](https://github.com/AnalyticalGraphicsInc/cesium/issues/2499). -* Fixed a bug that prevented per-vertex colors from working with `PolylineGeometry` and `SimplePolylineGeometry` when used asynchronously. [#2516](https://github.com/AnalyticalGraphicsInc/cesium/issues/2516) -* Fixed a bug that would caused duplicate graphics if non-time-dynamic `Entity` objects were modified in quick succession. [#2514](https://github.com/AnalyticalGraphicsInc/cesium/issues/2514). -* Fixed a bug where `camera.flyToBoundingSphere` would ignore range if the bounding sphere radius was 0. [#2519](https://github.com/AnalyticalGraphicsInc/cesium/issues/2519) -* Fixed some styling issues with `InfoBox` and `BaseLayerPicker` caused by using Bootstrap with Cesium. [#2487](https://github.com/AnalyticalGraphicsInc/cesium/issues/2479) +* Fixed a bug that caused `ElipseOutlineGeometry` and `CircleOutlineGeometry` to be extruded to the ground when they should have instead been drawn at height. [#2499](https://github.com/CesiumGS/cesium/issues/2499). +* Fixed a bug that prevented per-vertex colors from working with `PolylineGeometry` and `SimplePolylineGeometry` when used asynchronously. [#2516](https://github.com/CesiumGS/cesium/issues/2516) +* Fixed a bug that would caused duplicate graphics if non-time-dynamic `Entity` objects were modified in quick succession. [#2514](https://github.com/CesiumGS/cesium/issues/2514). +* Fixed a bug where `camera.flyToBoundingSphere` would ignore range if the bounding sphere radius was 0. [#2519](https://github.com/CesiumGS/cesium/issues/2519) +* Fixed some styling issues with `InfoBox` and `BaseLayerPicker` caused by using Bootstrap with Cesium. [#2487](https://github.com/CesiumGS/cesium/issues/2479) * Added support for rendering a water effect on Quantized-Mesh terrain tiles. * Added `pack` and `unpack` functions to `Matrix2` and `Matrix3`. * Added camera-terrain collision detection/response when the camera reference frame is set. @@ -1894,9 +1925,9 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Fixed an issue which caused order independent translucency to be broken on many video cards. Disabling order independent translucency should no longer be necessary. * `GeoJsonDataSource` now supports polygons with holes. * Many Sandcastle examples have been rewritten to make use of the newly improved Entity API. -* Instead of throwing an exception when there are not enough unique positions to define a geometry, creating a `Primitive` will succeed, but not render. [#2375](https://github.com/AnalyticalGraphicsInc/cesium/issues/2375) -* Improved performance of asynchronous geometry creation (as much as 20% faster in some use cases). [#2342](https://github.com/AnalyticalGraphicsInc/cesium/issues/2342) -* Fixed picking in 2D. [#2447](https://github.com/AnalyticalGraphicsInc/cesium/issues/2447) +* Instead of throwing an exception when there are not enough unique positions to define a geometry, creating a `Primitive` will succeed, but not render. [#2375](https://github.com/CesiumGS/cesium/issues/2375) +* Improved performance of asynchronous geometry creation (as much as 20% faster in some use cases). [#2342](https://github.com/CesiumGS/cesium/issues/2342) +* Fixed picking in 2D. [#2447](https://github.com/CesiumGS/cesium/issues/2447) * Added `viewer.entities` which allows you to easily create and manage `Entity` instances without a corresponding `DataSource`. This is just a shortcut to `viewer.dataSourceDisplay.defaultDataSource.entities` * Added `viewer.zoomTo` and `viewer.flyTo` which takes an entity, array of entities, `EntityCollection`, or `DataSource` as a parameter and zooms or flies to the corresponding visualization. * Setting `viewer.trackedEntity` to `undefined` will now restore the camera controls to their default states. @@ -1945,10 +1976,10 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Added `BoxGraphics` and `Entity.box`. * Added `CorridorGraphics` and `Entity.corridor`. * Added `CylinderGraphics` and `Entity.cylinder`. -* Fixed imagery providers whose rectangle crosses the IDL. Added `Rectangle.computeWidth`, `Rectangle.computeHeight`, `Rectangle.width`, and `Rectangle.height`. [#2195](https://github.com/AnalyticalGraphicsInc/cesium/issues/2195) +* Fixed imagery providers whose rectangle crosses the IDL. Added `Rectangle.computeWidth`, `Rectangle.computeHeight`, `Rectangle.width`, and `Rectangle.height`. [#2195](https://github.com/CesiumGS/cesium/issues/2195) * `ConstantProperty` now accepts `HTMLElement` instances as valid values. * `BillboardGraphics.image` and `ImageMaterialProperty.image` now accept `Property` instances that represent an `Image` or `Canvas` in addition to a url. -* Fixed a bug in `PolylineGeometry` that would cause gaps in the line. [#2136](https://github.com/AnalyticalGraphicsInc/cesium/issues/2136) +* Fixed a bug in `PolylineGeometry` that would cause gaps in the line. [#2136](https://github.com/CesiumGS/cesium/issues/2136) * Fixed `upsampleQuantizedTerrainMesh` rounding errors that had occasionally led to missing terrain skirt geometry in upsampled tiles. * Added `Math.mod` which computes `m % n` but also works when `m` is negative. @@ -1957,8 +1988,8 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Breaking changes * Types implementing `TerrainProvider` are now required to implement the `getTileDataAvailable` function. Backwards compatibility for this was deprecated in Cesium 1.2. * Deprecated - * The `sourceUri` parameter to `GeoJsonDatasource.load` was deprecated and will be removed in Cesium 1.6 on February 3, 2015 ([#2257](https://github.com/AnalyticalGraphicsInc/cesium/issues/2257)). Use `options.sourceUri` instead. - * `GeometryPipeline.wrapLongitude` was deprecated. It will be removed in Cesium 1.5 on January 2, 2015. Use `GeometryPipeline.splitLongitude`. ([#2272](https://github.com/AnalyticalGraphicsInc/cesium/issues/2272)) + * The `sourceUri` parameter to `GeoJsonDatasource.load` was deprecated and will be removed in Cesium 1.6 on February 3, 2015 ([#2257](https://github.com/CesiumGS/cesium/issues/2257)). Use `options.sourceUri` instead. + * `GeometryPipeline.wrapLongitude` was deprecated. It will be removed in Cesium 1.5 on January 2, 2015. Use `GeometryPipeline.splitLongitude`. ([#2272](https://github.com/CesiumGS/cesium/issues/2272)) * `GeometryPipeline.combine` was deprecated. It will be removed in Cesium 1.5. Use `GeometryPipeline.combineInstances`. * Added support for touch events on Internet Explorer 11 using the [Pointer Events API](http://www.w3.org/TR/pointerevents/). * Added geometry outline width support to the `DataSource` layer. This is exposed via the new `outlineWidth` property on `EllipseGraphics`, `EllipsoidGraphics`, `PolygonGraphics`, `RectangleGraphics`, and `WallGraphics`. @@ -1971,7 +2002,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Improved point visualization performance for all DataSources. * Improved the performance and memory usage of `EllipseGeometry`, `EllipseOutlineGeometry`, `CircleGeometry`, and `CircleOutlineGeometry`. * Added `tileMatrixLabels` option to `WebMapTileServiceImageryProvider`. -* Fixed a bug in `PolylineGeometry` that would cause the geometry to be split across the IDL for 3D only scenes. [#1197](https://github.com/AnalyticalGraphicsInc/cesium/issues/1197) +* Fixed a bug in `PolylineGeometry` that would cause the geometry to be split across the IDL for 3D only scenes. [#1197](https://github.com/CesiumGS/cesium/issues/1197) * Added `modelMatrix` and `cull` options to `Primitive` constructor. * The `translation` parameter to `Matrix4.fromRotationTranslation` now defaults to `Cartesian3.ZERO`. * Fixed `ModelNode.matrix` when a node is targeted for animation. @@ -1983,13 +2014,13 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ ### 1.3 - 2014-11-03 -* Worked around a shader compilation regression in Firefox 33 and 34 by falling back to a less precise shader on those browsers. [#2197](https://github.com/AnalyticalGraphicsInc/cesium/issues/2197) +* Worked around a shader compilation regression in Firefox 33 and 34 by falling back to a less precise shader on those browsers. [#2197](https://github.com/CesiumGS/cesium/issues/2197) * Added support to the `CesiumTerrainProvider` for terrain tiles with more than 64K vertices, which is common for sub-meter terrain. * Added `Primitive.compressVertices`. When true (default), geometry vertices are compressed to save GPU memory. * Added `culture` option to `BingMapsImageryProvider` constructor. * Reduced the amount of GPU memory used by billboards and labels. -* Fixed a bug that caused non-base imagery layers with a limited `rectangle` to be stretched to the edges of imagery tiles. [#416](https://github.com/AnalyticalGraphicsInc/cesium/issues/416) -* Fixed rendering polylines with duplicate positions. [#898](https://github.com/AnalyticalGraphicsInc/cesium/issues/898) +* Fixed a bug that caused non-base imagery layers with a limited `rectangle` to be stretched to the edges of imagery tiles. [#416](https://github.com/CesiumGS/cesium/issues/416) +* Fixed rendering polylines with duplicate positions. [#898](https://github.com/CesiumGS/cesium/issues/898) * Fixed a bug in `Globe.pick` that caused it to return incorrect results when using terrain data with vertex normals. The bug manifested itself as strange behavior when navigating around the surface with the mouse as well as incorrect results when using `Camera.viewRectangle`. * Fixed a bug in `sampleTerrain` that could cause it to produce undefined heights when sampling for a position very near the edge of a tile. * `ReferenceProperty` instances now retain their last value if the entity being referenced is removed from the target collection. The reference will be automatically reattached if the target is reintroduced. @@ -2002,7 +2033,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * Deprecated * Types implementing the `TerrainProvider` interface should now include the new `getTileDataAvailable` function. The function will be required starting in Cesium 1.4. * Fixed model orientations to follow the same Z-up convention used throughout Cesium. There was also an orientation issue fixed in the [online model converter](http://cesiumjs.org/convertmodel.html). If you are having orientation issues after updating, try reconverting your models. -* Fixed a bug in `Model` where the wrong animations could be used when the model was created from glTF JSON instead of a url to a glTF file. [#2078](https://github.com/AnalyticalGraphicsInc/cesium/issues/2078) +* Fixed a bug in `Model` where the wrong animations could be used when the model was created from glTF JSON instead of a url to a glTF file. [#2078](https://github.com/CesiumGS/cesium/issues/2078) * Fixed a bug in `GeoJsonDataSource` which was causing polygons with height values to be drawn onto the surface. * Fixed a bug that could cause a crash when quickly adding and removing imagery layers. * Eliminated imagery artifacts at some zoom levels due to Mercator reprojection. @@ -2133,7 +2164,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * `VRTheWorldTerrainProvider.hasWaterMask` * Removed `ScreenSpaceCameraController.ellipsoid`. The behavior that depended on the ellipsoid is now determined based on the scene state. * Sandcastle examples now automatically wrap the example code in RequireJS boilerplate. To upgrade any custom examples, copy the code into an existing example (such as Hello World) and save a new file. - * Removed `CustomSensorVolume`, `RectangularPyramidSensorVolume`, `DynamicCone`, `DynamicConeVisualizerUsingCustomSensor`, `DynamicPyramid` and `DynamicPyramidVisualizer`. This will be moved to a plugin in early August. [#1887](https://github.com/AnalyticalGraphicsInc/cesium/issues/1887) + * Removed `CustomSensorVolume`, `RectangularPyramidSensorVolume`, `DynamicCone`, `DynamicConeVisualizerUsingCustomSensor`, `DynamicPyramid` and `DynamicPyramidVisualizer`. This will be moved to a plugin in early August. [#1887](https://github.com/CesiumGS/cesium/issues/1887) * If `Primitive.modelMatrix` is changed after creation, it only affects primitives with one instance and only in 3D mode. * `ImageryLayer` properties `alpha`, `brightness`, `contrast`, `hue`, `saturation`, and `gamma` may no longer be functions. If you need to change these values each frame, consider moving your logic to an event handler for `Scene.preRender`. * Removed `closeTop` and `closeBottom` options from `RectangleGeometry`. @@ -2151,7 +2182,7 @@ _This is an npm-only release to fix an issue with using Cesium in Node.js.__ * The `orientation` property has been changed to match Cesium convention. To update existing CZML documents, conjugate the quaternion values. * `pixelOffset` now uses the top-left of the screen as the origin; previously it was the bottom-left. To update existing documents, negate the `y` value. * Removed `color`, `outlineColor`, and `outlineWidth` properties from `polyline` and `path`. There is a new `material` property that allows you to specify a variety of materials, such as `solidColor`, `polylineOutline` and `polylineGlow`. - * See the [CZML Schema](https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Content) for more details. We plan on greatly improving this document in the coming weeks. + * See the [CZML Schema](https://github.com/CesiumGS/cesium/wiki/CZML-Content) for more details. We plan on greatly improving this document in the coming weeks. * Added camera collision detection with terrain to the default mouse interaction. * Modified the default camera tilt mouse behavior to tilt about the point clicked, taking into account terrain. * Modified the default camera mouse behavior to look about the camera's position when the sky is clicked. @@ -2272,7 +2303,7 @@ Beta Releases * Replaced `color`, `outlineColor`, and `outlineWidth` in `DynamicPath` with a `material` property. * `ModelAnimationCollection.add` and `ModelAnimationCollection.addAll` renamed `options.startOffset` to `options.delay`. Also renamed `ModelAnimation.startOffset` to `ModelAnimation.delay`. * Replaced `Scene.scene2D.projection` property with read-only `Scene.mapProjection`. Set this with the `mapProjection` option for the `Viewer`, `CesiumWidget`, or `Scene` constructors. - * Moved Fresnel, Reflection, and Refraction materials to the [Materials Pack Plugin](https://github.com/AnalyticalGraphicsInc/cesium-materials-pack). + * Moved Fresnel, Reflection, and Refraction materials to the [Materials Pack Plugin](https://github.com/CesiumGS/cesium-materials-pack). * Renamed `Simon1994PlanetaryPositions` functions `ComputeSunPositionInEarthInertialFrame` and `ComputeMoonPositionInEarthInertialFrame` to `computeSunPositionInEarthInertialFrame` and `computeMoonPositionInEarthInertialFrame`, respectively. * `Scene` constructor function now takes an `options` parameter instead of individual parameters. * `CesiumWidget.showErrorPanel` now takes a `message` parameter in between the previous `title` and `error` parameters. @@ -2332,7 +2363,7 @@ Beta Releases * Removed `CameraColumbusViewMode`. * Removed `Enumeration`. * Added new functions to `Cartesian3`: `fromDegrees`, `fromRadians`, `fromDegreesArray`, `fromRadiansArray`, `fromDegreesArray3D` and `fromRadiansArray3D`. Added `fromRadians` to `Cartographic`. -* Fixed dark lighting in 3D and Columbus View when viewing a primitive edge on. ([#592](https://github.com/AnalyticalGraphicsInc/cesium/issues/592)) +* Fixed dark lighting in 3D and Columbus View when viewing a primitive edge on. ([#592](https://github.com/CesiumGS/cesium/issues/592)) * Improved Internet Explorer 11.0.8 support including workarounds for rendering labels, billboards, and the sun. * Improved terrain and imagery rendering performance when very close to the surface. * Added `preRender` and `postRender` events to `Scene`. @@ -2386,7 +2417,7 @@ Beta Releases * `getChangedEvent` -> `changedEvent` * `getDynamicObjectCollection` -> `dynamicObjects` * `getErrorEvent` -> `errorEvent` - * `BaseLayerPicker` has been extended to support terrain selection ([#1607](https://github.com/AnalyticalGraphicsInc/cesium/pull/1607)). + * `BaseLayerPicker` has been extended to support terrain selection ([#1607](https://github.com/CesiumGS/cesium/pull/1607)). * The `BaseLayerPicker` constructor function now takes the container element and an options object instead of a CentralBody and ImageryLayerCollection. * The `BaseLayerPickerViewModel` constructor function now takes an options object instead of a `CentralBody` and `ImageryLayerCollection`. * `ImageryProviderViewModel` -> `ProviderViewModel` @@ -2567,8 +2598,8 @@ Beta Releases * Replaced `SceneTransitioner` with new functions and properties on the `Scene`: `morphTo2D`, `morphToColumbusView`, `morphTo3D`, `completeMorphOnUserInput`, `morphStart`, `morphComplete`, and `completeMorph`. * Removed `TexturePool`. * Improved visual quality for translucent objects with [Weighted Blended Order-Independent Transparency](http://cesiumjs.org/2014/03/14/Weighted-Blended-Order-Independent-Transparency/). -* Fixed extruded polygons rendered in the southern hemisphere. [#1490](https://github.com/AnalyticalGraphicsInc/cesium/issues/1490) -* Fixed Primitive picking that have a closed appearance drawn on the surface. [#1333](https://github.com/AnalyticalGraphicsInc/cesium/issues/1333) +* Fixed extruded polygons rendered in the southern hemisphere. [#1490](https://github.com/CesiumGS/cesium/issues/1490) +* Fixed Primitive picking that have a closed appearance drawn on the surface. [#1333](https://github.com/CesiumGS/cesium/issues/1333) * Added `StripeMaterialProperty` for supporting the `Stripe` material in DynamicScene. * `loadArrayBuffer`, `loadBlob`, `loadJson`, `loadText`, and `loadXML` now support loading data from data URIs. * The `debugShowBoundingVolume` property on primitives now works across all scene modes. @@ -2691,17 +2722,17 @@ Beta Releases * `BingMapsImageryProvider` now uses HTTPS by default for metadata and tiles when the document is loaded over HTTPS. * Added the ability for imagery providers to specify view-dependent attribution to be display in the `CreditDisplay`. * View-dependent imagery source attribution is now added to the `CreditDisplay` by the `BingMapsImageryProvider`. -* Fixed viewing an extent. [#1431](https://github.com/AnalyticalGraphicsInc/cesium/issues/1431) -* Fixed camera tilt in ICRF. [#544](https://github.com/AnalyticalGraphicsInc/cesium/issues/544) -* Fixed developer error when zooming in 2D. If the zoom would create an invalid frustum, nothing is done. [#1432](https://github.com/AnalyticalGraphicsInc/cesium/issues/1432) -* Fixed `WallGeometry` bug that failed by removing positions that were less close together by less than 6 decimal places. [#1483](https://github.com/AnalyticalGraphicsInc/cesium/pull/1483) -* Fixed `EllipsoidGeometry` texture coordinates. [#1454](https://github.com/AnalyticalGraphicsInc/cesium/issues/1454) -* Added a loop property to `Polyline`s to join the first and last point. [#960](https://github.com/AnalyticalGraphicsInc/cesium/issues/960) +* Fixed viewing an extent. [#1431](https://github.com/CesiumGS/cesium/issues/1431) +* Fixed camera tilt in ICRF. [#544](https://github.com/CesiumGS/cesium/issues/544) +* Fixed developer error when zooming in 2D. If the zoom would create an invalid frustum, nothing is done. [#1432](https://github.com/CesiumGS/cesium/issues/1432) +* Fixed `WallGeometry` bug that failed by removing positions that were less close together by less than 6 decimal places. [#1483](https://github.com/CesiumGS/cesium/pull/1483) +* Fixed `EllipsoidGeometry` texture coordinates. [#1454](https://github.com/CesiumGS/cesium/issues/1454) +* Added a loop property to `Polyline`s to join the first and last point. [#960](https://github.com/CesiumGS/cesium/issues/960) * Use `performance.now()` instead of `Date.now()`, when available, to limit time spent loading terrain and imagery tiles. This results in more consistent frame rates while loading tiles on some systems. * `RequestErrorEvent` now includes the headers that were returned with the error response. * Added `AssociativeArray`, which is a helper class for maintaining a hash of objects that also needs to be iterated often. * Added `TimeIntervalCollection.getChangedEvent` which returns an event that will be raised whenever intervals are updated. -* Added a second parameter to `Material.fromType` to override default uniforms. [#1522](https://github.com/AnalyticalGraphicsInc/cesium/pull/1522) +* Added a second parameter to `Material.fromType` to override default uniforms. [#1522](https://github.com/CesiumGS/cesium/pull/1522) * Added `Intersections2D` class containing operations on 2D triangles. * Added `czm_inverseViewProjection` and `czm_inverseModelViewProjection` automatic GLSL uniform. @@ -2711,7 +2742,7 @@ Beta Releases * The `Viewer` constructor argument `options.fullscreenElement` now matches the `FullscreenButton` default of `document.body`, it was previously the `Viewer` container itself. * Removed `Viewer.objectTracked` event; `Viewer.trackedObject` is now an ES5 Knockout observable that can be subscribed to directly. * Replaced `PerformanceDisplay` with `Scene.debugShowFramesPerSecond`. - * `Asphalt`, `Blob`, `Brick`, `Cement`, `Erosion`, `Facet`, `Grass`, `TieDye`, and `Wood` materials were moved to the [Materials Pack Plugin](https://github.com/AnalyticalGraphicsInc/cesium-materials-pack). + * `Asphalt`, `Blob`, `Brick`, `Cement`, `Erosion`, `Facet`, `Grass`, `TieDye`, and `Wood` materials were moved to the [Materials Pack Plugin](https://github.com/CesiumGS/cesium-materials-pack). * Renamed `GeometryPipeline.createAttributeIndices` to `GeometryPipeline.createAttributeLocations`. * Renamed `attributeIndices` property to `attributeLocations` when calling `Context.createVertexArrayFromGeometry`. * `PerformanceDisplay` requires a DOM element as a parameter. @@ -2719,7 +2750,7 @@ Beta Releases * `Viewer` now monitors the clock settings of the first added `DataSource` for changes, and also now has a constructor option `automaticallyTrackFirstDataSourceClock` which will turn off this behavior. * The `DynamicObjectCollection` created by `CzmlDataSource` now sends a single `collectionChanged` event after CZML is loaded; previously it was sending an event every time an object was created or removed during the load process. * Added `ScreenSpaceCameraController.enableInputs` to fix issue with inputs not being restored after overlapping camera flights. -* Fixed picking in 2D with rotated map. [#1337](https://github.com/AnalyticalGraphicsInc/cesium/issues/1337) +* Fixed picking in 2D with rotated map. [#1337](https://github.com/CesiumGS/cesium/issues/1337) * `TileMapServiceImageryProvider` can now handle casing differences in tilemapresource.xml. * `OpenStreetMapImageryProvider` now supports imagery with a minimum level. * Added `Quaternion.fastSlerp` and `Quaternion.fastSquad`. @@ -2939,8 +2970,8 @@ Beta Releases * Rendering over a thousand polylines in the same collection with different materials went from 20 to 40 frames per second. * Improved runtime generation of GLSL shaders. * Made sun size accurate. -* Fixed bug in triangulation that fails on complex polygons. Instead, it makes a best effort to render what it can. [#1121](https://github.com/AnalyticalGraphicsInc/cesium/issues/1121) -* Fixed geometries not closing completely. [#1093](https://github.com/AnalyticalGraphicsInc/cesium/issues/1093) +* Fixed bug in triangulation that fails on complex polygons. Instead, it makes a best effort to render what it can. [#1121](https://github.com/CesiumGS/cesium/issues/1121) +* Fixed geometries not closing completely. [#1093](https://github.com/CesiumGS/cesium/issues/1093) * Fixed `EllipsoidTangentPlane.projectPointOntoPlane` for tangent planes on an ellipsoid other than the unit sphere. * `CompositePrimitive.add` now returns the added primitive. This allows us to write more concise code. @@ -2954,11 +2985,11 @@ Beta Releases ### b20 - 2013-09-03 -_This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https://github.com/AnalyticalGraphicsInc/cesium/issues/1002) and [#1047](https://github.com/AnalyticalGraphicsInc/cesium/issues/1047))._ +_This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https://github.com/CesiumGS/cesium/issues/1002) and [#1047](https://github.com/CesiumGS/cesium/issues/1047))._ * Breaking changes: * The `CameraFlightPath` functions `createAnimation`, `createAnimationCartographic`, and `createAnimationExtent` now take `scene` as their first parameter instead of `frameState`. - * Completely refactored the `DynamicScene` property system to vastly improve the API. See [#1080](https://github.com/AnalyticalGraphicsInc/cesium/pull/1080) for complete details. + * Completely refactored the `DynamicScene` property system to vastly improve the API. See [#1080](https://github.com/CesiumGS/cesium/pull/1080) for complete details. * Removed `CzmlBoolean`, `CzmlCartesian2`, `CzmlCartesian3`, `CzmlColor`, `CzmlDefaults`, `CzmlDirection`, `CzmlHorizontalOrigin`, `CzmlImage`, `CzmlLabelStyle`, `CzmlNumber`, `CzmlPosition`, `CzmlString`, `CzmlUnitCartesian3`, `CzmlUnitQuaternion`, `CzmlUnitSpherical`, and `CzmlVerticalOrigin` since they are no longer needed. * Removed `DynamicProperty`, `DynamicMaterialProperty`, `DynamicDirectionsProperty`, and `DynamicVertexPositionsProperty`; replacing them with an all new system of properties. * `Property` - base interface for all properties. @@ -3004,7 +3035,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * `DeveloperError` and `RuntimeError` no longer contain an `error` property. Call `toString`, or check the `stack` property directly instead. * Replaced `createPickFragmentShaderSource` with `createShaderSource`. * Renamed `PolygonPipeline.earClip2D` to `PolygonPipeline.triangulate`. -* Added outline geometries. [#1021](https://github.com/AnalyticalGraphicsInc/cesium/pull/1021). +* Added outline geometries. [#1021](https://github.com/CesiumGS/cesium/pull/1021). * Added `CorridorGeometry`. * Added `Billboard.scaleByDistance` and `NearFarScalar` to control billboard minimum/maximum scale based on camera distance. * Added `EllipsoidGeodesic`. @@ -3027,7 +3058,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * `CameraFlightPath` now automatically disables and restores mouse input for the flights it generates. * Fixed broken surface rendering in Columbus View when using the `EllipsoidTerrainProvider`. * Fixed triangulation for polygons that cross the international date line. -* Fixed `EllipsoidPrimitive` rendering for some oblate ellipsoids. [#1067](https://github.com/AnalyticalGraphicsInc/cesium/pull/1067). +* Fixed `EllipsoidPrimitive` rendering for some oblate ellipsoids. [#1067](https://github.com/CesiumGS/cesium/pull/1067). * Fixed Cesium on Nexus 4 with Android 4.3. * Upgraded Knockout from version 2.2.1 to 2.3.0. @@ -3053,7 +3084,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * Added `surfaceHeight` parameter to `Extent.subsample`. * Renamed `pointInsideTriangle2D` to `pointInsideTriangle`. * Renamed `getLogo` to `getCredit` for `ImageryProvider` and `TerrainProvider`. -* Added Geometry and Appearances [#911](https://github.com/AnalyticalGraphicsInc/cesium/pull/911). +* Added Geometry and Appearances [#911](https://github.com/CesiumGS/cesium/pull/911). * Added property `intersectionWidth` to `DynamicCone`, `DynamicPyramid`, `CustomSensorVolume`, and `RectangularPyramidSensorVolume`. * Added `ExtentPrimitive`. * Added `PolylinePipeline.removeDuplicates`. @@ -3071,7 +3102,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https ### b18 - 2013-07-01 * Breaking changes: - * Removed `CesiumViewerWidget` and replaced it with a new `Viewer` widget with mixin architecture. This new widget does not depend on Dojo and is part of the combined Cesium.js file. It is intended to be a flexible base widget for easily building robust applications. ([#838](https://github.com/AnalyticalGraphicsInc/cesium/pull/838)) + * Removed `CesiumViewerWidget` and replaced it with a new `Viewer` widget with mixin architecture. This new widget does not depend on Dojo and is part of the combined Cesium.js file. It is intended to be a flexible base widget for easily building robust applications. ([#838](https://github.com/CesiumGS/cesium/pull/838)) * Changed all widgets to use ECMAScript 5 properties. All public observable properties now must be accessed and assigned as if they were normal properties, instead of being called as functions. For example: * `clockViewModel.shouldAnimate()` -> `clockViewModel.shouldAnimate` * `clockViewModel.shouldAnimate(true);` -> `clockViewModel.shouldAnimate = true;` @@ -3083,8 +3114,8 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * The `Client CZML` SandCastle demo has been removed, largely because it is redundant with the Simple CZML demo. * The `Two Viewer Widgets` SandCastle demo has been removed. We will add back a multi-scene example when we have a good architecture for it in place. * Changed static `clone` functions in all objects such that if the object being cloned is undefined, the function will return undefined instead of throwing an exception. -* Fix resizing issues in `CesiumWidget` ([#608](https://github.com/AnalyticalGraphicsInc/cesium/issues/608), [#834](https://github.com/AnalyticalGraphicsInc/cesium/issues/834)). -* Added initial support for [GeoJSON](http://www.geojson.org/) and [TopoJSON](https://github.com/mbostock/topojson). ([#890](https://github.com/AnalyticalGraphicsInc/cesium/pull/890), [#906](https://github.com/AnalyticalGraphicsInc/cesium/pull/906)) +* Fix resizing issues in `CesiumWidget` ([#608](https://github.com/CesiumGS/cesium/issues/608), [#834](https://github.com/CesiumGS/cesium/issues/834)). +* Added initial support for [GeoJSON](http://www.geojson.org/) and [TopoJSON](https://github.com/mbostock/topojson). ([#890](https://github.com/CesiumGS/cesium/pull/890), [#906](https://github.com/CesiumGS/cesium/pull/906)) * Added rotation, aligned axis, width, and height properties to `Billboard`s. * Improved the performance of "missing tile" checking, especially for Bing imagery. * Improved the performance of terrain and imagery refinement, especially when using a mixture of slow and fast imagery sources. @@ -3110,7 +3141,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * Removed `addAttribute`, `removeAttribute`, and `setIndexBuffer` from `VertexArray`. They were not used. * Added support for approximating local vertical, local horizontal (LVLH) reference frames when using `DynamicObjectView` in 3D. The object automatically selects LVLH or EastNorthUp based on the object's velocity. * Added support for CZML defined vectors via new `CzmlDirection`, `DynamicVector`, and `DynamicVectorVisualizer` objects. -* Added `SceneTransforms.wgs84ToWindowCoordinates`. [#746](https://github.com/AnalyticalGraphicsInc/cesium/issues/746). +* Added `SceneTransforms.wgs84ToWindowCoordinates`. [#746](https://github.com/CesiumGS/cesium/issues/746). * Added `fromElements` to `Cartesian2`, `Cartesian3`, and `Cartesian4`. * Added `DrawCommand.cull` to avoid redundant visibility checks. * Added `czm_morphTime` automatic GLSL uniform. @@ -3125,8 +3156,8 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * Added camera flight to extents. See new methods `CameraController.getExtentCameraCoordinates` and `CameraFlightPath.createAnimationExtent`. * Improved the load ordering of terrain and imagery tiles, so that relevant detail is now more likely to be loaded first. * Improved appearance of the Polyline arrow material. -* Fixed polyline clipping artifact. [#728](https://github.com/AnalyticalGraphicsInc/cesium/issues/728). -* Fixed polygon crossing International Date Line for 2D and Columbus view. [#99](https://github.com/AnalyticalGraphicsInc/cesium/issues/99). +* Fixed polyline clipping artifact. [#728](https://github.com/CesiumGS/cesium/issues/728). +* Fixed polygon crossing International Date Line for 2D and Columbus view. [#99](https://github.com/CesiumGS/cesium/issues/99). * Fixed issue for camera flights when `frameState.mode === SceneMode.MORPHING`. * Fixed ISO8601 date parsing when UTC offset is specified in the extended format, such as `2008-11-10T14:00:00+02:30`. @@ -3163,7 +3194,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * `RenderState` objects returned from `Context.createRenderState` are now immutable. * Removed `positionMC` from `czm_materialInput`. It is no longer used by any materials. * Added wide polylines that work with and without ANGLE. -* Polylines now use materials to describe their surface appearance. See the [Fabric](https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric) wiki page for more details on how to create materials. +* Polylines now use materials to describe their surface appearance. See the [Fabric](https://github.com/CesiumGS/cesium/wiki/Fabric) wiki page for more details on how to create materials. * Added new `PolylineOutline`, `PolylineGlow`, `PolylineArrow`, and `Fade` materials. * Added `czm_pixelSizeInMeters` automatic GLSL uniform. * Added `AnimationViewModel.snapToTicks`, which when set to true, causes the shuttle ring on the Animation widget to snap to the defined tick values, rather than interpolate between them. @@ -3233,7 +3264,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * Removed `erosion` property from `Polygon`, `ComplexConicSensorVolume`, `RectangularPyramidSensorVolume`, and `ComplexConicSensorVolume`. Use the new `Erosion` material. See the Sandbox Animation example. * Removed `setRectangle` and `getRectangle` methods from `ViewportQuad`. Use the new `rectangle` property. * Removed `time` parameter from `Scene.initializeFrame`. Instead, pass the time to `Scene.render`. -* Added new `RimLighting` and `Erosion` materials. See the [Fabric](https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric) wiki page. +* Added new `RimLighting` and `Erosion` materials. See the [Fabric](https://github.com/CesiumGS/cesium/wiki/Fabric) wiki page. * Added `hue` and `saturation` properties to `ImageryLayer`. * Added `czm_hue` and `czm_saturation` to adjust the hue and saturation of RGB colors. * Added `JulianDate.getDaysDifference` method. @@ -3241,7 +3272,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * Added `EarthOrientationParameters`, `EarthOrientationParametersSample`, `Iau2006XysData`, and `Iau2006XysDataSample` classes to `Core`. * CZML now supports the ability to specify positions in the International Celestial Reference Frame (ICRF), and inertial reference frame. * Fixed globe rendering on the Nexus 4 running Google Chrome Beta. -* `ViewportQuad` now supports the material system. See the [Fabric](https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric) wiki page. +* `ViewportQuad` now supports the material system. See the [Fabric](https://github.com/CesiumGS/cesium/wiki/Fabric) wiki page. * Fixed rendering artifacts in `EllipsoidPrimitive`. * Fixed an issue where streaming CZML would fail when changing material types. * Updated Dojo from 1.7.2 to 1.8.4. Reminder: Cesium does not depend on Dojo but uses it for reference applications. @@ -3355,7 +3386,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https ### b9 - 2012-10-01 * Breaking changes: - * Removed the `render` and `renderForPick` functions of primitives. The primitive `update` function updates a list of commands for the renderer. For more details, see the [Data Driven Renderer](https://github.com/AnalyticalGraphicsInc/cesium/wiki/Data-Driven-Renderer-Details). + * Removed the `render` and `renderForPick` functions of primitives. The primitive `update` function updates a list of commands for the renderer. For more details, see the [Data Driven Renderer](https://github.com/CesiumGS/cesium/wiki/Data-Driven-Renderer-Details). * Removed `Context.getViewport` and `Context.setViewport`. The viewport defaults to the size of the canvas if a primitive does not override the viewport property in the render state. * `shallowEquals` has been removed. * Passing `undefined` to any of the set functions on `Billboard` now throws an exception. @@ -3375,7 +3406,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https ### b8 - 2012-09-05 * Breaking changes: - * Materials are now created through a centralized Material class using a JSON schema called [Fabric](https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric). For example, change: + * Materials are now created through a centralized Material class using a JSON schema called [Fabric](https://github.com/CesiumGS/cesium/wiki/Fabric). For example, change: polygon.material = new BlobMaterial({repeat : 10.0}); @@ -3426,7 +3457,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * Added support for nested polygons with holes. See `Polygon.configureFromPolygonHierarchy`. * Added support to the renderer for view frustum and central body occlusion culling. All built-in primitives, such as `BillboardCollection`, `Polygon`, `PolylineCollection`, etc., can be culled. See the advanced examples in the Sandbox for details. * Added `writeTextToCanvas` function which handles sizing the resulting canvas to fit the desired text. -* Added support for CZML path visualization via the `DynamicPath` and `DynamicPathVisualizer` objects. See the [CZML wiki](https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Guide) for more details. +* Added support for CZML path visualization via the `DynamicPath` and `DynamicPathVisualizer` objects. See the [CZML wiki](https://github.com/CesiumGS/cesium/wiki/CZML-Guide) for more details. * Added support for [WEBGL_depth_texture](http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/). See `Framebuffer.setDepthTexture`. * Added `CesiumMath.isPowerOfTwo`. * Added `affectedByLighting` to `ComplexConicSensorVolume`, `CustomSensorVolume`, and `RectangularPyramidSensorVolume` to turn lighting on/off for these objects. @@ -3521,7 +3552,7 @@ _This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https * Added `LagrangePolynomialApproximation`, `HermitePolynomialApproximation`, and `LinearApproximation` interpolation algorithms. * Added `CoordinateConversions`, a new static class where most coordinate conversion methods will be stored. * Added `Spherical` coordinate type -* Added a new DynamicScene layer for time-dynamic, data-driven visualization. This include CZML processing. For more details see https://github.com/AnalyticalGraphicsInc/cesium/wiki/Architecture and https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-in-Cesium. +* Added a new DynamicScene layer for time-dynamic, data-driven visualization. This include CZML processing. For more details see https://github.com/CesiumGS/cesium/wiki/Architecture and https://github.com/CesiumGS/cesium/wiki/CZML-in-Cesium. * Added a new application, Cesium Viewer, for viewing CZML files and otherwise exploring the globe. * Added a new Widgets directory, to contain common re-usable Cesium related controls. * Added a new Timeline widget to the Widgets directory. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 2892144624e2..da5b2687bfff 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,5 +1,5 @@ -# Code of Conduct +# Code of Conduct -One of Cesium's strengths is our community. Our contributors and users are pushing the 3D geospatial field to amazing new levels. We rely on an open, friendly, inclusive environment to facilitate this. As such, we follow the [Contributor Covenant](http://contributor-covenant.org/)'s [Code of Conduct](http://contributor-covenant.org/version/1/4/code-of-conduct.md) to ensure a harassment-free experience in the Cesium community. Any unacceptable behavior can be confidentially sent to the core team at pcozzi@agi.com. +One of Cesium's strengths is our community. Our contributors and users are pushing the 3D geospatial field to amazing new levels. We rely on an open, friendly, inclusive environment to facilitate this. As such, we follow the [Contributor Covenant](http://contributor-covenant.org/)'s [Code of Conduct](http://contributor-covenant.org/version/1/4/code-of-conduct.md) to ensure a harassment-free experience in the Cesium community. Any unacceptable behavior can be confidentially sent to the core team at hello@cesium.com. -This applies to the main Cesium repo, forum, twitter, and all channels, including all repos in the [AnalyticalGraphicsInc](https://github.com/AnalyticalGraphicsInc) GitHub organization. +This applies to the main Cesium repo, forum, twitter, and all channels, including all repos in the [CesiumGS](https://github.com/CesiumGS) GitHub organization. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28741509c9d3..6059562d4f1a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,12 +10,12 @@ To ensure an inclusive community, contributors and users in the Cesium community If you have a question, do not submit an issue; instead, search the [Cesium forum](https://groups.google.com/forum/?hl=en#!forum/cesium-dev). The forum is very active and there are years of informative archives, often with answers from the core Cesium team. If you do not find an answer to your question, start a new thread and you'll likely get a quick response. -If you think you've found a bug in CesiumJS, first search the [issues](https://github.com/AnalyticalGraphicsInc/cesium/issues). If an issue already exists, please add a comment expressing your interest and any additional information. This helps us prioritize issues. +If you think you've found a bug in CesiumJS, first search the [issues](https://github.com/CesiumGS/cesium/issues). If an issue already exists, please add a comment expressing your interest and any additional information. This helps us prioritize issues. If a related issue does not exist, submit a new one. Please be concise and include as much of the following information as is relevant: * Minimum amount of sample code (and data) shared through [Sandcastle](https://sandcastle.cesium.com). -* Screenshot or animated .gif if appropriate (try [LICEcap](http://www.cockos.com/licecap/)). For example, see [#3153](https://github.com/AnalyticalGraphicsInc/cesium/issues/3153). Screenshots are particularly useful for exceptions and rendering artifacts. If it is a rendering artifact, also include the output of [webglreport.com](http://webglreport.com/). -* Link to the thread if this was discussed on the Cesium forum or elsewhere. For example, see [#3045](https://github.com/AnalyticalGraphicsInc/cesium/issues/3045). +* Screenshot or animated .gif if appropriate (try [LICEcap](http://www.cockos.com/licecap/)). For example, see [#3153](https://github.com/CesiumGS/cesium/issues/3153). Screenshots are particularly useful for exceptions and rendering artifacts. If it is a rendering artifact, also include the output of [webglreport.com](http://webglreport.com/). +* Link to the thread if this was discussed on the Cesium forum or elsewhere. For example, see [#3045](https://github.com/CesiumGS/cesium/issues/3045). * Your operating system and version, browser and version, and video card. Are they all up-to-date? Is the issue specific to one of them? * The version of Cesium. Did this work in a previous version? * Ideas for how to fix or workaround the issue. Also mention if you are willing to help fix it. If so, the Cesium team can often provide guidance and the issue may get fixed more quickly with your help. @@ -28,15 +28,15 @@ In addition to contributing core CesiumJS code, we appreciate many types of cont * Being active on the [Cesium forum](https://groups.google.com/forum/?hl=en#!forum/cesium-dev) by answering questions and providing input on Cesium's direction. * Showcasing your Cesium apps on [Cesium blog](https://cesium.com/blog/categories/userstories/). Contact us at hello@cesium.com. -* Writing tutorials, creating examples, and improving the reference documentation. See the issues labeled [doc](https://github.com/AnalyticalGraphicsInc/cesium/labels/doc). +* Writing tutorials, creating examples, and improving the reference documentation. See the issues labeled [doc](https://github.com/CesiumGS/cesium/labels/doc). * Submitting issues as [described above](#submitting-an-issue). -* Triaging issues. Browse the [issues](https://github.com/AnalyticalGraphicsInc/cesium/issues) and comment on issues that are no longer reproducible or on issues which you have additional information. -* Creating ecosystem projects for [glTF](https://github.com/KhronosGroup/glTF/issues/456), [CZML](https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Guide), and [3D Tiles](https://github.com/AnalyticalGraphicsInc/3d-tiles). +* Triaging issues. Browse the [issues](https://github.com/CesiumGS/cesium/issues) and comment on issues that are no longer reproducible or on issues which you have additional information. +* Creating ecosystem projects for [glTF](https://github.com/KhronosGroup/glTF/issues/456), [CZML](https://github.com/CesiumGS/cesium/wiki/CZML-Guide), and [3D Tiles](https://github.com/CesiumGS/3d-tiles). For ideas for CesiumJS code contributions, see: -* issues labeled [`good first issue`](https://github.com/AnalyticalGraphicsInc/cesium/labels/good%20first%20issue) and -* issues labeled [`roadmap`](https://github.com/AnalyticalGraphicsInc/cesium/labels/roadmap). +* issues labeled [`good first issue`](https://github.com/CesiumGS/cesium/labels/good%20first%20issue) and +* issues labeled [`roadmap`](https://github.com/CesiumGS/cesium/labels/roadmap). See the [Build Guide](Documentation/Contributors/BuildGuide/README.md) for how to build and run Cesium on your system. @@ -55,7 +55,7 @@ Before we can review a pull request, we require a signed Contributor License Agr * [individuals](https://docs.google.com/forms/d/e/1FAIpQLScU-yvQdcdjCFHkNXwdNeEXx5Qhu45QXuWX_uF5qiLGFSEwlA/viewform) and * [corporations](https://docs.google.com/forms/d/e/1FAIpQLSeYEaWlBl1tQEiegfHMuqnH9VxyfgXGyIw13C2sN7Fj3J3GVA/viewform). -This only needs to be completed once, and enables contributions to all of the projects under the [Analytical Graphics Inc](https://github.com/AnalyticalGraphicsInc) organization, including CesiumJS. The CLA ensures you retain copyright to your contributions, and provides us the right to use, modify, and redistribute your contributions using the [Apache 2.0 License](LICENSE.md). +This only needs to be completed once, and enables contributions to all of the projects under the [CesiumGS](https://github.com/CesiumGS) organization, including CesiumJS. The CLA ensures you retain copyright to your contributions, and provides us the right to use, modify, and redistribute your contributions using the [Apache 2.0 License](LICENSE.md). If you have any questions, feel free to reach out to [hello@cesium.com](mailto:hello@cesium)! @@ -64,11 +64,11 @@ If you have any questions, feel free to reach out to [hello@cesium.com](mailto:h Our code is our lifeblood so maintaining CesiumJS's high code quality is important to us. * Review the [Contributor Guides](Documentation/Contributors/README.md). In addition to CesiumJS-specific topics, they contain a lot of general software development best practices. -* If this is your first contribution to CesiumJS, add your name to [CONTRIBUTORS.md](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTORS.md). +* If this is your first contribution to CesiumJS, add your name to [CONTRIBUTORS.md](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTORS.md). * For an overview of our workflow see [github pull request workflows](https://cesium.com/blog/2013/10/08/github-pull-request-workflows/). * Pull request tips - * After you open a pull request, the friendly [cesium-concierge](https://github.com/AnalyticalGraphicsInc/cesium-concierge) bot will comment with a short automated review. At least one human will also review your pull request. - * If your pull request fixes an existing issue, include a link to the issue in the description (like this: [#1](https://github.com/AnalyticalGraphicsInc/cesium/issues/1)). Likewise, if your pull request fixes an issue reported on the Cesium forum, include a link to the thread. + * After you open a pull request, the friendly [cesium-concierge](https://github.com/CesiumGS/cesium-concierge) bot will comment with a short automated review. At least one human will also review your pull request. + * If your pull request fixes an existing issue, include a link to the issue in the description (like this: [#1](https://github.com/CesiumGS/cesium/issues/1)). Likewise, if your pull request fixes an issue reported on the Cesium forum, include a link to the thread. * If your pull request needs additional work, include a [task list](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments). * Once you are done making new commits to address feedback, add a comment to the pull request such as `"this is ready"` since GitHub doesn't notify us about commits. * Code and tests @@ -79,7 +79,7 @@ Our code is our lifeblood so maintaining CesiumJS's high code quality is importa * Update [CHANGES.md](CHANGES.md). * Include reference documentation with code examples. Follow the [Documentation Guide](Documentation/Contributors/DocumentationGuide/README.md). * If the change is significant, add a new [Sandcastle](https://sandcastle.cesium.com) example or extend and existing one. - * If you added third-party libraries, including new version of existing libraries, update [LICENSE.md](LICENSE.md). Mention it in [CHANGES.md](CHANGES.md). If you plan to add a third-party library, start a [GitHub issue](https://github.com/AnalyticalGraphicsInc/cesium/issues/new) discussing it first. + * If you added third-party libraries, including new version of existing libraries, update [LICENSE.md](LICENSE.md). Mention it in [CHANGES.md](CHANGES.md). If you plan to add a third-party library, start a [GitHub issue](https://github.com/CesiumGS/cesium/issues/new) discussing it first. ## Code of Conduct diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0d1f53cc3781..905ceae486e4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -50,7 +50,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Omar Shehata](https://github.com/OmarShehata) * [Matt Petry](https://github.com/MattPetry) * [Michael Squires](https://github.com/mksquires) - * [Sam Suhag](https://github.com/sanjeetsuhag) * [NICTA/CSIRO's Data61](https://www.data61.csiro.au/) * [Kevin Ring](https://github.com/kring) * [Keith Grochow](https://github.com/kgrochow) @@ -141,6 +140,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Peter Gagliardi](https://github.com/ptrgags) * [Ian Lilley](https://github.com/IanLilleyT) * [Samuel Vargas](https://github.com/Samulus) + * [Sam Suhag](https://github.com/sanjeetsuhag) * [Northrop Grumman](http://www.northropgrumman.com) * [Joseph Stein](https://github.com/nahgrin) * [EOX IT Services GmbH](https://eox.at) @@ -244,5 +244,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Tinco Andringa](https://github.com/tinco) * [André Borud](https://github.com/andreborud) * [Nathan Schulte](https://github.com/nmschulte) +* [Ricardo Morin](https://github.com/jimmyangel) * [Jan Wąsak](https://github.com/jhnwsk) * [Julian Fell](https://github.com/jtfell) +* [Richard Becker](https://github.com/richard3d) +* [Daniel Leone](https://github.com/danielleone) +* [Zhou Jiang](https://github.com/aboutqx) diff --git a/Documentation/Contributors/BuildGuide/README.md b/Documentation/Contributors/BuildGuide/README.md index 276ebed379b0..d7d2ad0a659e 100644 --- a/Documentation/Contributors/BuildGuide/README.md +++ b/Documentation/Contributors/BuildGuide/README.md @@ -14,14 +14,14 @@ * Recommended Git settings: * `git config --global pull.rebase preserve` - when pulling remote changes, rebase your local changes on top of the remote changes, to avoid unnecessary merge commits. * `git config --global fetch.prune true` - when fetching remote changes, remove any remote branches that no longer exist on the remote. -* Have [commit access](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Documentation/Contributors/CommittersGuide/README.md) to CesiumJS? +* Have [commit access](https://github.com/CesiumGS/cesium/blob/master/Documentation/Contributors/CommittersGuide/README.md) to CesiumJS? * No - * Fork [cesium](https://github.com/AnalyticalGraphicsInc/cesium). - * Use the [GitHub website](https://github.com/AnalyticalGraphicsInc/cesium/branches/all) to delete all branches in your fork except `master`. + * Fork [cesium](https://github.com/CesiumGS/cesium). + * Use the [GitHub website](https://github.com/CesiumGS/cesium/branches/all) to delete all branches in your fork except `master`. * Clone your fork, e.g., `git clone git@github.com:yourusername/cesium.git`. * Make changes in a branch, e.g., `git checkout -b my-feature`. * Yes - * Clone the cesium repo, e.g., `git clone git@github.com:AnalyticalGraphicsInc/cesium.git` + * Clone the cesium repo, e.g., `git clone git@github.com:CesiumGS/cesium.git` * Make changes in a branch, e.g., `git checkout -b my-feature`. ## Build the Code @@ -51,8 +51,8 @@ Then browse to [http://localhost:8080/](http://localhost:8080/). The landing pag * **Hello World** : an example using the combined and minified Cesium library to create a 3D globe. [Tutorial here](http://cesiumjs.org/tutorials/cesium-up-and-running/) * **Sandcastle** : an app for viewing and creating [code examples](https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Hello%20World.html&label=Showcases), complete with a live preview -* **Test Suites** : tests using [Jasmine](https://jasmine.github.io/). [Testing guide here.](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Documentation/Contributors/TestingGuide/README.md#testing-guide) -* **Documentation** : reference documentation built from source. [Documentation guide here.](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Documentation/Contributors/DocumentationGuide/README.md#documentation-guide) +* **Test Suites** : tests using [Jasmine](https://jasmine.github.io/). [Testing guide here.](https://github.com/CesiumGS/cesium/blob/master/Documentation/Contributors/TestingGuide/README.md#testing-guide) +* **Documentation** : reference documentation built from source. [Documentation guide here.](https://github.com/CesiumGS/cesium/blob/master/Documentation/Contributors/DocumentationGuide/README.md#documentation-guide) Cesium can be used in two different ways. Cesium can be either a set of modules using [Asynchronous Module Definition (AMD)](https://github.com/amdjs/amdjs-api/wiki/AMD), or it can be built as one combined file containing all modules. The basics: @@ -130,7 +130,7 @@ Travis triggers a build whenever someone opens a pull request or pushes code to ![Checks](checks_failed.jpg) -You can also access the build of any branch of CesiumJS by going to the [Cesium Branches](https://github.com/AnalyticalGraphicsInc/cesium/branches/all) page, and clicking the icon next to the branch name. +You can also access the build of any branch of CesiumJS by going to the [Cesium Branches](https://github.com/CesiumGS/cesium/branches/all) page, and clicking the icon next to the branch name. ![Branches](branches.png) diff --git a/Documentation/Contributors/CodeReviewGuide/README.md b/Documentation/Contributors/CodeReviewGuide/README.md index b14e50b00074..fb468b61a99b 100644 --- a/Documentation/Contributors/CodeReviewGuide/README.md +++ b/Documentation/Contributors/CodeReviewGuide/README.md @@ -14,9 +14,9 @@ This guide describes best practices for code reviewers. * It is ultimately the responsibility of the pull request opener to get their changes merged. They should champion their code being merged and should bump the PR or `@mention` a specific developer if it is not getting the necessary attention. * GitHub has great [tools for code reviews in pull requests](https://help.github.com/articles/using-pull-requests/#reviewing-proposed-changes) that you should become familiar with. -* We need a CLA for any contribution. If we don't have a CLA for the contributor who opened the pull request (or, more precisely, any contributor to the branch), the Cesium Concierge will ask for one. If you receive no updates, politely ask for one before reviewing the pull request ([example](https://github.com/AnalyticalGraphicsInc/cesium/pull/2918#issuecomment-127805425)). +* We need a CLA for any contribution. If we don't have a CLA for the contributor who opened the pull request (or, more precisely, any contributor to the branch), the Cesium Concierge will ask for one. If you receive no updates, politely ask for one before reviewing the pull request ([example](https://github.com/CesiumGS/cesium/pull/2918#issuecomment-127805425)). * Most pull requests require additional work, minor or major, before being merged. Sometime pull requests are submitted incomplete for early feedback. Include a [task list](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) covering the steps that must be completed before merging. -* Anyone is encouraged to review any pull request that interests them. However, someone familiar with the changed code should ultimately merge it. +* Anyone is encouraged to review any pull request that interests them. However, someone familiar with the changed code should ultimately merge it. * It's OK to provide a few comments without taking responsibility for the final merge, for example commenting on the state of the public API or a Sandcastle example. However, be explicit that you will not be reviewing again. This sometimes happens when a reviewer wants to take a quick look at the public API or code examples but not all the implementation details. ## Reviewing @@ -61,7 +61,7 @@ This guide describes best practices for code reviewers. Sometimes it is useful to clean up the pull request. Here are some scenarios and how to tackle them. The tips below will use the following keywords: * **origin** will refer to the user fork, ie. `git@github.com/username/cesium.git`. -* **upstream** will refer to the AGI repo, ie. `git@github.com/AnalyticalGraphicsInc/cesium.git`. +* **upstream** will refer to the CesiumGS repo, ie. `git@github.com/CesiumGS/cesium.git`. * **mybranch** will refer to your local branch name. * **target** will refer to the target branch the PR is to be merged into (and also the source for `mybranch`). @@ -120,16 +120,16 @@ git push -f origin mybranch # Requires force push as it is changing existing his GitHub's [hub](https://hub.github.com) makes checking-out PR's simple. For example, run: - ```hub checkout https://github.com/AnalyticalGraphicsInc/cesium/pull/3941``` - + ```hub checkout https://github.com/CesiumGS/cesium/pull/3941``` + This will create a new branch with the contents of the pull request. Also, you can easily add remote forks with: - + ```hub fetch boomer_jones,pjcozzi``` - + which will automatically add these repos as remotes and fetch them. See the hub [open-source maintainer section](https://hub.github.com/#maintainer) for more info. - + ## Resources * [Practice Conspicuous Code Review](http://producingoss.com/en/producingoss.html#code-review) in [Producing Open Source Software](http://producingoss.com/). diff --git a/Documentation/Contributors/CodingGuide/README.md b/Documentation/Contributors/CodingGuide/README.md index 3648cfa493f2..24c35c5bd5f5 100644 --- a/Documentation/Contributors/CodingGuide/README.md +++ b/Documentation/Contributors/CodingGuide/README.md @@ -62,7 +62,7 @@ this._canvas = canvas; ``` * Constants are in uppercase with underscores, e.g., ```javascript -Cartesian3.UNIT_X = freezeObject(new Cartesian3(1.0, 0.0, 0.0)); +Cartesian3.UNIT_X = Object.freeze(new Cartesian3(1.0, 0.0, 0.0)); ``` * Avoid abbreviations in public identifiers unless the full name is prohibitively cumbersome and has a widely accepted abbreviation, e.g., ```javascript @@ -140,7 +140,7 @@ function Model(options) { ## Linting -For syntax and style guidelines, we use the ESLint recommended settings (the list of rules can be found [here](http://eslint.org/docs/rules/)) as a base and extend it with additional rules via a shared config Node module, [eslint-config-cesium](https://www.npmjs.com/package/eslint-config-cesium). This package is maintained as a part of the Cesium repository and is also used throughout the Cesium ecosystem. For a list of which rules are enabled, look in [index.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Tools/eslint-config-cesium/index.js), [browser.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Tools/eslint-config-cesium/browser.js), and [node.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Tools/eslint-config-cesium/node.js). +For syntax and style guidelines, we use the ESLint recommended settings (the list of rules can be found [here](http://eslint.org/docs/rules/)) as a base and extend it with additional rules via a shared config Node module, [eslint-config-cesium](https://www.npmjs.com/package/eslint-config-cesium). This package is maintained as a part of the Cesium repository and is also used throughout the Cesium ecosystem. For a list of which rules are enabled, look in [index.js](https://github.com/CesiumGS/cesium/blob/master/Tools/eslint-config-cesium/index.js), [browser.js](https://github.com/CesiumGS/cesium/blob/master/Tools/eslint-config-cesium/browser.js), and [node.js](https://github.com/CesiumGS/cesium/blob/master/Tools/eslint-config-cesium/node.js). **General rules:** - [block-scoped-var](http://eslint.org/docs/rules/block-scoped-var) @@ -284,20 +284,15 @@ if (defined(u)) { // True } ``` -* Use Cesium's `freezeObject` function to create enums, e.g., +* Use `Object.freeze` function to create enums, e.g., ```javascript -define([ - '../Core/freezeObject' - ], function( - freezeObject) { - 'use strict'; var ModelAnimationState = { STOPPED : 0, ANIMATING : 1 }; - return freezeObject(ModelAnimationState); + return Object.freeze(ModelAnimationState); }); ``` * Use descriptive comments for non-obvious code, e.g., @@ -429,7 +424,7 @@ Some common sensible defaults are ### Throwing Exceptions -Use the functions of Cesium's [Check](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/Check.js) class to throw a `DeveloperError` when the user has a coding error. The most common errors are parameters that are missing, have the wrong type or are out of rangers of the wrong type or are out of range. +Use the functions of Cesium's [Check](https://github.com/CesiumGS/cesium/blob/master/Source/Core/Check.js) class to throw a `DeveloperError` when the user has a coding error. The most common errors are parameters that are missing, have the wrong type or are out of rangers of the wrong type or are out of range. * For example, to check that a parameter is defined and is an object: ```javascript @@ -629,9 +624,9 @@ The prototype versions have the benefit of being able to be used polymorphically ### Static Constants -To create a static constant related to a class, use `freezeObject`: +To create a static constant related to a class, use `Object.freeze`: ```javascript -Cartesian3.ZERO = freezeObject(new Cartesian3(0.0, 0.0, 0.0)); +Cartesian3.ZERO = Object.freeze(new Cartesian3(0.0, 0.0, 0.0)); ``` ### Private Functions @@ -678,13 +673,13 @@ function Model(options) { }; ``` -Read-only properties can be created with a private property and a getter using Cesium's `defineProperties` function, e.g., +Read-only properties can be created with a private property and a getter using `Object.defineProperties` function, e.g., ```javascript function Cesium3DTileset(options) { this._url = options.url; }; -defineProperties(Cesium3DTileset.prototype, { +Object.defineProperties(Cesium3DTileset.prototype, { url : { get : function() { return this._url; @@ -696,7 +691,7 @@ Getters can perform any needed computation to return the property, but the perfo Setters can also perform computation before assigning to a private property, set a flag to delay computation, or both, for example: ```javascript -defineProperties(UniformState.prototype, { +Object.defineProperties(UniformState.prototype, { viewport : { get : function() { return this._viewport; @@ -774,13 +769,13 @@ even though it relies on implicitly hoisting the `loadTileset` function to the t * :house: Make a class or function part of the Cesium API only if it will likely be useful to end users; avoid making an implementation detail part of the public API. When something is public, it makes the Cesium API bigger and harder to learn, is harder to change later, and requires more documentation work. * :art: Put new classes and functions in the right part of the Cesium stack (directory). From the bottom up: - * `Source/Core` - Number crunching. Pure math such as [`Cartesian3`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/Cartesian3.js). Pure geometry such as [`CylinderGeometry`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/CylinderGeometry.js). Fundamental algorithms such as [`mergeSort`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/mergeSort.js). Request helper functions such as [`loadArrayBuffer`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/loadArrayBuffer.js). - * `Source/Renderer` - WebGL abstractions such as [`ShaderProgram`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Renderer/ShaderProgram.js) and WebGL-specific utilities such as [`ShaderCache`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Renderer/ShaderCache.js). Identifiers in this directory are not part of the public Cesium API. - * `Source/Scene` - The graphics engine, including primitives such as [Model](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Model.js). Code in this directory often depends on `Renderer`. - * `Source/DataSources` - Entity API, such as [`Entity`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/DataSources/Entity.js), and data sources such as [`CzmlDataSource`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/DataSources/CzmlDataSource.js). - * `Source/Widgets` - Widgets such as the main Cesium [`Viewer`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/Viewer.js). + * `Source/Core` - Number crunching. Pure math such as [`Cartesian3`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/Cartesian3.js). Pure geometry such as [`CylinderGeometry`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/CylinderGeometry.js). Fundamental algorithms such as [`mergeSort`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/mergeSort.js). Request helper functions such as [`loadArrayBuffer`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/loadArrayBuffer.js). + * `Source/Renderer` - WebGL abstractions such as [`ShaderProgram`](https://github.com/CesiumGS/cesium/blob/master/Source/Renderer/ShaderProgram.js) and WebGL-specific utilities such as [`ShaderCache`](https://github.com/CesiumGS/cesium/blob/master/Source/Renderer/ShaderCache.js). Identifiers in this directory are not part of the public Cesium API. + * `Source/Scene` - The graphics engine, including primitives such as [Model](https://github.com/CesiumGS/cesium/blob/master/Source/Scene/Model.js). Code in this directory often depends on `Renderer`. + * `Source/DataSources` - Entity API, such as [`Entity`](https://github.com/CesiumGS/cesium/blob/master/Source/DataSources/Entity.js), and data sources such as [`CzmlDataSource`](https://github.com/CesiumGS/cesium/blob/master/Source/DataSources/CzmlDataSource.js). + * `Source/Widgets` - Widgets such as the main Cesium [`Viewer`](https://github.com/CesiumGS/cesium/blob/master/Source/Widgets/Viewer/Viewer.js). -It is usually obvious what directory a file belongs in. When it isn't, the decision is usually between `Core` and another directory. Put the file in `Core` if it is pure number crunching or a utility that is expected to be generally useful to Cesium, e.g., [`Matrix4`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/Matrix4.js) belongs in `Core` since many parts of the Cesium stack use 4x4 matrices; on the other hand, [`BoundingSphereState`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/DataSources/BoundingSphereState.js) is in `DataSources` because it is specific to data sources. +It is usually obvious what directory a file belongs in. When it isn't, the decision is usually between `Core` and another directory. Put the file in `Core` if it is pure number crunching or a utility that is expected to be generally useful to Cesium, e.g., [`Matrix4`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/Matrix4.js) belongs in `Core` since many parts of the Cesium stack use 4x4 matrices; on the other hand, [`BoundingSphereState`](https://github.com/CesiumGS/cesium/blob/master/Source/DataSources/BoundingSphereState.js) is in `DataSources` because it is specific to data sources. ![](1.jpg) @@ -790,14 +785,12 @@ Modules (files) should only reference modules in the same level or a lower level ```javascript define([ '../Core/defaultValue', - '../Core/defineProperties', '../Core/Event', '../Core/JulianDate', './ModelAnimationLoop', './ModelAnimationState' ], function( defaultValue, - defineProperties, Event, JulianDate, ModelAnimationLoop, @@ -830,7 +823,7 @@ An `@experimental` API is subject to breaking changes in future Cesium releases A public identifier (class, function, property) should be deprecated before being removed. To do so: * Decide on which future version the deprecated API should be removed. This is on a case-by-case basis depending on how badly it impacts users and Cesium development. Most deprecated APIs will removed in 1-3 releases. This can be discussed in the pull request if needed. -* Use [`deprecationWarning`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/deprecationWarning.js) to warn users that the API is deprecated and what proactive changes they can take, e.g., +* Use [`deprecationWarning`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/deprecationWarning.js) to warn users that the API is deprecated and what proactive changes they can take, e.g., ```javascript function Foo() { deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); @@ -839,8 +832,8 @@ function Foo() { ``` * Add the [`@deprecated`](http://usejsdoc.org/tags-deprecated.html) doc tag. * Remove all use of the deprecated API inside Cesium except for unit tests that specifically test the deprecated API. -* Mention the deprecation in the `Deprecated` section of [`CHANGES.md`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CHANGES.md). Include what Cesium version it will be removed in. -* Create an [issue](https://github.com/AnalyticalGraphicsInc/cesium/issues) to remove the API with the appropriate `remove in [version]` label. +* Mention the deprecation in the `Deprecated` section of [`CHANGES.md`](https://github.com/CesiumGS/cesium/blob/master/CHANGES.md). Include what Cesium version it will be removed in. +* Create an [issue](https://github.com/CesiumGS/cesium/issues) to remove the API with the appropriate `remove in [version]` label. ## Third-Party Libraries @@ -857,7 +850,7 @@ Cesium includes a handful of standard widgets that are used in the Viewer, inclu To learn about using the Knockout library, see the [Get started](http://knockoutjs.com/) section of their home page. They also have a great [interactive tutorial](http://learn.knockoutjs.com/) with step by step instructions. -Cesium also uses the [Knockout-ES5](http://blog.stevensanderson.com/2013/05/20/knockout-es5-a-plugin-to-simplify-your-syntax/) plugin to simplify knockout syntax. This lets us use knockout observables the same way we use other variables. Call `knockout.track` to create the observables. Here is an example from [BaseLayerPickerViewModel](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel.js#L73) that makes observables for `tooltip`, `showInstructions` and `_touch` properties. +Cesium also uses the [Knockout-ES5](http://blog.stevensanderson.com/2013/05/20/knockout-es5-a-plugin-to-simplify-your-syntax/) plugin to simplify knockout syntax. This lets us use knockout observables the same way we use other variables. Call `knockout.track` to create the observables. Here is an example from [BaseLayerPickerViewModel](https://github.com/CesiumGS/cesium/blob/master/Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel.js#L73) that makes observables for `tooltip`, `showInstructions` and `_touch` properties. ``` javascript knockout.track(this, ['tooltip', 'showInstructions', '_touch']); @@ -865,11 +858,11 @@ knockout.track(this, ['tooltip', 'showInstructions', '_touch']); ### Knockout subscriptions -Use a knockout subscription only when you are unable to accomplish what you need to do with a standard binding. For [example](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/Viewer.js#L588), the `Viewer` subscribes to `FullscreenButtonViewModel.isFullscreenEnabled` because it needs to change the width of the timeline widget when that value changes. This cannot be done with binding because the value from `FullscreenButtonViewModel` is affecting a value not contained within that widget. +Use a knockout subscription only when you are unable to accomplish what you need to do with a standard binding. For [example](https://github.com/CesiumGS/cesium/blob/master/Source/Widgets/Viewer/Viewer.js#L588), the `Viewer` subscribes to `FullscreenButtonViewModel.isFullscreenEnabled` because it needs to change the width of the timeline widget when that value changes. This cannot be done with binding because the value from `FullscreenButtonViewModel` is affecting a value not contained within that widget. -Cesium includes a [`subscribeAndEvaluate`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/subscribeAndEvaluate.js) helper function for subscribing to knockout observable. +Cesium includes a [`subscribeAndEvaluate`](https://github.com/CesiumGS/cesium/blob/master/Source/Widgets/subscribeAndEvaluate.js) helper function for subscribing to knockout observable. -When using a subscription, always be sure to [dispose the subscription](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/Viewer.js#L1413) when the viewmodel is no longer using it. Otherwise the listener will continue to be notified for the lifetime of the observable. +When using a subscription, always be sure to [dispose the subscription](https://github.com/CesiumGS/cesium/blob/master/Source/Widgets/Viewer/Viewer.js#L1413) when the viewmodel is no longer using it. Otherwise the listener will continue to be notified for the lifetime of the observable. ``` fullscreenSubscription = subscribeAndEvaluate(fullscreenButton.viewModel, 'isFullscreenEnabled', function(isFullscreenEnabled) { ... }); @@ -881,10 +874,10 @@ fullscreenSubscription.dispose(); ### Naming -* GLSL files end with `.glsl` and are in the [Shaders](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Source/Shaders) directory. +* GLSL files end with `.glsl` and are in the [Shaders](https://github.com/CesiumGS/cesium/tree/master/Source/Shaders) directory. * Files for vertex shaders have a `VS` suffix; fragment shaders have an `FS` suffix. For example: `BillboardCollectionVS.glsl` and `BillboardCollectionFS.glsl`. * Generally, identifiers, such as functions and variables, use `camelCase`. -* Cesium built-in identifiers start with `czm_`, for example, [`czm_material`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Shaders/Builtin/Structs/material.glsl). Files have the same name without the `czm_` prefix, e.g., `material.glsl`. +* Cesium built-in identifiers start with `czm_`, for example, [`czm_material`](https://github.com/CesiumGS/cesium/blob/master/Source/Shaders/Builtin/Structs/material.glsl). Files have the same name without the `czm_` prefix, e.g., `material.glsl`. * Varyings start with `v_`, e.g., ```javascript varying vec2 v_textureCoordinates; diff --git a/Documentation/Contributors/DocumentationGuide/README.md b/Documentation/Contributors/DocumentationGuide/README.md index 7d17410fef74..dea159818ec1 100644 --- a/Documentation/Contributors/DocumentationGuide/README.md +++ b/Documentation/Contributors/DocumentationGuide/README.md @@ -6,7 +6,7 @@ This guide describes best practices for writing reference doc. Always include doc for new identifiers (classes, functions, properties, constants) in the public CesiumJS API. -Generally, just follow the patterns that are already in comparable parts of the code, e.g., if you are documenting a new utility function in `Core`, look at a function in `Core` such as [`binarySearch`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/binarySearch.js); likewise, if you are documenting a new class in `Scene`, look at a similar class such as [`Model`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Model.js). +Generally, just follow the patterns that are already in comparable parts of the code, e.g., if you are documenting a new utility function in `Core`, look at a function in `Core` such as [`binarySearch`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/binarySearch.js); likewise, if you are documenting a new class in `Scene`, look at a similar class such as [`Model`](https://github.com/CesiumGS/cesium/blob/master/Source/Scene/Model.js). * [Building the Doc](#building-the-doc) * [Basics](#basics) @@ -114,7 +114,7 @@ The CesiumJS classes in the `Type` column are links to their doc. ## `options` Parameters -Each property of an `options` parameter (see the [Coding Guide](https://github.com/AnalyticalGraphicsInc/cesium/true/master/Documentation/Contributors/CodingGuide/README.md#options-parameters)) should be documented with a separate `@param` tag, e.g., +Each property of an `options` parameter (see the [Coding Guide](https://github.com/CesiumGS/cesium/true/master/Documentation/Contributors/CodingGuide/README.md#options-parameters)) should be documented with a separate `@param` tag, e.g., ``` * @param {Object} [options] Object with the following properties: * @param {Number} [options.length=10000000.0] The length of the axes in meters. @@ -270,7 +270,7 @@ function Cartesian3(x, y) { ``` * Use `@memberOf` when documenting property getter/setters, e.g., ```javascript -defineProperties(Entity.prototype, { +Object.defineProperties(Entity.prototype, { /** * Gets or sets whether this entity should be displayed. When set to true, * the entity is only displayed if the parent entity's show property is also true. @@ -290,7 +290,7 @@ defineProperties(Entity.prototype, { ``` * Use `@readonly` to indicate read-only properties, e.g., ```javascript -defineProperties(Entity.prototype, { +Object.defineProperties(Entity.prototype, { /** * Gets the unique ID associated with this object. * @@ -315,7 +315,7 @@ defineProperties(Entity.prototype, { * @type {Cartesian3} * @constant */ -Cartesian3.ZERO = freezeObject(new Cartesian3(0.0, 0.0, 0.0)); +Cartesian3.ZERO = Object.freeze(new Cartesian3(0.0, 0.0, 0.0)); ``` ## Functions and Callbacks @@ -378,7 +378,7 @@ Queue.prototype.sort = function(compareFunction) { ## Private -Documentation is not generated for private members that start with `_`. It is often useful to still write doc comments for them for maintainability (see the [Coding Guide](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/CodingGuide/README.md#design)). +Documentation is not generated for private members that start with `_`. It is often useful to still write doc comments for them for maintainability (see the [Coding Guide](https://github.com/CesiumGS/cesium/tree/master/Documentation/Contributors/CodingGuide/README.md#design)). If a member or function doesn't start with `_`, but is intended to be private, use the `@private` tag at the bottom of the documentation, e.g., ```javascript diff --git a/Documentation/Contributors/TestingGuide/README.md b/Documentation/Contributors/TestingGuide/README.md index 001f39fb7d71..e9ac16df53d4 100644 --- a/Documentation/Contributors/TestingGuide/README.md +++ b/Documentation/Contributors/TestingGuide/README.md @@ -37,7 +37,6 @@ All new code should have 100% code coverage and should pass all tests. Always r * [Pragmatic Advice](#pragmatic-advice) * [Start with a Similar (Small) Test](#start-with-a-similar-small-test) * [Debugger-Aided Incremental Improvements](#debugger-aided-incremental-improvements) -* [Testing in WebStorm](#testing-in-webstorm) * [Resources](#resources) ## Running the Tests @@ -106,7 +105,7 @@ However, many users build apps using the built Cesium.js in `Build/Cesium` (whic The **Run All Tests against Combined File with Debug Code Removed** is the same except it is for use with the release version of the built Cesium.js (which is created, for example, by running `npm run combineRelease`). The release version has `DeveloperError` exceptions optimized out so this test option makes `toThrowDeveloperError` always pass. -See the [Build Guide](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Documentation/Contributors/BuildGuide/README.md#build-scripts) for all the CesiumJS build options. +See the [Build Guide](https://github.com/CesiumGS/cesium/blob/master/Documentation/Contributors/BuildGuide/README.md#build-scripts) for all the CesiumJS build options. ## Run Coverage @@ -200,9 +199,9 @@ Sometimes it is useful to see if an issue exists in a previous version of Cesium ## `testfailure` Label for Issues -Despite our best efforts, sometimes tests fail. This is often due to a new browser, OS, or driver bug that breaks a test that previously passed. If this indicates a bug in CesiumJS, we strive to quickly fix it. Likewise, if it indicates that CesiumJS needs to work around the issue (for example, as we [did for Safari 9](https://github.com/AnalyticalGraphicsInc/cesium/issues/2989)), we also strive to quickly fix it. +Despite our best efforts, sometimes tests fail. This is often due to a new browser, OS, or driver bug that breaks a test that previously passed. If this indicates a bug in CesiumJS, we strive to quickly fix it. Likewise, if it indicates that CesiumJS needs to work around the issue (for example, as we [did for Safari 9](https://github.com/CesiumGS/cesium/issues/2989)), we also strive to quickly fix it. -If a test failure is likely due to a browser, OS, or driver bug, or a poorly written test, and the failure does not impact actual CesiumJS apps, we sometimes submit an issue with the [testfailure](https://github.com/AnalyticalGraphicsInc/cesium/labels/test%20failure) label to fix it at a later time. A great way to contribute to CesiumJS is to help fix these issues. +If a test failure is likely due to a browser, OS, or driver bug, or a poorly written test, and the failure does not impact actual CesiumJS apps, we sometimes submit an issue with the [testfailure](https://github.com/CesiumGS/cesium/labels/test%20failure) label to fix it at a later time. A great way to contribute to CesiumJS is to help fix these issues. ## Writing Tests @@ -210,17 +209,17 @@ We _love_ to write tests. We often write them as we write engine code (meaning ### Directory Organization -Tests are located in the [Specs](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Specs) directory (recall, Jasmine calls a test a "spec"), which has a directory structure that mirrors the [Source](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Source) directory. For example, all the tests for files in `Source/Core` are in `Specs/Core`. Likewise, all the tests for `Source/Core/Cartesian3.js` are in `Specs/Core/Cartesian3Spec.js`. The filenames are the same except for the `Spec` suffix. Each spec file corresponds to at least one suite (sometimes suites are nested inside). +Tests are located in the [Specs](https://github.com/CesiumGS/cesium/tree/master/Specs) directory (recall, Jasmine calls a test a "spec"), which has a directory structure that mirrors the [Source](https://github.com/CesiumGS/cesium/tree/master/Source) directory. For example, all the tests for files in `Source/Core` are in `Specs/Core`. Likewise, all the tests for `Source/Core/Cartesian3.js` are in `Specs/Core/Cartesian3Spec.js`. The filenames are the same except for the `Spec` suffix. Each spec file corresponds to at least one suite (sometimes suites are nested inside). ### Bottom-Up Unit Testing The CesiumJS tests are largely **unit tests** because they test individual units, e.g., functions or classes. The simplest units are tested individually, and then units built upon other units are also tested. This allows us to build CesiumJS on well-tested foundations and to quickly narrow down issues. -For example, a [`BoundingSphere`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/BoundingSphere.js) is composed of a `Cartesian3` that defines its center and a number that defines its radius. Even though tests for `BoundingSphere` implicitly test parts of `Cartesian3`, there are separate tests that explicitly test `Cartesian3` as a unit so anything that relies on `Cartesian3` knows it is already tested. +For example, a [`BoundingSphere`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/BoundingSphere.js) is composed of a `Cartesian3` that defines its center and a number that defines its radius. Even though tests for `BoundingSphere` implicitly test parts of `Cartesian3`, there are separate tests that explicitly test `Cartesian3` as a unit so anything that relies on `Cartesian3` knows it is already tested. -Often, we also test private units individually for the same reason. For example, [`ShaderCache`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Renderer/ShaderCache.js) is a private class in CesiumJS used by primitives, but it is still individually tested in [ShaderCacheSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Renderer/ShaderCacheSpec.js). +Often, we also test private units individually for the same reason. For example, [`ShaderCache`](https://github.com/CesiumGS/cesium/blob/master/Source/Renderer/ShaderCache.js) is a private class in CesiumJS used by primitives, but it is still individually tested in [ShaderCacheSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Renderer/ShaderCacheSpec.js). -Sometimes classes or functions are even designed with a separation specifically to enable more precise testing. For example, see [`getStringFromTypedArray`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/getStringFromTypedArray.js) and [getStringFromTypedArraySpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Core/getStringFromTypedArraySpec.js). +Sometimes classes or functions are even designed with a separation specifically to enable more precise testing. For example, see [`getStringFromTypedArray`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/getStringFromTypedArray.js) and [getStringFromTypedArraySpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Core/getStringFromTypedArraySpec.js). ### Test Code is Code @@ -228,7 +227,7 @@ Tests are written in JavaScript using Jasmine. It is important to realize that ### Testing Basics -[Cartesian3Spec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Core/Cartesian3Spec.js) contains the tests for [`Cartesian3`](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/Cartesian3.js), which is a class representing a 3D point or vector with `x`, `y`, and `z` properties, and typical functions like adding two `Cartesian3` objects. +[Cartesian3Spec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Core/Cartesian3Spec.js) contains the tests for [`Cartesian3`](https://github.com/CesiumGS/cesium/blob/master/Source/Core/Cartesian3.js), which is a class representing a 3D point or vector with `x`, `y`, and `z` properties, and typical functions like adding two `Cartesian3` objects. Here is a stripped down version of the tests: @@ -275,7 +274,7 @@ it('angleBetween works for acute angles', function() { }); ``` -`toEqualEpsilon` is a custom Jasmine matcher that the CesiumJS tests add. See [Specs/addDefaultMatchers.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/addDefaultMatchers.js) for all the custom matchers. In general, all test utility functions are in files in the `Specs` root directory. +`toEqualEpsilon` is a custom Jasmine matcher that the CesiumJS tests add. See [Specs/addDefaultMatchers.js](https://github.com/CesiumGS/cesium/blob/master/Specs/addDefaultMatchers.js) for all the custom matchers. In general, all test utility functions are in files in the `Specs` root directory. For more on comparing floating-point numbers, see [Comparing Floating Point Numbers, 2012 Edition](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). @@ -307,7 +306,7 @@ it('fromDegrees throws with no latitude', function() { ### Before and After Tests and Suites -The Jasmine functions `beforeAll` and `afterAll` are used to run a function before and after, respectively, all the tests in a suite. Likewise, `beforeEach` and `afterEach` run a function before and after each test is run. For example, here is a common pattern from [DebugModelMatrixPrimitiveSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Scene/DebugModelMatrixPrimitiveSpec.js): +The Jasmine functions `beforeAll` and `afterAll` are used to run a function before and after, respectively, all the tests in a suite. Likewise, `beforeEach` and `afterEach` run a function before and after each test is run. For example, here is a common pattern from [DebugModelMatrixPrimitiveSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Scene/DebugModelMatrixPrimitiveSpec.js): ```javascript var scene; @@ -460,7 +459,7 @@ it('can declare automatic uniforms', function() { ### GLSL -GLSL is the shading language used by WebGL to run small graphics programs in parallel on the GPU. Under-the-hood, CesiumJS contains a library of GLSL identifiers and functions. These are unit tested by writing a simple fragment shader that outputs white if the test passes. For example, here is an excerpt from [BuiltinFunctionsSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Renderer/BuiltinFunctionsSpec.js); +GLSL is the shading language used by WebGL to run small graphics programs in parallel on the GPU. Under-the-hood, CesiumJS contains a library of GLSL identifiers and functions. These are unit tested by writing a simple fragment shader that outputs white if the test passes. For example, here is an excerpt from [BuiltinFunctionsSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Renderer/BuiltinFunctionsSpec.js); ```javascript var context; @@ -495,7 +494,7 @@ In the test above, the expectation is implicit in the GLSL string for the fragme It can be useful to expect if a function was called and inspect information about the function call such as the arguments passed to it. Jasmine spies are used for this. -Here is an excerpt from [TweenCollectionSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Scene/TweenCollectionSpec.js): +Here is an excerpt from [TweenCollectionSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Scene/TweenCollectionSpec.js): ```javascript it('add() adds with a duration of zero', function() { @@ -515,7 +514,7 @@ it('add() adds with a duration of zero', function() { ``` Tweens are used for animation. This test creates a spy with `jasmine.createSpy` to verify that a tween calls the provided `complete` function when a tween finishes animating using `toHaveBeenCalled()`, which is immediately in this case given `duration` is `0.0`. -Spies can also provide more information about the function call (or calls). Here is an excerpt from [GeocoderViewModelSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Widgets/Geocoder/GeocoderViewModelSpec.js): +Spies can also provide more information about the function call (or calls). Here is an excerpt from [GeocoderViewModelSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Widgets/Geocoder/GeocoderViewModelSpec.js): ```javascript it('Zooms to longitude, latitude, height', function() { @@ -537,7 +536,7 @@ it('Zooms to longitude, latitude, height', function() { ``` Here, `spyOn` is used to replace `Camera.flyTo` (prototype function on instances) with a spy. When the Geocoder is used to search for a location, the test expects that `Camera.flyTo` was called with the right arguments. -Spies can also be used on non-prototype functions. Here is an excerpt from [ModelSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Scene/ModelSpec.js): +Spies can also be used on non-prototype functions. Here is an excerpt from [ModelSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Scene/ModelSpec.js): ```javascript it('Applies the right render state', function() { @@ -566,9 +565,9 @@ Beware of too tightly coupling a test with an implementation; it makes engine co ### Test Data and Services -Sometimes, a test requires sample data, like a CZML file or glTF model, or a service. When possible, we try to procedurally create data or mock a response in the test instead of reading a local file or making an external request. For example, [loadArrayBufferSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Core/loadArrayBufferSpec.js) uses a spy to simulate an XHR response. +Sometimes, a test requires sample data, like a CZML file or glTF model, or a service. When possible, we try to procedurally create data or mock a response in the test instead of reading a local file or making an external request. For example, [loadArrayBufferSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Core/loadArrayBufferSpec.js) uses a spy to simulate an XHR response. -When external data can't be avoided, prefer storing a small file in a subdirectory of [Specs/Data](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Specs/Data). Avoid bloating the repo with an unnecessarily large file. Update [LICENSE.md](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md) if the data requires a license or attribution. Include a README file when useful, for example, see [Specs/Data/Models/Box-Textured-Custom](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Specs/Data/Models/Box-Textured-Custom). +When external data can't be avoided, prefer storing a small file in a subdirectory of [Specs/Data](https://github.com/CesiumGS/cesium/tree/master/Specs/Data). Avoid bloating the repo with an unnecessarily large file. Update [LICENSE.md](https://github.com/CesiumGS/cesium/blob/master/LICENSE.md) if the data requires a license or attribution. Include a README file when useful, for example, see [Specs/Data/Models/Box-Textured-Custom](https://github.com/CesiumGS/cesium/tree/master/Specs/Data/Models/Box-Textured-Custom). Make external requests that assume the tests are being used with an Internet connection very sparingly. We anticipate being able to run the tests offline. @@ -578,7 +577,7 @@ Make external requests that assume the tests are being used with an Internet con For asynchronous testing, Jasmine's `it` function uses a `done` callback. For better integration with CesiumJS's asynchronous patterns, CesiumJS replaces `it` with a function that can return promises. -Here is an excerpt from [ModelSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Scene/ModelSpec.js): +Here is an excerpt from [ModelSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Scene/ModelSpec.js): ```javascript var texturedBoxUrl = './Data/Models/Box-Textured/CesiumTexturedBoxTest.gltf'; @@ -619,7 +618,7 @@ function loadModelJson(gltf) { Since loading a model requires asynchronous requests and creating WebGL resources that may be spread over several frames, CesiumJS's `pollToPromise` is used to return a promise that resolves when the model is ready, which occurs by rendering the scene in an implicit loop (hence the name "poll") until `model.ready` is `true` or the `timeout` is reached. -`pollToPromise` is used in many places where a test needs to wait for an asynchronous event before testing its expectations. Here is an excerpt from [BillboardCollectionSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Scene/BillboardCollectionSpec.js): +`pollToPromise` is used in many places where a test needs to wait for an asynchronous event before testing its expectations. Here is an excerpt from [BillboardCollectionSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Scene/BillboardCollectionSpec.js): ```javascript it('can create a billboard using a URL', function() { @@ -638,7 +637,7 @@ it('can create a billboard using a URL', function() { Here a billboard is loaded using a url to image. Internally, `Billboard` makes an asynchronous request for the image and then sets its `ready` property to `true`. The function passed to `pollToPromise` just returns the value of `ready`; it does not need to render the scene to progressively complete the request like `Model`. Finally, the resolve function (passed to `then`) verifies that the billboard is green. -To test if a promises rejects, we call `fail` in the resolve function and put the expectation in the reject function. Here is an excerpt from [ArcGisMapServerImageryProviderSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Scene/ArcGisMapServerImageryProviderSpec.js): +To test if a promises rejects, we call `fail` in the resolve function and put the expectation in the reject function. Here is an excerpt from [ArcGisMapServerImageryProviderSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Scene/ArcGisMapServerImageryProviderSpec.js): ```javascript it('rejects readyPromise on error', function() { @@ -659,7 +658,7 @@ it('rejects readyPromise on error', function() { ### Mocks -To isolate testing, mock objects can be used to simulate real objects. Here is an excerpt from [SceneSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Scene/SceneSpec.js); +To isolate testing, mock objects can be used to simulate real objects. Here is an excerpt from [SceneSpec.js](https://github.com/CesiumGS/cesium/blob/master/Specs/Scene/SceneSpec.js); ```javascript function MockPrimitive(command) { @@ -750,20 +749,6 @@ The first 73 CesiumJS tests from March 2011. > Try this approach for yourself! -## Testing in WebStorm - -When you load the CesiumJS WebStorm project, there will already be a predefined run configuration for executing the unit tests. It will be in the upper-right corner and look something like the below: - -![](webstorm-test-configuration.png) - -You can run or debug the tests by using the first two buttons. The third button is for coverage, which is currently not supported. It will pop up the WebStorm test runner: - -![](webstorm-test-runner.png) - -This runner has lots of options, such as only showing failing tests or automatically re-running the tests on a test interval (great for development when combined with `fdescribe`!). You can hover over each of the buttons to see what they do. - -To make jumping between the source and spec files easier download the [Cesium WebStorm plugin](https://github.com/AnalyticalGraphicsInc/cesium-webstorm-plugin). - ## Resources See Section 4.4 of [Getting Serious with JavaScript](http://webglinsights.github.io/downloads/WebGL-Insights-Chapter-4.pdf) by CesiumJS contributors Matthew Amato and Kevin Ring in _WebGL Insights_ for a deeper but less broad presentation of CesiumJS testing. diff --git a/Documentation/Contributors/WebStormGuide/README.md b/Documentation/Contributors/WebStormGuide/README.md deleted file mode 100644 index ebcb2d0acd3d..000000000000 --- a/Documentation/Contributors/WebStormGuide/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# WebStorm Guide - -Install [WebStorm](https://www.jetbrains.com/webstorm/). - -While it's a commercial IDE, it's pretty cheap and there's a 30-day free trial. - -WebStorm requires very little configuration out of the box. Just browse to and open the WebStorm project included with CesiumJS. Most things a Web Developer would want are built-in. Whenever you open a file that has a plugin available, such as `md`, `glsl`, or `.gitignore`, WebStorm will ask if you want to install it. Simply say yes and off you go. While most of us still use `git` on the command-line, WebStorm includes excellent tools for merging, diffing, and managing branches as well. - -### Gulp Integration - -CesiumJS's build scripts use gulp. WebStorm has excellent gulp integration for running tasks from the IDE. Just right-click on `gulpfile.js` in the Project tree and select `Show Gulp Tasks`, now you can double click on any task to run it. Even better, perpetual tasks like `build-watch` and `jsHint-watch` -will get their own output tab that automatically updates. - -### WebStorm Plugins - -The [Cesium WebStorm plugin](https://github.com/AnalyticalGraphicsInc/cesium-webstorm-plugin) allows users to easily jump between source and spec files. - -### WebStorm Shortcuts - -* `Ctrl-Shift-A` - search for settings, shortcuts, or anything else you want to do. -* `Ctrl-Shift-N` - search and open files in the workspace. -* `Ctrl-ALT-L` - auto-format an entire file or the selected block of code. -* `Ctrl-Shift-F` - bring up the global find dialog. -* `ALT-Shift-K` - jump between source and spec file (using the Cesium WebStorm plugin). diff --git a/LICENSE.md b/LICENSE.md index b076d96fbbbd..03ec70f0f13e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -202,9 +202,9 @@ Copyright 2011-2020 CesiumJS Contributors See the License for the specific language governing permissions and limitations under the License. -Patents US9153063B2 US9865085B1 +Patents US9153063B2 US9865085B1 US10592242 -Patents pending US15/829,786 US16/516,997 US62/837,358 US62/837,381 +Patents pending US15/829,786 US62/837,358 US62/837,381 Third-Party Code ================ @@ -851,7 +851,7 @@ http://dojotoolkit.org/ http://codemirror.net/ -> Copyright (C) 2014 by Marijn Haverbeke and others +> Copyright (C) 2017 by Marijn Haverbeke and others > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > diff --git a/README.md b/README.md index 16c2a934e685..4619cf1f0ebc 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@

- +

-[![Build Status](https://travis-ci.org/AnalyticalGraphicsInc/cesium.svg?branch=master)](https://travis-ci.org/AnalyticalGraphicsInc/cesium)  -[![Docs](https://img.shields.io/badge/docs-online-orange.svg)](https://cesium.com/docs/) [![Greenkeeper badge](https://badges.greenkeeper.io/AnalyticalGraphicsInc/cesium.svg)](https://greenkeeper.io/) +[![Build Status](https://travis-ci.org/CesiumGS/cesium.svg?branch=master)](https://travis-ci.org/CesiumGS/cesium)  +[![Docs](https://img.shields.io/badge/docs-online-orange.svg)](https://cesium.com/docs/) CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It uses WebGL for hardware-accelerated graphics, and is cross-platform, cross-browser, and tuned for dynamic-data visualization. [CesiumJS Homepage](https://cesium.com/cesiumjs) -[CesiumJS Features Checklist](https://github.com/AnalyticalGraphicsInc/cesium/wiki/CesiumJS-Features-Checklist) +[CesiumJS Features Checklist](https://github.com/CesiumGS/cesium/wiki/CesiumJS-Features-Checklist) ### :rocket: Get Started @@ -38,11 +38,11 @@ Using Cesium ion helps support CesiumJS development. :heart: ### :clap: Featured Demos -

+

      -  +        @@ -54,7 +54,7 @@ Using Cesium ion helps support CesiumJS development. :heart:       -  +   

diff --git a/Source/Core/ApproximateTerrainHeights.js b/Source/Core/ApproximateTerrainHeights.js index 9fbe33dcf579..93724cb5212b 100644 --- a/Source/Core/ApproximateTerrainHeights.js +++ b/Source/Core/ApproximateTerrainHeights.js @@ -6,7 +6,6 @@ import Cartographic from './Cartographic.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import GeographicTilingScheme from './GeographicTilingScheme.js'; @@ -184,7 +183,7 @@ import Resource from './Resource.js'; ApproximateTerrainHeights._terrainHeights = undefined; ApproximateTerrainHeights._initPromise = undefined; - defineProperties(ApproximateTerrainHeights, { + Object.defineProperties(ApproximateTerrainHeights, { /** * Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights, * call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve. diff --git a/Source/Core/ArcGISTiledElevationTerrainProvider.js b/Source/Core/ArcGISTiledElevationTerrainProvider.js index 618db212a95c..1416393493ca 100644 --- a/Source/Core/ArcGISTiledElevationTerrainProvider.js +++ b/Source/Core/ArcGISTiledElevationTerrainProvider.js @@ -3,7 +3,6 @@ import Cartesian2 from './Cartesian2.js'; import Credit from './Credit.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import Event from './Event.js'; @@ -160,7 +159,7 @@ import WebMercatorTilingScheme from './WebMercatorTilingScheme.js'; this._errorEvent = new Event(); } - defineProperties(ArcGISTiledElevationTerrainProvider.prototype, { + Object.defineProperties(ArcGISTiledElevationTerrainProvider.prototype, { /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners diff --git a/Source/Core/ArcType.js b/Source/Core/ArcType.js index e5665855334b..96a90f403ecb 100644 --- a/Source/Core/ArcType.js +++ b/Source/Core/ArcType.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * ArcType defines the path that should be taken connecting vertices. @@ -30,4 +29,4 @@ import freezeObject from './freezeObject.js'; */ RHUMB : 2 }; -export default freezeObject(ArcType); +export default Object.freeze(ArcType); diff --git a/Source/Core/AssociativeArray.js b/Source/Core/AssociativeArray.js index e4fe67788d80..9a3932929881 100644 --- a/Source/Core/AssociativeArray.js +++ b/Source/Core/AssociativeArray.js @@ -1,5 +1,4 @@ import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; /** @@ -13,7 +12,7 @@ import DeveloperError from './DeveloperError.js'; this._hash = {}; } - defineProperties(AssociativeArray.prototype, { + Object.defineProperties(AssociativeArray.prototype, { /** * Gets the number of items in the collection. * @memberof AssociativeArray.prototype diff --git a/Source/Core/AttributeCompression.js b/Source/Core/AttributeCompression.js index 59fe136b8c86..00cd2b6d30b3 100644 --- a/Source/Core/AttributeCompression.js +++ b/Source/Core/AttributeCompression.js @@ -339,7 +339,7 @@ import CesiumMath from './Math.js'; * @param {Uint16Array} vBuffer The buffer view of v values. * @param {Uint16Array} [heightBuffer] The buffer view of height values. * - * @see {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh|quantized-mesh-1.0 terrain format} + * @see {@link https://github.com/CesiumGS/quantized-mesh|quantized-mesh-1.0 terrain format} */ AttributeCompression.zigZagDeltaDecode = function(uBuffer, vBuffer, heightBuffer) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/BingMapsGeocoderService.js b/Source/Core/BingMapsGeocoderService.js index 91aaff956004..41d694df647f 100644 --- a/Source/Core/BingMapsGeocoderService.js +++ b/Source/Core/BingMapsGeocoderService.js @@ -1,7 +1,6 @@ import BingMapsApi from './BingMapsApi.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; -import defineProperties from './defineProperties.js'; import Rectangle from './Rectangle.js'; import Resource from './Resource.js'; @@ -29,7 +28,7 @@ import Resource from './Resource.js'; }); } - defineProperties(BingMapsGeocoderService.prototype, { + Object.defineProperties(BingMapsGeocoderService.prototype, { /** * The URL endpoint for the Bing geocoder service * @type {String} diff --git a/Source/Core/Cartesian2.js b/Source/Core/Cartesian2.js index 4ffcfcc81a9b..ac76c2c58e55 100644 --- a/Source/Core/Cartesian2.js +++ b/Source/Core/Cartesian2.js @@ -2,7 +2,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; /** @@ -149,7 +148,8 @@ import CesiumMath from './Math.js'; * Flattens an array of Cartesian2s into and array of components. * * @param {Cartesian2[]} array The array of cartesians to pack. - * @param {Number[]} [result] The array onto which to store the result. + * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements. + * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { @@ -158,10 +158,13 @@ import CesiumMath from './Math.js'; //>>includeEnd('debug'); var length = array.length; + var resultLength = length * 2; if (!defined(result)) { - result = new Array(length * 2); - } else { - result.length = length * 2; + result = new Array(resultLength); + } else if (!Array.isArray(result) && result.length !== resultLength) { + throw new DeveloperError('If result is a typed array, it must have exactly array.length * 2 elements'); + } else if (result.length !== resultLength) { + result.length = resultLength; } for (var i = 0; i < length; ++i) { @@ -180,6 +183,10 @@ import CesiumMath from './Math.js'; Cartesian2.unpackArray = function(array, result) { //>>includeStart('debug', pragmas.debug); Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 2); + if (array.length % 2 !== 0) { + throw new DeveloperError('array length must be a multiple of 2.'); + } //>>includeEnd('debug'); var length = array.length; @@ -671,7 +678,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian2} * @constant */ - Cartesian2.ZERO = freezeObject(new Cartesian2(0.0, 0.0)); + Cartesian2.ZERO = Object.freeze(new Cartesian2(0.0, 0.0)); /** * An immutable Cartesian2 instance initialized to (1.0, 0.0). @@ -679,7 +686,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian2} * @constant */ - Cartesian2.UNIT_X = freezeObject(new Cartesian2(1.0, 0.0)); + Cartesian2.UNIT_X = Object.freeze(new Cartesian2(1.0, 0.0)); /** * An immutable Cartesian2 instance initialized to (0.0, 1.0). @@ -687,7 +694,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian2} * @constant */ - Cartesian2.UNIT_Y = freezeObject(new Cartesian2(0.0, 1.0)); + Cartesian2.UNIT_Y = Object.freeze(new Cartesian2(0.0, 1.0)); /** * Duplicates this Cartesian2 instance. diff --git a/Source/Core/Cartesian3.js b/Source/Core/Cartesian3.js index 9fbd998f683f..2ca99e6f0967 100644 --- a/Source/Core/Cartesian3.js +++ b/Source/Core/Cartesian3.js @@ -2,7 +2,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; /** @@ -177,7 +176,7 @@ import CesiumMath from './Math.js'; * Flattens an array of Cartesian3s into an array of components. * * @param {Cartesian3[]} array The array of cartesians to pack. - * @param {Number[]} [result] The array onto which to store the result. + * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements. * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { @@ -186,10 +185,13 @@ import CesiumMath from './Math.js'; //>>includeEnd('debug'); var length = array.length; + var resultLength = length * 3; if (!defined(result)) { - result = new Array(length * 3); - } else { - result.length = length * 3; + result = new Array(resultLength); + } else if (!Array.isArray(result) && result.length !== resultLength) { + throw new DeveloperError('If result is a typed array, it must have exactly array.length * 3 elements'); + } else if (result.length !== resultLength) { + result.length = resultLength; } for (var i = 0; i < length; ++i) { @@ -1009,7 +1011,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian3} * @constant */ - Cartesian3.ZERO = freezeObject(new Cartesian3(0.0, 0.0, 0.0)); + Cartesian3.ZERO = Object.freeze(new Cartesian3(0.0, 0.0, 0.0)); /** * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0). @@ -1017,7 +1019,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian3} * @constant */ - Cartesian3.UNIT_X = freezeObject(new Cartesian3(1.0, 0.0, 0.0)); + Cartesian3.UNIT_X = Object.freeze(new Cartesian3(1.0, 0.0, 0.0)); /** * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0). @@ -1025,7 +1027,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian3} * @constant */ - Cartesian3.UNIT_Y = freezeObject(new Cartesian3(0.0, 1.0, 0.0)); + Cartesian3.UNIT_Y = Object.freeze(new Cartesian3(0.0, 1.0, 0.0)); /** * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0). @@ -1033,7 +1035,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian3} * @constant */ - Cartesian3.UNIT_Z = freezeObject(new Cartesian3(0.0, 0.0, 1.0)); + Cartesian3.UNIT_Z = Object.freeze(new Cartesian3(0.0, 0.0, 1.0)); /** * Duplicates this Cartesian3 instance. diff --git a/Source/Core/Cartesian4.js b/Source/Core/Cartesian4.js index 6f3911fefad3..4273018235a1 100644 --- a/Source/Core/Cartesian4.js +++ b/Source/Core/Cartesian4.js @@ -2,7 +2,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; /** @@ -177,7 +176,8 @@ import CesiumMath from './Math.js'; * Flattens an array of Cartesian4s into and array of components. * * @param {Cartesian4[]} array The array of cartesians to pack. - * @param {Number[]} [result] The array onto which to store the result. + * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements. + * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { @@ -186,10 +186,13 @@ import CesiumMath from './Math.js'; //>>includeEnd('debug'); var length = array.length; + var resultLength = length * 4; if (!defined(result)) { - result = new Array(length * 4); - } else { - result.length = length * 4; + result = new Array(resultLength); + } else if (!Array.isArray(result) && result.length !== resultLength) { + throw new DeveloperError('If result is a typed array, it must have exactly array.length * 4 elements'); + } else if (result.length !== resultLength) { + result.length = resultLength; } for (var i = 0; i < length; ++i) { @@ -208,6 +211,10 @@ import CesiumMath from './Math.js'; Cartesian4.unpackArray = function(array, result) { //>>includeStart('debug', pragmas.debug); Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 4); + if (array.length % 4 !== 0) { + throw new DeveloperError('array length must be a multiple of 4.'); + } //>>includeEnd('debug'); var length = array.length; @@ -730,7 +737,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian4} * @constant */ - Cartesian4.ZERO = freezeObject(new Cartesian4(0.0, 0.0, 0.0, 0.0)); + Cartesian4.ZERO = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 0.0)); /** * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0). @@ -738,7 +745,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian4} * @constant */ - Cartesian4.UNIT_X = freezeObject(new Cartesian4(1.0, 0.0, 0.0, 0.0)); + Cartesian4.UNIT_X = Object.freeze(new Cartesian4(1.0, 0.0, 0.0, 0.0)); /** * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0). @@ -746,7 +753,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian4} * @constant */ - Cartesian4.UNIT_Y = freezeObject(new Cartesian4(0.0, 1.0, 0.0, 0.0)); + Cartesian4.UNIT_Y = Object.freeze(new Cartesian4(0.0, 1.0, 0.0, 0.0)); /** * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0). @@ -754,7 +761,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian4} * @constant */ - Cartesian4.UNIT_Z = freezeObject(new Cartesian4(0.0, 0.0, 1.0, 0.0)); + Cartesian4.UNIT_Z = Object.freeze(new Cartesian4(0.0, 0.0, 1.0, 0.0)); /** * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0). @@ -762,7 +769,7 @@ import CesiumMath from './Math.js'; * @type {Cartesian4} * @constant */ - Cartesian4.UNIT_W = freezeObject(new Cartesian4(0.0, 0.0, 0.0, 1.0)); + Cartesian4.UNIT_W = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 1.0)); /** * Duplicates this Cartesian4 instance. diff --git a/Source/Core/Cartographic.js b/Source/Core/Cartographic.js index d8fc84bd899c..7e1c3918fef2 100644 --- a/Source/Core/Cartographic.js +++ b/Source/Core/Cartographic.js @@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; import scaleToGeodeticSurface from './scaleToGeodeticSurface.js'; @@ -219,7 +218,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js'; * @type {Cartographic} * @constant */ - Cartographic.ZERO = freezeObject(new Cartographic(0.0, 0.0, 0.0)); + Cartographic.ZERO = Object.freeze(new Cartographic(0.0, 0.0, 0.0)); /** * Duplicates this instance. diff --git a/Source/Core/CatmullRomSpline.js b/Source/Core/CatmullRomSpline.js index 352c647045b5..2bb602a31f72 100644 --- a/Source/Core/CatmullRomSpline.js +++ b/Source/Core/CatmullRomSpline.js @@ -3,7 +3,6 @@ import Cartesian4 from './Cartesian4.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import HermiteSpline from './HermiteSpline.js'; import Matrix4 from './Matrix4.js'; import Spline from './Spline.js'; @@ -174,7 +173,7 @@ import Spline from './Spline.js'; this._lastTimeIndex = 0; } - defineProperties(CatmullRomSpline.prototype, { + Object.defineProperties(CatmullRomSpline.prototype, { /** * An array of times for the control points. * diff --git a/Source/Core/CesiumTerrainProvider.js b/Source/Core/CesiumTerrainProvider.js index 3fa8aea1f484..2f286623821d 100644 --- a/Source/Core/CesiumTerrainProvider.js +++ b/Source/Core/CesiumTerrainProvider.js @@ -5,7 +5,6 @@ import Cartesian3 from './Cartesian3.js'; import Credit from './Credit.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Event from './Event.js'; import GeographicTilingScheme from './GeographicTilingScheme.js'; @@ -720,7 +719,7 @@ import TileProviderError from './TileProviderError.js'; }); } - defineProperties(CesiumTerrainProvider.prototype, { + Object.defineProperties(CesiumTerrainProvider.prototype, { /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners diff --git a/Source/Core/CircleGeometry.js b/Source/Core/CircleGeometry.js index 18ad570f8e5b..dd1402bfdb08 100644 --- a/Source/Core/CircleGeometry.js +++ b/Source/Core/CircleGeometry.js @@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import EllipseGeometry from './EllipseGeometry.js'; import Ellipsoid from './Ellipsoid.js'; import VertexFormat from './VertexFormat.js'; @@ -165,7 +164,7 @@ import VertexFormat from './VertexFormat.js'; }); }; - defineProperties(CircleGeometry.prototype, { + Object.defineProperties(CircleGeometry.prototype, { /** * @private */ diff --git a/Source/Core/Clock.js b/Source/Core/Clock.js index ab33cd1c6192..390db7f1469a 100644 --- a/Source/Core/Clock.js +++ b/Source/Core/Clock.js @@ -2,7 +2,6 @@ import ClockRange from './ClockRange.js'; import ClockStep from './ClockStep.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Event from './Event.js'; import getTimestamp from './getTimestamp.js'; @@ -141,7 +140,7 @@ import JulianDate from './JulianDate.js'; this.clockStep = defaultValue(options.clockStep, ClockStep.SYSTEM_CLOCK_MULTIPLIER); } - defineProperties(Clock.prototype, { + Object.defineProperties(Clock.prototype, { /** * The current time. * Changing this property will change diff --git a/Source/Core/ClockRange.js b/Source/Core/ClockRange.js index b458f8b07edd..ca3343497d96 100644 --- a/Source/Core/ClockRange.js +++ b/Source/Core/ClockRange.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * Constants used by {@link Clock#tick} to determine behavior @@ -38,4 +37,4 @@ import freezeObject from './freezeObject.js'; */ LOOP_STOP : 2 }; -export default freezeObject(ClockRange); +export default Object.freeze(ClockRange); diff --git a/Source/Core/ClockStep.js b/Source/Core/ClockStep.js index 26385e80dfb3..c2429730a63e 100644 --- a/Source/Core/ClockStep.js +++ b/Source/Core/ClockStep.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * Constants to determine how much time advances with each call @@ -37,4 +36,4 @@ import freezeObject from './freezeObject.js'; */ SYSTEM_CLOCK : 2 }; -export default freezeObject(ClockStep); +export default Object.freeze(ClockStep); diff --git a/Source/Core/Color.js b/Source/Core/Color.js index 9119ca9e5a31..62a27a68b0e8 100644 --- a/Source/Core/Color.js +++ b/Source/Core/Color.js @@ -2,7 +2,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; import FeatureDetection from './FeatureDetection.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; function hue2rgb(m1, m2, h) { @@ -880,7 +879,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.ALICEBLUE = freezeObject(Color.fromCssColorString('#F0F8FF')); + Color.ALICEBLUE = Object.freeze(Color.fromCssColorString('#F0F8FF')); /** * An immutable Color instance initialized to CSS color #FAEBD7 @@ -889,7 +888,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.ANTIQUEWHITE = freezeObject(Color.fromCssColorString('#FAEBD7')); + Color.ANTIQUEWHITE = Object.freeze(Color.fromCssColorString('#FAEBD7')); /** * An immutable Color instance initialized to CSS color #00FFFF @@ -898,7 +897,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.AQUA = freezeObject(Color.fromCssColorString('#00FFFF')); + Color.AQUA = Object.freeze(Color.fromCssColorString('#00FFFF')); /** * An immutable Color instance initialized to CSS color #7FFFD4 @@ -907,7 +906,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.AQUAMARINE = freezeObject(Color.fromCssColorString('#7FFFD4')); + Color.AQUAMARINE = Object.freeze(Color.fromCssColorString('#7FFFD4')); /** * An immutable Color instance initialized to CSS color #F0FFFF @@ -916,7 +915,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.AZURE = freezeObject(Color.fromCssColorString('#F0FFFF')); + Color.AZURE = Object.freeze(Color.fromCssColorString('#F0FFFF')); /** * An immutable Color instance initialized to CSS color #F5F5DC @@ -925,7 +924,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.BEIGE = freezeObject(Color.fromCssColorString('#F5F5DC')); + Color.BEIGE = Object.freeze(Color.fromCssColorString('#F5F5DC')); /** * An immutable Color instance initialized to CSS color #FFE4C4 @@ -934,7 +933,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.BISQUE = freezeObject(Color.fromCssColorString('#FFE4C4')); + Color.BISQUE = Object.freeze(Color.fromCssColorString('#FFE4C4')); /** * An immutable Color instance initialized to CSS color #000000 @@ -943,7 +942,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.BLACK = freezeObject(Color.fromCssColorString('#000000')); + Color.BLACK = Object.freeze(Color.fromCssColorString('#000000')); /** * An immutable Color instance initialized to CSS color #FFEBCD @@ -952,7 +951,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.BLANCHEDALMOND = freezeObject(Color.fromCssColorString('#FFEBCD')); + Color.BLANCHEDALMOND = Object.freeze(Color.fromCssColorString('#FFEBCD')); /** * An immutable Color instance initialized to CSS color #0000FF @@ -961,7 +960,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.BLUE = freezeObject(Color.fromCssColorString('#0000FF')); + Color.BLUE = Object.freeze(Color.fromCssColorString('#0000FF')); /** * An immutable Color instance initialized to CSS color #8A2BE2 @@ -970,7 +969,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.BLUEVIOLET = freezeObject(Color.fromCssColorString('#8A2BE2')); + Color.BLUEVIOLET = Object.freeze(Color.fromCssColorString('#8A2BE2')); /** * An immutable Color instance initialized to CSS color #A52A2A @@ -979,7 +978,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.BROWN = freezeObject(Color.fromCssColorString('#A52A2A')); + Color.BROWN = Object.freeze(Color.fromCssColorString('#A52A2A')); /** * An immutable Color instance initialized to CSS color #DEB887 @@ -988,7 +987,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.BURLYWOOD = freezeObject(Color.fromCssColorString('#DEB887')); + Color.BURLYWOOD = Object.freeze(Color.fromCssColorString('#DEB887')); /** * An immutable Color instance initialized to CSS color #5F9EA0 @@ -997,7 +996,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.CADETBLUE = freezeObject(Color.fromCssColorString('#5F9EA0')); + Color.CADETBLUE = Object.freeze(Color.fromCssColorString('#5F9EA0')); /** * An immutable Color instance initialized to CSS color #7FFF00 * @@ -1005,7 +1004,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.CHARTREUSE = freezeObject(Color.fromCssColorString('#7FFF00')); + Color.CHARTREUSE = Object.freeze(Color.fromCssColorString('#7FFF00')); /** * An immutable Color instance initialized to CSS color #D2691E @@ -1014,7 +1013,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.CHOCOLATE = freezeObject(Color.fromCssColorString('#D2691E')); + Color.CHOCOLATE = Object.freeze(Color.fromCssColorString('#D2691E')); /** * An immutable Color instance initialized to CSS color #FF7F50 @@ -1023,7 +1022,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.CORAL = freezeObject(Color.fromCssColorString('#FF7F50')); + Color.CORAL = Object.freeze(Color.fromCssColorString('#FF7F50')); /** * An immutable Color instance initialized to CSS color #6495ED @@ -1032,7 +1031,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.CORNFLOWERBLUE = freezeObject(Color.fromCssColorString('#6495ED')); + Color.CORNFLOWERBLUE = Object.freeze(Color.fromCssColorString('#6495ED')); /** * An immutable Color instance initialized to CSS color #FFF8DC @@ -1041,7 +1040,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.CORNSILK = freezeObject(Color.fromCssColorString('#FFF8DC')); + Color.CORNSILK = Object.freeze(Color.fromCssColorString('#FFF8DC')); /** * An immutable Color instance initialized to CSS color #DC143C @@ -1050,7 +1049,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.CRIMSON = freezeObject(Color.fromCssColorString('#DC143C')); + Color.CRIMSON = Object.freeze(Color.fromCssColorString('#DC143C')); /** * An immutable Color instance initialized to CSS color #00FFFF @@ -1059,7 +1058,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.CYAN = freezeObject(Color.fromCssColorString('#00FFFF')); + Color.CYAN = Object.freeze(Color.fromCssColorString('#00FFFF')); /** * An immutable Color instance initialized to CSS color #00008B @@ -1068,7 +1067,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKBLUE = freezeObject(Color.fromCssColorString('#00008B')); + Color.DARKBLUE = Object.freeze(Color.fromCssColorString('#00008B')); /** * An immutable Color instance initialized to CSS color #008B8B @@ -1077,7 +1076,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKCYAN = freezeObject(Color.fromCssColorString('#008B8B')); + Color.DARKCYAN = Object.freeze(Color.fromCssColorString('#008B8B')); /** * An immutable Color instance initialized to CSS color #B8860B @@ -1086,7 +1085,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKGOLDENROD = freezeObject(Color.fromCssColorString('#B8860B')); + Color.DARKGOLDENROD = Object.freeze(Color.fromCssColorString('#B8860B')); /** * An immutable Color instance initialized to CSS color #A9A9A9 @@ -1095,7 +1094,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKGRAY = freezeObject(Color.fromCssColorString('#A9A9A9')); + Color.DARKGRAY = Object.freeze(Color.fromCssColorString('#A9A9A9')); /** * An immutable Color instance initialized to CSS color #006400 @@ -1104,7 +1103,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKGREEN = freezeObject(Color.fromCssColorString('#006400')); + Color.DARKGREEN = Object.freeze(Color.fromCssColorString('#006400')); /** * An immutable Color instance initialized to CSS color #A9A9A9 @@ -1122,7 +1121,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKKHAKI = freezeObject(Color.fromCssColorString('#BDB76B')); + Color.DARKKHAKI = Object.freeze(Color.fromCssColorString('#BDB76B')); /** * An immutable Color instance initialized to CSS color #8B008B @@ -1131,7 +1130,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKMAGENTA = freezeObject(Color.fromCssColorString('#8B008B')); + Color.DARKMAGENTA = Object.freeze(Color.fromCssColorString('#8B008B')); /** * An immutable Color instance initialized to CSS color #556B2F @@ -1140,7 +1139,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKOLIVEGREEN = freezeObject(Color.fromCssColorString('#556B2F')); + Color.DARKOLIVEGREEN = Object.freeze(Color.fromCssColorString('#556B2F')); /** * An immutable Color instance initialized to CSS color #FF8C00 @@ -1149,7 +1148,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKORANGE = freezeObject(Color.fromCssColorString('#FF8C00')); + Color.DARKORANGE = Object.freeze(Color.fromCssColorString('#FF8C00')); /** * An immutable Color instance initialized to CSS color #9932CC @@ -1158,7 +1157,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKORCHID = freezeObject(Color.fromCssColorString('#9932CC')); + Color.DARKORCHID = Object.freeze(Color.fromCssColorString('#9932CC')); /** * An immutable Color instance initialized to CSS color #8B0000 @@ -1167,7 +1166,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKRED = freezeObject(Color.fromCssColorString('#8B0000')); + Color.DARKRED = Object.freeze(Color.fromCssColorString('#8B0000')); /** * An immutable Color instance initialized to CSS color #E9967A @@ -1176,7 +1175,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKSALMON = freezeObject(Color.fromCssColorString('#E9967A')); + Color.DARKSALMON = Object.freeze(Color.fromCssColorString('#E9967A')); /** * An immutable Color instance initialized to CSS color #8FBC8F @@ -1185,7 +1184,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKSEAGREEN = freezeObject(Color.fromCssColorString('#8FBC8F')); + Color.DARKSEAGREEN = Object.freeze(Color.fromCssColorString('#8FBC8F')); /** * An immutable Color instance initialized to CSS color #483D8B @@ -1194,7 +1193,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKSLATEBLUE = freezeObject(Color.fromCssColorString('#483D8B')); + Color.DARKSLATEBLUE = Object.freeze(Color.fromCssColorString('#483D8B')); /** * An immutable Color instance initialized to CSS color #2F4F4F @@ -1203,7 +1202,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKSLATEGRAY = freezeObject(Color.fromCssColorString('#2F4F4F')); + Color.DARKSLATEGRAY = Object.freeze(Color.fromCssColorString('#2F4F4F')); /** * An immutable Color instance initialized to CSS color #2F4F4F @@ -1221,7 +1220,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKTURQUOISE = freezeObject(Color.fromCssColorString('#00CED1')); + Color.DARKTURQUOISE = Object.freeze(Color.fromCssColorString('#00CED1')); /** * An immutable Color instance initialized to CSS color #9400D3 @@ -1230,7 +1229,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DARKVIOLET = freezeObject(Color.fromCssColorString('#9400D3')); + Color.DARKVIOLET = Object.freeze(Color.fromCssColorString('#9400D3')); /** * An immutable Color instance initialized to CSS color #FF1493 @@ -1239,7 +1238,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DEEPPINK = freezeObject(Color.fromCssColorString('#FF1493')); + Color.DEEPPINK = Object.freeze(Color.fromCssColorString('#FF1493')); /** * An immutable Color instance initialized to CSS color #00BFFF @@ -1248,7 +1247,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DEEPSKYBLUE = freezeObject(Color.fromCssColorString('#00BFFF')); + Color.DEEPSKYBLUE = Object.freeze(Color.fromCssColorString('#00BFFF')); /** * An immutable Color instance initialized to CSS color #696969 @@ -1257,7 +1256,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DIMGRAY = freezeObject(Color.fromCssColorString('#696969')); + Color.DIMGRAY = Object.freeze(Color.fromCssColorString('#696969')); /** * An immutable Color instance initialized to CSS color #696969 @@ -1275,7 +1274,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.DODGERBLUE = freezeObject(Color.fromCssColorString('#1E90FF')); + Color.DODGERBLUE = Object.freeze(Color.fromCssColorString('#1E90FF')); /** * An immutable Color instance initialized to CSS color #B22222 @@ -1284,7 +1283,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.FIREBRICK = freezeObject(Color.fromCssColorString('#B22222')); + Color.FIREBRICK = Object.freeze(Color.fromCssColorString('#B22222')); /** * An immutable Color instance initialized to CSS color #FFFAF0 @@ -1293,7 +1292,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.FLORALWHITE = freezeObject(Color.fromCssColorString('#FFFAF0')); + Color.FLORALWHITE = Object.freeze(Color.fromCssColorString('#FFFAF0')); /** * An immutable Color instance initialized to CSS color #228B22 @@ -1302,7 +1301,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.FORESTGREEN = freezeObject(Color.fromCssColorString('#228B22')); + Color.FORESTGREEN = Object.freeze(Color.fromCssColorString('#228B22')); /** * An immutable Color instance initialized to CSS color #FF00FF @@ -1311,7 +1310,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.FUCHSIA = freezeObject(Color.fromCssColorString('#FF00FF')); + Color.FUCHSIA = Object.freeze(Color.fromCssColorString('#FF00FF')); /** * An immutable Color instance initialized to CSS color #DCDCDC @@ -1320,7 +1319,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.GAINSBORO = freezeObject(Color.fromCssColorString('#DCDCDC')); + Color.GAINSBORO = Object.freeze(Color.fromCssColorString('#DCDCDC')); /** * An immutable Color instance initialized to CSS color #F8F8FF @@ -1329,7 +1328,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.GHOSTWHITE = freezeObject(Color.fromCssColorString('#F8F8FF')); + Color.GHOSTWHITE = Object.freeze(Color.fromCssColorString('#F8F8FF')); /** * An immutable Color instance initialized to CSS color #FFD700 @@ -1338,7 +1337,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.GOLD = freezeObject(Color.fromCssColorString('#FFD700')); + Color.GOLD = Object.freeze(Color.fromCssColorString('#FFD700')); /** * An immutable Color instance initialized to CSS color #DAA520 @@ -1347,7 +1346,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.GOLDENROD = freezeObject(Color.fromCssColorString('#DAA520')); + Color.GOLDENROD = Object.freeze(Color.fromCssColorString('#DAA520')); /** * An immutable Color instance initialized to CSS color #808080 @@ -1356,7 +1355,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.GRAY = freezeObject(Color.fromCssColorString('#808080')); + Color.GRAY = Object.freeze(Color.fromCssColorString('#808080')); /** * An immutable Color instance initialized to CSS color #008000 @@ -1365,7 +1364,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.GREEN = freezeObject(Color.fromCssColorString('#008000')); + Color.GREEN = Object.freeze(Color.fromCssColorString('#008000')); /** * An immutable Color instance initialized to CSS color #ADFF2F @@ -1374,7 +1373,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.GREENYELLOW = freezeObject(Color.fromCssColorString('#ADFF2F')); + Color.GREENYELLOW = Object.freeze(Color.fromCssColorString('#ADFF2F')); /** * An immutable Color instance initialized to CSS color #808080 @@ -1392,7 +1391,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.HONEYDEW = freezeObject(Color.fromCssColorString('#F0FFF0')); + Color.HONEYDEW = Object.freeze(Color.fromCssColorString('#F0FFF0')); /** * An immutable Color instance initialized to CSS color #FF69B4 @@ -1401,7 +1400,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.HOTPINK = freezeObject(Color.fromCssColorString('#FF69B4')); + Color.HOTPINK = Object.freeze(Color.fromCssColorString('#FF69B4')); /** * An immutable Color instance initialized to CSS color #CD5C5C @@ -1410,7 +1409,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.INDIANRED = freezeObject(Color.fromCssColorString('#CD5C5C')); + Color.INDIANRED = Object.freeze(Color.fromCssColorString('#CD5C5C')); /** * An immutable Color instance initialized to CSS color #4B0082 @@ -1419,7 +1418,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.INDIGO = freezeObject(Color.fromCssColorString('#4B0082')); + Color.INDIGO = Object.freeze(Color.fromCssColorString('#4B0082')); /** * An immutable Color instance initialized to CSS color #FFFFF0 @@ -1428,7 +1427,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.IVORY = freezeObject(Color.fromCssColorString('#FFFFF0')); + Color.IVORY = Object.freeze(Color.fromCssColorString('#FFFFF0')); /** * An immutable Color instance initialized to CSS color #F0E68C @@ -1437,7 +1436,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.KHAKI = freezeObject(Color.fromCssColorString('#F0E68C')); + Color.KHAKI = Object.freeze(Color.fromCssColorString('#F0E68C')); /** * An immutable Color instance initialized to CSS color #E6E6FA @@ -1446,7 +1445,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LAVENDER = freezeObject(Color.fromCssColorString('#E6E6FA')); + Color.LAVENDER = Object.freeze(Color.fromCssColorString('#E6E6FA')); /** * An immutable Color instance initialized to CSS color #FFF0F5 @@ -1455,7 +1454,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LAVENDAR_BLUSH = freezeObject(Color.fromCssColorString('#FFF0F5')); + Color.LAVENDAR_BLUSH = Object.freeze(Color.fromCssColorString('#FFF0F5')); /** * An immutable Color instance initialized to CSS color #7CFC00 @@ -1464,7 +1463,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LAWNGREEN = freezeObject(Color.fromCssColorString('#7CFC00')); + Color.LAWNGREEN = Object.freeze(Color.fromCssColorString('#7CFC00')); /** * An immutable Color instance initialized to CSS color #FFFACD @@ -1473,7 +1472,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LEMONCHIFFON = freezeObject(Color.fromCssColorString('#FFFACD')); + Color.LEMONCHIFFON = Object.freeze(Color.fromCssColorString('#FFFACD')); /** * An immutable Color instance initialized to CSS color #ADD8E6 @@ -1482,7 +1481,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTBLUE = freezeObject(Color.fromCssColorString('#ADD8E6')); + Color.LIGHTBLUE = Object.freeze(Color.fromCssColorString('#ADD8E6')); /** * An immutable Color instance initialized to CSS color #F08080 @@ -1491,7 +1490,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTCORAL = freezeObject(Color.fromCssColorString('#F08080')); + Color.LIGHTCORAL = Object.freeze(Color.fromCssColorString('#F08080')); /** * An immutable Color instance initialized to CSS color #E0FFFF @@ -1500,7 +1499,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTCYAN = freezeObject(Color.fromCssColorString('#E0FFFF')); + Color.LIGHTCYAN = Object.freeze(Color.fromCssColorString('#E0FFFF')); /** * An immutable Color instance initialized to CSS color #FAFAD2 @@ -1509,7 +1508,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTGOLDENRODYELLOW = freezeObject(Color.fromCssColorString('#FAFAD2')); + Color.LIGHTGOLDENRODYELLOW = Object.freeze(Color.fromCssColorString('#FAFAD2')); /** * An immutable Color instance initialized to CSS color #D3D3D3 @@ -1518,7 +1517,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTGRAY = freezeObject(Color.fromCssColorString('#D3D3D3')); + Color.LIGHTGRAY = Object.freeze(Color.fromCssColorString('#D3D3D3')); /** * An immutable Color instance initialized to CSS color #90EE90 @@ -1527,7 +1526,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTGREEN = freezeObject(Color.fromCssColorString('#90EE90')); + Color.LIGHTGREEN = Object.freeze(Color.fromCssColorString('#90EE90')); /** * An immutable Color instance initialized to CSS color #D3D3D3 @@ -1545,7 +1544,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTPINK = freezeObject(Color.fromCssColorString('#FFB6C1')); + Color.LIGHTPINK = Object.freeze(Color.fromCssColorString('#FFB6C1')); /** * An immutable Color instance initialized to CSS color #20B2AA @@ -1554,7 +1553,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTSEAGREEN = freezeObject(Color.fromCssColorString('#20B2AA')); + Color.LIGHTSEAGREEN = Object.freeze(Color.fromCssColorString('#20B2AA')); /** * An immutable Color instance initialized to CSS color #87CEFA @@ -1563,7 +1562,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTSKYBLUE = freezeObject(Color.fromCssColorString('#87CEFA')); + Color.LIGHTSKYBLUE = Object.freeze(Color.fromCssColorString('#87CEFA')); /** * An immutable Color instance initialized to CSS color #778899 @@ -1572,7 +1571,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTSLATEGRAY = freezeObject(Color.fromCssColorString('#778899')); + Color.LIGHTSLATEGRAY = Object.freeze(Color.fromCssColorString('#778899')); /** * An immutable Color instance initialized to CSS color #778899 @@ -1590,7 +1589,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTSTEELBLUE = freezeObject(Color.fromCssColorString('#B0C4DE')); + Color.LIGHTSTEELBLUE = Object.freeze(Color.fromCssColorString('#B0C4DE')); /** * An immutable Color instance initialized to CSS color #FFFFE0 @@ -1599,7 +1598,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIGHTYELLOW = freezeObject(Color.fromCssColorString('#FFFFE0')); + Color.LIGHTYELLOW = Object.freeze(Color.fromCssColorString('#FFFFE0')); /** * An immutable Color instance initialized to CSS color #00FF00 @@ -1608,7 +1607,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIME = freezeObject(Color.fromCssColorString('#00FF00')); + Color.LIME = Object.freeze(Color.fromCssColorString('#00FF00')); /** * An immutable Color instance initialized to CSS color #32CD32 @@ -1617,7 +1616,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LIMEGREEN = freezeObject(Color.fromCssColorString('#32CD32')); + Color.LIMEGREEN = Object.freeze(Color.fromCssColorString('#32CD32')); /** * An immutable Color instance initialized to CSS color #FAF0E6 @@ -1626,7 +1625,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.LINEN = freezeObject(Color.fromCssColorString('#FAF0E6')); + Color.LINEN = Object.freeze(Color.fromCssColorString('#FAF0E6')); /** * An immutable Color instance initialized to CSS color #FF00FF @@ -1635,7 +1634,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MAGENTA = freezeObject(Color.fromCssColorString('#FF00FF')); + Color.MAGENTA = Object.freeze(Color.fromCssColorString('#FF00FF')); /** * An immutable Color instance initialized to CSS color #800000 @@ -1644,7 +1643,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MAROON = freezeObject(Color.fromCssColorString('#800000')); + Color.MAROON = Object.freeze(Color.fromCssColorString('#800000')); /** * An immutable Color instance initialized to CSS color #66CDAA @@ -1653,7 +1652,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMAQUAMARINE = freezeObject(Color.fromCssColorString('#66CDAA')); + Color.MEDIUMAQUAMARINE = Object.freeze(Color.fromCssColorString('#66CDAA')); /** * An immutable Color instance initialized to CSS color #0000CD @@ -1662,7 +1661,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMBLUE = freezeObject(Color.fromCssColorString('#0000CD')); + Color.MEDIUMBLUE = Object.freeze(Color.fromCssColorString('#0000CD')); /** * An immutable Color instance initialized to CSS color #BA55D3 @@ -1671,7 +1670,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMORCHID = freezeObject(Color.fromCssColorString('#BA55D3')); + Color.MEDIUMORCHID = Object.freeze(Color.fromCssColorString('#BA55D3')); /** * An immutable Color instance initialized to CSS color #9370DB @@ -1680,7 +1679,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMPURPLE = freezeObject(Color.fromCssColorString('#9370DB')); + Color.MEDIUMPURPLE = Object.freeze(Color.fromCssColorString('#9370DB')); /** * An immutable Color instance initialized to CSS color #3CB371 @@ -1689,7 +1688,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMSEAGREEN = freezeObject(Color.fromCssColorString('#3CB371')); + Color.MEDIUMSEAGREEN = Object.freeze(Color.fromCssColorString('#3CB371')); /** * An immutable Color instance initialized to CSS color #7B68EE @@ -1698,7 +1697,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMSLATEBLUE = freezeObject(Color.fromCssColorString('#7B68EE')); + Color.MEDIUMSLATEBLUE = Object.freeze(Color.fromCssColorString('#7B68EE')); /** * An immutable Color instance initialized to CSS color #00FA9A @@ -1707,7 +1706,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMSPRINGGREEN = freezeObject(Color.fromCssColorString('#00FA9A')); + Color.MEDIUMSPRINGGREEN = Object.freeze(Color.fromCssColorString('#00FA9A')); /** * An immutable Color instance initialized to CSS color #48D1CC @@ -1716,7 +1715,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMTURQUOISE = freezeObject(Color.fromCssColorString('#48D1CC')); + Color.MEDIUMTURQUOISE = Object.freeze(Color.fromCssColorString('#48D1CC')); /** * An immutable Color instance initialized to CSS color #C71585 @@ -1725,7 +1724,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MEDIUMVIOLETRED = freezeObject(Color.fromCssColorString('#C71585')); + Color.MEDIUMVIOLETRED = Object.freeze(Color.fromCssColorString('#C71585')); /** * An immutable Color instance initialized to CSS color #191970 @@ -1734,7 +1733,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MIDNIGHTBLUE = freezeObject(Color.fromCssColorString('#191970')); + Color.MIDNIGHTBLUE = Object.freeze(Color.fromCssColorString('#191970')); /** * An immutable Color instance initialized to CSS color #F5FFFA @@ -1743,7 +1742,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MINTCREAM = freezeObject(Color.fromCssColorString('#F5FFFA')); + Color.MINTCREAM = Object.freeze(Color.fromCssColorString('#F5FFFA')); /** * An immutable Color instance initialized to CSS color #FFE4E1 @@ -1752,7 +1751,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MISTYROSE = freezeObject(Color.fromCssColorString('#FFE4E1')); + Color.MISTYROSE = Object.freeze(Color.fromCssColorString('#FFE4E1')); /** * An immutable Color instance initialized to CSS color #FFE4B5 @@ -1761,7 +1760,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.MOCCASIN = freezeObject(Color.fromCssColorString('#FFE4B5')); + Color.MOCCASIN = Object.freeze(Color.fromCssColorString('#FFE4B5')); /** * An immutable Color instance initialized to CSS color #FFDEAD @@ -1770,7 +1769,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.NAVAJOWHITE = freezeObject(Color.fromCssColorString('#FFDEAD')); + Color.NAVAJOWHITE = Object.freeze(Color.fromCssColorString('#FFDEAD')); /** * An immutable Color instance initialized to CSS color #000080 @@ -1779,7 +1778,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.NAVY = freezeObject(Color.fromCssColorString('#000080')); + Color.NAVY = Object.freeze(Color.fromCssColorString('#000080')); /** * An immutable Color instance initialized to CSS color #FDF5E6 @@ -1788,7 +1787,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.OLDLACE = freezeObject(Color.fromCssColorString('#FDF5E6')); + Color.OLDLACE = Object.freeze(Color.fromCssColorString('#FDF5E6')); /** * An immutable Color instance initialized to CSS color #808000 @@ -1797,7 +1796,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.OLIVE = freezeObject(Color.fromCssColorString('#808000')); + Color.OLIVE = Object.freeze(Color.fromCssColorString('#808000')); /** * An immutable Color instance initialized to CSS color #6B8E23 @@ -1806,7 +1805,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.OLIVEDRAB = freezeObject(Color.fromCssColorString('#6B8E23')); + Color.OLIVEDRAB = Object.freeze(Color.fromCssColorString('#6B8E23')); /** * An immutable Color instance initialized to CSS color #FFA500 @@ -1815,7 +1814,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.ORANGE = freezeObject(Color.fromCssColorString('#FFA500')); + Color.ORANGE = Object.freeze(Color.fromCssColorString('#FFA500')); /** * An immutable Color instance initialized to CSS color #FF4500 @@ -1824,7 +1823,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.ORANGERED = freezeObject(Color.fromCssColorString('#FF4500')); + Color.ORANGERED = Object.freeze(Color.fromCssColorString('#FF4500')); /** * An immutable Color instance initialized to CSS color #DA70D6 @@ -1833,7 +1832,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.ORCHID = freezeObject(Color.fromCssColorString('#DA70D6')); + Color.ORCHID = Object.freeze(Color.fromCssColorString('#DA70D6')); /** * An immutable Color instance initialized to CSS color #EEE8AA @@ -1842,7 +1841,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PALEGOLDENROD = freezeObject(Color.fromCssColorString('#EEE8AA')); + Color.PALEGOLDENROD = Object.freeze(Color.fromCssColorString('#EEE8AA')); /** * An immutable Color instance initialized to CSS color #98FB98 @@ -1851,7 +1850,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PALEGREEN = freezeObject(Color.fromCssColorString('#98FB98')); + Color.PALEGREEN = Object.freeze(Color.fromCssColorString('#98FB98')); /** * An immutable Color instance initialized to CSS color #AFEEEE @@ -1860,7 +1859,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PALETURQUOISE = freezeObject(Color.fromCssColorString('#AFEEEE')); + Color.PALETURQUOISE = Object.freeze(Color.fromCssColorString('#AFEEEE')); /** * An immutable Color instance initialized to CSS color #DB7093 @@ -1869,7 +1868,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PALEVIOLETRED = freezeObject(Color.fromCssColorString('#DB7093')); + Color.PALEVIOLETRED = Object.freeze(Color.fromCssColorString('#DB7093')); /** * An immutable Color instance initialized to CSS color #FFEFD5 @@ -1878,7 +1877,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PAPAYAWHIP = freezeObject(Color.fromCssColorString('#FFEFD5')); + Color.PAPAYAWHIP = Object.freeze(Color.fromCssColorString('#FFEFD5')); /** * An immutable Color instance initialized to CSS color #FFDAB9 @@ -1887,7 +1886,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PEACHPUFF = freezeObject(Color.fromCssColorString('#FFDAB9')); + Color.PEACHPUFF = Object.freeze(Color.fromCssColorString('#FFDAB9')); /** * An immutable Color instance initialized to CSS color #CD853F @@ -1896,7 +1895,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PERU = freezeObject(Color.fromCssColorString('#CD853F')); + Color.PERU = Object.freeze(Color.fromCssColorString('#CD853F')); /** * An immutable Color instance initialized to CSS color #FFC0CB @@ -1905,7 +1904,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PINK = freezeObject(Color.fromCssColorString('#FFC0CB')); + Color.PINK = Object.freeze(Color.fromCssColorString('#FFC0CB')); /** * An immutable Color instance initialized to CSS color #DDA0DD @@ -1914,7 +1913,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PLUM = freezeObject(Color.fromCssColorString('#DDA0DD')); + Color.PLUM = Object.freeze(Color.fromCssColorString('#DDA0DD')); /** * An immutable Color instance initialized to CSS color #B0E0E6 @@ -1923,7 +1922,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.POWDERBLUE = freezeObject(Color.fromCssColorString('#B0E0E6')); + Color.POWDERBLUE = Object.freeze(Color.fromCssColorString('#B0E0E6')); /** * An immutable Color instance initialized to CSS color #800080 @@ -1932,7 +1931,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.PURPLE = freezeObject(Color.fromCssColorString('#800080')); + Color.PURPLE = Object.freeze(Color.fromCssColorString('#800080')); /** * An immutable Color instance initialized to CSS color #FF0000 @@ -1941,7 +1940,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.RED = freezeObject(Color.fromCssColorString('#FF0000')); + Color.RED = Object.freeze(Color.fromCssColorString('#FF0000')); /** * An immutable Color instance initialized to CSS color #BC8F8F @@ -1950,7 +1949,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.ROSYBROWN = freezeObject(Color.fromCssColorString('#BC8F8F')); + Color.ROSYBROWN = Object.freeze(Color.fromCssColorString('#BC8F8F')); /** * An immutable Color instance initialized to CSS color #4169E1 @@ -1959,7 +1958,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.ROYALBLUE = freezeObject(Color.fromCssColorString('#4169E1')); + Color.ROYALBLUE = Object.freeze(Color.fromCssColorString('#4169E1')); /** * An immutable Color instance initialized to CSS color #8B4513 @@ -1968,7 +1967,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SADDLEBROWN = freezeObject(Color.fromCssColorString('#8B4513')); + Color.SADDLEBROWN = Object.freeze(Color.fromCssColorString('#8B4513')); /** * An immutable Color instance initialized to CSS color #FA8072 @@ -1977,7 +1976,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SALMON = freezeObject(Color.fromCssColorString('#FA8072')); + Color.SALMON = Object.freeze(Color.fromCssColorString('#FA8072')); /** * An immutable Color instance initialized to CSS color #F4A460 @@ -1986,7 +1985,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SANDYBROWN = freezeObject(Color.fromCssColorString('#F4A460')); + Color.SANDYBROWN = Object.freeze(Color.fromCssColorString('#F4A460')); /** * An immutable Color instance initialized to CSS color #2E8B57 @@ -1995,7 +1994,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SEAGREEN = freezeObject(Color.fromCssColorString('#2E8B57')); + Color.SEAGREEN = Object.freeze(Color.fromCssColorString('#2E8B57')); /** * An immutable Color instance initialized to CSS color #FFF5EE @@ -2004,7 +2003,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SEASHELL = freezeObject(Color.fromCssColorString('#FFF5EE')); + Color.SEASHELL = Object.freeze(Color.fromCssColorString('#FFF5EE')); /** * An immutable Color instance initialized to CSS color #A0522D @@ -2013,7 +2012,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SIENNA = freezeObject(Color.fromCssColorString('#A0522D')); + Color.SIENNA = Object.freeze(Color.fromCssColorString('#A0522D')); /** * An immutable Color instance initialized to CSS color #C0C0C0 @@ -2022,7 +2021,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SILVER = freezeObject(Color.fromCssColorString('#C0C0C0')); + Color.SILVER = Object.freeze(Color.fromCssColorString('#C0C0C0')); /** * An immutable Color instance initialized to CSS color #87CEEB @@ -2031,7 +2030,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SKYBLUE = freezeObject(Color.fromCssColorString('#87CEEB')); + Color.SKYBLUE = Object.freeze(Color.fromCssColorString('#87CEEB')); /** * An immutable Color instance initialized to CSS color #6A5ACD @@ -2040,7 +2039,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SLATEBLUE = freezeObject(Color.fromCssColorString('#6A5ACD')); + Color.SLATEBLUE = Object.freeze(Color.fromCssColorString('#6A5ACD')); /** * An immutable Color instance initialized to CSS color #708090 @@ -2049,7 +2048,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SLATEGRAY = freezeObject(Color.fromCssColorString('#708090')); + Color.SLATEGRAY = Object.freeze(Color.fromCssColorString('#708090')); /** * An immutable Color instance initialized to CSS color #708090 @@ -2067,7 +2066,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SNOW = freezeObject(Color.fromCssColorString('#FFFAFA')); + Color.SNOW = Object.freeze(Color.fromCssColorString('#FFFAFA')); /** * An immutable Color instance initialized to CSS color #00FF7F @@ -2076,7 +2075,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.SPRINGGREEN = freezeObject(Color.fromCssColorString('#00FF7F')); + Color.SPRINGGREEN = Object.freeze(Color.fromCssColorString('#00FF7F')); /** * An immutable Color instance initialized to CSS color #4682B4 @@ -2085,7 +2084,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.STEELBLUE = freezeObject(Color.fromCssColorString('#4682B4')); + Color.STEELBLUE = Object.freeze(Color.fromCssColorString('#4682B4')); /** * An immutable Color instance initialized to CSS color #D2B48C @@ -2094,7 +2093,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.TAN = freezeObject(Color.fromCssColorString('#D2B48C')); + Color.TAN = Object.freeze(Color.fromCssColorString('#D2B48C')); /** * An immutable Color instance initialized to CSS color #008080 @@ -2103,7 +2102,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.TEAL = freezeObject(Color.fromCssColorString('#008080')); + Color.TEAL = Object.freeze(Color.fromCssColorString('#008080')); /** * An immutable Color instance initialized to CSS color #D8BFD8 @@ -2112,7 +2111,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.THISTLE = freezeObject(Color.fromCssColorString('#D8BFD8')); + Color.THISTLE = Object.freeze(Color.fromCssColorString('#D8BFD8')); /** * An immutable Color instance initialized to CSS color #FF6347 @@ -2121,7 +2120,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.TOMATO = freezeObject(Color.fromCssColorString('#FF6347')); + Color.TOMATO = Object.freeze(Color.fromCssColorString('#FF6347')); /** * An immutable Color instance initialized to CSS color #40E0D0 @@ -2130,7 +2129,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.TURQUOISE = freezeObject(Color.fromCssColorString('#40E0D0')); + Color.TURQUOISE = Object.freeze(Color.fromCssColorString('#40E0D0')); /** * An immutable Color instance initialized to CSS color #EE82EE @@ -2139,7 +2138,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.VIOLET = freezeObject(Color.fromCssColorString('#EE82EE')); + Color.VIOLET = Object.freeze(Color.fromCssColorString('#EE82EE')); /** * An immutable Color instance initialized to CSS color #F5DEB3 @@ -2148,7 +2147,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.WHEAT = freezeObject(Color.fromCssColorString('#F5DEB3')); + Color.WHEAT = Object.freeze(Color.fromCssColorString('#F5DEB3')); /** * An immutable Color instance initialized to CSS color #FFFFFF @@ -2157,7 +2156,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.WHITE = freezeObject(Color.fromCssColorString('#FFFFFF')); + Color.WHITE = Object.freeze(Color.fromCssColorString('#FFFFFF')); /** * An immutable Color instance initialized to CSS color #F5F5F5 @@ -2166,7 +2165,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.WHITESMOKE = freezeObject(Color.fromCssColorString('#F5F5F5')); + Color.WHITESMOKE = Object.freeze(Color.fromCssColorString('#F5F5F5')); /** * An immutable Color instance initialized to CSS color #FFFF00 @@ -2175,7 +2174,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.YELLOW = freezeObject(Color.fromCssColorString('#FFFF00')); + Color.YELLOW = Object.freeze(Color.fromCssColorString('#FFFF00')); /** * An immutable Color instance initialized to CSS color #9ACD32 @@ -2184,7 +2183,7 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.YELLOWGREEN = freezeObject(Color.fromCssColorString('#9ACD32')); + Color.YELLOWGREEN = Object.freeze(Color.fromCssColorString('#9ACD32')); /** * An immutable Color instance initialized to CSS transparent. @@ -2193,5 +2192,5 @@ import CesiumMath from './Math.js'; * @constant * @type {Color} */ - Color.TRANSPARENT = freezeObject(new Color(0, 0, 0, 0)); + Color.TRANSPARENT = Object.freeze(new Color(0, 0, 0, 0)); export default Color; diff --git a/Source/Core/ColorGeometryInstanceAttribute.js b/Source/Core/ColorGeometryInstanceAttribute.js index 5ef44ea8e36c..cf88ec7ad89b 100644 --- a/Source/Core/ColorGeometryInstanceAttribute.js +++ b/Source/Core/ColorGeometryInstanceAttribute.js @@ -2,7 +2,6 @@ import Color from './Color.js'; import ComponentDatatype from './ComponentDatatype.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; /** @@ -54,7 +53,7 @@ import DeveloperError from './DeveloperError.js'; ]); } - defineProperties(ColorGeometryInstanceAttribute.prototype, { + Object.defineProperties(ColorGeometryInstanceAttribute.prototype, { /** * The datatype of each component in the attribute, e.g., individual elements in * {@link ColorGeometryInstanceAttribute#value}. diff --git a/Source/Core/ComponentDatatype.js b/Source/Core/ComponentDatatype.js index fe1ab0d87833..fcc29403ab12 100644 --- a/Source/Core/ComponentDatatype.js +++ b/Source/Core/ComponentDatatype.js @@ -1,7 +1,6 @@ import defaultValue from './defaultValue.js'; import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import WebGLConstants from './WebGLConstants.js'; /** @@ -318,4 +317,4 @@ import WebGLConstants from './WebGLConstants.js'; //>>includeEnd('debug'); } }; -export default freezeObject(ComponentDatatype); +export default Object.freeze(ComponentDatatype); diff --git a/Source/Core/CompressedTextureBuffer.js b/Source/Core/CompressedTextureBuffer.js index 62f00c56ea9e..3016fdad58c7 100644 --- a/Source/Core/CompressedTextureBuffer.js +++ b/Source/Core/CompressedTextureBuffer.js @@ -1,5 +1,4 @@ import defined from './defined.js'; -import defineProperties from './defineProperties.js'; /** * Describes a compressed texture and contains a compressed texture buffer. @@ -18,7 +17,7 @@ import defineProperties from './defineProperties.js'; this._buffer = buffer; } - defineProperties(CompressedTextureBuffer.prototype, { + Object.defineProperties(CompressedTextureBuffer.prototype, { /** * The format of the compressed texture. * @type PixelFormat diff --git a/Source/Core/CornerType.js b/Source/Core/CornerType.js index de73c9ef7fb9..55b29a36a857 100644 --- a/Source/Core/CornerType.js +++ b/Source/Core/CornerType.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * Style options for corners. @@ -36,4 +35,4 @@ import freezeObject from './freezeObject.js'; */ BEVELED : 2 }; -export default freezeObject(CornerType); +export default Object.freeze(CornerType); diff --git a/Source/Core/CorridorGeometry.js b/Source/Core/CorridorGeometry.js index 096ccab75bbc..fcaebd4181bc 100644 --- a/Source/Core/CorridorGeometry.js +++ b/Source/Core/CorridorGeometry.js @@ -9,7 +9,6 @@ import CornerType from './CornerType.js'; import CorridorGeometryLibrary from './CorridorGeometryLibrary.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Ellipsoid from './Ellipsoid.js'; import Geometry from './Geometry.js'; import GeometryAttribute from './GeometryAttribute.js'; @@ -1066,7 +1065,7 @@ import VertexFormat from './VertexFormat.js'; }); }; - defineProperties(CorridorGeometry.prototype, { + Object.defineProperties(CorridorGeometry.prototype, { /** * @private */ diff --git a/Source/Core/Credit.js b/Source/Core/Credit.js index e6b45128b4e8..e4eba45763c4 100644 --- a/Source/Core/Credit.js +++ b/Source/Core/Credit.js @@ -2,7 +2,6 @@ import DOMPurify from '../ThirdParty/purify.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; var nextCreditId = 0; var creditToId = {}; @@ -44,7 +43,7 @@ import defineProperties from './defineProperties.js'; this._element = undefined; } - defineProperties(Credit.prototype, { + Object.defineProperties(Credit.prototype, { /** * The credit content * @memberof Credit.prototype diff --git a/Source/Core/DistanceDisplayCondition.js b/Source/Core/DistanceDisplayCondition.js index 17cc7337c98f..6ad3b43189dd 100644 --- a/Source/Core/DistanceDisplayCondition.js +++ b/Source/Core/DistanceDisplayCondition.js @@ -1,6 +1,5 @@ import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; /** @@ -24,7 +23,7 @@ import DeveloperError from './DeveloperError.js'; this._far = far; } - defineProperties(DistanceDisplayCondition.prototype, { + Object.defineProperties(DistanceDisplayCondition.prototype, { /** * The smallest distance in the interval where the object is visible. * @memberof DistanceDisplayCondition.prototype diff --git a/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js b/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js index f51ee7efa027..38f8b59d8e01 100644 --- a/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js +++ b/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js @@ -1,7 +1,6 @@ import ComponentDatatype from './ComponentDatatype.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; /** @@ -53,7 +52,7 @@ import DeveloperError from './DeveloperError.js'; this.value = new Float32Array([near, far]); } - defineProperties(DistanceDisplayConditionGeometryInstanceAttribute.prototype, { + Object.defineProperties(DistanceDisplayConditionGeometryInstanceAttribute.prototype, { /** * The datatype of each component in the attribute, e.g., individual elements in * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}. diff --git a/Source/Core/DoublyLinkedList.js b/Source/Core/DoublyLinkedList.js index 6dcb2ebea2ec..03e0786349fd 100644 --- a/Source/Core/DoublyLinkedList.js +++ b/Source/Core/DoublyLinkedList.js @@ -1,5 +1,4 @@ import defined from './defined.js'; -import defineProperties from './defineProperties.js'; /** * @private @@ -10,7 +9,7 @@ import defineProperties from './defineProperties.js'; this._length = 0; } - defineProperties(DoublyLinkedList.prototype, { + Object.defineProperties(DoublyLinkedList.prototype, { length : { get : function() { return this._length; diff --git a/Source/Core/EarthOrientationParameters.js b/Source/Core/EarthOrientationParameters.js index 60cadf4036a3..daae39b69f19 100644 --- a/Source/Core/EarthOrientationParameters.js +++ b/Source/Core/EarthOrientationParameters.js @@ -3,7 +3,6 @@ import binarySearch from './binarySearch.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; import EarthOrientationParametersSample from './EarthOrientationParametersSample.js'; -import freezeObject from './freezeObject.js'; import JulianDate from './JulianDate.js'; import LeapSecond from './LeapSecond.js'; import Resource from './Resource.js'; @@ -99,7 +98,7 @@ import TimeStandard from './TimeStandard.js'; /** * A default {@link EarthOrientationParameters} instance that returns zero for all EOP values. */ - EarthOrientationParameters.NONE = freezeObject({ + EarthOrientationParameters.NONE = Object.freeze({ getPromiseToLoad : function() { return when(); }, diff --git a/Source/Core/EasingFunction.js b/Source/Core/EasingFunction.js index 2747bd7f61cf..685ef7074aa8 100644 --- a/Source/Core/EasingFunction.js +++ b/Source/Core/EasingFunction.js @@ -1,5 +1,4 @@ import Tween from '../ThirdParty/Tween.js'; -import freezeObject from './freezeObject.js'; /** * Easing functions for use with TweenCollection. These function are from @@ -254,4 +253,4 @@ import freezeObject from './freezeObject.js'; * return time * (2.0 - time); * } */ -export default freezeObject(EasingFunction); +export default Object.freeze(EasingFunction); diff --git a/Source/Core/EllipseGeometry.js b/Source/Core/EllipseGeometry.js index 6414056bcf72..94580a26cbd7 100644 --- a/Source/Core/EllipseGeometry.js +++ b/Source/Core/EllipseGeometry.js @@ -7,7 +7,6 @@ import Check from './Check.js'; import ComponentDatatype from './ComponentDatatype.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import EllipseGeometryLibrary from './EllipseGeometryLibrary.js'; import Ellipsoid from './Ellipsoid.js'; @@ -1046,7 +1045,7 @@ import VertexFormat from './VertexFormat.js'; return Geometry._textureCoordinateRotationPoints(positions, stRotation, ellipsoid, boundingRectangle); } - defineProperties(EllipseGeometry.prototype, { + Object.defineProperties(EllipseGeometry.prototype, { /** * @private */ diff --git a/Source/Core/Ellipsoid.js b/Source/Core/Ellipsoid.js index 48918405e57e..c2a8b94e05be 100644 --- a/Source/Core/Ellipsoid.js +++ b/Source/Core/Ellipsoid.js @@ -3,9 +3,7 @@ import Cartographic from './Cartographic.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; import scaleToGeodeticSurface from './scaleToGeodeticSurface.js'; @@ -83,7 +81,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js'; initialize(this, x, y, z); } - defineProperties(Ellipsoid.prototype, { + Object.defineProperties(Ellipsoid.prototype, { /** * Gets the radii of the ellipsoid. * @memberof Ellipsoid.prototype @@ -225,7 +223,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js'; * @type {Ellipsoid} * @constant */ - Ellipsoid.WGS84 = freezeObject(new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793)); + Ellipsoid.WGS84 = Object.freeze(new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793)); /** * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0). @@ -233,7 +231,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js'; * @type {Ellipsoid} * @constant */ - Ellipsoid.UNIT_SPHERE = freezeObject(new Ellipsoid(1.0, 1.0, 1.0)); + Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0)); /** * An Ellipsoid instance initialized to a sphere with the lunar radius. @@ -241,7 +239,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js'; * @type {Ellipsoid} * @constant */ - Ellipsoid.MOON = freezeObject(new Ellipsoid(CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS)); + Ellipsoid.MOON = Object.freeze(new Ellipsoid(CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS)); /** * Duplicates an Ellipsoid instance. diff --git a/Source/Core/EllipsoidGeodesic.js b/Source/Core/EllipsoidGeodesic.js index 4ea5b62c829a..899297844e0b 100644 --- a/Source/Core/EllipsoidGeodesic.js +++ b/Source/Core/EllipsoidGeodesic.js @@ -3,7 +3,6 @@ import Cartographic from './Cartographic.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Ellipsoid from './Ellipsoid.js'; import CesiumMath from './Math.js'; @@ -208,7 +207,7 @@ import CesiumMath from './Math.js'; } } - defineProperties(EllipsoidGeodesic.prototype, { + Object.defineProperties(EllipsoidGeodesic.prototype, { /** * Gets the ellipsoid. * @memberof EllipsoidGeodesic.prototype diff --git a/Source/Core/EllipsoidRhumbLine.js b/Source/Core/EllipsoidRhumbLine.js index 1fb62e1b776f..04ffa3e3838a 100644 --- a/Source/Core/EllipsoidRhumbLine.js +++ b/Source/Core/EllipsoidRhumbLine.js @@ -3,7 +3,6 @@ import Cartographic from './Cartographic.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import CesiumMath from './Math.js'; @@ -227,7 +226,7 @@ import CesiumMath from './Math.js'; } } - defineProperties(EllipsoidRhumbLine.prototype, { + Object.defineProperties(EllipsoidRhumbLine.prototype, { /** * Gets the ellipsoid. * @memberof EllipsoidRhumbLine.prototype diff --git a/Source/Core/EllipsoidTangentPlane.js b/Source/Core/EllipsoidTangentPlane.js index 54a33f1886f0..1b0cfda8d6cd 100644 --- a/Source/Core/EllipsoidTangentPlane.js +++ b/Source/Core/EllipsoidTangentPlane.js @@ -5,7 +5,6 @@ import Cartesian4 from './Cartesian4.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import IntersectionTests from './IntersectionTests.js'; @@ -51,7 +50,7 @@ import Transforms from './Transforms.js'; this._plane = Plane.fromPointNormal(origin, normal); } - defineProperties(EllipsoidTangentPlane.prototype, { + Object.defineProperties(EllipsoidTangentPlane.prototype, { /** * Gets the ellipsoid. * @memberof EllipsoidTangentPlane.prototype diff --git a/Source/Core/EllipsoidTerrainProvider.js b/Source/Core/EllipsoidTerrainProvider.js index fef1b4cfa455..bdbd1e7cfdd8 100644 --- a/Source/Core/EllipsoidTerrainProvider.js +++ b/Source/Core/EllipsoidTerrainProvider.js @@ -1,7 +1,6 @@ import when from '../ThirdParty/when.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Ellipsoid from './Ellipsoid.js'; import Event from './Event.js'; import GeographicTilingScheme from './GeographicTilingScheme.js'; @@ -43,7 +42,7 @@ import TerrainProvider from './TerrainProvider.js'; this._readyPromise = when.resolve(true); } - defineProperties(EllipsoidTerrainProvider.prototype, { + Object.defineProperties(EllipsoidTerrainProvider.prototype, { /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners diff --git a/Source/Core/EllipsoidalOccluder.js b/Source/Core/EllipsoidalOccluder.js index 590c812d07ca..84ba5897b044 100644 --- a/Source/Core/EllipsoidalOccluder.js +++ b/Source/Core/EllipsoidalOccluder.js @@ -3,7 +3,6 @@ import Cartesian3 from './Cartesian3.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Ellipsoid from './Ellipsoid.js'; import Rectangle from './Rectangle.js'; @@ -46,7 +45,7 @@ import Rectangle from './Rectangle.js'; } } - defineProperties(EllipsoidalOccluder.prototype, { + Object.defineProperties(EllipsoidalOccluder.prototype, { /** * Gets the occluding ellipsoid. * @memberof EllipsoidalOccluder.prototype diff --git a/Source/Core/Event.js b/Source/Core/Event.js index 87660a4417a2..47e07552958d 100644 --- a/Source/Core/Event.js +++ b/Source/Core/Event.js @@ -1,6 +1,5 @@ import Check from './Check.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; /** * A generic utility class for managing subscribers for a particular event. @@ -28,7 +27,7 @@ import defineProperties from './defineProperties.js'; this._insideRaiseEvent = false; } - defineProperties(Event.prototype, { + Object.defineProperties(Event.prototype, { /** * The number of listeners currently subscribed to the event. * @memberof Event.prototype diff --git a/Source/Core/ExtrapolationType.js b/Source/Core/ExtrapolationType.js index 1dd05abb2a5c..40f40c6632ad 100644 --- a/Source/Core/ExtrapolationType.js +++ b/Source/Core/ExtrapolationType.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * Constants to determine how an interpolated value is extrapolated @@ -33,4 +32,4 @@ import freezeObject from './freezeObject.js'; */ EXTRAPOLATE : 2 }; -export default freezeObject(ExtrapolationType); +export default Object.freeze(ExtrapolationType); diff --git a/Source/Core/FeatureDetection.js b/Source/Core/FeatureDetection.js index 142e4dcf8763..0b6d6eeeab49 100644 --- a/Source/Core/FeatureDetection.js +++ b/Source/Core/FeatureDetection.js @@ -1,7 +1,6 @@ import when from '../ThirdParty/when.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Fullscreen from './Fullscreen.js'; /*global CanvasPixelArray*/ @@ -168,7 +167,7 @@ import Fullscreen from './Fullscreen.js'; //that rely on it, such as the Windows WebBrowser control which defines //PointerEvent but sets navigator.pointerEnabled to false. - //Firefox disabled because of https://github.com/AnalyticalGraphicsInc/cesium/issues/6372 + //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372 hasPointerEvents = !isFirefox() && typeof PointerEvent !== 'undefined' && (!defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled); } return hasPointerEvents; @@ -237,7 +236,7 @@ import Fullscreen from './Fullscreen.js'; return supportsWebPDeferred.promise; }; - defineProperties(supportsWebP, { + Object.defineProperties(supportsWebP, { initialized: { get: function() { return defined(supportsWebP._result); diff --git a/Source/Core/Fullscreen.js b/Source/Core/Fullscreen.js index ba85ec0ee8cb..8e73a22c4d79 100644 --- a/Source/Core/Fullscreen.js +++ b/Source/Core/Fullscreen.js @@ -1,5 +1,4 @@ import defined from './defined.js'; -import defineProperties from './defineProperties.js'; var _supportsFullscreen; var _names = { @@ -21,7 +20,7 @@ import defineProperties from './defineProperties.js'; */ var Fullscreen = {}; - defineProperties(Fullscreen, { + Object.defineProperties(Fullscreen, { /** * The element that is currently fullscreen, if any. To simply check if the * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}. diff --git a/Source/Core/GeocodeType.js b/Source/Core/GeocodeType.js index a56053c198ad..0e251cc01a53 100644 --- a/Source/Core/GeocodeType.js +++ b/Source/Core/GeocodeType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * The type of geocoding to be performed by a {@link GeocoderService}. @@ -23,4 +22,4 @@ import freezeObject from '../Core/freezeObject.js'; */ AUTOCOMPLETE: 1 }; -export default freezeObject(GeocodeType); +export default Object.freeze(GeocodeType); diff --git a/Source/Core/GeographicProjection.js b/Source/Core/GeographicProjection.js index 19a7d42cc3a8..6e4d64f5b9a3 100644 --- a/Source/Core/GeographicProjection.js +++ b/Source/Core/GeographicProjection.js @@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js'; import Cartographic from './Cartographic.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; @@ -25,7 +24,7 @@ import Ellipsoid from './Ellipsoid.js'; this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis; } - defineProperties(GeographicProjection.prototype, { + Object.defineProperties(GeographicProjection.prototype, { /** * Gets the {@link Ellipsoid}. * diff --git a/Source/Core/GeographicTilingScheme.js b/Source/Core/GeographicTilingScheme.js index 657ecd0153c5..3282c6177349 100644 --- a/Source/Core/GeographicTilingScheme.js +++ b/Source/Core/GeographicTilingScheme.js @@ -2,7 +2,6 @@ import Cartesian2 from './Cartesian2.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Ellipsoid from './Ellipsoid.js'; import GeographicProjection from './GeographicProjection.js'; import CesiumMath from './Math.js'; @@ -35,7 +34,7 @@ import Rectangle from './Rectangle.js'; this._numberOfLevelZeroTilesY = defaultValue(options.numberOfLevelZeroTilesY, 1); } - defineProperties(GeographicTilingScheme.prototype, { + Object.defineProperties(GeographicTilingScheme.prototype, { /** * Gets the ellipsoid that is tiled by this tiling scheme. * @memberof GeographicTilingScheme.prototype diff --git a/Source/Core/GeometryOffsetAttribute.js b/Source/Core/GeometryOffsetAttribute.js index b585a118724b..b42ce92da6b4 100644 --- a/Source/Core/GeometryOffsetAttribute.js +++ b/Source/Core/GeometryOffsetAttribute.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Represents which vertices should have a value of `true` for the `applyOffset` attribute @@ -9,4 +8,4 @@ import freezeObject from '../Core/freezeObject.js'; TOP : 1, ALL : 2 }; -export default freezeObject(GeometryOffsetAttribute); +export default Object.freeze(GeometryOffsetAttribute); diff --git a/Source/Core/GeometryType.js b/Source/Core/GeometryType.js index 41dd1b1bd962..f001a554ec7a 100644 --- a/Source/Core/GeometryType.js +++ b/Source/Core/GeometryType.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * @private @@ -9,4 +8,4 @@ import freezeObject from './freezeObject.js'; LINES : 2, POLYLINES : 3 }; -export default freezeObject(GeometryType); +export default Object.freeze(GeometryType); diff --git a/Source/Core/GoogleEarthEnterpriseMetadata.js b/Source/Core/GoogleEarthEnterpriseMetadata.js index f7802eab9b7c..88c57fa624f2 100644 --- a/Source/Core/GoogleEarthEnterpriseMetadata.js +++ b/Source/Core/GoogleEarthEnterpriseMetadata.js @@ -5,7 +5,6 @@ import Check from './Check.js'; import Credit from './Credit.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import GoogleEarthEnterpriseTileInformation from './GoogleEarthEnterpriseTileInformation.js'; import isBitSet from './isBitSet.js'; import loadAndExecuteScript from './loadAndExecuteScript.js'; @@ -128,7 +127,7 @@ import TaskProcessor from './TaskProcessor.js'; }); } - defineProperties(GoogleEarthEnterpriseMetadata.prototype, { + Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, { /** * Gets the name of the Google Earth Enterprise server. * @memberof GoogleEarthEnterpriseMetadata.prototype diff --git a/Source/Core/GoogleEarthEnterpriseTerrainData.js b/Source/Core/GoogleEarthEnterpriseTerrainData.js index d1418b26ce2f..9b9b865894aa 100644 --- a/Source/Core/GoogleEarthEnterpriseTerrainData.js +++ b/Source/Core/GoogleEarthEnterpriseTerrainData.js @@ -4,7 +4,6 @@ import Cartesian3 from './Cartesian3.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import IndexDatatype from './IndexDatatype.js'; import Intersections2D from './Intersections2D.js'; @@ -86,7 +85,7 @@ import TerrainMesh from './TerrainMesh.js'; this._maximumHeight = undefined; } - defineProperties(GoogleEarthEnterpriseTerrainData.prototype, { + Object.defineProperties(GoogleEarthEnterpriseTerrainData.prototype, { /** * An array of credits for this tile * @memberof GoogleEarthEnterpriseTerrainData.prototype diff --git a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js index 273c30f3e9ca..db2b011f7623 100644 --- a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +++ b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js @@ -2,7 +2,6 @@ import when from '../ThirdParty/when.js'; import Credit from './Credit.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Event from './Event.js'; import GeographicTilingScheme from './GeographicTilingScheme.js'; @@ -152,7 +151,7 @@ import TileProviderError from './TileProviderError.js'; }); } - defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, { + Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, { /** * Gets the name of the Google Earth Enterprise server url hosting the imagery. * @memberof GoogleEarthEnterpriseTerrainProvider.prototype diff --git a/Source/Core/GroundPolylineGeometry.js b/Source/Core/GroundPolylineGeometry.js index 22fb8f6c7cce..8fad73bce20f 100644 --- a/Source/Core/GroundPolylineGeometry.js +++ b/Source/Core/GroundPolylineGeometry.js @@ -8,7 +8,6 @@ import Check from './Check.js'; import ComponentDatatype from './ComponentDatatype.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import EllipsoidGeodesic from './EllipsoidGeodesic.js'; @@ -126,7 +125,7 @@ import WebMercatorProjection from './WebMercatorProjection.js'; this._scene3DOnly = false; } - defineProperties(GroundPolylineGeometry.prototype, { + Object.defineProperties(GroundPolylineGeometry.prototype, { /** * The number of elements used to pack the object into an array. * @memberof GroundPolylineGeometry.prototype diff --git a/Source/Core/Heap.js b/Source/Core/Heap.js index ed181a03936c..0682f132a44a 100644 --- a/Source/Core/Heap.js +++ b/Source/Core/Heap.js @@ -1,7 +1,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; /** * Array implementation of a heap. @@ -25,7 +24,7 @@ import defineProperties from './defineProperties.js'; this._maximumLength = undefined; } - defineProperties(Heap.prototype, { + Object.defineProperties(Heap.prototype, { /** * Gets the length of the heap. * diff --git a/Source/Core/HeightmapEncoding.js b/Source/Core/HeightmapEncoding.js index 37f77ff14977..5e64cd476a8b 100644 --- a/Source/Core/HeightmapEncoding.js +++ b/Source/Core/HeightmapEncoding.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * The encoding that is used for a heightmap @@ -24,4 +23,4 @@ import freezeObject from './freezeObject.js'; */ LERC: 1 }; -export default freezeObject(HeightmapEncoding); +export default Object.freeze(HeightmapEncoding); diff --git a/Source/Core/HeightmapTerrainData.js b/Source/Core/HeightmapTerrainData.js index 608f37872c4e..1c3e5dc5c261 100644 --- a/Source/Core/HeightmapTerrainData.js +++ b/Source/Core/HeightmapTerrainData.js @@ -3,7 +3,6 @@ import BoundingSphere from './BoundingSphere.js'; import Cartesian3 from './Cartesian3.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import GeographicProjection from './GeographicProjection.js'; import HeightmapEncoding from './HeightmapEncoding.js'; @@ -134,7 +133,7 @@ import TerrainProvider from './TerrainProvider.js'; this._mesh = undefined; } - defineProperties(HeightmapTerrainData.prototype, { + Object.defineProperties(HeightmapTerrainData.prototype, { /** * An array of credits for this tile. * @memberof HeightmapTerrainData.prototype diff --git a/Source/Core/HeightmapTessellator.js b/Source/Core/HeightmapTessellator.js index 7bcdc623a7cd..043f64e44ce0 100644 --- a/Source/Core/HeightmapTessellator.js +++ b/Source/Core/HeightmapTessellator.js @@ -7,7 +7,6 @@ import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import EllipsoidalOccluder from './EllipsoidalOccluder.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; import Matrix4 from './Matrix4.js'; import OrientedBoundingBox from './OrientedBoundingBox.js'; @@ -30,7 +29,7 @@ import WebMercatorProjection from './WebMercatorProjection.js'; * * @constant */ - HeightmapTessellator.DEFAULT_STRUCTURE = freezeObject({ + HeightmapTessellator.DEFAULT_STRUCTURE = Object.freeze({ heightScale : 1.0, heightOffset : 0.0, elementsPerHeight : 1, diff --git a/Source/Core/HermiteSpline.js b/Source/Core/HermiteSpline.js index a5f00e25d008..746a13620aaa 100644 --- a/Source/Core/HermiteSpline.js +++ b/Source/Core/HermiteSpline.js @@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js'; import Cartesian4 from './Cartesian4.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import LinearSpline from './LinearSpline.js'; import Matrix4 from './Matrix4.js'; @@ -196,7 +195,7 @@ import TridiagonalSystemSolver from './TridiagonalSystemSolver.js'; this._lastTimeIndex = 0; } - defineProperties(HermiteSpline.prototype, { + Object.defineProperties(HermiteSpline.prototype, { /** * An array of times for the control points. * diff --git a/Source/Core/IndexDatatype.js b/Source/Core/IndexDatatype.js index 8aee42784101..21fbf6d3a087 100644 --- a/Source/Core/IndexDatatype.js +++ b/Source/Core/IndexDatatype.js @@ -1,6 +1,5 @@ import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; import WebGLConstants from './WebGLConstants.js'; @@ -158,4 +157,4 @@ import WebGLConstants from './WebGLConstants.js'; return new Uint16Array(sourceArray, byteOffset, length); }; -export default freezeObject(IndexDatatype); +export default Object.freeze(IndexDatatype); diff --git a/Source/Core/Intersect.js b/Source/Core/Intersect.js index a5b82e4970d4..89eda3504ee1 100644 --- a/Source/Core/Intersect.js +++ b/Source/Core/Intersect.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * This enumerated type is used in determining where, relative to the frustum, an @@ -33,4 +32,4 @@ import freezeObject from './freezeObject.js'; */ INSIDE : 1 }; -export default freezeObject(Intersect); +export default Object.freeze(Intersect); diff --git a/Source/Core/Ion.js b/Source/Core/Ion.js index 5a5a832cdd73..db5b785d6aea 100644 --- a/Source/Core/Ion.js +++ b/Source/Core/Ion.js @@ -3,7 +3,7 @@ import defined from './defined.js'; import Resource from './Resource.js'; var defaultTokenCredit; - var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyYmFmMDZjZi03ZTIzLTRmNDYtYmM4MS1hZmUyOTNlZWQ4N2MiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTgwNzQ2MDQzfQ.I05JcRTUCUA1RWX2y0oQa_p4dFV6tgaAKHrCU5AjlgI'; + var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhZmRiYzgzMy1hODQ3LTRkMDktYjE0Ni0zNTViMTdmNGEyZWEiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTgzMTYzMTYwfQ.blu_ATsUNqSYK0fIBrNRvxq9HiCzY5Ul_4v_4-3F5QY'; /** * Default settings for accessing the Cesium ion API. diff --git a/Source/Core/IonResource.js b/Source/Core/IonResource.js index 8d802cad8ee8..eea166480cf8 100644 --- a/Source/Core/IonResource.js +++ b/Source/Core/IonResource.js @@ -4,7 +4,6 @@ import Check from './Check.js'; import Credit from './Credit.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Ion from './Ion.js'; import Resource from './Resource.js'; import RuntimeError from './RuntimeError.js'; @@ -101,7 +100,7 @@ import RuntimeError from './RuntimeError.js'; }); }; - defineProperties(IonResource.prototype, { + Object.defineProperties(IonResource.prototype, { /** * Gets the credits required for attribution of the asset. * diff --git a/Source/Core/Iso8601.js b/Source/Core/Iso8601.js index ee5b0b8e1faf..9d0ca91cf63d 100644 --- a/Source/Core/Iso8601.js +++ b/Source/Core/Iso8601.js @@ -1,10 +1,9 @@ -import freezeObject from './freezeObject.js'; import JulianDate from './JulianDate.js'; import TimeInterval from './TimeInterval.js'; - var MINIMUM_VALUE = freezeObject(JulianDate.fromIso8601('0000-01-01T00:00:00Z')); - var MAXIMUM_VALUE = freezeObject(JulianDate.fromIso8601('9999-12-31T24:00:00Z')); - var MAXIMUM_INTERVAL = freezeObject(new TimeInterval({ + var MINIMUM_VALUE = Object.freeze(JulianDate.fromIso8601('0000-01-01T00:00:00Z')); + var MAXIMUM_VALUE = Object.freeze(JulianDate.fromIso8601('9999-12-31T24:00:00Z')); + var MAXIMUM_INTERVAL = Object.freeze(new TimeInterval({ start : MINIMUM_VALUE, stop : MAXIMUM_VALUE })); diff --git a/Source/Core/KeyboardEventModifier.js b/Source/Core/KeyboardEventModifier.js index dd26f08c3641..5992e4f75b5c 100644 --- a/Source/Core/KeyboardEventModifier.js +++ b/Source/Core/KeyboardEventModifier.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * This enumerated type is for representing keyboard modifiers. These are keys @@ -31,4 +30,4 @@ import freezeObject from './freezeObject.js'; */ ALT : 2 }; -export default freezeObject(KeyboardEventModifier); +export default Object.freeze(KeyboardEventModifier); diff --git a/Source/Core/LinearSpline.js b/Source/Core/LinearSpline.js index 0ac9ab9cfa3f..b2e3a2aa96e3 100644 --- a/Source/Core/LinearSpline.js +++ b/Source/Core/LinearSpline.js @@ -1,7 +1,6 @@ import Cartesian3 from './Cartesian3.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Spline from './Spline.js'; @@ -64,7 +63,7 @@ import Spline from './Spline.js'; this._lastTimeIndex = 0; } - defineProperties(LinearSpline.prototype, { + Object.defineProperties(LinearSpline.prototype, { /** * An array of times for the control points. * diff --git a/Source/Core/ManagedArray.js b/Source/Core/ManagedArray.js index 65d151602a37..f45a5f1a472d 100644 --- a/Source/Core/ManagedArray.js +++ b/Source/Core/ManagedArray.js @@ -1,6 +1,5 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; -import defineProperties from './defineProperties.js'; /** * A wrapper around arrays so that the internal length of the array can be manually managed. @@ -17,7 +16,7 @@ import defineProperties from './defineProperties.js'; this._length = length; } - defineProperties(ManagedArray.prototype, { + Object.defineProperties(ManagedArray.prototype, { /** * Gets or sets the length of the array. * If the set length is greater than the length of the internal array, the internal array is resized. diff --git a/Source/Core/MapProjection.js b/Source/Core/MapProjection.js index 9f4a1489f5a3..6daae86147c5 100644 --- a/Source/Core/MapProjection.js +++ b/Source/Core/MapProjection.js @@ -1,4 +1,3 @@ -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; /** @@ -15,7 +14,7 @@ import DeveloperError from './DeveloperError.js'; DeveloperError.throwInstantiationError(); } - defineProperties(MapProjection.prototype, { + Object.defineProperties(MapProjection.prototype, { /** * Gets the {@link Ellipsoid}. * diff --git a/Source/Core/Matrix2.js b/Source/Core/Matrix2.js index f6679a79cfff..d9bc7f92353a 100644 --- a/Source/Core/Matrix2.js +++ b/Source/Core/Matrix2.js @@ -2,8 +2,6 @@ import Cartesian2 from './Cartesian2.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; -import freezeObject from './freezeObject.js'; /** * A 2x2 matrix, indexable as a column-major order array. @@ -750,7 +748,7 @@ import freezeObject from './freezeObject.js'; * @type {Matrix2} * @constant */ - Matrix2.IDENTITY = freezeObject(new Matrix2(1.0, 0.0, + Matrix2.IDENTITY = Object.freeze(new Matrix2(1.0, 0.0, 0.0, 1.0)); /** @@ -759,7 +757,7 @@ import freezeObject from './freezeObject.js'; * @type {Matrix2} * @constant */ - Matrix2.ZERO = freezeObject(new Matrix2(0.0, 0.0, + Matrix2.ZERO = Object.freeze(new Matrix2(0.0, 0.0, 0.0, 0.0)); /** @@ -810,7 +808,7 @@ import freezeObject from './freezeObject.js'; */ Matrix2.COLUMN1ROW1 = 3; - defineProperties(Matrix2.prototype, { + Object.defineProperties(Matrix2.prototype, { /** * Gets the number of items in the collection. * @memberof Matrix2.prototype diff --git a/Source/Core/Matrix3.js b/Source/Core/Matrix3.js index 743da429dc7c..996b7222c8fa 100644 --- a/Source/Core/Matrix3.js +++ b/Source/Core/Matrix3.js @@ -2,9 +2,7 @@ import Cartesian3 from './Cartesian3.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; /** @@ -1342,7 +1340,7 @@ import CesiumMath from './Math.js'; * @type {Matrix3} * @constant */ - Matrix3.IDENTITY = freezeObject(new Matrix3(1.0, 0.0, 0.0, + Matrix3.IDENTITY = Object.freeze(new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)); @@ -1352,7 +1350,7 @@ import CesiumMath from './Math.js'; * @type {Matrix3} * @constant */ - Matrix3.ZERO = freezeObject(new Matrix3(0.0, 0.0, 0.0, + Matrix3.ZERO = Object.freeze(new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); @@ -1428,7 +1426,7 @@ import CesiumMath from './Math.js'; */ Matrix3.COLUMN2ROW2 = 8; - defineProperties(Matrix3.prototype, { + Object.defineProperties(Matrix3.prototype, { /** * Gets the number of items in the collection. * @memberof Matrix3.prototype diff --git a/Source/Core/Matrix4.js b/Source/Core/Matrix4.js index 3d2eeaea1a51..8c497050e40d 100644 --- a/Source/Core/Matrix4.js +++ b/Source/Core/Matrix4.js @@ -3,8 +3,6 @@ import Cartesian4 from './Cartesian4.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; import Matrix3 from './Matrix3.js'; import RuntimeError from './RuntimeError.js'; @@ -2388,7 +2386,7 @@ import RuntimeError from './RuntimeError.js'; * @type {Matrix4} * @constant */ - Matrix4.IDENTITY = freezeObject(new Matrix4(1.0, 0.0, 0.0, 0.0, + Matrix4.IDENTITY = Object.freeze(new Matrix4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0)); @@ -2399,7 +2397,7 @@ import RuntimeError from './RuntimeError.js'; * @type {Matrix4} * @constant */ - Matrix4.ZERO = freezeObject(new Matrix4(0.0, 0.0, 0.0, 0.0, + Matrix4.ZERO = Object.freeze(new Matrix4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); @@ -2532,7 +2530,7 @@ import RuntimeError from './RuntimeError.js'; */ Matrix4.COLUMN3ROW3 = 15; - defineProperties(Matrix4.prototype, { + Object.defineProperties(Matrix4.prototype, { /** * Gets the number of items in the collection. * @memberof Matrix4.prototype diff --git a/Source/Core/Occluder.js b/Source/Core/Occluder.js index 0041ad6261f9..b690797c186b 100644 --- a/Source/Core/Occluder.js +++ b/Source/Core/Occluder.js @@ -2,7 +2,6 @@ import BoundingSphere from './BoundingSphere.js'; import Cartesian3 from './Cartesian3.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import CesiumMath from './Math.js'; @@ -51,7 +50,7 @@ import Visibility from './Visibility.js'; var scratchCartesian3 = new Cartesian3(); - defineProperties(Occluder.prototype, { + Object.defineProperties(Occluder.prototype, { /** * The position of the occluder. * @memberof Occluder.prototype diff --git a/Source/Core/OffsetGeometryInstanceAttribute.js b/Source/Core/OffsetGeometryInstanceAttribute.js index 7e1d8ec55896..e6f8cfd09f98 100644 --- a/Source/Core/OffsetGeometryInstanceAttribute.js +++ b/Source/Core/OffsetGeometryInstanceAttribute.js @@ -2,7 +2,6 @@ import Check from './Check.js'; import ComponentDatatype from './ComponentDatatype.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; /** * Value and type information for per-instance geometry attribute that determines the geometry instance offset @@ -32,7 +31,7 @@ import defineProperties from './defineProperties.js'; this.value = new Float32Array([x, y, z]); } - defineProperties(OffsetGeometryInstanceAttribute.prototype, { + Object.defineProperties(OffsetGeometryInstanceAttribute.prototype, { /** * The datatype of each component in the attribute, e.g., individual elements in * {@link OffsetGeometryInstanceAttribute#value}. diff --git a/Source/Core/OpenCageGeocoderService.js b/Source/Core/OpenCageGeocoderService.js index 4b00c7c73fb2..88dab9add823 100644 --- a/Source/Core/OpenCageGeocoderService.js +++ b/Source/Core/OpenCageGeocoderService.js @@ -3,7 +3,6 @@ import Check from './Check.js'; import combine from './combine.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Rectangle from './Rectangle.js'; import Resource from './Resource.js'; @@ -51,7 +50,7 @@ import Resource from './Resource.js'; this._params = defaultValue(params, {}); } - defineProperties(OpenCageGeocoderService.prototype, { + Object.defineProperties(OpenCageGeocoderService.prototype, { /** * The Resource used to access the OpenCage endpoint. * @type {Resource} diff --git a/Source/Core/OrthographicFrustum.js b/Source/Core/OrthographicFrustum.js index 9fa793ea3dcd..19932800130f 100644 --- a/Source/Core/OrthographicFrustum.js +++ b/Source/Core/OrthographicFrustum.js @@ -1,7 +1,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import CesiumMath from './Math.js'; import OrthographicOffCenterFrustum from './OrthographicOffCenterFrustum.js'; @@ -160,7 +159,7 @@ import OrthographicOffCenterFrustum from './OrthographicOffCenterFrustum.js'; } } - defineProperties(OrthographicFrustum.prototype, { + Object.defineProperties(OrthographicFrustum.prototype, { /** * Gets the orthographic projection matrix computed from the view frustum. * @memberof OrthographicFrustum.prototype diff --git a/Source/Core/OrthographicOffCenterFrustum.js b/Source/Core/OrthographicOffCenterFrustum.js index 6ca8971b60a6..e1a9a821bf9a 100644 --- a/Source/Core/OrthographicOffCenterFrustum.js +++ b/Source/Core/OrthographicOffCenterFrustum.js @@ -3,7 +3,6 @@ import Cartesian4 from './Cartesian4.js'; import CullingVolume from './CullingVolume.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import CesiumMath from './Math.js'; import Matrix4 from './Matrix4.js'; @@ -126,7 +125,7 @@ import Matrix4 from './Matrix4.js'; } } - defineProperties(OrthographicOffCenterFrustum.prototype, { + Object.defineProperties(OrthographicOffCenterFrustum.prototype, { /** * Gets the orthographic projection matrix computed from the view frustum. * @memberof OrthographicOffCenterFrustum.prototype diff --git a/Source/Core/PeliasGeocoderService.js b/Source/Core/PeliasGeocoderService.js index 951a4c77dde9..26db199fe194 100644 --- a/Source/Core/PeliasGeocoderService.js +++ b/Source/Core/PeliasGeocoderService.js @@ -1,7 +1,6 @@ import Cartesian3 from './Cartesian3.js'; import Check from './Check.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import GeocodeType from './GeocodeType.js'; import Rectangle from './Rectangle.js'; import Resource from './Resource.js'; @@ -33,7 +32,7 @@ import Resource from './Resource.js'; this._url.appendForwardSlash(); } - defineProperties(PeliasGeocoderService.prototype, { + Object.defineProperties(PeliasGeocoderService.prototype, { /** * The Resource used to access the Pelias endpoint. * @type {Resource} diff --git a/Source/Core/PerspectiveFrustum.js b/Source/Core/PerspectiveFrustum.js index 64dd216bb5dd..e8bd3aca74dc 100644 --- a/Source/Core/PerspectiveFrustum.js +++ b/Source/Core/PerspectiveFrustum.js @@ -1,7 +1,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import CesiumMath from './Math.js'; import PerspectiveOffCenterFrustum from './PerspectiveOffCenterFrustum.js'; @@ -203,7 +202,7 @@ import PerspectiveOffCenterFrustum from './PerspectiveOffCenterFrustum.js'; } } - defineProperties(PerspectiveFrustum.prototype, { + Object.defineProperties(PerspectiveFrustum.prototype, { /** * Gets the perspective projection matrix computed from the view frustum. * @memberof PerspectiveFrustum.prototype diff --git a/Source/Core/PerspectiveOffCenterFrustum.js b/Source/Core/PerspectiveOffCenterFrustum.js index 19d2cf37e47f..176ac3ce0104 100644 --- a/Source/Core/PerspectiveOffCenterFrustum.js +++ b/Source/Core/PerspectiveOffCenterFrustum.js @@ -3,7 +3,6 @@ import Cartesian4 from './Cartesian4.js'; import CullingVolume from './CullingVolume.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import CesiumMath from './Math.js'; import Matrix4 from './Matrix4.js'; @@ -130,7 +129,7 @@ import Matrix4 from './Matrix4.js'; } } - defineProperties(PerspectiveOffCenterFrustum.prototype, { + Object.defineProperties(PerspectiveOffCenterFrustum.prototype, { /** * Gets the perspective projection matrix computed from the view frustum. * @memberof PerspectiveOffCenterFrustum.prototype diff --git a/Source/Core/PixelFormat.js b/Source/Core/PixelFormat.js index 3d9c1f94cdef..a1f99b88ca87 100644 --- a/Source/Core/PixelFormat.js +++ b/Source/Core/PixelFormat.js @@ -1,5 +1,4 @@ import PixelDatatype from '../Renderer/PixelDatatype.js'; -import freezeObject from './freezeObject.js'; import WebGLConstants from './WebGLConstants.js'; /** @@ -324,4 +323,4 @@ import WebGLConstants from './WebGLConstants.js'; return flipped; } }; -export default freezeObject(PixelFormat); +export default Object.freeze(PixelFormat); diff --git a/Source/Core/Plane.js b/Source/Core/Plane.js index 3304a9aed5bc..40a69873e670 100644 --- a/Source/Core/Plane.js +++ b/Source/Core/Plane.js @@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js'; import Check from './Check.js'; import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; import Matrix4 from './Matrix4.js'; @@ -240,7 +239,7 @@ import Matrix4 from './Matrix4.js'; * @type {Plane} * @constant */ - Plane.ORIGIN_XY_PLANE = freezeObject(new Plane(Cartesian3.UNIT_Z, 0.0)); + Plane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Z, 0.0)); /** * A constant initialized to the YZ plane passing through the origin, with normal in positive X. @@ -248,7 +247,7 @@ import Matrix4 from './Matrix4.js'; * @type {Plane} * @constant */ - Plane.ORIGIN_YZ_PLANE = freezeObject(new Plane(Cartesian3.UNIT_X, 0.0)); + Plane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_X, 0.0)); /** * A constant initialized to the ZX plane passing through the origin, with normal in positive Y. @@ -256,5 +255,5 @@ import Matrix4 from './Matrix4.js'; * @type {Plane} * @constant */ - Plane.ORIGIN_ZX_PLANE = freezeObject(new Plane(Cartesian3.UNIT_Y, 0.0)); + Plane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Y, 0.0)); export default Plane; diff --git a/Source/Core/PolygonGeometry.js b/Source/Core/PolygonGeometry.js index 9979b582095e..62d0a7a836c3 100644 --- a/Source/Core/PolygonGeometry.js +++ b/Source/Core/PolygonGeometry.js @@ -9,7 +9,6 @@ import Check from './Check.js'; import ComponentDatatype from './ComponentDatatype.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import EllipsoidGeodesic from './EllipsoidGeodesic.js'; @@ -1049,7 +1048,7 @@ import WindingOrder from './WindingOrder.js'; return Geometry._textureCoordinateRotationPoints(positions, stRotation, ellipsoid, boundingRectangle); } - defineProperties(PolygonGeometry.prototype, { + Object.defineProperties(PolygonGeometry.prototype, { /** * @private */ diff --git a/Source/Core/PolylinePipeline.js b/Source/Core/PolylinePipeline.js index ab1a1aadd30b..3f6aac973ddb 100644 --- a/Source/Core/PolylinePipeline.js +++ b/Source/Core/PolylinePipeline.js @@ -7,7 +7,6 @@ import Ellipsoid from './Ellipsoid.js'; import EllipsoidGeodesic from './EllipsoidGeodesic.js'; import EllipsoidRhumbLine from './EllipsoidRhumbLine.js'; import IntersectionTests from './IntersectionTests.js'; -import isArray from './isArray.js'; import CesiumMath from './Math.js'; import Matrix4 from './Matrix4.js'; import Plane from './Plane.js'; @@ -260,7 +259,7 @@ import Plane from './Plane.js'; var length = positions.length; var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84); var height = defaultValue(options.height, 0); - var hasHeightArray = isArray(height); + var hasHeightArray = Array.isArray(height); if (length < 1) { return []; @@ -351,7 +350,7 @@ import Plane from './Plane.js'; var length = positions.length; var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84); var height = defaultValue(options.height, 0); - var hasHeightArray = isArray(height); + var hasHeightArray = Array.isArray(height); if (length < 1) { return []; diff --git a/Source/Core/PolylineVolumeGeometry.js b/Source/Core/PolylineVolumeGeometry.js index 7c57caabbaa1..7a63ba7ce9cb 100644 --- a/Source/Core/PolylineVolumeGeometry.js +++ b/Source/Core/PolylineVolumeGeometry.js @@ -142,7 +142,7 @@ import WindingOrder from './WindingOrder.js'; geometry = GeometryPipeline.computeTangentAndBitangent(geometry); } catch (e) { oneTimeWarning('polyline-volume-tangent-bitangent', 'Unable to compute tangents and bitangents for polyline volume geometry'); - //TODO https://github.com/AnalyticalGraphicsInc/cesium/issues/3609 + //TODO https://github.com/CesiumGS/cesium/issues/3609 } if (!vertexFormat.tangent) { diff --git a/Source/Core/PrimitiveType.js b/Source/Core/PrimitiveType.js index 899f3282b655..96e680e55ea9 100644 --- a/Source/Core/PrimitiveType.js +++ b/Source/Core/PrimitiveType.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; import WebGLConstants from './WebGLConstants.js'; /** @@ -80,4 +79,4 @@ import WebGLConstants from './WebGLConstants.js'; primitiveType === PrimitiveType.TRIANGLE_FAN; } }; -export default freezeObject(PrimitiveType); +export default Object.freeze(PrimitiveType); diff --git a/Source/Core/QuantizedMeshTerrainData.js b/Source/Core/QuantizedMeshTerrainData.js index 5cae490b0664..988fb96a6a72 100644 --- a/Source/Core/QuantizedMeshTerrainData.js +++ b/Source/Core/QuantizedMeshTerrainData.js @@ -4,7 +4,6 @@ import Cartesian2 from './Cartesian2.js'; import Cartesian3 from './Cartesian3.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import IndexDatatype from './IndexDatatype.js'; import Intersections2D from './Intersections2D.js'; @@ -182,7 +181,7 @@ import TerrainMesh from './TerrainMesh.js'; this._mesh = undefined; } - defineProperties(QuantizedMeshTerrainData.prototype, { + Object.defineProperties(QuantizedMeshTerrainData.prototype, { /** * An array of credits for this tile. * @memberof QuantizedMeshTerrainData.prototype diff --git a/Source/Core/Quaternion.js b/Source/Core/Quaternion.js index 7297fa322d57..0639c163958b 100644 --- a/Source/Core/Quaternion.js +++ b/Source/Core/Quaternion.js @@ -3,7 +3,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; import FeatureDetection from './FeatureDetection.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; import Matrix3 from './Matrix3.js'; @@ -967,7 +966,7 @@ import Matrix3 from './Matrix3.js'; * @type {Quaternion} * @constant */ - Quaternion.ZERO = freezeObject(new Quaternion(0.0, 0.0, 0.0, 0.0)); + Quaternion.ZERO = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 0.0)); /** * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0). @@ -975,7 +974,7 @@ import Matrix3 from './Matrix3.js'; * @type {Quaternion} * @constant */ - Quaternion.IDENTITY = freezeObject(new Quaternion(0.0, 0.0, 0.0, 1.0)); + Quaternion.IDENTITY = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 1.0)); /** * Duplicates this Quaternion instance. diff --git a/Source/Core/QuaternionSpline.js b/Source/Core/QuaternionSpline.js index 19fbd5bb23a3..afc7f5fd94a7 100644 --- a/Source/Core/QuaternionSpline.js +++ b/Source/Core/QuaternionSpline.js @@ -1,6 +1,5 @@ import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Quaternion from './Quaternion.js'; import Spline from './Spline.js'; @@ -69,7 +68,7 @@ import Spline from './Spline.js'; this._lastTimeIndex = 0; } - defineProperties(QuaternionSpline.prototype, { + Object.defineProperties(QuaternionSpline.prototype, { /** * An array of times for the control points. * diff --git a/Source/Core/Queue.js b/Source/Core/Queue.js index 6c27bd2572aa..cc6c7f30439e 100644 --- a/Source/Core/Queue.js +++ b/Source/Core/Queue.js @@ -1,4 +1,3 @@ -import defineProperties from './defineProperties.js'; /** * A queue that can enqueue items at the end, and dequeue items from the front. @@ -12,7 +11,7 @@ import defineProperties from './defineProperties.js'; this._length = 0; } - defineProperties(Queue.prototype, { + Object.defineProperties(Queue.prototype, { /** * The length of the queue. * diff --git a/Source/Core/Rectangle.js b/Source/Core/Rectangle.js index 6bd3ba7ad638..346bcc004647 100644 --- a/Source/Core/Rectangle.js +++ b/Source/Core/Rectangle.js @@ -2,9 +2,7 @@ import Cartographic from './Cartographic.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Ellipsoid from './Ellipsoid.js'; -import freezeObject from './freezeObject.js'; import CesiumMath from './Math.js'; /** @@ -54,7 +52,7 @@ import CesiumMath from './Math.js'; this.north = defaultValue(north, 0.0); } - defineProperties(Rectangle.prototype, { + Object.defineProperties(Rectangle.prototype, { /** * Gets the width of the rectangle in radians. * @memberof Rectangle.prototype @@ -867,5 +865,5 @@ import CesiumMath from './Math.js'; * @type {Rectangle} * @constant */ - Rectangle.MAX_VALUE = freezeObject(new Rectangle(-Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, CesiumMath.PI_OVER_TWO)); + Rectangle.MAX_VALUE = Object.freeze(new Rectangle(-Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, CesiumMath.PI_OVER_TWO)); export default Rectangle; diff --git a/Source/Core/RectangleGeometry.js b/Source/Core/RectangleGeometry.js index c6dc0f1fac07..a4da85203282 100644 --- a/Source/Core/RectangleGeometry.js +++ b/Source/Core/RectangleGeometry.js @@ -7,7 +7,6 @@ import Check from './Check.js'; import ComponentDatatype from './ComponentDatatype.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import Geometry from './Geometry.js'; @@ -1169,7 +1168,7 @@ import VertexFormat from './VertexFormat.js'; return result; } - defineProperties(RectangleGeometry.prototype, { + Object.defineProperties(RectangleGeometry.prototype, { /** * @private */ diff --git a/Source/Core/ReferenceFrame.js b/Source/Core/ReferenceFrame.js index a7c37b79cd55..70eb4fcfd7cf 100644 --- a/Source/Core/ReferenceFrame.js +++ b/Source/Core/ReferenceFrame.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * Constants for identifying well-known reference frames. @@ -22,4 +21,4 @@ import freezeObject from './freezeObject.js'; */ INERTIAL : 1 }; -export default freezeObject(ReferenceFrame); +export default Object.freeze(ReferenceFrame); diff --git a/Source/Core/RequestScheduler.js b/Source/Core/RequestScheduler.js index 0bc21591fcc7..6c1138bde60b 100644 --- a/Source/Core/RequestScheduler.js +++ b/Source/Core/RequestScheduler.js @@ -3,7 +3,6 @@ import when from '../ThirdParty/when.js'; import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Event from './Event.js'; import Heap from './Heap.js'; import isBlobUri from './isBlobUri.js'; @@ -94,7 +93,7 @@ import RequestState from './RequestState.js'; */ RequestScheduler.requestCompletedEvent = requestCompletedEvent; - defineProperties(RequestScheduler, { + Object.defineProperties(RequestScheduler, { /** * Returns the statistics used by the request scheduler. * diff --git a/Source/Core/RequestState.js b/Source/Core/RequestState.js index 32ea53af0110..15efccad847d 100644 --- a/Source/Core/RequestState.js +++ b/Source/Core/RequestState.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * State of the request. @@ -54,4 +53,4 @@ import freezeObject from '../Core/freezeObject.js'; */ FAILED : 5 }; -export default freezeObject(RequestState); +export default Object.freeze(RequestState); diff --git a/Source/Core/RequestType.js b/Source/Core/RequestType.js index 0f2e577dbd4d..7e7bbd9a054f 100644 --- a/Source/Core/RequestType.js +++ b/Source/Core/RequestType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * An enum identifying the type of request. Used for finer grained logging and priority sorting. @@ -38,4 +37,4 @@ import freezeObject from '../Core/freezeObject.js'; */ OTHER : 3 }; -export default freezeObject(RequestType); +export default Object.freeze(RequestType); diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index 941fc1a42c36..04463a4856c5 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -6,9 +6,7 @@ import clone from './clone.js'; import combine from './combine.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import getAbsoluteUri from './getAbsoluteUri.js'; import getBaseUri from './getBaseUri.js'; import getExtensionFromUri from './getExtensionFromUri.js'; @@ -385,7 +383,7 @@ import TrustedServers from './TrustedServers.js'; return supportsImageBitmapOptionsPromise; }; - defineProperties(Resource, { + Object.defineProperties(Resource, { /** * Returns true if blobs are supported. * @@ -401,7 +399,7 @@ import TrustedServers from './TrustedServers.js'; } }); - defineProperties(Resource.prototype, { + Object.defineProperties(Resource.prototype, { /** * Query parameters appended to the url. * @@ -1831,7 +1829,7 @@ import TrustedServers from './TrustedServers.js'; Resource.supportsImageBitmapOptions() .then(function(supportsImageBitmap) { // We can only use ImageBitmap if we can flip on decode. - // See: https://github.com/AnalyticalGraphicsInc/cesium/pull/7579#issuecomment-466146898 + // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898 if (!(supportsImageBitmap && preferImageBitmap)) { loadImageElement(url, crossOrigin, deferred); return; @@ -1899,15 +1897,10 @@ import TrustedServers from './TrustedServers.js'; } function loadWithHttpRequest(url, responseType, method, data, headers, deferred, overrideMimeType) { - - // Specifically use the Node version of require to avoid conflicts with the global - // require defined in the built version of Cesium. - var nodeRequire = global.require; // eslint-disable-line - // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer - var URL = nodeRequire('url').parse(url); - var http = URL.protocol === 'https:' ? nodeRequire('https') : nodeRequire('http'); - var zlib = nodeRequire('zlib'); + var URL = require('url').parse(url); // eslint-disable-line + var http = URL.protocol === 'https:' ? require('https') : require('http'); // eslint-disable-line + var zlib = require('zlib'); // eslint-disable-line var options = { protocol : URL.protocol, hostname : URL.hostname, @@ -2068,7 +2061,7 @@ import TrustedServers from './TrustedServers.js'; * @type {Resource} * @constant */ - Resource.DEFAULT = freezeObject(new Resource({ + Resource.DEFAULT = Object.freeze(new Resource({ url: (typeof document === 'undefined') ? '' : document.location.href.split('?')[0] })); diff --git a/Source/Core/ScreenSpaceEventHandler.js b/Source/Core/ScreenSpaceEventHandler.js index 1d5e6b8bdb70..0a4dc8487cdc 100644 --- a/Source/Core/ScreenSpaceEventHandler.js +++ b/Source/Core/ScreenSpaceEventHandler.js @@ -53,7 +53,13 @@ import ScreenSpaceEventType from './ScreenSpaceEventType.js'; function listener(e) { callback(screenSpaceEventHandler, e); } - element.addEventListener(domType, listener, false); + + if (FeatureDetection.isInternetExplorer()) { + element.addEventListener(domType, listener, false); + } + else { + element.addEventListener(domType, listener, { capture: false, passive: false }); + } screenSpaceEventHandler._removalFunctions.push(function() { element.removeEventListener(domType, listener, false); diff --git a/Source/Core/ScreenSpaceEventType.js b/Source/Core/ScreenSpaceEventType.js index 83d4929c4f3e..457722443f80 100644 --- a/Source/Core/ScreenSpaceEventType.js +++ b/Source/Core/ScreenSpaceEventType.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down. @@ -126,4 +125,4 @@ import freezeObject from './freezeObject.js'; */ PINCH_MOVE : 19 }; -export default freezeObject(ScreenSpaceEventType); +export default Object.freeze(ScreenSpaceEventType); diff --git a/Source/Core/ShowGeometryInstanceAttribute.js b/Source/Core/ShowGeometryInstanceAttribute.js index 6c0f9c8f4dce..e13a12ef04b7 100644 --- a/Source/Core/ShowGeometryInstanceAttribute.js +++ b/Source/Core/ShowGeometryInstanceAttribute.js @@ -1,7 +1,6 @@ import ComponentDatatype from './ComponentDatatype.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; /** @@ -44,7 +43,7 @@ import DeveloperError from './DeveloperError.js'; this.value = ShowGeometryInstanceAttribute.toValue(show); } - defineProperties(ShowGeometryInstanceAttribute.prototype, { + Object.defineProperties(ShowGeometryInstanceAttribute.prototype, { /** * The datatype of each component in the attribute, e.g., individual elements in * {@link ColorGeometryInstanceAttribute#value}. diff --git a/Source/Core/TerrainData.js b/Source/Core/TerrainData.js index c1a52bfab7f9..572424bd283b 100644 --- a/Source/Core/TerrainData.js +++ b/Source/Core/TerrainData.js @@ -1,4 +1,3 @@ -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; /** @@ -16,7 +15,7 @@ import DeveloperError from './DeveloperError.js'; DeveloperError.throwInstantiationError(); } - defineProperties(TerrainData.prototype, { + Object.defineProperties(TerrainData.prototype, { /** * An array of credits for this tile. * @memberof TerrainData.prototype diff --git a/Source/Core/TerrainProvider.js b/Source/Core/TerrainProvider.js index c234fed8ab33..0e82db0b45ae 100644 --- a/Source/Core/TerrainProvider.js +++ b/Source/Core/TerrainProvider.js @@ -1,5 +1,4 @@ import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import IndexDatatype from './IndexDatatype.js'; import CesiumMath from './Math.js'; @@ -21,7 +20,7 @@ import CesiumMath from './Math.js'; DeveloperError.throwInstantiationError(); } - defineProperties(TerrainProvider.prototype, { + Object.defineProperties(TerrainProvider.prototype, { /** * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners diff --git a/Source/Core/TerrainQuantization.js b/Source/Core/TerrainQuantization.js index b97807c37b68..e8cb9abded23 100644 --- a/Source/Core/TerrainQuantization.js +++ b/Source/Core/TerrainQuantization.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * This enumerated type is used to determine how the vertices of the terrain mesh are compressed. @@ -24,4 +23,4 @@ import freezeObject from './freezeObject.js'; */ BITS12 : 1 }; -export default freezeObject(TerrainQuantization); +export default Object.freeze(TerrainQuantization); diff --git a/Source/Core/TileAvailability.js b/Source/Core/TileAvailability.js index 3f39c058e94a..a050362199a1 100644 --- a/Source/Core/TileAvailability.js +++ b/Source/Core/TileAvailability.js @@ -1,7 +1,6 @@ import binarySearch from './binarySearch.js'; import Cartographic from './Cartographic.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Rectangle from './Rectangle.js'; /** @@ -215,7 +214,7 @@ import Rectangle from './Rectangle.js'; this._ne = undefined; } - defineProperties(QuadtreeNode.prototype, { + Object.defineProperties(QuadtreeNode.prototype, { nw: { get: function() { if (!this._nw) { diff --git a/Source/Core/TilingScheme.js b/Source/Core/TilingScheme.js index d79b4db78b90..3a5ba25a6816 100644 --- a/Source/Core/TilingScheme.js +++ b/Source/Core/TilingScheme.js @@ -1,4 +1,3 @@ -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; /** @@ -20,7 +19,7 @@ import DeveloperError from './DeveloperError.js'; //>>includeEnd('debug'); } - defineProperties(TilingScheme.prototype, { + Object.defineProperties(TilingScheme.prototype, { /** * Gets the ellipsoid that is tiled by the tiling scheme. * @memberof TilingScheme.prototype diff --git a/Source/Core/TimeConstants.js b/Source/Core/TimeConstants.js index f75616d67a82..447437bb3918 100644 --- a/Source/Core/TimeConstants.js +++ b/Source/Core/TimeConstants.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * Constants for time conversions like those done by {@link JulianDate}. @@ -82,4 +81,4 @@ import freezeObject from './freezeObject.js'; */ MODIFIED_JULIAN_DATE_DIFFERENCE : 2400000.5 }; -export default freezeObject(TimeConstants); +export default Object.freeze(TimeConstants); diff --git a/Source/Core/TimeInterval.js b/Source/Core/TimeInterval.js index ac5b100f6b7e..55b4eba3de19 100644 --- a/Source/Core/TimeInterval.js +++ b/Source/Core/TimeInterval.js @@ -1,9 +1,7 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; import JulianDate from './JulianDate.js'; /** @@ -94,7 +92,7 @@ import JulianDate from './JulianDate.js'; this.isStopIncluded = defaultValue(options.isStopIncluded, true); } - defineProperties(TimeInterval.prototype, { + Object.defineProperties(TimeInterval.prototype, { /** * Gets whether or not this interval is empty. * @memberof TimeInterval.prototype @@ -373,7 +371,7 @@ import JulianDate from './JulianDate.js'; * @type {TimeInterval} * @constant */ - TimeInterval.EMPTY = freezeObject(new TimeInterval({ + TimeInterval.EMPTY = Object.freeze(new TimeInterval({ start : new JulianDate(), stop : new JulianDate(), isStartIncluded : false, diff --git a/Source/Core/TimeIntervalCollection.js b/Source/Core/TimeIntervalCollection.js index f0f6690e95dc..799ded2176bc 100644 --- a/Source/Core/TimeIntervalCollection.js +++ b/Source/Core/TimeIntervalCollection.js @@ -1,7 +1,6 @@ import binarySearch from './binarySearch.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Event from './Event.js'; import GregorianDate from './GregorianDate.js'; @@ -33,7 +32,7 @@ import TimeInterval from './TimeInterval.js'; } } - defineProperties(TimeIntervalCollection.prototype, { + Object.defineProperties(TimeIntervalCollection.prototype, { /** * Gets an event that is raised whenever the collection of intervals change. * @memberof TimeIntervalCollection.prototype diff --git a/Source/Core/TimeStandard.js b/Source/Core/TimeStandard.js index 785519b15000..bdcf41fb9079 100644 --- a/Source/Core/TimeStandard.js +++ b/Source/Core/TimeStandard.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * Provides the type of time standards which JulianDate can take as input. @@ -29,4 +28,4 @@ import freezeObject from './freezeObject.js'; */ TAI : 1 }; -export default freezeObject(TimeStandard); +export default Object.freeze(TimeStandard); diff --git a/Source/Core/VRTheWorldTerrainProvider.js b/Source/Core/VRTheWorldTerrainProvider.js index dc024ba8ae6a..aa24478ce44f 100644 --- a/Source/Core/VRTheWorldTerrainProvider.js +++ b/Source/Core/VRTheWorldTerrainProvider.js @@ -2,7 +2,6 @@ import when from '../ThirdParty/when.js'; import Credit from './Credit.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import Event from './Event.js'; @@ -126,7 +125,7 @@ import TileProviderError from './TileProviderError.js'; requestMetadata(); } - defineProperties(VRTheWorldTerrainProvider.prototype, { + Object.defineProperties(VRTheWorldTerrainProvider.prototype, { /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing * to the event, you will be notified of the error and can potentially recover from it. Event listeners diff --git a/Source/Core/VertexFormat.js b/Source/Core/VertexFormat.js index b491b919c099..4da08f2ff5cf 100644 --- a/Source/Core/VertexFormat.js +++ b/Source/Core/VertexFormat.js @@ -1,7 +1,6 @@ import defaultValue from './defaultValue.js'; import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import freezeObject from './freezeObject.js'; /** * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided @@ -107,7 +106,7 @@ import freezeObject from './freezeObject.js'; * * @see VertexFormat#position */ - VertexFormat.POSITION_ONLY = freezeObject(new VertexFormat({ + VertexFormat.POSITION_ONLY = Object.freeze(new VertexFormat({ position : true })); @@ -121,7 +120,7 @@ import freezeObject from './freezeObject.js'; * @see VertexFormat#position * @see VertexFormat#normal */ - VertexFormat.POSITION_AND_NORMAL = freezeObject(new VertexFormat({ + VertexFormat.POSITION_AND_NORMAL = Object.freeze(new VertexFormat({ position : true, normal : true })); @@ -138,7 +137,7 @@ import freezeObject from './freezeObject.js'; * @see VertexFormat#normal * @see VertexFormat#st */ - VertexFormat.POSITION_NORMAL_AND_ST = freezeObject(new VertexFormat({ + VertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(new VertexFormat({ position : true, normal : true, st : true @@ -154,7 +153,7 @@ import freezeObject from './freezeObject.js'; * @see VertexFormat#position * @see VertexFormat#st */ - VertexFormat.POSITION_AND_ST = freezeObject(new VertexFormat({ + VertexFormat.POSITION_AND_ST = Object.freeze(new VertexFormat({ position : true, st : true })); @@ -168,7 +167,7 @@ import freezeObject from './freezeObject.js'; * @see VertexFormat#position * @see VertexFormat#color */ - VertexFormat.POSITION_AND_COLOR = freezeObject(new VertexFormat({ + VertexFormat.POSITION_AND_COLOR = Object.freeze(new VertexFormat({ position : true, color : true })); @@ -185,7 +184,7 @@ import freezeObject from './freezeObject.js'; * @see VertexFormat#tangent * @see VertexFormat#bitangent */ - VertexFormat.ALL = freezeObject(new VertexFormat({ + VertexFormat.ALL = Object.freeze(new VertexFormat({ position : true, normal : true, st : true, diff --git a/Source/Core/VideoSynchronizer.js b/Source/Core/VideoSynchronizer.js index 8b41189c22ba..68168672a555 100644 --- a/Source/Core/VideoSynchronizer.js +++ b/Source/Core/VideoSynchronizer.js @@ -1,6 +1,5 @@ import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import destroyObject from './destroyObject.js'; import Iso8601 from './Iso8601.js'; import JulianDate from './JulianDate.js'; @@ -54,7 +53,7 @@ import JulianDate from './JulianDate.js'; this._firstTickAfterSeek = false; } - defineProperties(VideoSynchronizer.prototype, { + Object.defineProperties(VideoSynchronizer.prototype, { /** * Gets or sets the clock used to drive the video element. * diff --git a/Source/Core/Visibility.js b/Source/Core/Visibility.js index 509a9abe8a6e..ebae8d8b89c0 100644 --- a/Source/Core/Visibility.js +++ b/Source/Core/Visibility.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * This enumerated type is used in determining to what extent an object, the occludee, @@ -33,4 +32,4 @@ import freezeObject from './freezeObject.js'; */ FULL : 1 }; -export default freezeObject(Visibility); +export default Object.freeze(Visibility); diff --git a/Source/Core/WebGLConstants.js b/Source/Core/WebGLConstants.js index f17056855cd5..90f68cc37c4e 100644 --- a/Source/Core/WebGLConstants.js +++ b/Source/Core/WebGLConstants.js @@ -1,9 +1,8 @@ -import freezeObject from './freezeObject.js'; /** * Enum containing WebGL Constant values by name. * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context - * (For example, in [Safari 9]{@link https://github.com/AnalyticalGraphicsInc/cesium/issues/2989}). + * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}). * * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/} * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/} @@ -607,4 +606,4 @@ import freezeObject from './freezeObject.js'; // Extensions MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; -export default freezeObject(WebGLConstants); +export default Object.freeze(WebGLConstants); diff --git a/Source/Core/WebMercatorProjection.js b/Source/Core/WebMercatorProjection.js index 1483ee8176f4..1753620d5d62 100644 --- a/Source/Core/WebMercatorProjection.js +++ b/Source/Core/WebMercatorProjection.js @@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js'; import Cartographic from './Cartographic.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Ellipsoid from './Ellipsoid.js'; import CesiumMath from './Math.js'; @@ -25,7 +24,7 @@ import CesiumMath from './Math.js'; this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis; } - defineProperties(WebMercatorProjection.prototype, { + Object.defineProperties(WebMercatorProjection.prototype, { /** * Gets the {@link Ellipsoid}. * diff --git a/Source/Core/WebMercatorTilingScheme.js b/Source/Core/WebMercatorTilingScheme.js index 6efd02dd8400..593a039d0112 100644 --- a/Source/Core/WebMercatorTilingScheme.js +++ b/Source/Core/WebMercatorTilingScheme.js @@ -1,7 +1,6 @@ import Cartesian2 from './Cartesian2.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import Ellipsoid from './Ellipsoid.js'; import Rectangle from './Rectangle.js'; import WebMercatorProjection from './WebMercatorProjection.js'; @@ -54,7 +53,7 @@ import WebMercatorProjection from './WebMercatorProjection.js'; northeast.longitude, northeast.latitude); } - defineProperties(WebMercatorTilingScheme.prototype, { + Object.defineProperties(WebMercatorTilingScheme.prototype, { /** * Gets the ellipsoid that is tiled by this tiling scheme. * @memberof WebMercatorTilingScheme.prototype diff --git a/Source/Core/WeightSpline.js b/Source/Core/WeightSpline.js index cb4747974677..7130b174c4b8 100644 --- a/Source/Core/WeightSpline.js +++ b/Source/Core/WeightSpline.js @@ -1,7 +1,6 @@ import Check from './Check.js'; import defaultValue from './defaultValue.js'; import defined from './defined.js'; -import defineProperties from './defineProperties.js'; import DeveloperError from './DeveloperError.js'; import Spline from './Spline.js'; @@ -60,7 +59,7 @@ import Spline from './Spline.js'; this._lastTimeIndex = 0; } - defineProperties(WeightSpline.prototype, { + Object.defineProperties(WeightSpline.prototype, { /** * An array of times for the control weights. * diff --git a/Source/Core/WindingOrder.js b/Source/Core/WindingOrder.js index d99cec6a60c1..9452e3f2cf47 100644 --- a/Source/Core/WindingOrder.js +++ b/Source/Core/WindingOrder.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; import WebGLConstants from './WebGLConstants.js'; /** @@ -31,4 +30,4 @@ import WebGLConstants from './WebGLConstants.js'; windingOrder === WindingOrder.COUNTER_CLOCKWISE; } }; -export default freezeObject(WindingOrder); +export default Object.freeze(WindingOrder); diff --git a/Source/Core/defaultValue.js b/Source/Core/defaultValue.js index cdce75d3b442..9e452636d46a 100644 --- a/Source/Core/defaultValue.js +++ b/Source/Core/defaultValue.js @@ -1,4 +1,3 @@ -import freezeObject from './freezeObject.js'; /** * Returns the first parameter if not undefined, otherwise the second parameter. @@ -25,5 +24,5 @@ import freezeObject from './freezeObject.js'; * an object literal. * @type {Object} */ - defaultValue.EMPTY_OBJECT = freezeObject({}); + defaultValue.EMPTY_OBJECT = Object.freeze({}); export default defaultValue; diff --git a/Source/Core/defineProperties.js b/Source/Core/defineProperties.js deleted file mode 100644 index e34e42fc10a2..000000000000 --- a/Source/Core/defineProperties.js +++ /dev/null @@ -1,27 +0,0 @@ -import defined from './defined.js'; - - var definePropertyWorks = (function() { - try { - return 'x' in Object.defineProperty({}, 'x', {}); - } catch (e) { - return false; - } - })(); - - /** - * Defines properties on an object, using Object.defineProperties if available, - * otherwise returns the object unchanged. This function should be used in - * setup code to prevent errors from completely halting JavaScript execution - * in legacy browsers. - * - * @private - * - * @exports defineProperties - */ - var defineProperties = Object.defineProperties; - if (!definePropertyWorks || !defined(defineProperties)) { - defineProperties = function(o) { - return o; - }; - } -export default defineProperties; diff --git a/Source/Core/deprecationWarning.js b/Source/Core/deprecationWarning.js index 3ac1c6ab1635..d714024b8220 100644 --- a/Source/Core/deprecationWarning.js +++ b/Source/Core/deprecationWarning.js @@ -26,7 +26,7 @@ import oneTimeWarning from './oneTimeWarning.js'; * }; * * // Deprecated property - * defineProperties(Bar.prototype, { + * Object.defineProperties(Bar.prototype, { * prop : { * get : function() { * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); diff --git a/Source/Core/freezeObject.js b/Source/Core/freezeObject.js deleted file mode 100644 index bd771b4ee081..000000000000 --- a/Source/Core/freezeObject.js +++ /dev/null @@ -1,18 +0,0 @@ -import defined from './defined.js'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } -export default freezeObject; diff --git a/Source/Core/isArray.js b/Source/Core/isArray.js index 30211cb09968..142118d38d15 100644 --- a/Source/Core/isArray.js +++ b/Source/Core/isArray.js @@ -1,4 +1,5 @@ import defined from './defined.js'; +import deprecationWarning from './deprecationWarning.js'; /** * Tests an object to see if it is an array. @@ -6,6 +7,8 @@ import defined from './defined.js'; * * @param {*} value The value to test. * @returns {Boolean} true if the value is an array, false otherwise. + * @deprecated See https://github.com/AnalyticalGraphicsInc/cesium/issues/8526. + * Use `Array.isArray` instead */ var isArray = Array.isArray; if (!defined(isArray)) { @@ -13,4 +16,9 @@ import defined from './defined.js'; return Object.prototype.toString.call(value) === '[object Array]'; }; } -export default isArray; + + function isArrayFunction(value) { + deprecationWarning('isArray', 'isArray will be removed in Cesium 1.69. Use the native `Array.isArray` function instead.'); + return isArray(value); + } +export default isArrayFunction; diff --git a/Source/Core/objectToQuery.js b/Source/Core/objectToQuery.js index feaeca762826..974fe27618c1 100644 --- a/Source/Core/objectToQuery.js +++ b/Source/Core/objectToQuery.js @@ -1,6 +1,5 @@ import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import isArray from './isArray.js'; /** * Converts an object representing a set of name/value pairs into a query string, @@ -36,7 +35,7 @@ import isArray from './isArray.js'; var value = obj[propName]; var part = encodeURIComponent(propName) + '='; - if (isArray(value)) { + if (Array.isArray(value)) { for (var i = 0, len = value.length; i < len; ++i) { result += part + encodeURIComponent(value[i]) + '&'; } @@ -51,7 +50,7 @@ import isArray from './isArray.js'; // This function used to replace %20 with + which is more compact and readable. // However, some servers didn't properly handle + as a space. - // https://github.com/AnalyticalGraphicsInc/cesium/issues/2192 + // https://github.com/CesiumGS/cesium/issues/2192 return result; } diff --git a/Source/Core/queryToObject.js b/Source/Core/queryToObject.js index 20469ae1c2d3..dad5b383ffb9 100644 --- a/Source/Core/queryToObject.js +++ b/Source/Core/queryToObject.js @@ -1,6 +1,5 @@ import defined from './defined.js'; import DeveloperError from './DeveloperError.js'; -import isArray from './isArray.js'; /** * Parses a query string into an object, where the keys and values of the object are the @@ -50,7 +49,7 @@ import isArray from './isArray.js'; if (typeof resultValue === 'string') { // expand the single value to an array result[name] = [resultValue, value]; - } else if (isArray(resultValue)) { + } else if (Array.isArray(resultValue)) { resultValue.push(value); } else { result[name] = value; diff --git a/Source/DataSources/BillboardGraphics.js b/Source/DataSources/BillboardGraphics.js index a0419397ad08..75aca39062c1 100644 --- a/Source/DataSources/BillboardGraphics.js +++ b/Source/DataSources/BillboardGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; @@ -87,7 +86,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(BillboardGraphics.prototype, { + Object.defineProperties(BillboardGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof BillboardGraphics.prototype diff --git a/Source/DataSources/BoundingSphereState.js b/Source/DataSources/BoundingSphereState.js index 12c124103190..e08e1b7ebc84 100644 --- a/Source/DataSources/BoundingSphereState.js +++ b/Source/DataSources/BoundingSphereState.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * The state of a BoundingSphere computation being performed by a {@link Visualizer}. @@ -25,4 +24,4 @@ import freezeObject from '../Core/freezeObject.js'; */ FAILED : 2 }; -export default freezeObject(BoundingSphereState); +export default Object.freeze(BoundingSphereState); diff --git a/Source/DataSources/BoxGeometryUpdater.js b/Source/DataSources/BoxGeometryUpdater.js index 8b67e4a36b59..c087521528a6 100644 --- a/Source/DataSources/BoxGeometryUpdater.js +++ b/Source/DataSources/BoxGeometryUpdater.js @@ -5,7 +5,6 @@ import Check from '../Core/Check.js'; import Color from '../Core/Color.js'; import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribute.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js'; import GeometryInstance from '../Core/GeometryInstance.js'; @@ -61,7 +60,7 @@ import Property from './Property.js'; BoxGeometryUpdater.prototype.constructor = BoxGeometryUpdater; } - defineProperties(BoxGeometryUpdater.prototype, { + Object.defineProperties(BoxGeometryUpdater.prototype, { /** * Gets the terrain offset property * @type {TerrainOffsetProperty} diff --git a/Source/DataSources/BoxGraphics.js b/Source/DataSources/BoxGraphics.js index 055f77b4384c..6cb57fcbcb66 100644 --- a/Source/DataSources/BoxGraphics.js +++ b/Source/DataSources/BoxGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -52,7 +51,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(BoxGraphics.prototype, { + Object.defineProperties(BoxGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof BoxGraphics.prototype diff --git a/Source/DataSources/CallbackProperty.js b/Source/DataSources/CallbackProperty.js index 0cc83cdf5de4..19963f710a50 100644 --- a/Source/DataSources/CallbackProperty.js +++ b/Source/DataSources/CallbackProperty.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; @@ -19,7 +18,7 @@ import Event from '../Core/Event.js'; this.setCallback(callback, isConstant); } - defineProperties(CallbackProperty.prototype, { + Object.defineProperties(CallbackProperty.prototype, { /** * Gets a value indicating if this property is constant. * @memberof CallbackProperty.prototype diff --git a/Source/DataSources/Cesium3DTilesetGraphics.js b/Source/DataSources/Cesium3DTilesetGraphics.js index b9c7a9629db5..f1fc2d6f92dc 100644 --- a/Source/DataSources/Cesium3DTilesetGraphics.js +++ b/Source/DataSources/Cesium3DTilesetGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; @@ -30,7 +29,7 @@ function Cesium3DTilesetGraphics(options) { this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } -defineProperties(Cesium3DTilesetGraphics.prototype, { +Object.defineProperties(Cesium3DTilesetGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof Cesium3DTilesetGraphics.prototype diff --git a/Source/DataSources/CheckerboardMaterialProperty.js b/Source/DataSources/CheckerboardMaterialProperty.js index c7f8622b0d52..5dd01b97993c 100644 --- a/Source/DataSources/CheckerboardMaterialProperty.js +++ b/Source/DataSources/CheckerboardMaterialProperty.js @@ -2,7 +2,6 @@ import Cartesian2 from '../Core/Cartesian2.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -37,7 +36,7 @@ import Property from './Property.js'; this.repeat = options.repeat; } - defineProperties(CheckerboardMaterialProperty.prototype, { + Object.defineProperties(CheckerboardMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/ColorMaterialProperty.js b/Source/DataSources/ColorMaterialProperty.js index 1e59beff78fd..1b0d0e30336b 100644 --- a/Source/DataSources/ColorMaterialProperty.js +++ b/Source/DataSources/ColorMaterialProperty.js @@ -1,6 +1,5 @@ import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -21,7 +20,7 @@ import Property from './Property.js'; this.color = color; } - defineProperties(ColorMaterialProperty.prototype, { + Object.defineProperties(ColorMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/CompositeEntityCollection.js b/Source/DataSources/CompositeEntityCollection.js index 94642db5fbe6..ed081d3686e1 100644 --- a/Source/DataSources/CompositeEntityCollection.js +++ b/Source/DataSources/CompositeEntityCollection.js @@ -1,6 +1,5 @@ import createGuid from '../Core/createGuid.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import CesiumMath from '../Core/Math.js'; import Entity from './Entity.js'; @@ -130,7 +129,7 @@ import EntityCollection from './EntityCollection.js'; this._shouldRecomposite = false; } - defineProperties(CompositeEntityCollection.prototype, { + Object.defineProperties(CompositeEntityCollection.prototype, { /** * Gets the event that is fired when entities are added or removed from the collection. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}. diff --git a/Source/DataSources/CompositeMaterialProperty.js b/Source/DataSources/CompositeMaterialProperty.js index 6ef3a17ba50f..4c1a3812562c 100644 --- a/Source/DataSources/CompositeMaterialProperty.js +++ b/Source/DataSources/CompositeMaterialProperty.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import CompositeProperty from './CompositeProperty.js'; @@ -17,7 +16,7 @@ import Property from './Property.js'; this._composite.definitionChanged.addEventListener(CompositeMaterialProperty.prototype._raiseDefinitionChanged, this); } - defineProperties(CompositeMaterialProperty.prototype, { + Object.defineProperties(CompositeMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/CompositePositionProperty.js b/Source/DataSources/CompositePositionProperty.js index 81c831f397d5..1f519ba750f0 100644 --- a/Source/DataSources/CompositePositionProperty.js +++ b/Source/DataSources/CompositePositionProperty.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import ReferenceFrame from '../Core/ReferenceFrame.js'; @@ -22,7 +21,7 @@ import Property from './Property.js'; this._composite.definitionChanged.addEventListener(CompositePositionProperty.prototype._raiseDefinitionChanged, this); } - defineProperties(CompositePositionProperty.prototype, { + Object.defineProperties(CompositePositionProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/CompositeProperty.js b/Source/DataSources/CompositeProperty.js index cd05487fa6be..308849002fd4 100644 --- a/Source/DataSources/CompositeProperty.js +++ b/Source/DataSources/CompositeProperty.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import EventHelper from '../Core/EventHelper.js'; @@ -60,7 +59,7 @@ import Property from './Property.js'; this._intervals.changedEvent.addEventListener(CompositeProperty.prototype._intervalsChanged, this); } - defineProperties(CompositeProperty.prototype, { + Object.defineProperties(CompositeProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/ConstantPositionProperty.js b/Source/DataSources/ConstantPositionProperty.js index 846bd303deba..11fccf90036a 100644 --- a/Source/DataSources/ConstantPositionProperty.js +++ b/Source/DataSources/ConstantPositionProperty.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import ReferenceFrame from '../Core/ReferenceFrame.js'; @@ -23,7 +22,7 @@ import PositionProperty from './PositionProperty.js'; this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED); } - defineProperties(ConstantPositionProperty.prototype, { + Object.defineProperties(ConstantPositionProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/ConstantProperty.js b/Source/DataSources/ConstantProperty.js index 4f70a9456fdc..f1c27ec56dc2 100644 --- a/Source/DataSources/ConstantProperty.js +++ b/Source/DataSources/ConstantProperty.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; /** @@ -20,7 +19,7 @@ import Event from '../Core/Event.js'; this.setValue(value); } - defineProperties(ConstantProperty.prototype, { + Object.defineProperties(ConstantProperty.prototype, { /** * Gets a value indicating if this property is constant. * This property always returns true. diff --git a/Source/DataSources/CorridorGeometryUpdater.js b/Source/DataSources/CorridorGeometryUpdater.js index 1b58ac5ec33c..520ded01c98c 100644 --- a/Source/DataSources/CorridorGeometryUpdater.js +++ b/Source/DataSources/CorridorGeometryUpdater.js @@ -174,7 +174,7 @@ import Property from './Property.js'; !Property.isConstant(corridor.outlineWidth) || // !Property.isConstant(corridor.cornerType) || // !Property.isConstant(corridor.zIndex) || // - (this._onTerrain && !Property.isConstant(this._materialProperty)); + (this._onTerrain && !Property.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty)); }; CorridorGeometryUpdater.prototype._setStaticOptions = function(entity, corridor) { diff --git a/Source/DataSources/CorridorGraphics.js b/Source/DataSources/CorridorGraphics.js index 80de75bea490..5f173ca6dbb0 100644 --- a/Source/DataSources/CorridorGraphics.js +++ b/Source/DataSources/CorridorGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -79,7 +78,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(CorridorGraphics.prototype, { + Object.defineProperties(CorridorGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof CorridorGraphics.prototype diff --git a/Source/DataSources/CustomDataSource.js b/Source/DataSources/CustomDataSource.js index 8ba15a953509..501f65c2c45e 100644 --- a/Source/DataSources/CustomDataSource.js +++ b/Source/DataSources/CustomDataSource.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import DataSource from './DataSource.js'; @@ -37,7 +36,7 @@ import EntityCollection from './EntityCollection.js'; this._entityCluster = new EntityCluster(); } - defineProperties(CustomDataSource.prototype, { + Object.defineProperties(CustomDataSource.prototype, { /** * Gets or sets a human-readable name for this instance. * @memberof CustomDataSource.prototype diff --git a/Source/DataSources/CylinderGeometryUpdater.js b/Source/DataSources/CylinderGeometryUpdater.js index 9f2973d6a5ef..95f15a049819 100644 --- a/Source/DataSources/CylinderGeometryUpdater.js +++ b/Source/DataSources/CylinderGeometryUpdater.js @@ -5,7 +5,6 @@ import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribu import CylinderGeometry from '../Core/CylinderGeometry.js'; import CylinderOutlineGeometry from '../Core/CylinderOutlineGeometry.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js'; import GeometryInstance from '../Core/GeometryInstance.js'; @@ -65,7 +64,7 @@ import Property from './Property.js'; CylinderGeometryUpdater.prototype.constructor = CylinderGeometryUpdater; } - defineProperties(CylinderGeometryUpdater.prototype, { + Object.defineProperties(CylinderGeometryUpdater.prototype, { /** * Gets the terrain offset property * @type {TerrainOffsetProperty} diff --git a/Source/DataSources/CylinderGraphics.js b/Source/DataSources/CylinderGraphics.js index bc01dae16f54..a5c8a43a3272 100644 --- a/Source/DataSources/CylinderGraphics.js +++ b/Source/DataSources/CylinderGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -63,7 +62,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(CylinderGraphics.prototype, { + Object.defineProperties(CylinderGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof CylinderGraphics.prototype diff --git a/Source/DataSources/CzmlDataSource.js b/Source/DataSources/CzmlDataSource.js index 1490788fdebd..5d94af20a332 100644 --- a/Source/DataSources/CzmlDataSource.js +++ b/Source/DataSources/CzmlDataSource.js @@ -11,7 +11,6 @@ import Credit from '../Core/Credit.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; import Ellipsoid from '../Core/Ellipsoid.js'; @@ -19,7 +18,6 @@ import Event from '../Core/Event.js'; import ExtrapolationType from '../Core/ExtrapolationType.js'; import getFilenameFromUri from '../Core/getFilenameFromUri.js'; import HermitePolynomialApproximation from '../Core/HermitePolynomialApproximation.js'; -import isArray from '../Core/isArray.js'; import Iso8601 from '../Core/Iso8601.js'; import JulianDate from '../Core/JulianDate.js'; import LagrangePolynomialApproximation from '../Core/LagrangePolynomialApproximation.js'; @@ -777,7 +775,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; return; } - if (isArray(packetData)) { + if (Array.isArray(packetData)) { for (var i = 0, len = packetData.length; i < len; ++i) { processProperty(type, object, propertyName, packetData[i], interval, sourceUri, entityCollection); } @@ -951,7 +949,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; return; } - if (isArray(packetData)) { + if (Array.isArray(packetData)) { for (var i = 0, len = packetData.length; i < len; ++i) { processPositionProperty(object, propertyName, packetData[i], interval, sourceUri, entityCollection); } @@ -1087,7 +1085,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; return; } - if (isArray(packetData)) { + if (Array.isArray(packetData)) { for (var i = 0, len = packetData.length; i < len; ++i) { processMaterialProperty(object, propertyName, packetData[i], interval, sourceUri, entityCollection); } @@ -1149,7 +1147,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; } var propertyData = propertiesData[key]; - if (isArray(propertyData)) { + if (Array.isArray(propertyData)) { for (var i = 0, len = propertyData.length; i < len; ++i) { processProperty(getPropertyType(propertyData[i]), entity.properties, key, propertyData[i], undefined, sourceUri, entityCollection); } @@ -1201,7 +1199,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; return; } - if (isArray(packetData)) { + if (Array.isArray(packetData)) { for (var i = 0, length = packetData.length; i < length; ++i) { processArrayPacketData(object, propertyName, packetData[i], entityCollection); } @@ -1234,7 +1232,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; return; } - if (isArray(packetData)) { + if (Array.isArray(packetData)) { for (var i = 0, length = packetData.length; i < length; ++i) { processPositionArrayPacketData(object, propertyName, packetData[i], entityCollection); } @@ -1284,7 +1282,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; return; } - if (isArray(packetData)) { + if (Array.isArray(packetData)) { for (var i = 0, length = packetData.length; i < length; ++i) { processPositionArrayOfArraysPacketData(object, propertyName, packetData[i], entityCollection); } @@ -1300,7 +1298,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; } var intervals; - if (isArray(packetData)) { + if (Array.isArray(packetData)) { for (var i = 0, len = packetData.length; i < len; ++i) { if (!defined(intervals)) { intervals = new TimeIntervalCollection(); @@ -1618,7 +1616,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; var i, len; var nodeTransformationsData = modelData.nodeTransformations; if (defined(nodeTransformationsData)) { - if (isArray(nodeTransformationsData)) { + if (Array.isArray(nodeTransformationsData)) { for (i = 0, len = nodeTransformationsData.length; i < len; ++i) { processNodeTransformations(model, nodeTransformationsData[i], interval, sourceUri, entityCollection); } @@ -1629,7 +1627,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; var articulationsData = modelData.articulations; if (defined(articulationsData)) { - if (isArray(articulationsData)) { + if (Array.isArray(articulationsData)) { for (i = 0, len = articulationsData.length; i < len; ++i) { processArticulations(model, articulationsData[i], interval, sourceUri, entityCollection); } @@ -1766,7 +1764,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; this._definitionChanged = new Event(); } - defineProperties(PolygonHierarchyProperty.prototype, { + Object.defineProperties(PolygonHierarchyProperty.prototype, { isConstant : { get : function() { var positions = this.polygon._positions; @@ -2190,7 +2188,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; return new CzmlDataSource().load(czml, options); }; - defineProperties(CzmlDataSource.prototype, { + Object.defineProperties(CzmlDataSource.prototype, { /** * Gets a human-readable name for this instance. * @memberof CzmlDataSource.prototype @@ -2408,7 +2406,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js'; CzmlDataSource._processCzml = function(czml, entityCollection, sourceUri, updaterFunctions, dataSource) { updaterFunctions = defaultValue(updaterFunctions, CzmlDataSource.updaters); - if (isArray(czml)) { + if (Array.isArray(czml)) { for (var i = 0, len = czml.length; i < len; ++i) { processCzmlPacket(czml[i], entityCollection, updaterFunctions, sourceUri, dataSource); } diff --git a/Source/DataSources/DataSource.js b/Source/DataSources/DataSource.js index 873dc627551c..d219cb782151 100644 --- a/Source/DataSources/DataSource.js +++ b/Source/DataSources/DataSource.js @@ -1,4 +1,3 @@ -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; /** @@ -15,7 +14,7 @@ import DeveloperError from '../Core/DeveloperError.js'; DeveloperError.throwInstantiationError(); } - defineProperties(DataSource.prototype, { + Object.defineProperties(DataSource.prototype, { /** * Gets a human-readable name for this instance. * @memberof DataSource.prototype diff --git a/Source/DataSources/DataSourceClock.js b/Source/DataSources/DataSourceClock.js index 6ef2309f0965..56f1def5dc44 100644 --- a/Source/DataSources/DataSourceClock.js +++ b/Source/DataSources/DataSourceClock.js @@ -1,7 +1,6 @@ import Clock from '../Core/Clock.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import JulianDate from '../Core/JulianDate.js'; @@ -24,7 +23,7 @@ import createRawPropertyDescriptor from './createRawPropertyDescriptor.js'; this._multiplier = undefined; } - defineProperties(DataSourceClock.prototype, { + Object.defineProperties(DataSourceClock.prototype, { /** * Gets the event that is raised whenever a new property is assigned. * @memberof DataSourceClock.prototype diff --git a/Source/DataSources/DataSourceCollection.js b/Source/DataSources/DataSourceCollection.js index 46bf07e16e05..c6e0de1abd3f 100644 --- a/Source/DataSources/DataSourceCollection.js +++ b/Source/DataSources/DataSourceCollection.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; @@ -19,7 +18,7 @@ import when from '../ThirdParty/when.js'; this._dataSourceMoved = new Event(); } - defineProperties(DataSourceCollection.prototype, { + Object.defineProperties(DataSourceCollection.prototype, { /** * Gets the number of data sources in this collection. * @memberof DataSourceCollection.prototype diff --git a/Source/DataSources/DataSourceDisplay.js b/Source/DataSources/DataSourceDisplay.js index dfb03267ff05..b1c213795e1e 100644 --- a/Source/DataSources/DataSourceDisplay.js +++ b/Source/DataSources/DataSourceDisplay.js @@ -3,7 +3,6 @@ import BoundingSphere from '../Core/BoundingSphere.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import EventHelper from '../Core/EventHelper.js'; import GroundPolylinePrimitive from '../Scene/GroundPolylinePrimitive.js'; @@ -117,7 +116,7 @@ import PolylineVisualizer from './PolylineVisualizer.js'; new PolylineVisualizer(scene, entities, dataSource._primitives, dataSource._groundPrimitives)]; }; - defineProperties(DataSourceDisplay.prototype, { + Object.defineProperties(DataSourceDisplay.prototype, { /** * Gets the scene associated with this display. * @memberof DataSourceDisplay.prototype diff --git a/Source/DataSources/EllipseGeometryUpdater.js b/Source/DataSources/EllipseGeometryUpdater.js index 1100baaf4762..19ea7853030d 100644 --- a/Source/DataSources/EllipseGeometryUpdater.js +++ b/Source/DataSources/EllipseGeometryUpdater.js @@ -179,7 +179,7 @@ import Property from './Property.js'; !Property.isConstant(ellipse.outlineWidth) || // !Property.isConstant(ellipse.numberOfVerticalLines) || // !Property.isConstant(ellipse.zIndex) || // - (this._onTerrain && !Property.isConstant(this._materialProperty)); + (this._onTerrain && !Property.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty)); }; EllipseGeometryUpdater.prototype._setStaticOptions = function(entity, ellipse) { diff --git a/Source/DataSources/EllipseGraphics.js b/Source/DataSources/EllipseGraphics.js index 37f802eef14d..4a73b08ba741 100644 --- a/Source/DataSources/EllipseGraphics.js +++ b/Source/DataSources/EllipseGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -85,7 +84,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(EllipseGraphics.prototype, { + Object.defineProperties(EllipseGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof EllipseGraphics.prototype diff --git a/Source/DataSources/EllipsoidGeometryUpdater.js b/Source/DataSources/EllipsoidGeometryUpdater.js index ffcad0a2fece..bb31b14fa7a7 100644 --- a/Source/DataSources/EllipsoidGeometryUpdater.js +++ b/Source/DataSources/EllipsoidGeometryUpdater.js @@ -4,7 +4,6 @@ import Color from '../Core/Color.js'; import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribute.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js'; import EllipsoidGeometry from '../Core/EllipsoidGeometry.js'; @@ -77,7 +76,7 @@ import Property from './Property.js'; EllipsoidGeometryUpdater.prototype.constructor = EllipsoidGeometryUpdater; } - defineProperties(EllipsoidGeometryUpdater.prototype, { + Object.defineProperties(EllipsoidGeometryUpdater.prototype, { /** * Gets the terrain offset property * @type {TerrainOffsetProperty} diff --git a/Source/DataSources/EllipsoidGraphics.js b/Source/DataSources/EllipsoidGraphics.js index 0354d6a3b46b..4d15841529f5 100644 --- a/Source/DataSources/EllipsoidGraphics.js +++ b/Source/DataSources/EllipsoidGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -76,7 +75,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(EllipsoidGraphics.prototype, { + Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof EllipsoidGraphics.prototype diff --git a/Source/DataSources/Entity.js b/Source/DataSources/Entity.js index 1a33d20ed803..1fa41b85e7f3 100644 --- a/Source/DataSources/Entity.js +++ b/Source/DataSources/Entity.js @@ -4,7 +4,6 @@ import Check from '../Core/Check.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import CesiumMath from '../Core/Math.js'; @@ -183,7 +182,7 @@ import WallGraphics from './WallGraphics.js'; entity._definitionChanged.raiseEvent(entity, 'isShowing', isShowing, !isShowing); } - defineProperties(Entity.prototype, { + Object.defineProperties(Entity.prototype, { /** * The availability, if any, associated with this object. * If availability is undefined, it is assumed that this object's diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js index 724793cbf621..8967584b6dc8 100644 --- a/Source/DataSources/EntityCluster.js +++ b/Source/DataSources/EntityCluster.js @@ -3,7 +3,6 @@ import Cartesian2 from '../Core/Cartesian2.js'; import Cartesian3 from '../Core/Cartesian3.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import EllipsoidalOccluder from '../Core/EllipsoidalOccluder.js'; import Event from '../Core/Event.js'; import Matrix4 from '../Core/Matrix4.js'; @@ -400,7 +399,7 @@ import kdbush from '../ThirdParty/kdbush.js'; this._removeEventListener = scene.camera.changed.addEventListener(cluster); }; - defineProperties(EntityCluster.prototype, { + Object.defineProperties(EntityCluster.prototype, { /** * Gets or sets whether clustering is enabled. * @memberof EntityCluster.prototype diff --git a/Source/DataSources/EntityCollection.js b/Source/DataSources/EntityCollection.js index 912ffb2143e8..49361318d9f8 100644 --- a/Source/DataSources/EntityCollection.js +++ b/Source/DataSources/EntityCollection.js @@ -1,7 +1,6 @@ import AssociativeArray from '../Core/AssociativeArray.js'; import createGuid from '../Core/createGuid.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import Iso8601 from '../Core/Iso8601.js'; @@ -106,7 +105,7 @@ import Entity from './Entity.js'; */ EntityCollection.collectionChangedEventCallback = undefined; - defineProperties(EntityCollection.prototype, { + Object.defineProperties(EntityCollection.prototype, { /** * Gets the event that is fired when entities are added or removed from the collection. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}. diff --git a/Source/DataSources/EntityView.js b/Source/DataSources/EntityView.js index 01cb2b41c092..dd897f3c1af2 100644 --- a/Source/DataSources/EntityView.js +++ b/Source/DataSources/EntityView.js @@ -2,7 +2,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Ellipsoid from '../Core/Ellipsoid.js'; import HeadingPitchRange from '../Core/HeadingPitchRange.js'; import JulianDate from '../Core/JulianDate.js'; @@ -229,7 +228,7 @@ import SceneMode from '../Scene/SceneMode.js'; } // STATIC properties defined here, not per-instance. - defineProperties(EntityView, { + Object.defineProperties(EntityView, { /** * Gets or sets a camera offset that will be used to * initialize subsequent EntityViews. diff --git a/Source/DataSources/GeoJsonDataSource.js b/Source/DataSources/GeoJsonDataSource.js index 22d3804a342e..e2a51fae6150 100644 --- a/Source/DataSources/GeoJsonDataSource.js +++ b/Source/DataSources/GeoJsonDataSource.js @@ -5,7 +5,6 @@ import createGuid from '../Core/createGuid.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import getFilenameFromUri from '../Core/getFilenameFromUri.js'; @@ -506,7 +505,7 @@ import PolylineGraphics from './PolylineGraphics.js'; return new GeoJsonDataSource().load(data, options); }; - defineProperties(GeoJsonDataSource, { + Object.defineProperties(GeoJsonDataSource, { /** * Gets or sets the default size of the map pin created for each point, in pixels. * @memberof GeoJsonDataSource @@ -651,7 +650,7 @@ import PolylineGraphics from './PolylineGraphics.js'; } }); - defineProperties(GeoJsonDataSource.prototype, { + Object.defineProperties(GeoJsonDataSource.prototype, { /** * Gets or sets a human-readable name for this instance. * @memberof GeoJsonDataSource.prototype diff --git a/Source/DataSources/GeometryUpdater.js b/Source/DataSources/GeometryUpdater.js index 89c71ba9652a..d1d7d165fa81 100644 --- a/Source/DataSources/GeometryUpdater.js +++ b/Source/DataSources/GeometryUpdater.js @@ -2,7 +2,6 @@ import Check from '../Core/Check.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; @@ -72,7 +71,7 @@ import Property from './Property.js'; this._supportsMaterialsforEntitiesOnTerrain = Entity.supportsMaterialsforEntitiesOnTerrain(options.scene); } - defineProperties(GeometryUpdater.prototype, { + Object.defineProperties(GeometryUpdater.prototype, { /** * Gets the unique ID associated with this updater * @memberof GeometryUpdater.prototype diff --git a/Source/DataSources/GeometryVisualizer.js b/Source/DataSources/GeometryVisualizer.js index 1d13d09fb4fd..d6e744a61cd3 100644 --- a/Source/DataSources/GeometryVisualizer.js +++ b/Source/DataSources/GeometryVisualizer.js @@ -141,7 +141,7 @@ import WallGeometryUpdater from './WallGeometryUpdater.js'; if (supportsMaterialsforEntitiesOnTerrain) { for (i = 0; i < numberOfClassificationTypes; ++i) { groundMaterialBatches.push(new StaticGroundGeometryPerMaterialBatch(groundPrimitives, i, MaterialAppearance)); - groundColorBatches[i] = new StaticGroundGeometryPerMaterialBatch(groundPrimitives, i, PerInstanceColorAppearance); + groundColorBatches[i] = new StaticGroundGeometryColorBatch(groundPrimitives, i); } } else { for (i = 0; i < numberOfClassificationTypes; ++i) { diff --git a/Source/DataSources/GridMaterialProperty.js b/Source/DataSources/GridMaterialProperty.js index 010e1d963de2..da154b012d72 100644 --- a/Source/DataSources/GridMaterialProperty.js +++ b/Source/DataSources/GridMaterialProperty.js @@ -2,7 +2,6 @@ import Cartesian2 from '../Core/Cartesian2.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -48,7 +47,7 @@ import Property from './Property.js'; this.lineOffset = options.lineOffset; } - defineProperties(GridMaterialProperty.prototype, { + Object.defineProperties(GridMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/GroundGeometryUpdater.js b/Source/DataSources/GroundGeometryUpdater.js index bf3eac291769..40e422da30e3 100644 --- a/Source/DataSources/GroundGeometryUpdater.js +++ b/Source/DataSources/GroundGeometryUpdater.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import GeometryOffsetAttribute from '../Core/GeometryOffsetAttribute.js'; import oneTimeWarning from '../Core/oneTimeWarning.js'; @@ -37,7 +36,7 @@ import TerrainOffsetProperty from './TerrainOffsetProperty.js'; GroundGeometryUpdater.prototype.constructor = GroundGeometryUpdater; } - defineProperties(GroundGeometryUpdater.prototype, { + Object.defineProperties(GroundGeometryUpdater.prototype, { /** * Gets the zindex * @type {Number} diff --git a/Source/DataSources/ImageMaterialProperty.js b/Source/DataSources/ImageMaterialProperty.js index e88131490ef4..71b950cc4512 100644 --- a/Source/DataSources/ImageMaterialProperty.js +++ b/Source/DataSources/ImageMaterialProperty.js @@ -2,7 +2,6 @@ import Cartesian2 from '../Core/Cartesian2.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -41,7 +40,7 @@ import Property from './Property.js'; this.transparent = options.transparent; } - defineProperties(ImageMaterialProperty.prototype, { + Object.defineProperties(ImageMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index a1a8bd2764cb..105a8122d070 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -12,7 +12,6 @@ import createGuid from '../Core/createGuid.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Ellipsoid from '../Core/Ellipsoid.js'; import Event from '../Core/Event.js'; @@ -191,7 +190,7 @@ import WallGraphics from './WallGraphics.js'; this._timeThreshold = 1000; // Initial load is 1 second } - defineProperties(DeferredLoading.prototype, { + Object.defineProperties(DeferredLoading.prototype, { dataSource : { get : function() { return this._dataSource; @@ -1353,6 +1352,9 @@ import WallGraphics from './WallGraphics.js'; if (defined(zIndex)) { oneTimeWarning('kml-gx:drawOrder', 'KML - gx:drawOrder is not supported in LineStrings when clampToGround is false'); } + if (dataSource._clampToGround && !tessellate) { + oneTimeWarning('kml-line-tesselate', 'Ignoring clampToGround for KML lines without the tessellate flag.'); + } polyline = defined(polyline) ? polyline.clone() : new PolylineGraphics(); entity.polyline = polyline; @@ -2533,7 +2535,7 @@ import WallGraphics from './WallGraphics.js'; *

* KML support in Cesium is incomplete, but a large amount of the standard, * as well as Google's gx extension namespace, is supported. See Github issue - * {@link https://github.com/AnalyticalGraphicsInc/cesium/issues/873|#873} for a + * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a * detailed list of what is and isn't support. Cesium will also write information to the * console when it encounters most unsupported features. *

@@ -2636,7 +2638,7 @@ import WallGraphics from './WallGraphics.js'; return dataSource.load(data, options); }; - defineProperties(KmlDataSource.prototype, { + Object.defineProperties(KmlDataSource.prototype, { /** * Gets or sets a human-readable name for this instance. * This will be automatically be set to the KML document name on load. diff --git a/Source/DataSources/LabelGraphics.js b/Source/DataSources/LabelGraphics.js index 1bede90930e1..ca3cbfbfe72b 100644 --- a/Source/DataSources/LabelGraphics.js +++ b/Source/DataSources/LabelGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; @@ -90,7 +89,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(LabelGraphics.prototype, { + Object.defineProperties(LabelGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof LabelGraphics.prototype diff --git a/Source/DataSources/MaterialProperty.js b/Source/DataSources/MaterialProperty.js index edcf3cbe4c5e..87156d440fc6 100644 --- a/Source/DataSources/MaterialProperty.js +++ b/Source/DataSources/MaterialProperty.js @@ -1,6 +1,5 @@ import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Material from '../Scene/Material.js'; @@ -24,7 +23,7 @@ import Material from '../Scene/Material.js'; DeveloperError.throwInstantiationError(); } - defineProperties(MaterialProperty.prototype, { + Object.defineProperties(MaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/ModelGraphics.js b/Source/DataSources/ModelGraphics.js index fe21f7e5421f..b745160ebcc8 100644 --- a/Source/DataSources/ModelGraphics.js +++ b/Source/DataSources/ModelGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; @@ -104,7 +103,7 @@ import PropertyBag from './PropertyBag.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(ModelGraphics.prototype, { + Object.defineProperties(ModelGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof ModelGraphics.prototype diff --git a/Source/DataSources/NodeTransformationProperty.js b/Source/DataSources/NodeTransformationProperty.js index 9e323ba2ed2f..46bb52bfac78 100644 --- a/Source/DataSources/NodeTransformationProperty.js +++ b/Source/DataSources/NodeTransformationProperty.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import TranslationRotationScale from '../Core/TranslationRotationScale.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; @@ -34,7 +33,7 @@ import Property from './Property.js'; this.scale = options.scale; }; - defineProperties(NodeTransformationProperty.prototype, { + Object.defineProperties(NodeTransformationProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/PathGraphics.js b/Source/DataSources/PathGraphics.js index 8bd012e37f71..a695909c6da6 100644 --- a/Source/DataSources/PathGraphics.js +++ b/Source/DataSources/PathGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -41,7 +40,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(PathGraphics.prototype, { + Object.defineProperties(PathGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof PathGraphics.prototype diff --git a/Source/DataSources/PlaneGraphics.js b/Source/DataSources/PlaneGraphics.js index 800928856636..33210caf2faa 100644 --- a/Source/DataSources/PlaneGraphics.js +++ b/Source/DataSources/PlaneGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -52,7 +51,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(PlaneGraphics.prototype, { + Object.defineProperties(PlaneGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof PlaneGraphics.prototype diff --git a/Source/DataSources/PointGraphics.js b/Source/DataSources/PointGraphics.js index 0854a93cbc1a..31b37a51ba69 100644 --- a/Source/DataSources/PointGraphics.js +++ b/Source/DataSources/PointGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; @@ -49,7 +48,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(PointGraphics.prototype, { + Object.defineProperties(PointGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof PointGraphics.prototype diff --git a/Source/DataSources/PolygonGeometryUpdater.js b/Source/DataSources/PolygonGeometryUpdater.js index 9cc9c5b52336..a8f46b6b9f40 100644 --- a/Source/DataSources/PolygonGeometryUpdater.js +++ b/Source/DataSources/PolygonGeometryUpdater.js @@ -240,7 +240,7 @@ import Property from './Property.js'; !Property.isConstant(polygon.closeBottom) || // !Property.isConstant(polygon.zIndex) || // !Property.isConstant(polygon.arcType) || // - (this._onTerrain && !Property.isConstant(this._materialProperty)); + (this._onTerrain && !Property.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty)); }; PolygonGeometryUpdater.prototype._setStaticOptions = function(entity, polygon) { diff --git a/Source/DataSources/PolygonGraphics.js b/Source/DataSources/PolygonGraphics.js index 288c89785213..7d8a8059f862 100644 --- a/Source/DataSources/PolygonGraphics.js +++ b/Source/DataSources/PolygonGraphics.js @@ -1,16 +1,14 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; -import isArray from '../Core/isArray.js'; import PolygonHierarchy from '../Core/PolygonHierarchy.js'; import ConstantProperty from './ConstantProperty.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; function createPolygonHierarchyProperty(value) { - if (isArray(value)) { + if (Array.isArray(value)) { // convert array of positions to PolygonHierarchy object value = new PolygonHierarchy(value); } @@ -99,7 +97,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(PolygonGraphics.prototype, { + Object.defineProperties(PolygonGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof PolygonGraphics.prototype diff --git a/Source/DataSources/PolylineArrowMaterialProperty.js b/Source/DataSources/PolylineArrowMaterialProperty.js index 3660ea923f9a..aeed9f995d20 100644 --- a/Source/DataSources/PolylineArrowMaterialProperty.js +++ b/Source/DataSources/PolylineArrowMaterialProperty.js @@ -1,6 +1,5 @@ import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -21,7 +20,7 @@ import Property from './Property.js'; this.color = color; } - defineProperties(PolylineArrowMaterialProperty.prototype, { + Object.defineProperties(PolylineArrowMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/PolylineDashMaterialProperty.js b/Source/DataSources/PolylineDashMaterialProperty.js index f57b16468214..c61fc3a152fc 100644 --- a/Source/DataSources/PolylineDashMaterialProperty.js +++ b/Source/DataSources/PolylineDashMaterialProperty.js @@ -1,7 +1,6 @@ import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -41,7 +40,7 @@ import Property from './Property.js'; this.dashPattern = options.dashPattern; } - defineProperties(PolylineDashMaterialProperty.prototype, { + Object.defineProperties(PolylineDashMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/PolylineGeometryUpdater.js b/Source/DataSources/PolylineGeometryUpdater.js index dca996953e43..7ae7fa0bacd6 100644 --- a/Source/DataSources/PolylineGeometryUpdater.js +++ b/Source/DataSources/PolylineGeometryUpdater.js @@ -5,7 +5,6 @@ import Color from '../Core/Color.js'; import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribute.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; @@ -100,7 +99,7 @@ import Property from './Property.js'; this._onEntityPropertyChanged(entity, 'polyline', entity.polyline, undefined); } - defineProperties(PolylineGeometryUpdater.prototype, { + Object.defineProperties(PolylineGeometryUpdater.prototype, { /** * Gets the unique ID associated with this updater * @memberof PolylineGeometryUpdater.prototype diff --git a/Source/DataSources/PolylineGlowMaterialProperty.js b/Source/DataSources/PolylineGlowMaterialProperty.js index a9a468a9926b..8543c01a5e3a 100644 --- a/Source/DataSources/PolylineGlowMaterialProperty.js +++ b/Source/DataSources/PolylineGlowMaterialProperty.js @@ -1,7 +1,6 @@ import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -36,7 +35,7 @@ import Property from './Property.js'; this.taperPower = options.taperPower; } - defineProperties(PolylineGlowMaterialProperty.prototype, { + Object.defineProperties(PolylineGlowMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/PolylineGraphics.js b/Source/DataSources/PolylineGraphics.js index 744d7941fb7c..d6ed7d5a03a9 100644 --- a/Source/DataSources/PolylineGraphics.js +++ b/Source/DataSources/PolylineGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -61,7 +60,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(PolylineGraphics.prototype, { + Object.defineProperties(PolylineGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof PolylineGraphics.prototype diff --git a/Source/DataSources/PolylineOutlineMaterialProperty.js b/Source/DataSources/PolylineOutlineMaterialProperty.js index 7e7966c047fe..051799f66c8d 100644 --- a/Source/DataSources/PolylineOutlineMaterialProperty.js +++ b/Source/DataSources/PolylineOutlineMaterialProperty.js @@ -1,7 +1,6 @@ import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -36,7 +35,7 @@ import Property from './Property.js'; this.outlineWidth = options.outlineWidth; } - defineProperties(PolylineOutlineMaterialProperty.prototype, { + Object.defineProperties(PolylineOutlineMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/PolylineVolumeGraphics.js b/Source/DataSources/PolylineVolumeGraphics.js index 1fe8588a000c..64110c3cfa2d 100644 --- a/Source/DataSources/PolylineVolumeGraphics.js +++ b/Source/DataSources/PolylineVolumeGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -60,7 +59,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(PolylineVolumeGraphics.prototype, { + Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof PolylineVolumeGraphics.prototype diff --git a/Source/DataSources/PositionProperty.js b/Source/DataSources/PositionProperty.js index 5c41d2471aeb..3c59411bdd5f 100644 --- a/Source/DataSources/PositionProperty.js +++ b/Source/DataSources/PositionProperty.js @@ -1,6 +1,5 @@ import Cartesian3 from '../Core/Cartesian3.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Matrix3 from '../Core/Matrix3.js'; import ReferenceFrame from '../Core/ReferenceFrame.js'; @@ -24,7 +23,7 @@ import Transforms from '../Core/Transforms.js'; DeveloperError.throwInstantiationError(); } - defineProperties(PositionProperty.prototype, { + Object.defineProperties(PositionProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/PositionPropertyArray.js b/Source/DataSources/PositionPropertyArray.js index 0cd3a9a79aa8..392338944fba 100644 --- a/Source/DataSources/PositionPropertyArray.js +++ b/Source/DataSources/PositionPropertyArray.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import EventHelper from '../Core/EventHelper.js'; @@ -25,7 +24,7 @@ import Property from './Property.js'; this.setValue(value); } - defineProperties(PositionPropertyArray.prototype, { + Object.defineProperties(PositionPropertyArray.prototype, { /** * Gets a value indicating if this property is constant. This property * is considered constant if all property items in the array are constant. diff --git a/Source/DataSources/Property.js b/Source/DataSources/Property.js index b1ac1560cd8f..3fdeb39a07c4 100644 --- a/Source/DataSources/Property.js +++ b/Source/DataSources/Property.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; /** @@ -23,7 +22,7 @@ import DeveloperError from '../Core/DeveloperError.js'; DeveloperError.throwInstantiationError(); } - defineProperties(Property.prototype, { + Object.defineProperties(Property.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/PropertyArray.js b/Source/DataSources/PropertyArray.js index 00450997b359..4ef59e7609c3 100644 --- a/Source/DataSources/PropertyArray.js +++ b/Source/DataSources/PropertyArray.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import EventHelper from '../Core/EventHelper.js'; @@ -21,7 +20,7 @@ import Property from './Property.js'; this.setValue(value); } - defineProperties(PropertyArray.prototype, { + Object.defineProperties(PropertyArray.prototype, { /** * Gets a value indicating if this property is constant. This property * is considered constant if all property items in the array are constant. diff --git a/Source/DataSources/PropertyBag.js b/Source/DataSources/PropertyBag.js index dc56607d2eb0..e4e9a32b294a 100644 --- a/Source/DataSources/PropertyBag.js +++ b/Source/DataSources/PropertyBag.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import ConstantProperty from './ConstantProperty.js'; @@ -25,7 +24,7 @@ import Property from './Property.js'; } }; - defineProperties(PropertyBag.prototype, { + Object.defineProperties(PropertyBag.prototype, { /** * Gets the names of all properties registered on this instance. * @memberof PropertyBag.prototype diff --git a/Source/DataSources/RectangleGeometryUpdater.js b/Source/DataSources/RectangleGeometryUpdater.js index 3eec4c912e39..568df2363e72 100644 --- a/Source/DataSources/RectangleGeometryUpdater.js +++ b/Source/DataSources/RectangleGeometryUpdater.js @@ -179,7 +179,7 @@ import Property from './Property.js'; !Property.isConstant(rectangle.rotation) || // !Property.isConstant(rectangle.outlineWidth) || // !Property.isConstant(rectangle.zIndex) || // - (this._onTerrain && !Property.isConstant(this._materialProperty)); + (this._onTerrain && !Property.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty)); }; RectangleGeometryUpdater.prototype._setStaticOptions = function(entity, rectangle) { diff --git a/Source/DataSources/RectangleGraphics.js b/Source/DataSources/RectangleGraphics.js index 26658e410c25..fda122dc4c57 100644 --- a/Source/DataSources/RectangleGraphics.js +++ b/Source/DataSources/RectangleGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -79,7 +78,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(RectangleGraphics.prototype, { + Object.defineProperties(RectangleGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof RectangleGraphics.prototype diff --git a/Source/DataSources/ReferenceProperty.js b/Source/DataSources/ReferenceProperty.js index adf626c6f6a4..403d813e6279 100644 --- a/Source/DataSources/ReferenceProperty.js +++ b/Source/DataSources/ReferenceProperty.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import Property from './Property.js'; @@ -109,7 +108,7 @@ import Property from './Property.js'; targetCollection.collectionChanged.addEventListener(ReferenceProperty.prototype._onCollectionChanged, this); } - defineProperties(ReferenceProperty.prototype, { + Object.defineProperties(ReferenceProperty.prototype, { /** * Gets a value indicating if this property is constant. * @memberof ReferenceProperty.prototype diff --git a/Source/DataSources/SampledPositionProperty.js b/Source/DataSources/SampledPositionProperty.js index 12947c208b7c..e45d183b37e3 100644 --- a/Source/DataSources/SampledPositionProperty.js +++ b/Source/DataSources/SampledPositionProperty.js @@ -2,7 +2,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import ReferenceFrame from '../Core/ReferenceFrame.js'; @@ -40,7 +39,7 @@ import SampledProperty from './SampledProperty.js'; }, this); } - defineProperties(SampledPositionProperty.prototype, { + Object.defineProperties(SampledPositionProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/SampledProperty.js b/Source/DataSources/SampledProperty.js index de5b2f47be51..e48d906617e6 100644 --- a/Source/DataSources/SampledProperty.js +++ b/Source/DataSources/SampledProperty.js @@ -2,7 +2,6 @@ import binarySearch from '../Core/binarySearch.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import ExtrapolationType from '../Core/ExtrapolationType.js'; @@ -206,7 +205,7 @@ import LinearApproximation from '../Core/LinearApproximation.js'; this._backwardExtrapolationDuration = 0; } - defineProperties(SampledProperty.prototype, { + Object.defineProperties(SampledProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/ScaledPositionProperty.js b/Source/DataSources/ScaledPositionProperty.js index 32713c74b687..7fe2c3973532 100644 --- a/Source/DataSources/ScaledPositionProperty.js +++ b/Source/DataSources/ScaledPositionProperty.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Ellipsoid from '../Core/Ellipsoid.js'; import Event from '../Core/Event.js'; @@ -18,7 +17,7 @@ import Property from './Property.js'; this.setValue(value); } - defineProperties(ScaledPositionProperty.prototype, { + Object.defineProperties(ScaledPositionProperty.prototype, { isConstant : { get : function() { return Property.isConstant(this._value); diff --git a/Source/DataSources/StaticGroundGeometryColorBatch.js b/Source/DataSources/StaticGroundGeometryColorBatch.js index 79859d83b861..df51704a3a67 100644 --- a/Source/DataSources/StaticGroundGeometryColorBatch.js +++ b/Source/DataSources/StaticGroundGeometryColorBatch.js @@ -1,5 +1,6 @@ import AssociativeArray from '../Core/AssociativeArray.js'; import Color from '../Core/Color.js'; +import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribute.js'; import defined from '../Core/defined.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js'; @@ -7,17 +8,17 @@ import ShowGeometryInstanceAttribute from '../Core/ShowGeometryInstanceAttribute import GroundPrimitive from '../Scene/GroundPrimitive.js'; import BoundingSphereState from './BoundingSphereState.js'; import Property from './Property.js'; +import RectangleCollisionChecker from '../Core/RectangleCollisionChecker.js'; var colorScratch = new Color(); var distanceDisplayConditionScratch = new DistanceDisplayCondition(); var defaultDistanceDisplayCondition = new DistanceDisplayCondition(); - function Batch(primitives, classificationType, color, key, zIndex) { + function Batch(primitives, classificationType, color, zIndex) { this.primitives = primitives; this.zIndex = zIndex; this.classificationType = classificationType; this.color = color; - this.key = key; this.createPrimitive = false; this.waitingOnCreate = false; this.primitive = undefined; @@ -30,13 +31,19 @@ import Property from './Property.js'; this.showsUpdated = new AssociativeArray(); this.itemsToRemove = []; this.isDirty = false; + this.rectangleCollisionCheck = new RectangleCollisionChecker(); } + Batch.prototype.overlapping = function(rectangle) { + return this.rectangleCollisionCheck.collides(rectangle); + }; + Batch.prototype.add = function(updater, instance) { var id = updater.id; this.createPrimitive = true; this.geometry.set(id, instance); this.updaters.set(id, updater); + this.rectangleCollisionCheck.insert(id, instance.geometry.rectangle); if (!updater.hasConstantFill || !updater.fillMaterialProperty.isConstant || !Property.isConstant(updater.distanceDisplayConditionProperty)) { this.updatersWithAttributes.set(id, updater); } else { @@ -51,8 +58,10 @@ import Property from './Property.js'; Batch.prototype.remove = function(updater) { var id = updater.id; + var geometryInstance = this.geometry.get(id); this.createPrimitive = this.geometry.remove(id) || this.createPrimitive; if (this.updaters.remove(id)) { + this.rectangleCollisionCheck.remove(id, geometryInstance.geometry.rectangle); this.updatersWithAttributes.remove(id); var unsubscribe = this.subscriptions.get(id); if (defined(unsubscribe)) { @@ -65,8 +74,6 @@ import Property from './Property.js'; return false; }; - var scratchArray = new Array(4); - Batch.prototype.update = function(time) { var isUpdated = true; var removedCount = 0; @@ -135,12 +142,7 @@ import Property from './Property.js'; if (!Color.equals(attributes._lastColor, fillColor)) { attributes._lastColor = Color.clone(fillColor, attributes._lastColor); - var color = this.color; - var newColor = fillColor.toBytes(scratchArray); - if (color[0] !== newColor[0] || color[1] !== newColor[1] || - color[2] !== newColor[2] || color[3] !== newColor[3]) { - this.itemsToRemove[removedCount++] = updater; - } + attributes.color = ColorGeometryInstanceAttribute.toValue(fillColor, attributes.color); } } @@ -233,7 +235,7 @@ import Property from './Property.js'; * @private */ function StaticGroundGeometryColorBatch(primitives, classificationType) { - this._batches = new AssociativeArray(); + this._batches = []; this._primitives = primitives; this._classificationType = classificationType; } @@ -241,25 +243,31 @@ import Property from './Property.js'; StaticGroundGeometryColorBatch.prototype.add = function(time, updater) { var instance = updater.createFillGeometryInstance(time); var batches = this._batches; - // color and zIndex are batch breakers, so we'll use that for the key var zIndex = Property.getValueOrDefault(updater.zIndex, 0); - var batchKey = new Uint32Array(instance.attributes.color.value.buffer)[0] + ':' + zIndex; var batch; - if (batches.contains(batchKey)) { - batch = batches.get(batchKey); - } else { - batch = new Batch(this._primitives, this._classificationType, instance.attributes.color.value, batchKey, zIndex); - batches.set(batchKey, batch); + var length = batches.length; + for (var i = 0; i < length; ++i) { + var item = batches[i]; + if (item.zIndex === zIndex && + !item.overlapping(instance.geometry.rectangle)) { + batch = item; + break; + } + } + + if (!defined(batch)) { + batch = new Batch(this._primitives, this._classificationType, instance.attributes.color.value, zIndex); + batches.push(batch); } batch.add(updater, instance); return batch; }; StaticGroundGeometryColorBatch.prototype.remove = function(updater) { - var batchesArray = this._batches.values; - var count = batchesArray.length; + var batches = this._batches; + var count = batches.length; for (var i = 0; i < count; ++i) { - if (batchesArray[i].remove(updater)) { + if (batches[i].remove(updater)) { return; } } @@ -272,15 +280,14 @@ import Property from './Property.js'; //Perform initial update var isUpdated = true; var batches = this._batches; - var batchesArray = batches.values; - var batchCount = batchesArray.length; + var batchCount = batches.length; for (i = 0; i < batchCount; ++i) { - isUpdated = batchesArray[i].update(time) && isUpdated; + isUpdated = batches[i].update(time) && isUpdated; } //If any items swapped between batches we need to move them for (i = 0; i < batchCount; ++i) { - var oldBatch = batchesArray[i]; + var oldBatch = batches[i]; var itemsToRemove = oldBatch.itemsToRemove; var itemsToMoveLength = itemsToRemove.length; for (var j = 0; j < itemsToMoveLength; j++) { @@ -293,16 +300,14 @@ import Property from './Property.js'; } //If we moved anything around, we need to re-build the primitive and remove empty batches - var batchesArrayCopy = batchesArray.slice(); - var batchesCopyCount = batchesArrayCopy.length; - for (i = 0; i < batchesCopyCount; ++i) { - var batch = batchesArrayCopy[i]; + for (i = batchCount - 1; i >= 0; --i) { + var batch = batches[i]; if (batch.isDirty) { - isUpdated = batchesArrayCopy[i].update(time) && isUpdated; + isUpdated = batches[i].update(time) && isUpdated; batch.isDirty = false; } if (batch.geometry.length === 0) { - batches.remove(batch.key); + batches.splice(i, 1); } } @@ -310,10 +315,10 @@ import Property from './Property.js'; }; StaticGroundGeometryColorBatch.prototype.getBoundingSphere = function(updater, result) { - var batchesArray = this._batches.values; - var batchCount = batchesArray.length; + var batches = this._batches; + var batchCount = batches.length; for (var i = 0; i < batchCount; ++i) { - var batch = batchesArray[i]; + var batch = batches[i]; if (batch.contains(updater)) { return batch.getBoundingSphere(updater, result); } @@ -323,10 +328,10 @@ import Property from './Property.js'; }; StaticGroundGeometryColorBatch.prototype.removeAllPrimitives = function() { - var batchesArray = this._batches.values; - var batchCount = batchesArray.length; + var batches = this._batches; + var batchCount = batches.length; for (var i = 0; i < batchCount; ++i) { - batchesArray[i].removeAllPrimitives(); + batches[i].removeAllPrimitives(); } }; export default StaticGroundGeometryColorBatch; diff --git a/Source/DataSources/StripeMaterialProperty.js b/Source/DataSources/StripeMaterialProperty.js index d0c2fbb0f064..1629b2cc8765 100644 --- a/Source/DataSources/StripeMaterialProperty.js +++ b/Source/DataSources/StripeMaterialProperty.js @@ -1,7 +1,6 @@ import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import createPropertyDescriptor from './createPropertyDescriptor.js'; import Property from './Property.js'; @@ -47,7 +46,7 @@ import StripeOrientation from './StripeOrientation.js'; this.repeat = options.repeat; } - defineProperties(StripeMaterialProperty.prototype, { + Object.defineProperties(StripeMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/StripeOrientation.js b/Source/DataSources/StripeOrientation.js index d44bc550d585..89e6854bf5c3 100644 --- a/Source/DataSources/StripeOrientation.js +++ b/Source/DataSources/StripeOrientation.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Defined the orientation of stripes in {@link StripeMaterialProperty}. @@ -18,4 +17,4 @@ import freezeObject from '../Core/freezeObject.js'; */ VERTICAL : 1 }; -export default freezeObject(StripeOrientation); +export default Object.freeze(StripeOrientation); diff --git a/Source/DataSources/TerrainOffsetProperty.js b/Source/DataSources/TerrainOffsetProperty.js index adffe275eed3..d4ba058a5e60 100644 --- a/Source/DataSources/TerrainOffsetProperty.js +++ b/Source/DataSources/TerrainOffsetProperty.js @@ -2,7 +2,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Cartographic from '../Core/Cartographic.js'; import Check from '../Core/Check.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import Event from '../Core/Event.js'; import Iso8601 from '../Core/Iso8601.js'; @@ -61,7 +60,7 @@ import Property from './Property.js'; } } - defineProperties(TerrainOffsetProperty.prototype, { + Object.defineProperties(TerrainOffsetProperty.prototype, { /** * Gets a value indicating if this property is constant. * @memberof TerrainOffsetProperty.prototype diff --git a/Source/DataSources/TimeIntervalCollectionPositionProperty.js b/Source/DataSources/TimeIntervalCollectionPositionProperty.js index 0320d8848923..b943ae74deba 100644 --- a/Source/DataSources/TimeIntervalCollectionPositionProperty.js +++ b/Source/DataSources/TimeIntervalCollectionPositionProperty.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import ReferenceFrame from '../Core/ReferenceFrame.js'; @@ -23,7 +22,7 @@ import Property from './Property.js'; this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED); } - defineProperties(TimeIntervalCollectionPositionProperty.prototype, { + Object.defineProperties(TimeIntervalCollectionPositionProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/TimeIntervalCollectionProperty.js b/Source/DataSources/TimeIntervalCollectionProperty.js index 865153f9e6e4..4ebf9bd17705 100644 --- a/Source/DataSources/TimeIntervalCollectionProperty.js +++ b/Source/DataSources/TimeIntervalCollectionProperty.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import TimeIntervalCollection from '../Core/TimeIntervalCollection.js'; @@ -47,7 +46,7 @@ import Property from './Property.js'; this._intervals.changedEvent.addEventListener(TimeIntervalCollectionProperty.prototype._intervalsChanged, this); } - defineProperties(TimeIntervalCollectionProperty.prototype, { + Object.defineProperties(TimeIntervalCollectionProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. diff --git a/Source/DataSources/VelocityOrientationProperty.js b/Source/DataSources/VelocityOrientationProperty.js index ad502d664186..9106b6ffaf82 100644 --- a/Source/DataSources/VelocityOrientationProperty.js +++ b/Source/DataSources/VelocityOrientationProperty.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Ellipsoid from '../Core/Ellipsoid.js'; import Event from '../Core/Event.js'; import Matrix3 from '../Core/Matrix3.js'; @@ -43,7 +42,7 @@ import VelocityVectorProperty from './VelocityVectorProperty.js'; }); } - defineProperties(VelocityOrientationProperty.prototype, { + Object.defineProperties(VelocityOrientationProperty.prototype, { /** * Gets a value indicating if this property is constant. * @memberof VelocityOrientationProperty.prototype diff --git a/Source/DataSources/VelocityVectorProperty.js b/Source/DataSources/VelocityVectorProperty.js index ec429e0086a2..8415641079cf 100644 --- a/Source/DataSources/VelocityVectorProperty.js +++ b/Source/DataSources/VelocityVectorProperty.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import JulianDate from '../Core/JulianDate.js'; @@ -38,7 +37,7 @@ import Property from './Property.js'; this.position = position; } - defineProperties(VelocityVectorProperty.prototype, { + Object.defineProperties(VelocityVectorProperty.prototype, { /** * Gets a value indicating if this property is constant. * @memberof VelocityVectorProperty.prototype diff --git a/Source/DataSources/WallGraphics.js b/Source/DataSources/WallGraphics.js index 2793e270af4f..a0a374c84ff5 100644 --- a/Source/DataSources/WallGraphics.js +++ b/Source/DataSources/WallGraphics.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js'; @@ -60,7 +59,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js'; this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT)); } - defineProperties(WallGraphics.prototype, { + Object.defineProperties(WallGraphics.prototype, { /** * Gets the event that is raised whenever a property or sub-property is changed or modified. * @memberof WallGraphics.prototype diff --git a/Source/DataSources/exportKml.js b/Source/DataSources/exportKml.js index 6faaa442d785..520797a4e60a 100644 --- a/Source/DataSources/exportKml.js +++ b/Source/DataSources/exportKml.js @@ -5,10 +5,8 @@ import Color from '../Core/Color.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Ellipsoid from '../Core/Ellipsoid.js'; -import isArray from '../Core/isArray.js'; import Iso8601 from '../Core/Iso8601.js'; import JulianDate from '../Core/JulianDate.js'; import CesiumMath from '../Core/Math.js'; @@ -118,7 +116,7 @@ import ScaledPositionProperty from './ScaledPositionProperty.js'; return url; }; - defineProperties(ExternalFileHandler.prototype, { + Object.defineProperties(ExternalFileHandler.prototype, { promise : { get : function() { return when.all(this._promises); @@ -949,7 +947,7 @@ import ScaledPositionProperty from './ScaledPositionProperty.js'; var hierarchy = valueGetter.get(hierarchyProperty); // Polygon hierarchy can sometimes just be an array of positions - var positions = isArray(hierarchy) ? hierarchy : hierarchy.positions; + var positions = Array.isArray(hierarchy) ? hierarchy : hierarchy.positions; // Polygon boundaries var outerBoundaryIs = kmlDoc.createElement('outerBoundaryIs'); @@ -1206,7 +1204,7 @@ import ScaledPositionProperty from './ScaledPositionProperty.js'; } function getCoordinates(coordinates, ellipsoid) { - if (!isArray(coordinates)) { + if (!Array.isArray(coordinates)) { coordinates = [coordinates]; } diff --git a/Source/Renderer/AutomaticUniforms.js b/Source/Renderer/AutomaticUniforms.js index a66f47128f5c..0e2c2c34e51b 100644 --- a/Source/Renderer/AutomaticUniforms.js +++ b/Source/Renderer/AutomaticUniforms.js @@ -1132,51 +1132,47 @@ import WebGLConstants from '../Core/WebGLConstants.js'; }), /** - * The log2 of the current frustums far plane. Used for computing the log depth. + * Gets the far plane's distance from the near plane, plus 1.0. * - * @alias czm_log2FarDistance + * @alias czm_farDepthFromNearPlusOne * @namespace * @glslUniform - * - * @private */ - czm_log2FarDistance : new AutomaticUniform({ - size : 1, + czm_farDepthFromNearPlusOne : new AutomaticUniform({ + size: 1, datatype : WebGLConstants.FLOAT, getValue : function(uniformState) { - return uniformState.log2FarDistance; + return uniformState.farDepthFromNearPlusOne; } }), /** - * An automatic GLSL uniform containing log2 of the far distance + 1.0. - * This is used when reversing log depth computations. + * Gets the log2 of {@link AutomaticUniforms#czm_farDepthFromNearPlusOne}. * - * @alias czm_log2FarPlusOne + * @alias czm_oneOverLog2FarDepthFromNearPlusOne * @namespace * @glslUniform */ - czm_log2FarPlusOne : new AutomaticUniform({ - size : 1, + czm_log2FarDepthFromNearPlusOne : new AutomaticUniform({ + size: 1, datatype : WebGLConstants.FLOAT, getValue : function(uniformState) { - return uniformState.log2FarPlusOne; + return uniformState.log2FarDepthFromNearPlusOne; } }), /** - * An automatic GLSL uniform containing log2 of the near distance. - * This is used when writing log depth in the fragment shader. + * Gets 1.0 divided by {@link AutomaticUniforms#czm_log2FarDepthFromNearPlusOne}. * - * @alias czm_log2NearDistance + * @alias czm_oneOverLog2FarDepthFromNearPlusOne * @namespace * @glslUniform */ - czm_log2NearDistance : new AutomaticUniform({ - size : 1, + czm_oneOverLog2FarDepthFromNearPlusOne : new AutomaticUniform({ + size: 1, datatype : WebGLConstants.FLOAT, getValue : function(uniformState) { - return uniformState.log2NearDistance; + return uniformState.oneOverLog2FarDepthFromNearPlusOne; } }), @@ -1868,6 +1864,34 @@ import WebGLConstants from '../Core/WebGLConstants.js'; getValue : function(uniformState) { return uniformState.gamma; } + }), + + /** + * An automatic GLSL uniform that stores the ellipsoid radii. + * + * @alias czm_ellipsoidRadii + * @glslUniform + */ + czm_ellipsoidRadii : new AutomaticUniform({ + size : 1, + datatype : WebGLConstants.FLOAT_VEC3, + getValue : function(uniformState) { + return uniformState.ellipsoid.radii; + } + }), + + /** + * An automatic GLSL uniform that stores the ellipsoid inverse radii. + * + * @alias czm_ellipsoidRadii + * @glslUniform + */ + czm_ellipsoidInverseRadii : new AutomaticUniform({ + size : 1, + datatype : WebGLConstants.FLOAT_VEC3, + getValue : function(uniformState) { + return uniformState.ellipsoid.oneOverRadii; + } }) }; export default AutomaticUniforms; diff --git a/Source/Renderer/Buffer.js b/Source/Renderer/Buffer.js index 83027786bade..25e575f5e742 100644 --- a/Source/Renderer/Buffer.js +++ b/Source/Renderer/Buffer.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import IndexDatatype from '../Core/IndexDatatype.js'; @@ -190,7 +189,7 @@ import BufferUsage from './BufferUsage.js'; var numberOfIndices = buffer.sizeInBytes / bytesPerIndex; - defineProperties(buffer, { + Object.defineProperties(buffer, { indexDatatype: { get : function() { return indexDatatype; @@ -211,7 +210,7 @@ import BufferUsage from './BufferUsage.js'; return buffer; }; - defineProperties(Buffer.prototype, { + Object.defineProperties(Buffer.prototype, { sizeInBytes : { get : function() { return this._sizeInBytes; diff --git a/Source/Renderer/BufferUsage.js b/Source/Renderer/BufferUsage.js index 09c0f8b8a778..76626be55a0c 100644 --- a/Source/Renderer/BufferUsage.js +++ b/Source/Renderer/BufferUsage.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -15,4 +14,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; (bufferUsage === BufferUsage.DYNAMIC_DRAW)); } }; -export default freezeObject(BufferUsage); +export default Object.freeze(BufferUsage); diff --git a/Source/Renderer/ClearCommand.js b/Source/Renderer/ClearCommand.js index c11e1b63961c..45c19f7d6107 100644 --- a/Source/Renderer/ClearCommand.js +++ b/Source/Renderer/ClearCommand.js @@ -1,6 +1,5 @@ import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; -import freezeObject from '../Core/freezeObject.js'; /** * Represents a command to the renderer for clearing a framebuffer. @@ -88,7 +87,7 @@ import freezeObject from '../Core/freezeObject.js'; * * @constant */ - ClearCommand.ALL = freezeObject(new ClearCommand({ + ClearCommand.ALL = Object.freeze(new ClearCommand({ color : new Color(0.0, 0.0, 0.0, 0.0), depth : 1.0, stencil : 0.0 diff --git a/Source/Renderer/Context.js b/Source/Renderer/Context.js index 1879a09f14ec..baa8566060cf 100644 --- a/Source/Renderer/Context.js +++ b/Source/Renderer/Context.js @@ -5,7 +5,6 @@ import ComponentDatatype from '../Core/ComponentDatatype.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Geometry from '../Core/Geometry.js'; @@ -418,7 +417,7 @@ import VertexArray from './VertexArray.js'; var defaultFramebufferMarker = {}; - defineProperties(Context.prototype, { + Object.defineProperties(Context.prototype, { id : { get : function() { return this._id; @@ -1218,7 +1217,7 @@ import VertexArray from './VertexArray.js'; this.color = color; } - defineProperties(PickId.prototype, { + Object.defineProperties(PickId.prototype, { object : { get : function() { return this._pickObjects[this.key]; diff --git a/Source/Renderer/ContextLimits.js b/Source/Renderer/ContextLimits.js index afa4b53bf726..7217a29c1d91 100644 --- a/Source/Renderer/ContextLimits.js +++ b/Source/Renderer/ContextLimits.js @@ -1,4 +1,3 @@ -import defineProperties from '../Core/defineProperties.js'; /** * @private @@ -27,7 +26,7 @@ import defineProperties from '../Core/defineProperties.js'; _highpIntSupported: false }; - defineProperties(ContextLimits, { + Object.defineProperties(ContextLimits, { /** * The maximum number of texture units that can be used from the vertex and fragment diff --git a/Source/Renderer/CubeMap.js b/Source/Renderer/CubeMap.js index d26f5f705985..71e99eb1ea3d 100644 --- a/Source/Renderer/CubeMap.js +++ b/Source/Renderer/CubeMap.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import CesiumMath from '../Core/Math.js'; @@ -181,7 +180,7 @@ import TextureMinificationFilter from './TextureMinificationFilter.js'; this.sampler = defined(options.sampler) ? options.sampler : new Sampler(); } - defineProperties(CubeMap.prototype, { + Object.defineProperties(CubeMap.prototype, { positiveX : { get : function() { return this._positiveX; diff --git a/Source/Renderer/CubeMapFace.js b/Source/Renderer/CubeMapFace.js index eeac279ce3b2..1625520b05cf 100644 --- a/Source/Renderer/CubeMapFace.js +++ b/Source/Renderer/CubeMapFace.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import PixelFormat from '../Core/PixelFormat.js'; import PixelDatatype from './PixelDatatype.js'; @@ -22,7 +21,7 @@ import PixelDatatype from './PixelDatatype.js'; this._initialized = initialized; } - defineProperties(CubeMapFace.prototype, { + Object.defineProperties(CubeMapFace.prototype, { pixelFormat : { get : function() { return this._pixelFormat; diff --git a/Source/Renderer/DrawCommand.js b/Source/Renderer/DrawCommand.js index aabdf2a34ac4..585967932637 100644 --- a/Source/Renderer/DrawCommand.js +++ b/Source/Renderer/DrawCommand.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import PrimitiveType from '../Core/PrimitiveType.js'; /** @@ -44,7 +43,7 @@ import PrimitiveType from '../Core/PrimitiveType.js'; this.derivedCommands = {}; } - defineProperties(DrawCommand.prototype, { + Object.defineProperties(DrawCommand.prototype, { /** * The bounding volume of the geometry in world space. This is used for culling and frustum selection. *

diff --git a/Source/Renderer/Framebuffer.js b/Source/Renderer/Framebuffer.js index 4c7118b7d247..066d3cdf224b 100644 --- a/Source/Renderer/Framebuffer.js +++ b/Source/Renderer/Framebuffer.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import PixelFormat from '../Core/PixelFormat.js'; @@ -236,7 +235,7 @@ import PixelDatatype from './PixelDatatype.js'; this._unBind(); } - defineProperties(Framebuffer.prototype, { + Object.defineProperties(Framebuffer.prototype, { /** * The status of the framebuffer. If the status is not WebGLConstants.FRAMEBUFFER_COMPLETE, * a {@link DeveloperError} will be thrown when attempting to render to the framebuffer. diff --git a/Source/Renderer/MipmapHint.js b/Source/Renderer/MipmapHint.js index 53c12419a5c6..87e8b2e79c62 100644 --- a/Source/Renderer/MipmapHint.js +++ b/Source/Renderer/MipmapHint.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -15,4 +14,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; (mipmapHint === MipmapHint.NICEST)); } }; -export default freezeObject(MipmapHint); +export default Object.freeze(MipmapHint); diff --git a/Source/Renderer/Pass.js b/Source/Renderer/Pass.js index 2d9a3d0df1b7..c4e7b8e01900 100644 --- a/Source/Renderer/Pass.js +++ b/Source/Renderer/Pass.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * The render pass for a command. @@ -25,4 +24,4 @@ import freezeObject from '../Core/freezeObject.js'; OVERLAY : 9, NUMBER_OF_PASSES : 10 }; -export default freezeObject(Pass); +export default Object.freeze(Pass); diff --git a/Source/Renderer/PixelDatatype.js b/Source/Renderer/PixelDatatype.js index 0f9e2b5bb2e8..f1df40a430a3 100644 --- a/Source/Renderer/PixelDatatype.js +++ b/Source/Renderer/PixelDatatype.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -51,4 +50,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; (pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5)); } }; -export default freezeObject(PixelDatatype); +export default Object.freeze(PixelDatatype); diff --git a/Source/Renderer/RenderState.js b/Source/Renderer/RenderState.js index 8cba2cab37eb..d0221b58b945 100644 --- a/Source/Renderer/RenderState.js +++ b/Source/Renderer/RenderState.js @@ -734,7 +734,7 @@ import freezeRenderState from './freezeRenderState.js'; var scissorTest = (defined(passState.scissorTest)) ? passState.scissorTest : renderState.scissorTest; // Our scissor rectangle can get out of sync with the GL scissor rectangle on clears. - // Seems to be a problem only on ANGLE. See https://github.com/AnalyticalGraphicsInc/cesium/issues/2994 + // Seems to be a problem only on ANGLE. See https://github.com/CesiumGS/cesium/issues/2994 if ((previousScissorTest !== scissorTest) || clear) { applyScissorTest(gl, renderState, passState); } diff --git a/Source/Renderer/Renderbuffer.js b/Source/Renderer/Renderbuffer.js index 616a600216d6..d9ad6e7f8651 100644 --- a/Source/Renderer/Renderbuffer.js +++ b/Source/Renderer/Renderbuffer.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import ContextLimits from './ContextLimits.js'; @@ -54,7 +53,7 @@ import RenderbufferFormat from './RenderbufferFormat.js'; gl.bindRenderbuffer(gl.RENDERBUFFER, null); } - defineProperties(Renderbuffer.prototype, { + Object.defineProperties(Renderbuffer.prototype, { format: { get : function() { return this._format; diff --git a/Source/Renderer/RenderbufferFormat.js b/Source/Renderer/RenderbufferFormat.js index 209cff56e615..e182eff32380 100644 --- a/Source/Renderer/RenderbufferFormat.js +++ b/Source/Renderer/RenderbufferFormat.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -21,4 +20,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; (renderbufferFormat === RenderbufferFormat.DEPTH_STENCIL)); } }; -export default freezeObject(RenderbufferFormat); +export default Object.freeze(RenderbufferFormat); diff --git a/Source/Renderer/Sampler.js b/Source/Renderer/Sampler.js index 7ac700d67576..447c2d3cf603 100644 --- a/Source/Renderer/Sampler.js +++ b/Source/Renderer/Sampler.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import TextureMagnificationFilter from './TextureMagnificationFilter.js'; import TextureMinificationFilter from './TextureMinificationFilter.js'; @@ -46,7 +45,7 @@ import TextureWrap from './TextureWrap.js'; this._maximumAnisotropy = maximumAnisotropy; } - defineProperties(Sampler.prototype, { + Object.defineProperties(Sampler.prototype, { wrapS : { get : function() { return this._wrapS; @@ -84,4 +83,11 @@ import TextureWrap from './TextureWrap.js'; (left._magnificationFilter === right._magnificationFilter) && (left._maximumAnisotropy === right._maximumAnisotropy)); }; + + Sampler.NEAREST = Object.freeze(new Sampler({ + wrapS : TextureWrap.CLAMP_TO_EDGE, + wrapT : TextureWrap.CLAMP_TO_EDGE, + minificationFilter : TextureMinificationFilter.NEAREST, + magnificationFilter : TextureMagnificationFilter.NEAREST + })); export default Sampler; diff --git a/Source/Renderer/ShaderCache.js b/Source/Renderer/ShaderCache.js index ddae1d890af0..940bf8616313 100644 --- a/Source/Renderer/ShaderCache.js +++ b/Source/Renderer/ShaderCache.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import ShaderProgram from './ShaderProgram.js'; import ShaderSource from './ShaderSource.js'; @@ -14,7 +13,7 @@ import ShaderSource from './ShaderSource.js'; this._shadersToRelease = {}; } - defineProperties(ShaderCache.prototype, { + Object.defineProperties(ShaderCache.prototype, { numberOfShaders : { get : function() { return this._numberOfShaders; diff --git a/Source/Renderer/ShaderProgram.js b/Source/Renderer/ShaderProgram.js index c9b92fa0e36b..c4f04d165b2f 100644 --- a/Source/Renderer/ShaderProgram.js +++ b/Source/Renderer/ShaderProgram.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import RuntimeError from '../Core/RuntimeError.js'; @@ -80,7 +79,7 @@ import createUniformArray from './createUniformArray.js'; return options.context.shaderCache.replaceShaderProgram(options); }; - defineProperties(ShaderProgram.prototype, { + Object.defineProperties(ShaderProgram.prototype, { /** * GLSL source for the shader program's vertex shader. * @memberof ShaderProgram.prototype diff --git a/Source/Renderer/Texture.js b/Source/Renderer/Texture.js index 8cb16d776e7f..f4aa7bd5bad2 100644 --- a/Source/Renderer/Texture.js +++ b/Source/Renderer/Texture.js @@ -3,7 +3,6 @@ import Check from '../Core/Check.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import CesiumMath from '../Core/Math.js'; @@ -346,7 +345,7 @@ import TextureMinificationFilter from './TextureMinificationFilter.js'; return texture; }; - defineProperties(Texture.prototype, { + Object.defineProperties(Texture.prototype, { /** * A unique id for the texture * @memberof Texture.prototype diff --git a/Source/Renderer/TextureCache.js b/Source/Renderer/TextureCache.js index 03f1dc36d16e..fbf92085ff35 100644 --- a/Source/Renderer/TextureCache.js +++ b/Source/Renderer/TextureCache.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; /** @@ -11,7 +10,7 @@ import destroyObject from '../Core/destroyObject.js'; this._texturesToRelease = {}; } - defineProperties(TextureCache.prototype, { + Object.defineProperties(TextureCache.prototype, { numberOfTextures : { get : function() { return this._numberOfTextures; diff --git a/Source/Renderer/TextureMagnificationFilter.js b/Source/Renderer/TextureMagnificationFilter.js index abff1542da2b..1bc96a18f562 100644 --- a/Source/Renderer/TextureMagnificationFilter.js +++ b/Source/Renderer/TextureMagnificationFilter.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -37,4 +36,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; (textureMagnificationFilter === TextureMagnificationFilter.LINEAR)); } }; -export default freezeObject(TextureMagnificationFilter); +export default Object.freeze(TextureMagnificationFilter); diff --git a/Source/Renderer/TextureMinificationFilter.js b/Source/Renderer/TextureMinificationFilter.js index f3e81d963157..90db4ee93cf3 100644 --- a/Source/Renderer/TextureMinificationFilter.js +++ b/Source/Renderer/TextureMinificationFilter.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -86,4 +85,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; (textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR)); } }; -export default freezeObject(TextureMinificationFilter); +export default Object.freeze(TextureMinificationFilter); diff --git a/Source/Renderer/TextureWrap.js b/Source/Renderer/TextureWrap.js index d78cf625e868..c5e09ad6a9c9 100644 --- a/Source/Renderer/TextureWrap.js +++ b/Source/Renderer/TextureWrap.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -15,4 +14,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; (textureWrap === TextureWrap.MIRRORED_REPEAT)); } }; -export default freezeObject(TextureWrap); +export default Object.freeze(TextureWrap); diff --git a/Source/Renderer/UniformState.js b/Source/Renderer/UniformState.js index b643eb3ed313..298e123004a7 100644 --- a/Source/Renderer/UniformState.js +++ b/Source/Renderer/UniformState.js @@ -6,7 +6,7 @@ import Cartographic from '../Core/Cartographic.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; +import Ellipsoid from '../Core/Ellipsoid.js'; import EncodedCartesian3 from '../Core/EncodedCartesian3.js'; import CesiumMath from '../Core/Math.js'; import Matrix3 from '../Core/Matrix3.js'; @@ -44,9 +44,9 @@ import SunLight from '../Scene/SunLight.js'; this._entireFrustum = new Cartesian2(); this._currentFrustum = new Cartesian2(); this._frustumPlanes = new Cartesian4(); - this._log2FarDistance = undefined; - this._log2FarPlusOne = undefined; - this._log2NearDistance = undefined; + this._farDepthFromNearPlusOne = undefined; + this._log2FarDepthFromNearPlusOne = undefined; + this._oneOverLog2FarDepthFromNearPlusOne = undefined; this._frameState = undefined; this._temeToPseudoFixed = Matrix3.clone(Matrix4.IDENTITY); @@ -136,6 +136,7 @@ import SunLight from '../Scene/SunLight.js'; this._pass = undefined; this._mode = undefined; this._mapProjection = undefined; + this._ellipsoid = undefined; this._cameraDirection = new Cartesian3(); this._cameraRight = new Cartesian3(); this._cameraUp = new Cartesian3(); @@ -164,7 +165,7 @@ import SunLight from '../Scene/SunLight.js'; this._minimumDisableDepthTestDistance = undefined; } - defineProperties(UniformState.prototype, { + Object.defineProperties(UniformState.prototype, { /** * @memberof UniformState.prototype * @type {FrameState} @@ -638,35 +639,38 @@ import SunLight from '../Scene/SunLight.js'; }, /** - * The log2 of the current frustum's far distance. Used to compute the log depth. + * The far plane's distance from the near plane, plus 1.0. + * * @memberof UniformState.prototype * @type {Number} */ - log2FarDistance : { + farDepthFromNearPlusOne : { get : function() { - return this._log2FarDistance; + return this._farDepthFromNearPlusOne; } }, /** - * The log2 of 1 + the current frustum's far distance. Used to reverse log depth. + * The log2 of {@link UniformState#farDepthFromNearPlusOne}. + * * @memberof UniformState.prototype * @type {Number} */ - log2FarPlusOne : { + log2FarDepthFromNearPlusOne : { get : function() { - return this._log2FarPlusOne; + return this._log2FarDepthFromNearPlusOne; } }, /** - * The log2 current frustum's near distance. Used when writing log depth in the fragment shader. + * 1.0 divided by {@link UniformState#log2FarDepthFromNearPlusOne}. + * * @memberof UniformState.prototype * @type {Number} */ - log2NearDistance : { + oneOverLog2FarDepthFromNearPlusOne : { get : function() { - return this._log2NearDistance; + return this._oneOverLog2FarDepthFromNearPlusOne; } }, @@ -996,6 +1000,18 @@ import SunLight from '../Scene/SunLight.js'; get : function() { return this._orthographicIn3D; } + }, + + /** + * The current ellipsoid. + * + * @memberOf UniformState.prototype + * @type {Ellipsoid} + */ + ellipsoid : { + get : function() { + return defaultValue(this._ellipsoid, Ellipsoid.WGS84); + } } }); @@ -1110,9 +1126,9 @@ import SunLight from '../Scene/SunLight.js'; this._currentFrustum.x = frustum.near; this._currentFrustum.y = frustum.far; - this._log2FarDistance = 2.0 / CesiumMath.log2(frustum.far + 1.0); - this._log2FarPlusOne = CesiumMath.log2(frustum.far + 1.0); - this._log2NearDistance = CesiumMath.log2(frustum.near); + this._farDepthFromNearPlusOne = (frustum.far - frustum.near) + 1.0; + this._log2FarDepthFromNearPlusOne = CesiumMath.log2(this._farDepthFromNearPlusOne); + this._oneOverLog2FarDepthFromNearPlusOne = 1.0 / this._log2FarDepthFromNearPlusOne; if (defined(frustum._offCenterFrustum)) { frustum = frustum._offCenterFrustum; @@ -1141,6 +1157,7 @@ import SunLight from '../Scene/SunLight.js'; UniformState.prototype.update = function(frameState) { this._mode = frameState.mode; this._mapProjection = frameState.mapProjection; + this._ellipsoid = frameState.mapProjection.ellipsoid; this._pixelRatio = frameState.pixelRatio; var camera = frameState.camera; diff --git a/Source/Renderer/VertexArray.js b/Source/Renderer/VertexArray.js index 29520452579e..e03cade7dc80 100644 --- a/Source/Renderer/VertexArray.js +++ b/Source/Renderer/VertexArray.js @@ -2,7 +2,6 @@ import Check from '../Core/Check.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Geometry from '../Core/Geometry.js'; @@ -624,7 +623,7 @@ import ContextLimits from './ContextLimits.js'; }); }; - defineProperties(VertexArray.prototype, { + Object.defineProperties(VertexArray.prototype, { numberOfAttributes : { get : function() { return this._attributes.length; diff --git a/Source/Renderer/freezeRenderState.js b/Source/Renderer/freezeRenderState.js index abd065214b16..71de888fdb3e 100644 --- a/Source/Renderer/freezeRenderState.js +++ b/Source/Renderer/freezeRenderState.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Returns frozen renderState as well as all of the object literal properties. This function is deep object freeze @@ -24,6 +23,6 @@ import freezeObject from '../Core/freezeObject.js'; renderState[propName] = freezeRenderState(renderState[propName]); } } - return freezeObject(renderState); + return Object.freeze(renderState); } export default freezeRenderState; diff --git a/Source/Scene/Appearance.js b/Source/Scene/Appearance.js index 6fcb5b3810bb..19720803a6e6 100644 --- a/Source/Scene/Appearance.js +++ b/Source/Scene/Appearance.js @@ -2,7 +2,6 @@ import clone from '../Core/clone.js'; import combine from '../Core/combine.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import BlendingState from './BlendingState.js'; import CullFace from './CullFace.js'; @@ -41,7 +40,7 @@ import CullFace from './CullFace.js'; * * @type Material * - * @see {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric} + * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} */ this.material = options.material; @@ -60,7 +59,7 @@ import CullFace from './CullFace.js'; this._closed = defaultValue(options.closed, false); } - defineProperties(Appearance.prototype, { + Object.defineProperties(Appearance.prototype, { /** * The GLSL source code for the vertex shader. * diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 1ba31ba133e4..cd619b390b3e 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -4,7 +4,6 @@ import Cartographic from '../Core/Cartographic.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import GeographicProjection from '../Core/GeographicProjection.js'; @@ -263,7 +262,7 @@ import ImageryProvider from './ImageryProvider.js'; return resource; } - defineProperties(ArcGisMapServerImageryProvider.prototype, { + Object.defineProperties(ArcGisMapServerImageryProvider.prototype, { /** * Gets the URL of the ArcGIS MapServer. * @memberof ArcGisMapServerImageryProvider.prototype diff --git a/Source/Scene/AttributeType.js b/Source/Scene/AttributeType.js index 0a6e8abbb696..4680c605285b 100644 --- a/Source/Scene/AttributeType.js +++ b/Source/Scene/AttributeType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * An enum describing the attribute type for glTF and 3D Tiles. @@ -64,4 +63,4 @@ import freezeObject from '../Core/freezeObject.js'; */ MAT4 : 'MAT4' }; -export default freezeObject(AttributeType); +export default Object.freeze(AttributeType); diff --git a/Source/Scene/AutoExposure.js b/Source/Scene/AutoExposure.js index e1796ce3ccb4..1f1432b4ed46 100644 --- a/Source/Scene/AutoExposure.js +++ b/Source/Scene/AutoExposure.js @@ -1,7 +1,6 @@ import Cartesian2 from '../Core/Cartesian2.js'; import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import PixelFormat from '../Core/PixelFormat.js'; import ClearCommand from '../Renderer/ClearCommand.js'; @@ -9,9 +8,6 @@ import Framebuffer from '../Renderer/Framebuffer.js'; import PixelDatatype from '../Renderer/PixelDatatype.js'; import Sampler from '../Renderer/Sampler.js'; import Texture from '../Renderer/Texture.js'; -import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js'; -import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'; -import TextureWrap from '../Renderer/TextureWrap.js'; /** * A post process stage that will get the luminance value at each pixel and @@ -68,7 +64,7 @@ import TextureWrap from '../Renderer/TextureWrap.js'; this.maximumLuminance = 10.0; } - defineProperties(AutoExposure.prototype, { + Object.defineProperties(AutoExposure.prototype, { /** * Determines if this post-process stage is ready to be executed. A stage is only executed when both ready * and {@link AutoExposure#enabled} are true. A stage will not be ready while it is waiting on textures @@ -139,12 +135,6 @@ import TextureWrap from '../Renderer/TextureWrap.js'; var pixelFormat = PixelFormat.RGBA; var pixelDatatype = context.halfFloatingPointTexture ? PixelDatatype.HALF_FLOAT : PixelDatatype.FLOAT; - var sampler = new Sampler({ - wrapS : TextureWrap.CLAMP_TO_EDGE, - wrapT : TextureWrap.CLAMP_TO_EDGE, - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }); var length = Math.ceil(Math.log(Math.max(width, height)) / Math.log(3.0)); var framebuffers = new Array(length); @@ -159,7 +149,7 @@ import TextureWrap from '../Renderer/TextureWrap.js'; height : height, pixelFormat : pixelFormat, pixelDatatype : pixelDatatype, - sampler : sampler + sampler : Sampler.NEAREST })] }); } @@ -173,7 +163,7 @@ import TextureWrap from '../Renderer/TextureWrap.js'; height : lastTexture.height, pixelFormat : pixelFormat, pixelDatatype : pixelDatatype, - sampler : sampler + sampler : Sampler.NEAREST })] }); diff --git a/Source/Scene/Axis.js b/Source/Scene/Axis.js index ad25abe3e7f2..353ab54d5751 100644 --- a/Source/Scene/Axis.js +++ b/Source/Scene/Axis.js @@ -1,5 +1,4 @@ import Check from '../Core/Check.js'; -import freezeObject from '../Core/freezeObject.js'; import CesiumMath from '../Core/Math.js'; import Matrix3 from '../Core/Matrix3.js'; import Matrix4 from '../Core/Matrix4.js'; @@ -97,4 +96,4 @@ import Matrix4 from '../Core/Matrix4.js'; return Axis[name]; } }; -export default freezeObject(Axis); +export default Object.freeze(Axis); diff --git a/Source/Scene/BatchTable.js b/Source/Scene/BatchTable.js index d123cc1c683b..ec61aadf3855 100644 --- a/Source/Scene/BatchTable.js +++ b/Source/Scene/BatchTable.js @@ -4,7 +4,6 @@ import Cartesian4 from '../Core/Cartesian4.js'; import combine from '../Core/combine.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import PixelFormat from '../Core/PixelFormat.js'; @@ -12,8 +11,6 @@ import ContextLimits from '../Renderer/ContextLimits.js'; import PixelDatatype from '../Renderer/PixelDatatype.js'; import Sampler from '../Renderer/Sampler.js'; import Texture from '../Renderer/Texture.js'; -import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js'; -import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'; /** * Creates a texture to look up per instance attributes for batched primitives. For example, store each primitive's pick color in the texture. @@ -119,7 +116,7 @@ import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js' this._batchValuesDirty = false; } - defineProperties(BatchTable.prototype, { + Object.defineProperties(BatchTable.prototype, { /** * The attribute descriptions. * @memberOf BatchTable.prototype @@ -341,10 +338,7 @@ import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js' pixelDatatype : batchTable._pixelDatatype, width : dimensions.x, height : dimensions.y, - sampler : new Sampler({ - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }), + sampler : Sampler.NEAREST, flipY : false }); } diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js index 6b8ed57baf8c..c41239b26d0e 100644 --- a/Source/Scene/Batched3DModel3DTileContent.js +++ b/Source/Scene/Batched3DModel3DTileContent.js @@ -3,7 +3,6 @@ import Color from '../Core/Color.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import deprecationWarning from '../Core/deprecationWarning.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; @@ -22,8 +21,8 @@ import ModelUtility from './ModelUtility.js'; /** * Represents the contents of a - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel|Batched 3D Model} - * tile in a {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles} tileset. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Batched3DModel|Batched 3D Model} + * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles} tileset. *

* Implements the {@link Cesium3DTileContent} interface. *

@@ -56,7 +55,7 @@ import ModelUtility from './ModelUtility.js'; // This can be overridden for testing purposes Batched3DModel3DTileContent._deprecationWarning = deprecationWarning; - defineProperties(Batched3DModel3DTileContent.prototype, { + Object.defineProperties(Batched3DModel3DTileContent.prototype, { featuresLength : { get : function() { return this._batchTable.featuresLength; @@ -242,7 +241,7 @@ import ModelUtility from './ModelUtility.js'; batchTableBinaryByteLength = 0; featureTableJsonByteLength = 0; featureTableBinaryByteLength = 0; - Batched3DModel3DTileContent._deprecationWarning('b3dm-legacy-header', 'This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.'); + Batched3DModel3DTileContent._deprecationWarning('b3dm-legacy-header', 'This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.'); } else if (batchTableBinaryByteLength >= 570425344) { // Second legacy check byteOffset -= sizeOfUint32; @@ -251,7 +250,7 @@ import ModelUtility from './ModelUtility.js'; batchTableBinaryByteLength = featureTableBinaryByteLength; featureTableJsonByteLength = 0; featureTableBinaryByteLength = 0; - Batched3DModel3DTileContent._deprecationWarning('b3dm-legacy-header', 'This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.'); + Batched3DModel3DTileContent._deprecationWarning('b3dm-legacy-header', 'This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.'); } var featureTableJson; diff --git a/Source/Scene/Billboard.js b/Source/Scene/Billboard.js index fa47d2956735..720eb199e478 100644 --- a/Source/Scene/Billboard.js +++ b/Source/Scene/Billboard.js @@ -7,7 +7,6 @@ import Color from '../Core/Color.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; import Matrix4 from '../Core/Matrix4.js'; @@ -206,7 +205,7 @@ import VerticalOrigin from './VerticalOrigin.js'; } } - defineProperties(Billboard.prototype, { + Object.defineProperties(Billboard.prototype, { /** * Determines if this billboard will be shown. Use this to hide or show a billboard, instead * of removing it and re-adding it to the collection. diff --git a/Source/Scene/BillboardCollection.js b/Source/Scene/BillboardCollection.js index 8083dec61d1a..9ce98213dc20 100644 --- a/Source/Scene/BillboardCollection.js +++ b/Source/Scene/BillboardCollection.js @@ -6,7 +6,6 @@ import Color from '../Core/Color.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import EncodedCartesian3 from '../Core/EncodedCartesian3.js'; @@ -316,7 +315,7 @@ import VerticalOrigin from './VerticalOrigin.js'; } } - defineProperties(BillboardCollection.prototype, { + Object.defineProperties(BillboardCollection.prototype, { /** * Returns the number of billboards in this collection. This is commonly used with * {@link BillboardCollection#get} to iterate over all the billboards diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index 95445a84cae9..0e5c7cd78514 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -4,7 +4,6 @@ import Check from '../Core/Check.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import CesiumMath from '../Core/Math.js'; @@ -205,7 +204,7 @@ import ImageryProvider from './ImageryProvider.js'; } } - defineProperties(BingMapsImageryProvider.prototype, { + Object.defineProperties(BingMapsImageryProvider.prototype, { /** * Gets the name of the BingMaps server url hosting the imagery. * @memberof BingMapsImageryProvider.prototype @@ -617,7 +616,7 @@ import ImageryProvider from './ImageryProvider.js'; BingMapsImageryProvider._logoUrl = undefined; - defineProperties(BingMapsImageryProvider, { + Object.defineProperties(BingMapsImageryProvider, { /** * Gets or sets the URL to the Bing logo for display in the credit. * @memberof BingMapsImageryProvider diff --git a/Source/Scene/BingMapsStyle.js b/Source/Scene/BingMapsStyle.js index 8aa3e45891e7..fab2f34d8847 100644 --- a/Source/Scene/BingMapsStyle.js +++ b/Source/Scene/BingMapsStyle.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * The types of imagery provided by Bing Maps. @@ -21,7 +20,7 @@ import freezeObject from '../Core/freezeObject.js'; * * @type {String} * @constant - * @deprecated See https://github.com/AnalyticalGraphicsInc/cesium/issues/7128. + * @deprecated See https://github.com/CesiumGS/cesium/issues/7128. * Use `BingMapsStyle.AERIAL_WITH_LABELS_ON_DEMAND` instead */ AERIAL_WITH_LABELS : 'AerialWithLabels', @@ -39,7 +38,7 @@ import freezeObject from '../Core/freezeObject.js'; * * @type {String} * @constant - * @deprecated See https://github.com/AnalyticalGraphicsInc/cesium/issues/7128. + * @deprecated See https://github.com/CesiumGS/cesium/issues/7128. * Use `BingMapsStyle.ROAD_ON_DEMAND` instead */ ROAD : 'Road', @@ -92,4 +91,4 @@ import freezeObject from '../Core/freezeObject.js'; */ COLLINS_BART : 'CollinsBart' }; -export default freezeObject(BingMapsStyle); +export default Object.freeze(BingMapsStyle); diff --git a/Source/Scene/BlendEquation.js b/Source/Scene/BlendEquation.js index cff57f7efb71..38f7316ff06b 100644 --- a/Source/Scene/BlendEquation.js +++ b/Source/Scene/BlendEquation.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -51,4 +50,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; */ MAX : WebGLConstants.MAX }; -export default freezeObject(BlendEquation); +export default Object.freeze(BlendEquation); diff --git a/Source/Scene/BlendFunction.js b/Source/Scene/BlendFunction.js index 50f817a24f63..be425dd9f01c 100644 --- a/Source/Scene/BlendFunction.js +++ b/Source/Scene/BlendFunction.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -127,4 +126,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; */ SOURCE_ALPHA_SATURATE : WebGLConstants.SRC_ALPHA_SATURATE }; -export default freezeObject(BlendFunction); +export default Object.freeze(BlendFunction); diff --git a/Source/Scene/BlendOption.js b/Source/Scene/BlendOption.js index 74e0f9f0c7fa..13fc9fc8343a 100644 --- a/Source/Scene/BlendOption.js +++ b/Source/Scene/BlendOption.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene. @@ -27,4 +26,4 @@ import freezeObject from '../Core/freezeObject.js'; */ OPAQUE_AND_TRANSLUCENT : 2 }; -export default freezeObject(BlendOption); +export default Object.freeze(BlendOption); diff --git a/Source/Scene/BlendingState.js b/Source/Scene/BlendingState.js index 56d167bd77e0..46551894a695 100644 --- a/Source/Scene/BlendingState.js +++ b/Source/Scene/BlendingState.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import BlendEquation from './BlendEquation.js'; import BlendFunction from './BlendFunction.js'; @@ -19,7 +18,7 @@ import BlendFunction from './BlendFunction.js'; * @type {Object} * @constant */ - DISABLED : freezeObject({ + DISABLED : Object.freeze({ enabled : false }), @@ -29,7 +28,7 @@ import BlendFunction from './BlendFunction.js'; * @type {Object} * @constant */ - ALPHA_BLEND : freezeObject({ + ALPHA_BLEND : Object.freeze({ enabled : true, equationRgb : BlendEquation.ADD, equationAlpha : BlendEquation.ADD, @@ -45,7 +44,7 @@ import BlendFunction from './BlendFunction.js'; * @type {Object} * @constant */ - PRE_MULTIPLIED_ALPHA_BLEND : freezeObject({ + PRE_MULTIPLIED_ALPHA_BLEND : Object.freeze({ enabled : true, equationRgb : BlendEquation.ADD, equationAlpha : BlendEquation.ADD, @@ -61,7 +60,7 @@ import BlendFunction from './BlendFunction.js'; * @type {Object} * @constant */ - ADDITIVE_BLEND : freezeObject({ + ADDITIVE_BLEND : Object.freeze({ enabled : true, equationRgb : BlendEquation.ADD, equationAlpha : BlendEquation.ADD, @@ -71,4 +70,4 @@ import BlendFunction from './BlendFunction.js'; functionDestinationAlpha : BlendFunction.ONE }) }; -export default freezeObject(BlendingState); +export default Object.freeze(BlendingState); diff --git a/Source/Scene/BoxEmitter.js b/Source/Scene/BoxEmitter.js index d10abdd4b5ae..c00991bf494a 100644 --- a/Source/Scene/BoxEmitter.js +++ b/Source/Scene/BoxEmitter.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; -import defineProperties from '../Core/defineProperties.js'; import CesiumMath from '../Core/Math.js'; var defaultDimensions = new Cartesian3(1.0, 1.0, 1.0); @@ -28,7 +27,7 @@ import CesiumMath from '../Core/Math.js'; this._dimensions = Cartesian3.clone(dimensions); } - defineProperties(BoxEmitter.prototype, { + Object.defineProperties(BoxEmitter.prototype, { /** * The width, height and depth dimensions of the box in meters. * @memberof BoxEmitter.prototype diff --git a/Source/Scene/BrdfLutGenerator.js b/Source/Scene/BrdfLutGenerator.js index 0e0c789569ab..1828ed58b102 100644 --- a/Source/Scene/BrdfLutGenerator.js +++ b/Source/Scene/BrdfLutGenerator.js @@ -1,6 +1,5 @@ import BoundingRectangle from '../Core/BoundingRectangle.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import PixelFormat from '../Core/PixelFormat.js'; import Framebuffer from '../Renderer/Framebuffer.js'; @@ -8,9 +7,6 @@ import PixelDatatype from '../Renderer/PixelDatatype.js'; import RenderState from '../Renderer/RenderState.js'; import Sampler from '../Renderer/Sampler.js'; import Texture from '../Renderer/Texture.js'; -import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js'; -import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'; -import TextureWrap from '../Renderer/TextureWrap.js'; import BrdfLutGeneratorFS from '../Shaders/BrdfLutGeneratorFS.js'; /** @@ -22,7 +18,7 @@ import BrdfLutGeneratorFS from '../Shaders/BrdfLutGeneratorFS.js'; this._drawCommand = undefined; } - defineProperties(BrdfLutGenerator.prototype, { + Object.defineProperties(BrdfLutGenerator.prototype, { colorTexture : { get : function() { return this._colorTexture; @@ -50,12 +46,7 @@ import BrdfLutGeneratorFS from '../Shaders/BrdfLutGeneratorFS.js'; height: 256, pixelFormat : PixelFormat.RGBA, pixelDatatype : PixelDatatype.UNSIGNED_BYTE, - sampler : new Sampler({ - wrapS : TextureWrap.CLAMP_TO_EDGE, - wrapT : TextureWrap.CLAMP_TO_EDGE, - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }) + sampler : Sampler.NEAREST }); generator._colorTexture = colorTexture; diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index af5e69bbe713..413c9a7b7e40 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -5,7 +5,6 @@ import Cartesian4 from '../Core/Cartesian4.js'; import Cartographic from '../Core/Cartographic.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import EasingFunction from '../Core/EasingFunction.js'; import Ellipsoid from '../Core/Ellipsoid.js'; @@ -606,7 +605,7 @@ import SceneMode from './SceneMode.js'; var scratchHPRMatrix1 = new Matrix4(); var scratchHPRMatrix2 = new Matrix4(); - defineProperties(Camera.prototype, { + Object.defineProperties(Camera.prototype, { /** * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix. * @memberof Camera.prototype diff --git a/Source/Scene/CameraEventAggregator.js b/Source/Scene/CameraEventAggregator.js index 28bf632a2d4b..33acfed2f32e 100644 --- a/Source/Scene/CameraEventAggregator.js +++ b/Source/Scene/CameraEventAggregator.js @@ -1,6 +1,5 @@ import Cartesian2 from '../Core/Cartesian2.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import KeyboardEventModifier from '../Core/KeyboardEventModifier.js'; @@ -285,7 +284,7 @@ import CameraEventType from './CameraEventType.js'; } } - defineProperties(CameraEventAggregator.prototype, { + Object.defineProperties(CameraEventAggregator.prototype, { /** * Gets the current mouse position. * @memberof CameraEventAggregator.prototype diff --git a/Source/Scene/CameraEventType.js b/Source/Scene/CameraEventType.js index 940cf8de379d..83da142f4be4 100644 --- a/Source/Scene/CameraEventType.js +++ b/Source/Scene/CameraEventType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Enumerates the available input for interacting with the camera. @@ -46,4 +45,4 @@ import freezeObject from '../Core/freezeObject.js'; */ PINCH : 4 }; -export default freezeObject(CameraEventType); +export default Object.freeze(CameraEventType); diff --git a/Source/Scene/Cesium3DTile.js b/Source/Scene/Cesium3DTile.js index 96c4f848aa5a..9e062c118d3c 100644 --- a/Source/Scene/Cesium3DTile.js +++ b/Source/Scene/Cesium3DTile.js @@ -5,7 +5,6 @@ import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribu import CullingVolume from '../Core/CullingVolume.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import deprecationWarning from '../Core/deprecationWarning.js'; import destroyObject from '../Core/destroyObject.js'; import Ellipsoid from '../Core/Ellipsoid.js'; @@ -336,7 +335,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; // This can be overridden for testing purposes Cesium3DTile._deprecationWarning = deprecationWarning; - defineProperties(Cesium3DTile.prototype, { + Object.defineProperties(Cesium3DTile.prototype, { /** * The tileset containing this tile. * @@ -420,7 +419,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * * @type {*} * @readonly - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.} */ extras : { get : function() { @@ -556,6 +555,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; if (defined(this._contentReadyToProcessPromise)) { return this._contentReadyToProcessPromise.promise; } + return undefined; } }, @@ -575,6 +575,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; if (defined(this._contentReadyPromise)) { return this._contentReadyPromise.promise; } + return undefined; } }, @@ -1211,8 +1212,8 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; this.geometricError = this._geometricError * uniformScale; }; - function applyDebugSettings(tile, tileset, frameState) { - if (!frameState.passes.render) { + function applyDebugSettings(tile, tileset, frameState, passOptions) { + if (!passOptions.isRender) { return; } @@ -1320,10 +1321,10 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * * @private */ - Cesium3DTile.prototype.update = function(tileset, frameState) { + Cesium3DTile.prototype.update = function(tileset, frameState, passOptions) { var initCommandLength = frameState.commandList.length; updateClippingPlanes(this, tileset); - applyDebugSettings(this, tileset, frameState); + applyDebugSettings(this, tileset, frameState, passOptions); updateContent(this, tileset, frameState); this._commandsLength = frameState.commandList.length - initCommandLength; diff --git a/Source/Scene/Cesium3DTileBatchTable.js b/Source/Scene/Cesium3DTileBatchTable.js index 2fdf11e3f221..b0045770c0c6 100644 --- a/Source/Scene/Cesium3DTileBatchTable.js +++ b/Source/Scene/Cesium3DTileBatchTable.js @@ -8,7 +8,6 @@ import combine from '../Core/combine.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import deprecationWarning from '../Core/deprecationWarning.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; @@ -23,8 +22,6 @@ import RenderState from '../Renderer/RenderState.js'; import Sampler from '../Renderer/Sampler.js'; import ShaderSource from '../Renderer/ShaderSource.js'; import Texture from '../Renderer/Texture.js'; -import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js'; -import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'; import AttributeType from './AttributeType.js'; import BlendingState from './BlendingState.js'; import Cesium3DTileColorBlendMode from './Cesium3DTileColorBlendMode.js'; @@ -101,7 +98,7 @@ import StencilOperation from './StencilOperation.js'; // This can be overridden for testing purposes Cesium3DTileBatchTable._deprecationWarning = deprecationWarning; - defineProperties(Cesium3DTileBatchTable.prototype, { + Object.defineProperties(Cesium3DTileBatchTable.prototype, { memorySizeInBytes : { get : function() { var memory = 0; @@ -1330,13 +1327,14 @@ import StencilOperation from './StencilOperation.js'; return derivedCommand; } - function getDisableLogDepthFragmentShaderProgram(context, shaderProgram) { + function getLogDepthPolygonOffsetFragmentShaderProgram(context, shaderProgram) { var shader = context.shaderCache.getDerivedShaderProgram(shaderProgram, 'zBackfaceLogDepth'); if (!defined(shader)) { var fs = shaderProgram.fragmentShaderSource.clone(); fs.defines = defined(fs.defines) ? fs.defines.slice(0) : []; - fs.defines.push('DISABLE_LOG_DEPTH_FRAGMENT_WRITE'); + fs.defines.push('POLYGON_OFFSET'); + fs.sources.unshift('#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n'); shader = context.shaderCache.createDerivedShaderProgram(shaderProgram, 'zBackfaceLogDepth', { vertexShaderSource : shaderProgram.vertexShaderSource, fragmentShaderSource : fs, @@ -1374,9 +1372,17 @@ import StencilOperation from './StencilOperation.js'; derivedCommand.renderState = RenderState.fromCache(rs); derivedCommand.castShadows = false; derivedCommand.receiveShadows = false; - // Disable the depth writes in the fragment shader. The back face commands were causing the higher resolution + derivedCommand.uniformMap = clone(command.uniformMap); + + var polygonOffset = new Cartesian2(5.0, 5.0); + derivedCommand.uniformMap.u_polygonOffset = function() { + return polygonOffset; + }; + + // Make the log depth depth fragment write account for the polygon offset, too. + // Otherwise, the back face commands will cause the higher resolution // tiles to disappear. - derivedCommand.shaderProgram = getDisableLogDepthFragmentShaderProgram(context, command.shaderProgram); + derivedCommand.shaderProgram = getLogDepthPolygonOffsetFragmentShaderProgram(context, command.shaderProgram); return derivedCommand; } @@ -1436,10 +1442,7 @@ import StencilOperation from './StencilOperation.js'; arrayBufferView : bytes }, flipY : false, - sampler : new Sampler({ - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }) + sampler : Sampler.NEAREST }); } diff --git a/Source/Scene/Cesium3DTileColorBlendMode.js b/Source/Scene/Cesium3DTileColorBlendMode.js index 782f052d9656..167d91dcbe65 100644 --- a/Source/Scene/Cesium3DTileColorBlendMode.js +++ b/Source/Scene/Cesium3DTileColorBlendMode.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from @@ -51,4 +50,4 @@ import freezeObject from '../Core/freezeObject.js'; */ MIX : 2 }; -export default freezeObject(Cesium3DTileColorBlendMode); +export default Object.freeze(Cesium3DTileColorBlendMode); diff --git a/Source/Scene/Cesium3DTileContent.js b/Source/Scene/Cesium3DTileContent.js index eeb4fe455319..673b65c78965 100644 --- a/Source/Scene/Cesium3DTileContent.js +++ b/Source/Scene/Cesium3DTileContent.js @@ -1,4 +1,3 @@ -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; /** @@ -30,7 +29,7 @@ import DeveloperError from '../Core/DeveloperError.js'; this.featurePropertiesDirty = false; } - defineProperties(Cesium3DTileContent.prototype, { + Object.defineProperties(Cesium3DTileContent.prototype, { /** * Gets the number of features in the tile. * @@ -40,7 +39,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ featuresLength : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -52,7 +51,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * equals the number of groups of points as distinguished by the BATCH_ID feature table semantic. *

* - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/PointCloud#batched-points} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/PointCloud#batched-points} * * @memberof Cesium3DTileContent.prototype * @@ -60,7 +59,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ pointsLength : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -74,7 +73,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ trianglesLength : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -88,7 +87,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ geometryByteLength : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -102,7 +101,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ texturesByteLength : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -116,7 +115,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ batchTableByteLength : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -125,7 +124,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * Gets the array of {@link Cesium3DTileContent} objects that represent the * content a composite's inner tiles, which can also be composites. * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Composite} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Composite} * * @memberof Cesium3DTileContent.prototype * @@ -133,7 +132,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ innerContents : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -147,7 +146,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ readyPromise : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -161,7 +160,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ tileset : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -175,7 +174,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ tile : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -188,7 +187,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ url : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -206,7 +205,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @private */ batchTable : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } } @@ -232,7 +231,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * Features in a tile are ordered by batchId, an index used to retrieve their metadata from the batch table. *

* - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/BatchTable}. + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/BatchTable}. * * @param {Number} batchId The batchId for the feature. * @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object. diff --git a/Source/Scene/Cesium3DTileContentState.js b/Source/Scene/Cesium3DTileContentState.js index 9de389d87cd7..5379a9de79e4 100644 --- a/Source/Scene/Cesium3DTileContentState.js +++ b/Source/Scene/Cesium3DTileContentState.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * @private @@ -11,4 +10,4 @@ import freezeObject from '../Core/freezeObject.js'; EXPIRED : 4, // Is expired and will be unloaded once new content is loaded. FAILED : 5 // Request failed. }; -export default freezeObject(Cesium3DTileContentState); +export default Object.freeze(Cesium3DTileContentState); diff --git a/Source/Scene/Cesium3DTileFeature.js b/Source/Scene/Cesium3DTileFeature.js index 8b678f7df39b..67204e2ed9d5 100644 --- a/Source/Scene/Cesium3DTileFeature.js +++ b/Source/Scene/Cesium3DTileFeature.js @@ -1,6 +1,5 @@ import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; /** * A feature of a {@link Cesium3DTileset}. @@ -43,7 +42,7 @@ import defineProperties from '../Core/defineProperties.js'; this._color = undefined; // for calling getColor } - defineProperties(Cesium3DTileFeature.prototype, { + Object.defineProperties(Cesium3DTileFeature.prototype, { /** * Gets or sets if the feature will be shown. This is set for all features * when a style's show is evaluated. @@ -147,7 +146,7 @@ import defineProperties from '../Core/defineProperties.js'; * Returns whether the feature contains this property. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} * * @param {String} name The case-sensitive name of the property. * @returns {Boolean} Whether the feature contains this property. @@ -160,7 +159,7 @@ import defineProperties from '../Core/defineProperties.js'; * Returns an array of property names for the feature. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} * * @param {String[]} results An array into which to store the results. * @returns {String[]} The names of the feature's properties. @@ -173,7 +172,7 @@ import defineProperties from '../Core/defineProperties.js'; * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} * * @param {String} name The case-sensitive name of the property. * @returns {*} The value of the property or undefined if the property does not exist. diff --git a/Source/Scene/Cesium3DTileOptimizationHint.js b/Source/Scene/Cesium3DTileOptimizationHint.js index 142f07c52e8f..ae6e6a30a716 100644 --- a/Source/Scene/Cesium3DTileOptimizationHint.js +++ b/Source/Scene/Cesium3DTileOptimizationHint.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Hint defining optimization support for a 3D tile @@ -12,4 +11,4 @@ import freezeObject from '../Core/freezeObject.js'; USE_OPTIMIZATION: 1, SKIP_OPTIMIZATION: 0 }; -export default freezeObject(Cesium3DTileOptimizationHint); +export default Object.freeze(Cesium3DTileOptimizationHint); diff --git a/Source/Scene/Cesium3DTilePass.js b/Source/Scene/Cesium3DTilePass.js index 04a1be803efa..8a5359b109f1 100644 --- a/Source/Scene/Cesium3DTilePass.js +++ b/Source/Scene/Cesium3DTilePass.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import Cesium3DTilesetMostDetailedTraversal from './Cesium3DTilesetMostDetailedTraversal.js'; import Cesium3DTilesetTraversal from './Cesium3DTilesetTraversal.js'; @@ -21,56 +20,56 @@ import Cesium3DTilesetTraversal from './Cesium3DTilesetTraversal.js'; var passOptions = new Array(Cesium3DTilePass.NUMBER_OF_PASSES); - passOptions[Cesium3DTilePass.RENDER] = freezeObject({ + passOptions[Cesium3DTilePass.RENDER] = Object.freeze({ traversal : Cesium3DTilesetTraversal, isRender : true, requestTiles : true, ignoreCommands : false }); - passOptions[Cesium3DTilePass.PICK] = freezeObject({ + passOptions[Cesium3DTilePass.PICK] = Object.freeze({ traversal : Cesium3DTilesetTraversal, isRender : false, requestTiles : false, ignoreCommands : false }); - passOptions[Cesium3DTilePass.SHADOW] = freezeObject({ + passOptions[Cesium3DTilePass.SHADOW] = Object.freeze({ traversal : Cesium3DTilesetTraversal, isRender : false, requestTiles : true, ignoreCommands : false }); - passOptions[Cesium3DTilePass.PRELOAD] = freezeObject({ + passOptions[Cesium3DTilePass.PRELOAD] = Object.freeze({ traversal : Cesium3DTilesetTraversal, isRender : false, requestTiles : true, ignoreCommands : true }); - passOptions[Cesium3DTilePass.PRELOAD_FLIGHT] = freezeObject({ + passOptions[Cesium3DTilePass.PRELOAD_FLIGHT] = Object.freeze({ traversal : Cesium3DTilesetTraversal, isRender : false, requestTiles : true, ignoreCommands : true }); - passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK] = freezeObject({ + passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK] = Object.freeze({ traversal : Cesium3DTilesetTraversal, isRender : false, requestTiles : true, ignoreCommands : true }); - passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD] = freezeObject({ + passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD] = Object.freeze({ traversal : Cesium3DTilesetMostDetailedTraversal, isRender : false, requestTiles : true, ignoreCommands : true }); - passOptions[Cesium3DTilePass.MOST_DETAILED_PICK] = freezeObject({ + passOptions[Cesium3DTilePass.MOST_DETAILED_PICK] = Object.freeze({ traversal : Cesium3DTilesetMostDetailedTraversal, isRender : false, requestTiles : false, @@ -80,4 +79,4 @@ import Cesium3DTilesetTraversal from './Cesium3DTilesetTraversal.js'; Cesium3DTilePass.getPassOptions = function(pass) { return passOptions[pass]; }; -export default freezeObject(Cesium3DTilePass); +export default Object.freeze(Cesium3DTilePass); diff --git a/Source/Scene/Cesium3DTilePointFeature.js b/Source/Scene/Cesium3DTilePointFeature.js index 5f4229be1e49..83951c56bfef 100644 --- a/Source/Scene/Cesium3DTilePointFeature.js +++ b/Source/Scene/Cesium3DTilePointFeature.js @@ -2,7 +2,6 @@ import Cartographic from '../Core/Cartographic.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import createBillboardPointCallback from './createBillboardPointCallback.js'; /** @@ -67,7 +66,7 @@ import createBillboardPointCallback from './createBillboardPointCallback.js'; var scratchCartographic = new Cartographic(); - defineProperties(Cesium3DTilePointFeature.prototype, { + Object.defineProperties(Cesium3DTilePointFeature.prototype, { /** * Gets or sets if the feature will be shown. This is set for all features * when a style's show is evaluated. @@ -672,7 +671,7 @@ import createBillboardPointCallback from './createBillboardPointCallback.js'; * Returns whether the feature contains this property. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} * * @param {String} name The case-sensitive name of the property. * @returns {Boolean} Whether the feature contains this property. @@ -685,7 +684,7 @@ import createBillboardPointCallback from './createBillboardPointCallback.js'; * Returns an array of property names for the feature. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} * * @param {String[]} results An array into which to store the results. * @returns {String[]} The names of the feature's properties. @@ -698,7 +697,7 @@ import createBillboardPointCallback from './createBillboardPointCallback.js'; * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's * class and inherited classes when using a batch table hierarchy. * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} * * @param {String} name The case-sensitive name of the property. * @returns {*} The value of the property or undefined if the property does not exist. diff --git a/Source/Scene/Cesium3DTileRefine.js b/Source/Scene/Cesium3DTileRefine.js index e1939e5dca62..c8261f430acb 100644 --- a/Source/Scene/Cesium3DTileRefine.js +++ b/Source/Scene/Cesium3DTileRefine.js @@ -1,9 +1,8 @@ -import freezeObject from '../Core/freezeObject.js'; /** * The refinement approach for a tile. *

- * See the {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#refinement|Refinement} + * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#refinement|Refinement} * in the 3D Tiles spec. *

* @@ -28,4 +27,4 @@ import freezeObject from '../Core/freezeObject.js'; */ REPLACE : 1 }; -export default freezeObject(Cesium3DTileRefine); +export default Object.freeze(Cesium3DTileRefine); diff --git a/Source/Scene/Cesium3DTileStyle.js b/Source/Scene/Cesium3DTileStyle.js index 08f483f4e3ec..ee0fb241f861 100644 --- a/Source/Scene/Cesium3DTileStyle.js +++ b/Source/Scene/Cesium3DTileStyle.js @@ -1,7 +1,6 @@ import clone from '../Core/clone.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Resource from '../Core/Resource.js'; import when from '../ThirdParty/when.js'; @@ -12,7 +11,7 @@ import Expression from './Expression.js'; * A style that is applied to a {@link Cesium3DTileset}. *

* Evaluates an expression defined using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. *

* * @alias Cesium3DTileStyle @@ -41,7 +40,7 @@ import Expression from './Expression.js'; * pointSize : '${Temperature} * 2.0' * }); * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} */ function Cesium3DTileStyle(style) { this._style = {}; @@ -172,10 +171,10 @@ import Expression from './Expression.js'; return expression; } - defineProperties(Cesium3DTileStyle.prototype, { + Object.defineProperties(Cesium3DTileStyle.prototype, { /** * Gets the object defining the style using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. * * @memberof Cesium3DTileStyle.prototype * diff --git a/Source/Scene/Cesium3DTileStyleEngine.js b/Source/Scene/Cesium3DTileStyleEngine.js index a7929a637e73..9bfc13833c22 100644 --- a/Source/Scene/Cesium3DTileStyleEngine.js +++ b/Source/Scene/Cesium3DTileStyleEngine.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; /** * @private @@ -10,7 +9,7 @@ import defineProperties from '../Core/defineProperties.js'; this._lastStyleTime = 0; // The "time" when the last style was assigned } - defineProperties(Cesium3DTileStyleEngine.prototype, { + Object.defineProperties(Cesium3DTileStyleEngine.prototype, { style : { get : function() { return this._style; @@ -26,7 +25,7 @@ import defineProperties from '../Core/defineProperties.js'; this._styleDirty = true; }; - Cesium3DTileStyleEngine.prototype.applyStyle = function(tileset, frameState) { + Cesium3DTileStyleEngine.prototype.applyStyle = function(tileset, passOptions) { if (!tileset.ready) { return; } @@ -37,8 +36,8 @@ import defineProperties from '../Core/defineProperties.js'; var styleDirty = this._styleDirty; - if (frameState.passes.render) { - // Don't reset until the color pass, e.g., for mouse-over picking + if (passOptions.isRender) { + // Don't reset until the render pass this._styleDirty = false; } diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 6acea1c705c6..d121042d8bbf 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -6,7 +6,6 @@ import Check from '../Core/Check.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import deprecationWarning from '../Core/deprecationWarning.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; @@ -46,7 +45,7 @@ import TileBoundingSphere from './TileBoundingSphere.js'; import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; /** - * A {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles tileset}, + * A {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles tileset}, * used for streaming massive heterogeneous 3D geospatial datasets. * * @alias Cesium3DTileset @@ -75,7 +74,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * @param {Number} [options.foveatedMinimumScreenSpaceErrorRelaxation=0.0] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. * @param {Cesium3DTileset~foveatedInterpolationCallback} [options.foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError} * @param {Number} [options.foveatedTimeDelay=0.2] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view. - * @param {Boolean} [options.skipLevelOfDetail=true] Optimization option. Determines if level of detail skipping should be applied during the traversal. + * @param {Boolean} [options.skipLevelOfDetail=false] Optimization option. Determines if level of detail skipping should be applied during the traversal. * @param {Number} [options.baseScreenSpaceError=1024] When skipLevelOfDetail is true, the screen space error that must be reached before skipping levels of detail. * @param {Number} [options.skipScreenSpaceErrorFactor=16] When skipLevelOfDetail is true, a multiplier defining the minimum screen space error to skip. Used in conjunction with skipLevels to determine which tiles to load. * @param {Number} [options.skipLevels=1] When skipLevelOfDetail is true, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with skipScreenSpaceErrorFactor to determine which tiles to load. @@ -132,7 +131,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * dynamicScreenSpaceErrorHeightFalloff : 0.25 * })); * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles specification} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles specification} */ function Cesium3DTileset(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); @@ -575,7 +574,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * @type {Boolean} * @default true */ - this.skipLevelOfDetail = defaultValue(options.skipLevelOfDetail, true); + this.skipLevelOfDetail = defaultValue(options.skipLevelOfDetail, false); this._skipLevelOfDetail = this.skipLevelOfDetail; this._disableSkipLevelOfDetail = false; @@ -882,7 +881,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; }); } - defineProperties(Cesium3DTileset.prototype, { + Object.defineProperties(Cesium3DTileset.prototype, { /** * NOTE: This getter exists so that `Picking.js` can differentiate between * PrimitiveCollection and Cesium3DTileset objects without inflating @@ -898,7 +897,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; /** * Gets the tileset's asset object property, which contains metadata about the tileset. *

- * See the {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#reference-asset|asset schema reference} + * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-asset|asset schema reference} * in the 3D Tiles spec for the full set of properties. *

* @@ -939,7 +938,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; /** * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties. *

- * See the {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#reference-properties|properties schema reference} + * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-properties|properties schema reference} * in the 3D Tiles spec for the full set of properties. *

* @@ -1065,7 +1064,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; /** * The style, defined using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, * applied to each feature in the tileset. *

* Assign undefined to remove the style, which will restore the visual @@ -1099,7 +1098,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * } * }); * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} */ style : { get : function() { @@ -1439,7 +1438,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * @type {*} * @readonly * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.} */ extras : { get : function() { @@ -1949,9 +1948,10 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; tileset._tileDebugLabels.update(frameState); } - function updateTiles(tileset, frameState, isRender) { - tileset._styleEngine.applyStyle(tileset, frameState); + function updateTiles(tileset, frameState, passOptions) { + tileset._styleEngine.applyStyle(tileset, passOptions); + var isRender = passOptions.isRender; var statistics = tileset._statistics; var commandList = frameState.commandList; var numberOfInitialCommands = commandList.length; @@ -1988,13 +1988,13 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; if (isRender) { tileVisible.raiseEvent(tile); } - tile.update(tileset, frameState); + tile.update(tileset, frameState, passOptions); statistics.incrementSelectionCounts(tile.content); ++statistics.selected; } for (i = 0; i < emptyLength; ++i) { tile = emptyTiles[i]; - tile.update(tileset, frameState); + tile.update(tileset, frameState, passOptions); } var addedCommandsLength = commandList.length - lengthBeforeUpdate; @@ -2051,7 +2051,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; tileset.pointCloudShading.attenuation && tileset.pointCloudShading.eyeDomeLighting && (addedCommandsLength > 0)) { - tileset._pointCloudEyeDomeLighting.update(frameState, numberOfInitialCommands, tileset.pointCloudShading); + tileset._pointCloudEyeDomeLighting.update(frameState, numberOfInitialCommands, tileset.pointCloudShading, tileset.boundingSphere); } if (isRender) { @@ -2202,7 +2202,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; requestTiles(tileset); } - updateTiles(tileset, frameState, isRender); + updateTiles(tileset, frameState, passOptions); // Update pass statistics Cesium3DTilesetStatistics.clone(statistics, passStatistics); diff --git a/Source/Scene/CircleEmitter.js b/Source/Scene/CircleEmitter.js index 82985cfb3768..bc9460ecf17a 100644 --- a/Source/Scene/CircleEmitter.js +++ b/Source/Scene/CircleEmitter.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; -import defineProperties from '../Core/defineProperties.js'; import CesiumMath from '../Core/Math.js'; /** @@ -23,7 +22,7 @@ import CesiumMath from '../Core/Math.js'; this._radius = defaultValue(radius, 1.0); } - defineProperties(CircleEmitter.prototype, { + Object.defineProperties(CircleEmitter.prototype, { /** * The radius of the circle in meters. * @memberof CircleEmitter.prototype diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js index cd8b98655515..792f8ce52f0e 100644 --- a/Source/Scene/ClassificationModel.js +++ b/Source/Scene/ClassificationModel.js @@ -7,7 +7,6 @@ import combine from '../Core/combine.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import FeatureDetection from '../Core/FeatureDetection.js'; @@ -218,7 +217,7 @@ import Vector3DTilePrimitive from './Vector3DTilePrimitive.js'; this._rtcCenter2D = undefined; // in projected world coordinates } - defineProperties(ClassificationModel.prototype, { + Object.defineProperties(ClassificationModel.prototype, { /** * The object for the glTF JSON, including properties with default values omitted * from the JSON provided to this model. diff --git a/Source/Scene/ClassificationPrimitive.js b/Source/Scene/ClassificationPrimitive.js index dab4fd28e875..5045ed0cf0d5 100644 --- a/Source/Scene/ClassificationPrimitive.js +++ b/Source/Scene/ClassificationPrimitive.js @@ -2,11 +2,9 @@ import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribu import combine from '../Core/combine.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import GeometryInstance from '../Core/GeometryInstance.js'; -import isArray from '../Core/isArray.js'; import DrawCommand from '../Renderer/DrawCommand.js'; import Pass from '../Renderer/Pass.js'; import RenderState from '../Renderer/RenderState.js'; @@ -26,8 +24,6 @@ import StencilConstants from './StencilConstants.js'; import StencilFunction from './StencilFunction.js'; import StencilOperation from './StencilOperation.js'; - var ClassificationPrimitiveReadOnlyInstanceAttributes = ['color']; - /** * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted. *

@@ -172,11 +168,6 @@ import StencilOperation from './StencilOperation.js'; this.appearance = options.appearance; - var readOnlyAttributes; - if (defined(geometryInstances) && isArray(geometryInstances) && geometryInstances.length > 1) { - readOnlyAttributes = ClassificationPrimitiveReadOnlyInstanceAttributes; - } - this._createBoundingVolumeFunction = options._createBoundingVolumeFunction; this._updateAndQueueCommandsFunction = options._updateAndQueueCommandsFunction; @@ -191,7 +182,6 @@ import StencilOperation from './StencilOperation.js'; allowPicking : defaultValue(options.allowPicking, true), asynchronous : defaultValue(options.asynchronous, true), compressVertices : defaultValue(options.compressVertices, true), - _readOnlyInstanceAttributes : readOnlyAttributes, _createBoundingVolumeFunction : undefined, _createRenderStatesFunction : undefined, _createShaderProgramFunction : undefined, @@ -201,7 +191,7 @@ import StencilOperation from './StencilOperation.js'; }; } - defineProperties(ClassificationPrimitive.prototype, { + Object.defineProperties(ClassificationPrimitive.prototype, { /** * When true, geometry vertices are optimized for the pre and post-vertex-shader caches. * @@ -533,14 +523,9 @@ import StencilOperation from './StencilOperation.js'; } var extrudedDefine = classificationPrimitive._extruded ? 'EXTRUDED_GEOMETRY' : ''; - // Tesselation on ClassificationPrimitives tends to be low, - // which causes problems when interpolating log depth from vertices. - // So force computing and writing logarithmic depth in the fragment shader. - // Re-enable at far distances to avoid z-fighting. - var disableGlPositionLogDepth = 'ENABLE_GL_POSITION_LOG_DEPTH_AT_HEIGHT'; var vsSource = new ShaderSource({ - defines : [extrudedDefine, disableGlPositionLogDepth], + defines : [extrudedDefine], sources : [vs] }); var fsSource = new ShaderSource({ @@ -564,7 +549,7 @@ import StencilOperation from './StencilOperation.js'; vsPick = Primitive._updatePickColorAttribute(vsPick); var pickFS3D = shadowVolumeAppearance.createPickFragmentShader(false); - var pickVS3D = shadowVolumeAppearance.createPickVertexShader([extrudedDefine, disableGlPositionLogDepth], vsPick, false, frameState.mapProjection); + var pickVS3D = shadowVolumeAppearance.createPickVertexShader([extrudedDefine], vsPick, false, frameState.mapProjection); classificationPrimitive._spPick = ShaderProgram.replaceCache({ context : context, @@ -580,7 +565,7 @@ import StencilOperation from './StencilOperation.js'; var pickProgram2D = context.shaderCache.getDerivedShaderProgram(classificationPrimitive._spPick, '2dPick'); if (!defined(pickProgram2D)) { var pickFS2D = shadowVolumeAppearance.createPickFragmentShader(true); - var pickVS2D = shadowVolumeAppearance.createPickVertexShader([extrudedDefine, disableGlPositionLogDepth], vsPick, true, frameState.mapProjection); + var pickVS2D = shadowVolumeAppearance.createPickVertexShader([extrudedDefine], vsPick, true, frameState.mapProjection); pickProgram2D = context.shaderCache.createDerivedShaderProgram(classificationPrimitive._spPick, '2dPick', { vertexShaderSource : pickVS2D, @@ -601,7 +586,7 @@ import StencilOperation from './StencilOperation.js'; vs = Primitive._appendShowToShader(primitive, vs); vsSource = new ShaderSource({ - defines : [extrudedDefine, disableGlPositionLogDepth], + defines : [extrudedDefine], sources : [vs] }); @@ -615,7 +600,7 @@ import StencilOperation from './StencilOperation.js'; // Create a fragment shader that computes only required material hookups using screen space techniques var fsColorSource = shadowVolumeAppearance.createFragmentShader(false); - var vsColorSource = shadowVolumeAppearance.createVertexShader([extrudedDefine, disableGlPositionLogDepth], vs, false, frameState.mapProjection); + var vsColorSource = shadowVolumeAppearance.createVertexShader([extrudedDefine], vs, false, frameState.mapProjection); classificationPrimitive._spColor = ShaderProgram.replaceCache({ context : context, @@ -632,7 +617,7 @@ import StencilOperation from './StencilOperation.js'; var colorProgram2D = context.shaderCache.getDerivedShaderProgram(classificationPrimitive._spColor, '2dColor'); if (!defined(colorProgram2D)) { var fsColorSource2D = shadowVolumeAppearance.createFragmentShader(true); - var vsColorSource2D = shadowVolumeAppearance.createVertexShader([extrudedDefine, disableGlPositionLogDepth], vs, true, frameState.mapProjection); + var vsColorSource2D = shadowVolumeAppearance.createVertexShader([extrudedDefine], vs, true, frameState.mapProjection); colorProgram2D = context.shaderCache.createDerivedShaderProgram(classificationPrimitive._spColor, '2dColor', { vertexShaderSource : vsColorSource2D, @@ -1002,7 +987,7 @@ import StencilOperation from './StencilOperation.js'; var primitiveOptions = this._primitiveOptions; if (!defined(this._primitive)) { - var instances = isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances]; + var instances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances]; var length = instances.length; var i; diff --git a/Source/Scene/ClassificationType.js b/Source/Scene/ClassificationType.js index 57bc3241aa49..a5355da0f4e5 100644 --- a/Source/Scene/ClassificationType.js +++ b/Source/Scene/ClassificationType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Whether a classification affects terrain, 3D Tiles or both. @@ -32,4 +31,4 @@ import freezeObject from '../Core/freezeObject.js'; */ NUMBER_OF_CLASSIFICATION_TYPES : 3 }; -export default freezeObject(ClassificationType); +export default Object.freeze(ClassificationType); diff --git a/Source/Scene/ClippingPlane.js b/Source/Scene/ClippingPlane.js index 7d35781409bf..17e47f1cdda9 100644 --- a/Source/Scene/ClippingPlane.js +++ b/Source/Scene/ClippingPlane.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Check from '../Core/Check.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; /** * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}. @@ -29,7 +28,7 @@ import defineProperties from '../Core/defineProperties.js'; this.index = -1; // to be set by ClippingPlaneCollection } - defineProperties(ClippingPlane.prototype, { + Object.defineProperties(ClippingPlane.prototype, { /** * The shortest distance from the origin to the plane. The sign of * distance determines which side of the plane the origin @@ -126,7 +125,7 @@ import defineProperties from '../Core/defineProperties.js'; this._cartesian3 = Cartesian3.clone(normal); } - defineProperties(UpdateChangedCartesian3.prototype, { + Object.defineProperties(UpdateChangedCartesian3.prototype, { x : { get : function() { return this._cartesian3.x; diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js index b5abd6304900..957dbb8f5c44 100644 --- a/Source/Scene/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -6,7 +6,6 @@ import Check from '../Core/Check.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; @@ -18,9 +17,6 @@ import ContextLimits from '../Renderer/ContextLimits.js'; import PixelDatatype from '../Renderer/PixelDatatype.js'; import Sampler from '../Renderer/Sampler.js'; import Texture from '../Renderer/Texture.js'; -import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js'; -import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'; -import TextureWrap from '../Renderer/TextureWrap.js'; import ClippingPlane from './ClippingPlane.js'; /** @@ -153,7 +149,7 @@ import ClippingPlane from './ClippingPlane.js'; return (value === Intersect.INSIDE); } - defineProperties(ClippingPlaneCollection.prototype, { + Object.defineProperties(ClippingPlaneCollection.prototype, { /** * Returns the number of planes in this collection. This is commonly used with * {@link ClippingPlaneCollection#get} to iterate over all the planes @@ -491,13 +487,6 @@ import ClippingPlane from './ClippingPlane.js'; // Allocate in the Y direction, since texture may be as wide as context texture support. requiredResolution.y *= 2; - var sampler = new Sampler({ - wrapS : TextureWrap.CLAMP_TO_EDGE, - wrapT : TextureWrap.CLAMP_TO_EDGE, - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }); - if (useFloatTexture) { clippingPlanesTexture = new Texture({ context : context, @@ -505,7 +494,7 @@ import ClippingPlane from './ClippingPlane.js'; height : requiredResolution.y, pixelFormat : PixelFormat.RGBA, pixelDatatype : PixelDatatype.FLOAT, - sampler : sampler, + sampler : Sampler.NEAREST, flipY : false }); this._float32View = new Float32Array(requiredResolution.x * requiredResolution.y * 4); @@ -516,7 +505,7 @@ import ClippingPlane from './ClippingPlane.js'; height : requiredResolution.y, pixelFormat : PixelFormat.RGBA, pixelDatatype : PixelDatatype.UNSIGNED_BYTE, - sampler : sampler, + sampler : Sampler.NEAREST, flipY : false }); this._uint8View = new Uint8Array(requiredResolution.x * requiredResolution.y * 4); diff --git a/Source/Scene/ColorBlendMode.js b/Source/Scene/ColorBlendMode.js index b71559bf95d5..3d1df4564f80 100644 --- a/Source/Scene/ColorBlendMode.js +++ b/Source/Scene/ColorBlendMode.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import CesiumMath from '../Core/Math.js'; /** @@ -31,4 +30,4 @@ import CesiumMath from '../Core/Math.js'; return CesiumMath.clamp(colorBlendAmount, CesiumMath.EPSILON4, 1.0); } }; -export default freezeObject(ColorBlendMode); +export default Object.freeze(ColorBlendMode); diff --git a/Source/Scene/Composite3DTileContent.js b/Source/Scene/Composite3DTileContent.js index ca6283cf75a3..2ce307951a8e 100644 --- a/Source/Scene/Composite3DTileContent.js +++ b/Source/Scene/Composite3DTileContent.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import getMagic from '../Core/getMagic.js'; import RuntimeError from '../Core/RuntimeError.js'; @@ -8,8 +7,8 @@ import when from '../ThirdParty/when.js'; /** * Represents the contents of a - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Composite|Composite} - * tile in a {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles} tileset. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Composite|Composite} + * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles} tileset. *

* Implements the {@link Cesium3DTileContent} interface. *

@@ -29,7 +28,7 @@ import when from '../ThirdParty/when.js'; initialize(this, arrayBuffer, byteOffset, factory); } - defineProperties(Composite3DTileContent.prototype, { + Object.defineProperties(Composite3DTileContent.prototype, { featurePropertiesDirty : { get : function() { var contents = this._contents; diff --git a/Source/Scene/ConditionsExpression.js b/Source/Scene/ConditionsExpression.js index 534ac1bf0092..720b7d55358a 100644 --- a/Source/Scene/ConditionsExpression.js +++ b/Source/Scene/ConditionsExpression.js @@ -1,13 +1,12 @@ import clone from '../Core/clone.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Expression from './Expression.js'; /** * An expression for a style applied to a {@link Cesium3DTileset}. *

* Evaluates a conditions expression defined using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. *

*

* Implements the {@link StyleExpression} interface. @@ -37,7 +36,7 @@ import Expression from './Expression.js'; setRuntime(this, defines); } - defineProperties(ConditionsExpression.prototype, { + Object.defineProperties(ConditionsExpression.prototype, { /** * Gets the conditions expression defined in the 3D Tiles Styling language. * @@ -82,7 +81,7 @@ import Expression from './Expression.js'; /** * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of * the expression in the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} * is of type Boolean, Number, or String, the corresponding JavaScript * primitive type will be returned. If the result is a RegExp, a Javascript RegExp * object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, diff --git a/Source/Scene/ConeEmitter.js b/Source/Scene/ConeEmitter.js index b49e5fff8ce1..d678649deb1d 100644 --- a/Source/Scene/ConeEmitter.js +++ b/Source/Scene/ConeEmitter.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; -import defineProperties from '../Core/defineProperties.js'; import CesiumMath from '../Core/Math.js'; var defaultAngle = CesiumMath.toRadians(30.0); @@ -19,7 +18,7 @@ import CesiumMath from '../Core/Math.js'; this._angle = defaultValue(angle, defaultAngle); } - defineProperties(ConeEmitter.prototype, { + Object.defineProperties(ConeEmitter.prototype, { /** * The angle of the cone in radians. * @memberof CircleEmitter.prototype diff --git a/Source/Scene/CreditDisplay.js b/Source/Scene/CreditDisplay.js index a872df9e2f8c..5216c38378c3 100644 --- a/Source/Scene/CreditDisplay.js +++ b/Source/Scene/CreditDisplay.js @@ -4,7 +4,6 @@ import Check from '../Core/Check.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; var mobileWidth = 576; @@ -499,7 +498,7 @@ import destroyObject from '../Core/destroyObject.js'; return defaultCredit; } - defineProperties(CreditDisplay, { + Object.defineProperties(CreditDisplay, { /** * Gets or sets the Cesium logo credit. * @memberof CreditDisplay diff --git a/Source/Scene/CullFace.js b/Source/Scene/CullFace.js index 78960e9c6714..3b0f0bd8125e 100644 --- a/Source/Scene/CullFace.js +++ b/Source/Scene/CullFace.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -31,4 +30,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; */ FRONT_AND_BACK : WebGLConstants.FRONT_AND_BACK }; -export default freezeObject(CullFace); +export default Object.freeze(CullFace); diff --git a/Source/Scene/DebugAppearance.js b/Source/Scene/DebugAppearance.js index a4edd8790bee..44fd94b53588 100644 --- a/Source/Scene/DebugAppearance.js +++ b/Source/Scene/DebugAppearance.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Appearance from './Appearance.js'; @@ -133,7 +132,7 @@ import Appearance from './Appearance.js'; this._glslDatatype = glslDatatype; } - defineProperties(DebugAppearance.prototype, { + Object.defineProperties(DebugAppearance.prototype, { /** * The GLSL source code for the vertex shader. * diff --git a/Source/Scene/DepthFunction.js b/Source/Scene/DepthFunction.js index ca716f23fe0a..87bec2136c41 100644 --- a/Source/Scene/DepthFunction.js +++ b/Source/Scene/DepthFunction.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -71,4 +70,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; */ ALWAYS : WebGLConstants.ALWAYS }; -export default freezeObject(DepthFunction); +export default Object.freeze(DepthFunction); diff --git a/Source/Scene/DepthPlane.js b/Source/Scene/DepthPlane.js index bb7a7aa55425..8ba5fcdbbbcf 100644 --- a/Source/Scene/DepthPlane.js +++ b/Source/Scene/DepthPlane.js @@ -134,7 +134,6 @@ import SceneMode from './SceneMode.js'; fs.sources.push(extension); fs.defines.push('LOG_DEPTH'); vs.defines.push('LOG_DEPTH'); - vs.defines.push('DISABLE_GL_POSITION_LOG_DEPTH'); } this._sp = ShaderProgram.replaceCache({ diff --git a/Source/Scene/DiscardEmptyTileImagePolicy.js b/Source/Scene/DiscardEmptyTileImagePolicy.js index 0fc35f008472..75a873b4d932 100644 --- a/Source/Scene/DiscardEmptyTileImagePolicy.js +++ b/Source/Scene/DiscardEmptyTileImagePolicy.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; /** * A policy for discarding tile images that contain no data (and so aren't actually images). @@ -34,7 +33,7 @@ import defineProperties from '../Core/defineProperties.js'; var emptyImage; - defineProperties(DiscardEmptyTileImagePolicy, { + Object.defineProperties(DiscardEmptyTileImagePolicy, { /** * Default value for representing an empty image. * @type {Image} diff --git a/Source/Scene/EllipsoidPrimitive.js b/Source/Scene/EllipsoidPrimitive.js index c22639b52bf1..ed2b951d31b0 100644 --- a/Source/Scene/EllipsoidPrimitive.js +++ b/Source/Scene/EllipsoidPrimitive.js @@ -113,7 +113,7 @@ import SceneMode from './SceneMode.js'; /** * The surface appearance of the ellipsoid. This can be one of several built-in {@link Material} objects or a custom material, scripted with - * {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric}. + * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. *

* The default material is Material.ColorType. *

@@ -129,7 +129,7 @@ import SceneMode from './SceneMode.js'; * // 2. Change material to horizontal stripes * e.material = Cesium.Material.fromType(Cesium.Material.StripeType); * - * @see {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric} + * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} */ this.material = defaultValue(options.material, Material.fromType(Material.ColorType)); this._material = undefined; @@ -348,7 +348,7 @@ import SceneMode from './SceneMode.js'; fs.defines.push('WRITE_DEPTH'); } if (this._useLogDepth) { - vs.defines.push('LOG_DEPTH', 'DISABLE_GL_POSITION_LOG_DEPTH'); + vs.defines.push('LOG_DEPTH'); fs.defines.push('LOG_DEPTH'); fs.sources.push(logDepthExtension); } diff --git a/Source/Scene/EllipsoidSurfaceAppearance.js b/Source/Scene/EllipsoidSurfaceAppearance.js index 929d18df8471..64f24c9b8941 100644 --- a/Source/Scene/EllipsoidSurfaceAppearance.js +++ b/Source/Scene/EllipsoidSurfaceAppearance.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import VertexFormat from '../Core/VertexFormat.js'; import EllipsoidSurfaceAppearanceFS from '../Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js'; import EllipsoidSurfaceAppearanceVS from '../Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js'; @@ -27,7 +26,7 @@ import Material from './Material.js'; * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. * @param {RenderState} [options.renderState] Optional render state to override the default render state. * - * @see {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric} + * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} * * @example * var primitive = new Cesium.Primitive({ @@ -56,7 +55,7 @@ import Material from './Material.js'; * * @default {@link Material.ColorType} * - * @see {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric} + * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} */ this.material = (defined(options.material)) ? options.material : Material.fromType(Material.ColorType); @@ -81,7 +80,7 @@ import Material from './Material.js'; this._aboveGround = aboveGround; } - defineProperties(EllipsoidSurfaceAppearance.prototype, { + Object.defineProperties(EllipsoidSurfaceAppearance.prototype, { /** * The GLSL source code for the vertex shader. * diff --git a/Source/Scene/Empty3DTileContent.js b/Source/Scene/Empty3DTileContent.js index 02483c23475c..494827e6d586 100644 --- a/Source/Scene/Empty3DTileContent.js +++ b/Source/Scene/Empty3DTileContent.js @@ -1,9 +1,8 @@ -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; /** * Represents empty content for tiles in a - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles} tileset that + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles} tileset that * do not have content, e.g., because they are used to optimize hierarchical culling. *

* Implements the {@link Cesium3DTileContent} interface. @@ -21,7 +20,7 @@ import destroyObject from '../Core/destroyObject.js'; this.featurePropertiesDirty = false; } - defineProperties(Empty3DTileContent.prototype, { + Object.defineProperties(Empty3DTileContent.prototype, { featuresLength : { get : function() { return 0; diff --git a/Source/Scene/Expression.js b/Source/Scene/Expression.js index 324f8b408e31..1b4da7d666ec 100644 --- a/Source/Scene/Expression.js +++ b/Source/Scene/Expression.js @@ -4,9 +4,7 @@ import Cartesian4 from '../Core/Cartesian4.js'; import Check from '../Core/Check.js'; import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; -import isArray from '../Core/isArray.js'; import CesiumMath from '../Core/Math.js'; import RuntimeError from '../Core/RuntimeError.js'; import jsep from '../ThirdParty/jsep.js'; @@ -16,7 +14,7 @@ import ExpressionNodeType from './ExpressionNodeType.js'; * An expression for a style applied to a {@link Cesium3DTileset}. *

* Evaluates an expression defined using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. *

*

* Implements the {@link StyleExpression} interface. @@ -59,7 +57,7 @@ import ExpressionNodeType from './ExpressionNodeType.js'; this._runtimeAst = createRuntimeAst(this, ast); } - defineProperties(Expression.prototype, { + Object.defineProperties(Expression.prototype, { /** * Gets the expression defined in the 3D Tiles Styling language. * @@ -125,7 +123,7 @@ import ExpressionNodeType from './ExpressionNodeType.js'; /** * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of * the expression in the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} * is of type Boolean, Number, or String, the corresponding JavaScript * primitive type will be returned. If the result is a RegExp, a Javascript RegExp * object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, @@ -1559,6 +1557,8 @@ import ExpressionNodeType from './ExpressionNodeType.js'; return expressions; } + var nullSentinel = 'czm_infinity'; // null just needs to be some sentinel value that will cause "[expression] === null" to be false in nearly all cases. GLSL doesn't have a NaN constant so use czm_infinity. + Node.prototype.getShaderExpression = function(attributePrefix, shaderState, parent) { var color; var left; @@ -1569,7 +1569,7 @@ import ExpressionNodeType from './ExpressionNodeType.js'; var value = this._value; if (defined(this._left)) { - if (isArray(this._left)) { + if (Array.isArray(this._left)) { // Left can be an array if the type is LITERAL_COLOR or LITERAL_VECTOR left = getExpressionArray(this._left, attributePrefix, shaderState, this); } else { @@ -1585,7 +1585,7 @@ import ExpressionNodeType from './ExpressionNodeType.js'; test = this._test.getShaderExpression(attributePrefix, shaderState, this); } - if (isArray(this._value)) { + if (Array.isArray(this._value)) { // For ARRAY type value = getExpressionArray(this._value, attributePrefix, shaderState, this); } @@ -1603,7 +1603,13 @@ import ExpressionNodeType from './ExpressionNodeType.js'; return 'floor(' + left + ' + 0.5)'; } else if (defined(unaryFunctions[value])) { return value + '(' + left + ')'; - } else if ((value === 'isNaN') || (value === 'isFinite') || (value === 'String') || (value === 'isExactClass') || (value === 'isClass') || (value === 'getExactClassName')) { + } else if (value === 'isNaN') { + // In GLSL 2.0 use isnan instead + return '(' + left + ' != ' + left + ')'; + } else if (value === 'isFinite') { + // In GLSL 2.0 use isinf instead. GLSL doesn't have an infinity constant so use czm_infinity which is an arbitrarily big enough number. + return '(abs(' + left + ') < czm_infinity)'; + } else if ((value === 'String') || (value === 'isExactClass') || (value === 'isClass') || (value === 'getExactClassName')) { throw new RuntimeError('Error generating style shader: "' + value + '" is not supported.'); } else if (defined(unaryFunctions[value])) { return value + '(' + left + ')'; @@ -1659,7 +1665,7 @@ import ExpressionNodeType from './ExpressionNodeType.js'; case ExpressionNodeType.VARIABLE_IN_STRING: throw new RuntimeError('Error generating style shader: Converting a variable to a string is not supported.'); case ExpressionNodeType.LITERAL_NULL: - throw new RuntimeError('Error generating style shader: null is not supported.'); + return nullSentinel; case ExpressionNodeType.LITERAL_BOOLEAN: return value ? 'true' : 'false'; case ExpressionNodeType.LITERAL_NUMBER: @@ -1745,7 +1751,7 @@ import ExpressionNodeType from './ExpressionNodeType.js'; case ExpressionNodeType.LITERAL_REGEX: throw new RuntimeError('Error generating style shader: Regular expressions are not supported.'); case ExpressionNodeType.LITERAL_UNDEFINED: - throw new RuntimeError('Error generating style shader: undefined is not supported.'); + return nullSentinel; case ExpressionNodeType.BUILTIN_VARIABLE: if (value === 'tiles3d_tileset_time') { return 'u_time'; diff --git a/Source/Scene/ExpressionNodeType.js b/Source/Scene/ExpressionNodeType.js index f972c5b4cc08..c4348223a431 100644 --- a/Source/Scene/ExpressionNodeType.js +++ b/Source/Scene/ExpressionNodeType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * @private @@ -24,4 +23,4 @@ import freezeObject from '../Core/freezeObject.js'; LITERAL_UNDEFINED : 17, BUILTIN_VARIABLE : 18 }; -export default freezeObject(ExpressionNodeType); +export default Object.freeze(ExpressionNodeType); diff --git a/Source/Scene/FrameRateMonitor.js b/Source/Scene/FrameRateMonitor.js index e4184c71e449..8f4fc5e188a9 100644 --- a/Source/Scene/FrameRateMonitor.js +++ b/Source/Scene/FrameRateMonitor.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; @@ -154,7 +153,7 @@ import TimeConstants from '../Core/TimeConstants.js'; return scene._frameRateMonitor; }; - defineProperties(FrameRateMonitor.prototype, { + Object.defineProperties(FrameRateMonitor.prototype, { /** * Gets the {@link Scene} instance for which to monitor performance. * @memberof FrameRateMonitor.prototype diff --git a/Source/Scene/FrameState.js b/Source/Scene/FrameState.js index f9343c143139..eba28e5326cd 100644 --- a/Source/Scene/FrameState.js +++ b/Source/Scene/FrameState.js @@ -127,6 +127,14 @@ import SceneMode from './SceneMode.js'; */ this.camera = undefined; + /** + * Whether the camera is underground. + * + * @type {Boolean} + * @default false + */ + this.cameraUnderground = false; + /** * The culling volume. * diff --git a/Source/Scene/Geometry3DTileContent.js b/Source/Scene/Geometry3DTileContent.js index 41443106946f..98378a93508e 100644 --- a/Source/Scene/Geometry3DTileContent.js +++ b/Source/Scene/Geometry3DTileContent.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import getStringFromTypedArray from '../Core/getStringFromTypedArray.js'; @@ -41,7 +40,7 @@ import Vector3DTileGeometry from './Vector3DTileGeometry.js'; initialize(this, arrayBuffer, byteOffset); } - defineProperties(Geometry3DTileContent.prototype, { + Object.defineProperties(Geometry3DTileContent.prototype, { featuresLength : { get : function() { return defined(this._batchTable) ? this._batchTable.featuresLength : 0; diff --git a/Source/Scene/Globe.js b/Source/Scene/Globe.js index 8a8798861334..6438308cd2e0 100644 --- a/Source/Scene/Globe.js +++ b/Source/Scene/Globe.js @@ -4,7 +4,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Cartographic from '../Core/Cartographic.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Ellipsoid from '../Core/Ellipsoid.js'; @@ -26,7 +25,6 @@ import ImageryLayerCollection from './ImageryLayerCollection.js'; import QuadtreePrimitive from './QuadtreePrimitive.js'; import SceneMode from './SceneMode.js'; import ShadowMode from './ShadowMode.js'; -import TileSelectionResult from './TileSelectionResult.js'; /** * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider}) @@ -292,7 +290,7 @@ import TileSelectionResult from './TileSelectionResult.js'; this._zoomedOutOceanSpecularIntensity = undefined; } - defineProperties(Globe.prototype, { + Object.defineProperties(Globe.prototype, { /** * Gets an ellipsoid describing the shape of this globe. * @memberof Globe.prototype @@ -451,7 +449,7 @@ import TileSelectionResult from './TileSelectionResult.js'; /** * Gets or sets the material appearance of the Globe. This can be one of several built-in {@link Material} objects or a custom material, scripted with - * {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric}. + * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. * @memberof Globe.prototype * @type {Material} */ @@ -612,7 +610,7 @@ import TileSelectionResult from './TileSelectionResult.js'; var scratchGetHeightRay = new Ray(); function tileIfContainsCartographic(tile, cartographic) { - return Rectangle.contains(tile.rectangle, cartographic) ? tile : undefined; + return defined(tile) && Rectangle.contains(tile.rectangle, cartographic) ? tile : undefined; } /** @@ -650,12 +648,13 @@ import TileSelectionResult from './TileSelectionResult.js'; var tileWithMesh = tile; - while (tile._lastSelectionResult === TileSelectionResult.REFINED) { - tile = tileIfContainsCartographic(tile.southwestChild, cartographic) || - tileIfContainsCartographic(tile.southeastChild, cartographic) || - tileIfContainsCartographic(tile.northwestChild, cartographic) || - tile.northeastChild; - if (defined(tile.data) && defined(tile.data.renderedMesh)) { + while (defined(tile)) { + tile = tileIfContainsCartographic(tile._southwestChild, cartographic) || + tileIfContainsCartographic(tile._southeastChild, cartographic) || + tileIfContainsCartographic(tile._northwestChild, cartographic) || + tile._northeastChild; + + if (defined(tile) && defined(tile.data) && defined(tile.data.renderedMesh)) { tileWithMesh = tile; } } diff --git a/Source/Scene/GlobeDepth.js b/Source/Scene/GlobeDepth.js index 8e1c0ad5b8f2..1790a7cf70c2 100644 --- a/Source/Scene/GlobeDepth.js +++ b/Source/Scene/GlobeDepth.js @@ -1,7 +1,6 @@ import BoundingRectangle from '../Core/BoundingRectangle.js'; import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import PixelFormat from '../Core/PixelFormat.js'; import ClearCommand from '../Renderer/ClearCommand.js'; @@ -11,9 +10,6 @@ import RenderState from '../Renderer/RenderState.js'; import Sampler from '../Renderer/Sampler.js'; import ShaderSource from '../Renderer/ShaderSource.js'; import Texture from '../Renderer/Texture.js'; -import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js'; -import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'; -import TextureWrap from '../Renderer/TextureWrap.js'; import PassThrough from '../Shaders/PostProcessStages/PassThrough.js'; import PassThroughDepth from '../Shaders/PostProcessStages/PassThroughDepth.js'; import BlendingState from './BlendingState.js'; @@ -61,7 +57,7 @@ import StencilOperation from './StencilOperation.js'; this._debugGlobeDepthViewportCommand = undefined; } - defineProperties(GlobeDepth.prototype, { + Object.defineProperties(GlobeDepth.prototype, { framebuffer : { get : function() { return this._globeColorFramebuffer; @@ -133,12 +129,7 @@ import StencilOperation from './StencilOperation.js'; height : height, pixelFormat : PixelFormat.RGBA, pixelDatatype : PixelDatatype.UNSIGNED_BYTE, - sampler : new Sampler({ - wrapS : TextureWrap.CLAMP_TO_EDGE, - wrapT : TextureWrap.CLAMP_TO_EDGE, - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }) + sampler : Sampler.NEAREST }); globeDepth._tempCopyDepthFramebuffer = new Framebuffer({ context : context, @@ -161,12 +152,7 @@ import StencilOperation from './StencilOperation.js'; height : height, pixelFormat : PixelFormat.RGBA, pixelDatatype : pixelDatatype, - sampler : new Sampler({ - wrapS : TextureWrap.CLAMP_TO_EDGE, - wrapT : TextureWrap.CLAMP_TO_EDGE, - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }) + sampler : Sampler.NEAREST }); globeDepth._depthStencilTexture = new Texture({ @@ -183,12 +169,7 @@ import StencilOperation from './StencilOperation.js'; height : height, pixelFormat : PixelFormat.RGBA, pixelDatatype : PixelDatatype.UNSIGNED_BYTE, - sampler : new Sampler({ - wrapS : TextureWrap.CLAMP_TO_EDGE, - wrapT : TextureWrap.CLAMP_TO_EDGE, - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }) + sampler : Sampler.NEAREST }); } @@ -215,12 +196,7 @@ import StencilOperation from './StencilOperation.js'; height : height, pixelFormat : PixelFormat.RGBA, pixelDatatype : pixelDatatype, - sampler : new Sampler({ - wrapS : TextureWrap.CLAMP_TO_EDGE, - wrapT : TextureWrap.CLAMP_TO_EDGE, - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }) + sampler : Sampler.NEAREST }); globeDepth._primitiveColorFramebuffer = new Framebuffer({ diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js index 7dc9086ad9a5..68c148a6963a 100644 --- a/Source/Scene/GlobeSurfaceShaderSet.js +++ b/Source/Scene/GlobeSurfaceShaderSet.js @@ -97,13 +97,6 @@ import SceneMode from './SceneMode.js'; quantizationDefine = 'QUANTIZATION_BITS12'; } - var vertexLogDepth = 0; - var vertexLogDepthDefine = ''; - if (!defined(surfaceTile.vertexArray) || !defined(surfaceTile.terrainData) || surfaceTile.terrainData._createdByUpsampling) { - vertexLogDepth = 1; - vertexLogDepthDefine = 'DISABLE_GL_POSITION_LOG_DEPTH'; - } - var cartographicLimitRectangleFlag = 0; var cartographicLimitRectangleDefine = ''; if (clippedByBoundaries) { @@ -139,12 +132,11 @@ import SceneMode from './SceneMode.js'; (quantization << 18) | (applySplit << 19) | (enableClippingPlanes << 20) | - (vertexLogDepth << 21) | - (cartographicLimitRectangleFlag << 22) | - (imageryCutoutFlag << 23) | - (colorCorrect << 24) | - (highlightFillTile << 25) | - (colorToAlpha << 26); + (cartographicLimitRectangleFlag << 21) | + (imageryCutoutFlag << 22) | + (colorCorrect << 23) | + (highlightFillTile << 24) | + (colorToAlpha << 25); var currentClippingShaderState = 0; if (defined(clippingPlanes) && clippingPlanes.length > 0) { @@ -176,7 +168,7 @@ import SceneMode from './SceneMode.js'; fs.sources.unshift(getClippingFunction(clippingPlanes, frameState.context)); // Need to go before GlobeFS } - vs.defines.push(quantizationDefine, vertexLogDepthDefine); + vs.defines.push(quantizationDefine); fs.defines.push('TEXTURE_UNITS ' + numberOfDayTextures, cartographicLimitRectangleDefine, imageryCutoutDefine); if (applyBrightness) { diff --git a/Source/Scene/GlobeSurfaceTile.js b/Source/Scene/GlobeSurfaceTile.js index 4800762c7552..334bc97a5a50 100644 --- a/Source/Scene/GlobeSurfaceTile.js +++ b/Source/Scene/GlobeSurfaceTile.js @@ -2,7 +2,6 @@ import BoundingSphere from '../Core/BoundingSphere.js'; import Cartesian3 from '../Core/Cartesian3.js'; import Cartesian4 from '../Core/Cartesian4.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import IndexDatatype from '../Core/IndexDatatype.js'; import IntersectionTests from '../Core/IntersectionTests.js'; import OrientedBoundingBox from '../Core/OrientedBoundingBox.js'; @@ -73,7 +72,7 @@ import TerrainState from './TerrainState.js'; this.clippedByBoundaries = false; } - defineProperties(GlobeSurfaceTile.prototype, { + Object.defineProperties(GlobeSurfaceTile.prototype, { /** * Gets a value indicating whether or not this tile is eligible to be unloaded. * Typically, a tile is ineligible to be unloaded while an asynchronous operation, diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 921e85905588..753128482905 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -10,7 +10,6 @@ import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribu import combine from '../Core/combine.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; @@ -159,7 +158,7 @@ import TileSelectionResult from './TileSelectionResult.js'; this._hasFillTilesThisFrame = false; } - defineProperties(GlobeSurfaceTileProvider.prototype, { + Object.defineProperties(GlobeSurfaceTileProvider.prototype, { /** * Gets or sets the color of the globe when no imagery is available. * @memberof GlobeSurfaceTileProvider.prototype @@ -411,9 +410,7 @@ import TileSelectionResult from './TileSelectionResult.js'; }, blending : BlendingState.ALPHA_BLEND }); - } - if (!this.backFaceCulling && !defined(this._disableCullingRenderState)) { var rs = clone(this._renderState, true); rs.cull.enabled = false; this._disableCullingRenderState = RenderState.fromCache(rs); @@ -552,7 +549,7 @@ import TileSelectionResult from './TileSelectionResult.js'; var distance = this.computeDistanceToTile(tile, frameState); tile._distance = distance; - if (frameState.fog.enabled) { + if (frameState.fog.enabled && !frameState.cameraUnderground) { if (CesiumMath.fog(distance, frameState.fog.density) >= 1.0) { // Tile is completely in fog so return that it is not visible. return Visibility.NONE; @@ -614,7 +611,7 @@ import TileSelectionResult from './TileSelectionResult.js'; } var ortho3D = frameState.mode === SceneMode.SCENE3D && frameState.camera.frustum instanceof OrthographicFrustum; - if (frameState.mode === SceneMode.SCENE3D && !ortho3D && defined(occluders)) { + if (frameState.mode === SceneMode.SCENE3D && !ortho3D && defined(occluders) && !frameState.cameraUnderground) { var occludeePointInScaledSpace = surfaceTile.occludeePointInScaledSpace; if (!defined(occludeePointInScaledSpace)) { return intersection; @@ -1545,11 +1542,13 @@ import TileSelectionResult from './TileSelectionResult.js'; waterMaskTranslationAndScale = surfaceTile.fill.waterMaskTranslationAndScale; } + var cameraUnderground = frameState.cameraUnderground; + var showReflectiveOcean = tileProvider.hasWaterMask && defined(waterMaskTexture); var oceanNormalMap = tileProvider.oceanNormalMap; var showOceanWaves = showReflectiveOcean && defined(oceanNormalMap); var hasVertexNormals = tileProvider.terrainProvider.ready && tileProvider.terrainProvider.hasVertexNormals; - var enableFog = frameState.fog.enabled; + var enableFog = frameState.fog.enabled && !cameraUnderground; var showGroundAtmosphere = tileProvider.showGroundAtmosphere; var castShadows = ShadowMode.castShadows(tileProvider.shadows); var receiveShadows = ShadowMode.receiveShadows(tileProvider.shadows); @@ -1674,8 +1673,10 @@ import TileSelectionResult from './TileSelectionResult.js'; var imageryIndex = 0; var imageryLen = tileImageryCollection.length; - var firstPassRenderState = tileProvider.backFaceCulling ? tileProvider._renderState : tileProvider._disableCullingRenderState; - var otherPassesRenderState = tileProvider.backFaceCulling ? tileProvider._blendRenderState : tileProvider._disableCullingBlendRenderState; + var showSkirts = tileProvider.showSkirts && !cameraUnderground; + var backFaceCulling = tileProvider.backFaceCulling && !cameraUnderground; + var firstPassRenderState = backFaceCulling ? tileProvider._renderState : tileProvider._disableCullingRenderState; + var otherPassesRenderState = backFaceCulling ? tileProvider._blendRenderState : tileProvider._disableCullingBlendRenderState; var renderState = firstPassRenderState; var initialColor = tileProvider._firstPassInitialColor; @@ -1922,7 +1923,7 @@ import TileSelectionResult from './TileSelectionResult.js'; surfaceShaderSetOptions.colorToAlpha = applyColorToAlpha; var count = surfaceTile.renderedMesh.indices.length; - if (!tileProvider.showSkirts) { + if (!showSkirts) { count = surfaceTile.renderedMesh.indexCountWithoutSkirts; } diff --git a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js index 4cbca27469ea..220fe1271437 100644 --- a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js @@ -2,7 +2,6 @@ import Credit from '../Core/Credit.js'; import decodeGoogleEarthEnterpriseData from '../Core/decodeGoogleEarthEnterpriseData.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import GeographicTilingScheme from '../Core/GeographicTilingScheme.js'; @@ -140,7 +139,7 @@ import when from '../ThirdParty/when.js'; }); } - defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, { + Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, { /** * Gets the name of the Google Earth Enterprise server url hosting the imagery. * @memberof GoogleEarthEnterpriseImageryProvider.prototype diff --git a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js index e8f1a6072ffb..d29615938f20 100644 --- a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js @@ -3,7 +3,6 @@ import Check from '../Core/Check.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import GeographicTilingScheme from '../Core/GeographicTilingScheme.js'; @@ -221,7 +220,7 @@ import ImageryProvider from './ImageryProvider.js'; requestMetadata(); } - defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, { + Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, { /** * Gets the URL of the Google Earth MapServer. * @memberof GoogleEarthEnterpriseMapsProvider.prototype @@ -582,7 +581,7 @@ import ImageryProvider from './ImageryProvider.js'; GoogleEarthEnterpriseMapsProvider._logoUrl = undefined; - defineProperties(GoogleEarthEnterpriseMapsProvider, { + Object.defineProperties(GoogleEarthEnterpriseMapsProvider, { /** * Gets or sets the URL to the Google Earth logo for display in the credit. * @memberof GoogleEarthEnterpriseMapsProvider diff --git a/Source/Scene/GridImageryProvider.js b/Source/Scene/GridImageryProvider.js index 5ceed292b615..d78286fd9e94 100644 --- a/Source/Scene/GridImageryProvider.js +++ b/Source/Scene/GridImageryProvider.js @@ -1,7 +1,6 @@ import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Event from '../Core/Event.js'; import GeographicTilingScheme from '../Core/GeographicTilingScheme.js'; import when from '../ThirdParty/when.js'; @@ -55,7 +54,7 @@ import when from '../ThirdParty/when.js'; this._readyPromise = when.resolve(true); } - defineProperties(GridImageryProvider.prototype, { + Object.defineProperties(GridImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GridImageryProvider.prototype diff --git a/Source/Scene/GroundPolylinePrimitive.js b/Source/Scene/GroundPolylinePrimitive.js index 383b4998b38c..5d6cdaef5fdb 100644 --- a/Source/Scene/GroundPolylinePrimitive.js +++ b/Source/Scene/GroundPolylinePrimitive.js @@ -2,13 +2,11 @@ import ApproximateTerrainHeights from '../Core/ApproximateTerrainHeights.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import GeometryInstance from '../Core/GeometryInstance.js'; import GeometryInstanceAttribute from '../Core/GeometryInstanceAttribute.js'; import GroundPolylineGeometry from '../Core/GroundPolylineGeometry.js'; -import isArray from '../Core/isArray.js'; import DrawCommand from '../Renderer/DrawCommand.js'; import Pass from '../Renderer/Pass.js'; import RenderState from '../Renderer/RenderState.js'; @@ -207,7 +205,7 @@ import StencilOperation from './StencilOperation.js'; }); } - defineProperties(GroundPolylinePrimitive.prototype, { + Object.defineProperties(GroundPolylinePrimitive.prototype, { /** * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. * @@ -349,11 +347,7 @@ import StencilOperation from './StencilOperation.js'; // Helps with varying budget. var fs = primitive._batchTable.getVertexShaderCallback()(PolylineShadowVolumeFS); - // Tesselation on these volumes tends to be low, - // which causes problems when interpolating log depth from vertices. - // So force computing and writing log depth in the fragment shader. - // Re-enable at far distances to avoid z-fighting. - var vsDefines = ['ENABLE_GL_POSITION_LOG_DEPTH_AT_HEIGHT', 'GLOBE_MINIMUM_ALTITUDE ' + frameState.mapProjection.ellipsoid.minimumRadius.toFixed(1)]; + var vsDefines = ['GLOBE_MINIMUM_ALTITUDE ' + frameState.mapProjection.ellipsoid.minimumRadius.toFixed(1)]; var colorDefine = ''; var materialShaderSource = ''; if (defined(appearance.material)) { @@ -596,7 +590,7 @@ import StencilOperation from './StencilOperation.js'; var that = this; var primitiveOptions = this._primitiveOptions; if (!defined(this._primitive)) { - var geometryInstances = isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances]; + var geometryInstances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances]; var geometryInstancesLength = geometryInstances.length; var groundInstances = new Array(geometryInstancesLength); diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js index e0087771a849..984ca5ca6458 100644 --- a/Source/Scene/GroundPrimitive.js +++ b/Source/Scene/GroundPrimitive.js @@ -5,11 +5,9 @@ import Cartographic from '../Core/Cartographic.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import GeometryInstance from '../Core/GeometryInstance.js'; -import isArray from '../Core/isArray.js'; import OrientedBoundingBox from '../Core/OrientedBoundingBox.js'; import Rectangle from '../Core/Rectangle.js'; import when from '../ThirdParty/when.js'; @@ -119,7 +117,7 @@ import ShadowVolumeAppearance from './ShadowVolumeAppearance.js'; var appearance = options.appearance; var geometryInstances = options.geometryInstances; if (!defined(appearance) && defined(geometryInstances)) { - var geometryInstancesArray = isArray(geometryInstances) ? geometryInstances : [geometryInstances]; + var geometryInstancesArray = Array.isArray(geometryInstances) ? geometryInstances : [geometryInstances]; var geometryInstanceCount = geometryInstancesArray.length; for (var i = 0; i < geometryInstanceCount; i++) { var attributes = geometryInstancesArray[i].attributes; @@ -237,7 +235,7 @@ import ShadowVolumeAppearance from './ShadowVolumeAppearance.js'; }; } - defineProperties(GroundPrimitive.prototype, { + Object.defineProperties(GroundPrimitive.prototype, { /** * When true, geometry vertices are optimized for the pre and post-vertex-shader caches. * @@ -619,7 +617,7 @@ import ShadowVolumeAppearance from './ShadowVolumeAppearance.js'; var geometry; var instanceType; - var instances = isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances]; + var instances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances]; var length = instances.length; var groundInstances = new Array(length); diff --git a/Source/Scene/HeightReference.js b/Source/Scene/HeightReference.js index be5ffb823af2..40fbf5bd5041 100644 --- a/Source/Scene/HeightReference.js +++ b/Source/Scene/HeightReference.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Represents the position relative to the terrain. @@ -27,4 +26,4 @@ import freezeObject from '../Core/freezeObject.js'; */ RELATIVE_TO_GROUND : 2 }; -export default freezeObject(HeightReference); +export default Object.freeze(HeightReference); diff --git a/Source/Scene/HorizontalOrigin.js b/Source/Scene/HorizontalOrigin.js index a382f9b0182d..aa78990d79b9 100644 --- a/Source/Scene/HorizontalOrigin.js +++ b/Source/Scene/HorizontalOrigin.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * The horizontal location of an origin relative to an object, e.g., a {@link Billboard} @@ -40,4 +39,4 @@ import freezeObject from '../Core/freezeObject.js'; */ RIGHT : -1 }; -export default freezeObject(HorizontalOrigin); +export default Object.freeze(HorizontalOrigin); diff --git a/Source/Scene/ImageryLayer.js b/Source/Scene/ImageryLayer.js index 4fced226f8b4..bf13c33ee4ac 100644 --- a/Source/Scene/ImageryLayer.js +++ b/Source/Scene/ImageryLayer.js @@ -2,7 +2,6 @@ import Cartesian2 from '../Core/Cartesian2.js'; import Cartesian4 from '../Core/Cartesian4.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import FeatureDetection from '../Core/FeatureDetection.js'; @@ -259,7 +258,7 @@ import TileImagery from './TileImagery.js'; this.colorToAlphaThreshold = defaultValue(options.colorToAlphaThreshold, ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD); } - defineProperties(ImageryLayer.prototype, { + Object.defineProperties(ImageryLayer.prototype, { /** * Gets the imagery provider for this layer. @@ -1025,18 +1024,18 @@ import TileImagery from './TileImagery.js'; // output pixel. So we used a grid of 256x256 vertices, because most of our imagery // tiles are 256x256. Fortunately the grid could be created and uploaded to the GPU just once and // re-used for all reprojections, so the performance was virtually unchanged from our original fragment - // shader approach. See https://github.com/AnalyticalGraphicsInc/cesium/pull/714. + // shader approach. See https://github.com/CesiumGS/cesium/pull/714. // - // Over a year later, we noticed (https://github.com/AnalyticalGraphicsInc/cesium/issues/2110) + // Over a year later, we noticed (https://github.com/CesiumGS/cesium/issues/2110) // that our reprojection code was creating a rare but severe artifact on some GPUs (Intel HD 4600 // for one). The problem was that the GLSL sin function on these GPUs had a discontinuity at fine scales in // a few places. // // We solved this by implementing a more reliable sin function based on the CORDIC algorithm - // (https://github.com/AnalyticalGraphicsInc/cesium/pull/2111). Even though this was a fair + // (https://github.com/CesiumGS/cesium/pull/2111). Even though this was a fair // amount of code to be executing per vertex, the performance seemed to be pretty good on most GPUs. // Unfortunately, on some GPUs, the performance was absolutely terrible - // (https://github.com/AnalyticalGraphicsInc/cesium/issues/2258). + // (https://github.com/CesiumGS/cesium/issues/2258). // // So that brings us to our current solution, the one you see here. Effectively, we compute the Web // Mercator texture coordinates on the CPU and store the T coordinate with each vertex (the S coordinate diff --git a/Source/Scene/ImageryLayerCollection.js b/Source/Scene/ImageryLayerCollection.js index 658bf5d224be..c47108aeb6c7 100644 --- a/Source/Scene/ImageryLayerCollection.js +++ b/Source/Scene/ImageryLayerCollection.js @@ -1,6 +1,5 @@ import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; @@ -57,7 +56,7 @@ import ImageryLayer from './ImageryLayer.js'; this.layerShownOrHidden = new Event(); } - defineProperties(ImageryLayerCollection.prototype, { + Object.defineProperties(ImageryLayerCollection.prototype, { /** * Gets the number of layers in this collection. * @memberof ImageryLayerCollection.prototype diff --git a/Source/Scene/ImageryProvider.js b/Source/Scene/ImageryProvider.js index 9d3dda636915..b30735cef7c2 100644 --- a/Source/Scene/ImageryProvider.js +++ b/Source/Scene/ImageryProvider.js @@ -1,6 +1,5 @@ import Check from '../Core/Check.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import loadCRN from '../Core/loadCRN.js'; import loadKTX from '../Core/loadKTX.js'; @@ -103,7 +102,7 @@ import Resource from '../Core/Resource.js'; DeveloperError.throwInstantiationError(); } - defineProperties(ImageryProvider.prototype, { + Object.defineProperties(ImageryProvider.prototype, { /** * Gets a value indicating whether or not the provider is ready for use. * @memberof ImageryProvider.prototype diff --git a/Source/Scene/ImagerySplitDirection.js b/Source/Scene/ImagerySplitDirection.js index 468da2ace576..c78f68b7eb79 100644 --- a/Source/Scene/ImagerySplitDirection.js +++ b/Source/Scene/ImagerySplitDirection.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}. @@ -32,4 +31,4 @@ import freezeObject from '../Core/freezeObject.js'; */ RIGHT : 1.0 }; -export default freezeObject(ImagerySplitDirection); +export default Object.freeze(ImagerySplitDirection); diff --git a/Source/Scene/ImageryState.js b/Source/Scene/ImageryState.js index fcbeabfaaef3..76a8eb62f21d 100644 --- a/Source/Scene/ImageryState.js +++ b/Source/Scene/ImageryState.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * @private @@ -13,4 +12,4 @@ import freezeObject from '../Core/freezeObject.js'; INVALID : 6, PLACEHOLDER : 7 }; -export default freezeObject(ImageryState); +export default Object.freeze(ImageryState); diff --git a/Source/Scene/Instanced3DModel3DTileContent.js b/Source/Scene/Instanced3DModel3DTileContent.js index 33e6558166df..0320563f50cf 100644 --- a/Source/Scene/Instanced3DModel3DTileContent.js +++ b/Source/Scene/Instanced3DModel3DTileContent.js @@ -4,7 +4,6 @@ import Color from '../Core/Color.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import deprecationWarning from '../Core/deprecationWarning.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; @@ -26,8 +25,8 @@ import ModelInstanceCollection from './ModelInstanceCollection.js'; /** * Represents the contents of a - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Instanced3DModel|Instanced 3D Model} - * tile in a {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles} tileset. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Instanced3DModel|Instanced 3D Model} + * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles} tileset. *

* Implements the {@link Cesium3DTileContent} interface. *

@@ -53,7 +52,7 @@ import ModelInstanceCollection from './ModelInstanceCollection.js'; // This can be overridden for testing purposes Instanced3DModel3DTileContent._deprecationWarning = deprecationWarning; - defineProperties(Instanced3DModel3DTileContent.prototype, { + Object.defineProperties(Instanced3DModel3DTileContent.prototype, { featuresLength : { get : function() { return this._batchTable.featuresLength; diff --git a/Source/Scene/InvertClassification.js b/Source/Scene/InvertClassification.js index dcfbb8e32f6d..a6f47b30e33d 100644 --- a/Source/Scene/InvertClassification.js +++ b/Source/Scene/InvertClassification.js @@ -1,6 +1,5 @@ import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import PixelFormat from '../Core/PixelFormat.js'; import ClearCommand from '../Renderer/ClearCommand.js'; @@ -63,7 +62,7 @@ import StencilOperation from './StencilOperation.js'; }; } - defineProperties(InvertClassification.prototype, { + Object.defineProperties(InvertClassification.prototype, { unclassifiedCommand : { get : function() { return this._unclassifiedCommand; diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js index e62ca19c93ee..1ec5a136a80c 100644 --- a/Source/Scene/IonImageryProvider.js +++ b/Source/Scene/IonImageryProvider.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import IonResource from '../Core/IonResource.js'; @@ -183,7 +182,7 @@ import WebMapTileServiceImageryProvider from './WebMapTileServiceImageryProvider }); } - defineProperties(IonImageryProvider.prototype, { + Object.defineProperties(IonImageryProvider.prototype, { /** * Gets a value indicating whether or not the provider is ready for use. * @memberof IonImageryProvider.prototype diff --git a/Source/Scene/IonWorldImageryStyle.js b/Source/Scene/IonWorldImageryStyle.js index b889774a13b1..c1f6a9d7b0af 100644 --- a/Source/Scene/IonWorldImageryStyle.js +++ b/Source/Scene/IonWorldImageryStyle.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; // Note, these values map directly to ion asset ids. @@ -32,4 +31,4 @@ import freezeObject from '../Core/freezeObject.js'; */ ROAD : 4 }; -export default freezeObject(IonWorldImageryStyle); +export default Object.freeze(IonWorldImageryStyle); diff --git a/Source/Scene/JobScheduler.js b/Source/Scene/JobScheduler.js index 4258abe3298b..38467b462197 100644 --- a/Source/Scene/JobScheduler.js +++ b/Source/Scene/JobScheduler.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import getTimestamp from '../Core/getTimestamp.js'; import JobType from './JobType.js'; @@ -33,7 +32,7 @@ import JobType from './JobType.js'; this.starvedLastFrame = false; } - defineProperties(JobTypeBudget.prototype, { + Object.defineProperties(JobTypeBudget.prototype, { total : { get : function() { return this._total; @@ -96,7 +95,7 @@ import JobType from './JobType.js'; // For unit testing JobScheduler.getTimestamp = getTimestamp; - defineProperties(JobScheduler.prototype, { + Object.defineProperties(JobScheduler.prototype, { totalBudget : { get : function() { return this._totalBudget; diff --git a/Source/Scene/JobType.js b/Source/Scene/JobType.js index eaa5410c2dbb..38fe3f6da705 100644 --- a/Source/Scene/JobType.js +++ b/Source/Scene/JobType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * @private @@ -9,4 +8,4 @@ import freezeObject from '../Core/freezeObject.js'; BUFFER : 2, NUMBER_OF_JOB_TYPES : 3 }; -export default freezeObject(JobType); +export default Object.freeze(JobType); diff --git a/Source/Scene/Label.js b/Source/Scene/Label.js index 44693c51c353..688e4eea6564 100644 --- a/Source/Scene/Label.js +++ b/Source/Scene/Label.js @@ -4,10 +4,8 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; -import freezeObject from '../Core/freezeObject.js'; import NearFarScalar from '../Core/NearFarScalar.js'; import Billboard from './Billboard.js'; import HeightReference from './HeightReference.js'; @@ -20,7 +18,7 @@ import VerticalOrigin from './VerticalOrigin.js'; var fontInfoCacheLength = 0; var fontInfoCacheMaxSize = 256; - var textTypes = freezeObject({ + var textTypes = Object.freeze({ LTR : 0, RTL : 1, WEAK : 2, @@ -186,7 +184,7 @@ import VerticalOrigin from './VerticalOrigin.js'; this._updateClamping(); } - defineProperties(Label.prototype, { + Object.defineProperties(Label.prototype, { /** * Determines if this label will be shown. Use this to hide or show a label, instead * of removing it and re-adding it to the collection. diff --git a/Source/Scene/LabelCollection.js b/Source/Scene/LabelCollection.js index ebf3bf4b82aa..fe92b9abdd43 100644 --- a/Source/Scene/LabelCollection.js +++ b/Source/Scene/LabelCollection.js @@ -3,7 +3,6 @@ import Cartesian2 from '../Core/Cartesian2.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Matrix4 from '../Core/Matrix4.js'; @@ -623,7 +622,7 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js'; this.blendOption = defaultValue(options.blendOption, BlendOption.OPAQUE_AND_TRANSLUCENT); } - defineProperties(LabelCollection.prototype, { + Object.defineProperties(LabelCollection.prototype, { /** * Returns the number of labels in this collection. This is commonly used with * {@link LabelCollection#get} to iterate over all the labels diff --git a/Source/Scene/LabelStyle.js b/Source/Scene/LabelStyle.js index 8c56bef9a9fa..ee798adabfb5 100644 --- a/Source/Scene/LabelStyle.js +++ b/Source/Scene/LabelStyle.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Describes how to draw a label. @@ -32,4 +31,4 @@ import freezeObject from '../Core/freezeObject.js'; */ FILL_AND_OUTLINE : 2 }; -export default freezeObject(LabelStyle); +export default Object.freeze(LabelStyle); diff --git a/Source/Scene/Light.js b/Source/Scene/Light.js index f3998d803b81..f09a908a4f83 100644 --- a/Source/Scene/Light.js +++ b/Source/Scene/Light.js @@ -1,4 +1,3 @@ -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; /** @@ -13,7 +12,7 @@ import DeveloperError from '../Core/DeveloperError.js'; function Light() { } - defineProperties(Light.prototype, { + Object.defineProperties(Light.prototype, { /** * The color of the light. * @memberof Light.prototype diff --git a/Source/Scene/MapMode2D.js b/Source/Scene/MapMode2D.js index 7e6f94fc11d1..2727ec072e58 100644 --- a/Source/Scene/MapMode2D.js +++ b/Source/Scene/MapMode2D.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Describes how the map will operate in 2D. @@ -22,4 +21,4 @@ import freezeObject from '../Core/freezeObject.js'; */ INFINITE_SCROLL : 1 }; -export default freezeObject(MapMode2D); +export default Object.freeze(MapMode2D); diff --git a/Source/Scene/MapboxImageryProvider.js b/Source/Scene/MapboxImageryProvider.js index 3f24235eb2db..8afea8d9147d 100644 --- a/Source/Scene/MapboxImageryProvider.js +++ b/Source/Scene/MapboxImageryProvider.js @@ -1,7 +1,6 @@ import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import MapboxApi from '../Core/MapboxApi.js'; import Resource from '../Core/Resource.js'; @@ -94,7 +93,7 @@ import UrlTemplateImageryProvider from './UrlTemplateImageryProvider.js'; }); } - defineProperties(MapboxImageryProvider.prototype, { + Object.defineProperties(MapboxImageryProvider.prototype, { /** * Gets the URL of the Mapbox server. * @memberof MapboxImageryProvider.prototype diff --git a/Source/Scene/MapboxStyleImageryProvider.js b/Source/Scene/MapboxStyleImageryProvider.js index 1c795d5810ff..2b3d91278f3c 100644 --- a/Source/Scene/MapboxStyleImageryProvider.js +++ b/Source/Scene/MapboxStyleImageryProvider.js @@ -1,7 +1,6 @@ import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import MapboxApi from '../Core/MapboxApi.js'; import Resource from '../Core/Resource.js'; @@ -99,7 +98,7 @@ function MapboxStyleImageryProvider(options) { }); } -defineProperties(MapboxStyleImageryProvider.prototype, { +Object.defineProperties(MapboxStyleImageryProvider.prototype, { /** * Gets the URL of the Mapbox server. * @memberof MapboxStyleImageryProvider.prototype diff --git a/Source/Scene/Material.js b/Source/Scene/Material.js index 91f950d5d022..59d00a89ce99 100644 --- a/Source/Scene/Material.js +++ b/Source/Scene/Material.js @@ -5,10 +5,8 @@ import combine from '../Core/combine.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; -import isArray from '../Core/isArray.js'; import loadCRN from '../Core/loadCRN.js'; import loadKTX from '../Core/loadKTX.js'; import Matrix2 from '../Core/Matrix2.js'; @@ -43,7 +41,7 @@ import when from '../ThirdParty/when.js'; * A Material defines surface appearance through a combination of diffuse, specular, * normal, emission, and alpha components. These values are specified using a * JSON schema called Fabric which gets parsed and assembled into glsl shader code - * behind-the-scenes. Check out the {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|wiki page} + * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page} * for more details on Fabric. *

* - - -
-

Match Highlighter Demo

-
- - - -

Search and highlight occurences of the selected text.

- -
diff --git a/ThirdParty/codemirror-4.6/doc/compress.html b/ThirdParty/codemirror-4.6/doc/compress.html deleted file mode 100644 index 4fdcc1331cda..000000000000 --- a/ThirdParty/codemirror-4.6/doc/compress.html +++ /dev/null @@ -1,289 +0,0 @@ - - -CodeMirror: Compression Helper - - - - - - - - -
- -

Script compression helper

- -

To optimize loading CodeMirror, especially when including a - bunch of different modes, it is recommended that you combine and - minify (and preferably also gzip) the scripts. This page makes - those first two steps very easy. Simply select the version and - scripts you need in the form below, and - click Compress to download the minified script - file.

- -
- -

Version:

- - - -

- with UglifyJS -

- -

Custom code to add to the compressed file:

-
- - - -
diff --git a/ThirdParty/codemirror-4.6/doc/logo.png b/ThirdParty/codemirror-4.6/doc/logo.png deleted file mode 100644 index 2334f5e09993..000000000000 Binary files a/ThirdParty/codemirror-4.6/doc/logo.png and /dev/null differ diff --git a/ThirdParty/codemirror-4.6/doc/logo.svg b/ThirdParty/codemirror-4.6/doc/logo.svg deleted file mode 100644 index 9783869c9c9c..000000000000 --- a/ThirdParty/codemirror-4.6/doc/logo.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - if (unit == "char") moveOnce(); else if (unit == "column") moveOnce(true); else if (unit == "word" || unit == "group") { var sawType = null, group = unit == "group"; for (var first = true;; first = false) { if (dir < 0 && !moveOnce(!first)) break; var cur = lineObj.text.charAt(ch) || "\n"; var type = isWordChar(cur) ? "w" : !group ? null : /\s/.test(cur) ? null : "p"; // punctuation if (sawType && sawType - - Code Mirror - - diff --git a/ThirdParty/codemirror-4.6/doc/releases.html b/ThirdParty/codemirror-4.6/doc/releases.html deleted file mode 100644 index f878850d3921..000000000000 --- a/ThirdParty/codemirror-4.6/doc/releases.html +++ /dev/null @@ -1,931 +0,0 @@ - - -CodeMirror: Release History - - - - - - -
- -

Release notes and version history

- -
- -

Version 4.x

- -

19-09-2014: Version 4.6:

- - - -

21-08-2014: Version 4.5:

- -
    -
  • Fix several serious bugs with horizontal scrolling
  • -
  • New mode: Slim
  • -
  • New command: goLineLeftSmart
  • -
  • More fixes and extensions for the Vim visual block mode
  • -
  • Full list of patches.
  • -
- -

21-07-2014: Version 4.4:

- -
    -
  • Note: Some events might now fire in slightly - different order ("change" is still guaranteed to fire - before "cursorActivity")
  • -
  • Nested operations in multiple editors are now synced (complete - at same time, reducing DOM reflows)
  • -
  • Visual block mode for vim (<C-v>) is nearly complete
  • -
  • New mode: Kotlin
  • -
  • Better multi-selection paste for text copied from multiple CodeMirror selections
  • -
  • Full list of patches.
  • -
- -

23-06-2014: Version 4.3:

- -
    -
  • Several vim bindings - improvements: search and exCommand history, global flag - for :substitute, :global command. -
  • Allow hiding the cursor by - setting cursorBlinkRate - to a negative value.
  • -
  • Make gutter markers themeable, use this in foldgutter.
  • -
  • Full list of patches.
  • -
- -

19-05-2014: Version 4.2:

- -
    -
  • Fix problem where some modes were broken by the fact that empty tokens were forbidden.
  • -
  • Several fixes to context menu handling.
  • -
  • On undo, scroll change, not cursor, into view.
  • -
  • Rewritten Jade mode.
  • -
  • Various improvements to Shell (support for more syntax) and Python (better indentation) modes.
  • -
  • New mode: Cypher.
  • -
  • New theme: Neo.
  • -
  • Support direct styling options (color, line style, width) in the rulers addon.
  • -
  • Recognize per-editor configuration for the show-hint and foldcode addons.
  • -
  • More intelligent scanning for existing close tags in closetag addon.
  • -
  • In the Vim bindings: Fix bracket matching, support case conversion in visual mode, visual paste, append action.
  • -
  • Full list of patches.
  • -
- -

22-04-2014: Version 4.1:

- -
    -
  • Slightly incompatible: - The "cursorActivity" - event now fires after all other events for the operation (and only - for handlers that were actually registered at the time the - activity happened).
  • -
  • New command: insertSoftTab.
  • -
  • New mode: Django.
  • -
  • Improved modes: Verilog (rewritten), Jinja2, Haxe, PHP (string interpolation highlighted), JavaScript (indentation of trailing else, template strings), LiveScript (multi-line strings).
  • -
  • Many small issues from the 3.x→4.x transition were found and fixed.
  • -
  • Full list of patches.
  • -
- -

20-03-2014: Version 4.0:

- -

This is a new major version of CodeMirror. There - are a few incompatible changes in the API. Upgrade - with care, and read the upgrading - guide.

- - - -
- -
- -

Version 3.x

- -

22-04-2014: Version 3.24:

- -

Merges the improvements from 4.1 that could - easily be applied to the 3.x code. Also improves the way the editor - size is updated when line widgets change.

- -

20-03-2014: Version 3.23:

- -
    -
  • In the XML mode, - add brackets style to angle brackets, fix - case-sensitivity of tags for HTML.
  • -
  • New mode: Dylan.
  • -
  • Many improvements to the Vim bindings.
  • -
- -

21-02-2014: Version 3.22:

- - - -

16-01-2014: Version 3.21:

- -
    -
  • Auto-indenting a block will no longer add trailing whitespace to blank lines. -
  • Marking text has a new option clearWhenEmpty to control auto-removal.
  • -
  • Several bugfixes in the handling of bidirectional text.
  • -
  • The XML and CSS modes were largely rewritten. LESS support was added to the CSS mode.
  • -
  • The OCaml mode was moved to an mllike mode, F# support added.
  • -
  • Make it possible to fetch multiple applicable helper values with getHelpers, and to register helpers matched on predicates with registerGlobalHelper.
  • -
  • New theme pastel-on-dark.
  • -
  • Better ECMAScript 6 support in JavaScript mode.
  • -
  • Full list of patches.
  • -
- -

21-11-2013: Version 3.20:

- - - -

21-10-2013: Version 3.19:

- - - -

23-09-2013: Version 3.18:

- -

Emergency release to fix a problem in 3.17 - where .setOption("lineNumbers", false) would raise an - error.

- -

23-09-2013: Version 3.17:

- - - -

21-08-2013: Version 3.16:

- - - -

29-07-2013: Version 3.15:

- - - -

20-06-2013: Version 3.14:

- - - -

20-05-2013: Version 3.13:

- - - -

19-04-2013: Version 3.12:

- - - -

20-03-2013: Version 3.11:

- - - -

21-02-2013: Version 3.1:

- - - - -

25-01-2013: Version 3.02:

- -

Single-bugfix release. Fixes a problem that - prevents CodeMirror instances from being garbage-collected after - they become unused.

- -

21-01-2013: Version 3.01:

- - - -

10-12-2012: Version 3.0:

- -

New major version. Only - partially backwards-compatible. See - the upgrading guide for more - information. Changes since release candidate 2:

- -
    -
  • Rewritten VIM mode.
  • -
  • Fix a few minor scrolling and sizing issues.
  • -
  • Work around Safari segfault when dragging.
  • -
  • Full list of patches.
  • -
- -

20-11-2012: Version 3.0, release candidate 2:

- -
    -
  • New mode: HTTP.
  • -
  • Improved handling of selection anchor position.
  • -
  • Improve IE performance on longer lines.
  • -
  • Reduce gutter glitches during horiz. scrolling.
  • -
  • Add addKeyMap and removeKeyMap methods.
  • -
  • Rewrite formatting and closetag add-ons.
  • -
  • Full list of patches.
  • -
- -

20-11-2012: Version 3.0, release candidate 1:

- - - -

22-10-2012: Version 3.0, beta 2:

- -
    -
  • Fix page-based coordinate computation.
  • -
  • Fix firing of gutterClick event.
  • -
  • Add cursorHeight option.
  • -
  • Fix bi-directional text regression.
  • -
  • Add viewportMargin option.
  • -
  • Directly handle mousewheel events (again, hopefully better).
  • -
  • Make vertical cursor movement more robust (through widgets, big line gaps).
  • -
  • Add flattenSpans option.
  • -
  • Many optimizations. Poor responsiveness should be fixed.
  • -
  • Initialization in hidden state works again.
  • -
  • Full list of patches.
  • -
- -

19-09-2012: Version 3.0, beta 1:

- -
    -
  • Bi-directional text support.
  • -
  • More powerful gutter model.
  • -
  • Support for arbitrary text/widget height.
  • -
  • In-line widgets.
  • -
  • Generalized event handling.
  • -
- -
- -
- -

Version 2.x

- -

21-01-2013: Version 2.38:

- -

Integrate some bugfixes, enhancements to the vim keymap, and new - modes - (D, Sass, APL) - from the v3 branch.

- -

20-12-2012: Version 2.37:

- -
    -
  • New mode: SQL (will replace plsql and mysql modes).
  • -
  • Further work on the new VIM mode.
  • -
  • Fix Cmd/Ctrl keys on recent Operas on OS X.
  • -
  • Full list of patches.
  • -
- -

20-11-2012: Version 2.36:

- - - -

22-10-2012: Version 2.35:

- -
    -
  • New (sub) mode: TypeScript.
  • -
  • Don't overwrite (insert key) when pasting.
  • -
  • Fix several bugs in markText/undo interaction.
  • -
  • Better indentation of JavaScript code without semicolons.
  • -
  • Add defineInitHook function.
  • -
  • Full list of patches.
  • -
- -

19-09-2012: Version 2.34:

- -
    -
  • New mode: Common Lisp.
  • -
  • Fix right-click select-all on most browsers.
  • -
  • Change the way highlighting happens:
      Saves memory and CPU cycles.
      compareStates is no longer needed.
      onHighlightComplete no longer works.
  • -
  • Integrate mode (Markdown, XQuery, CSS, sTex) tests in central testsuite.
  • -
  • Add a CodeMirror.version property.
  • -
  • More robust handling of nested modes in formatting and closetag plug-ins.
  • -
  • Un/redo now preserves marked text and bookmarks.
  • -
  • Full list of patches.
  • -
- -

23-08-2012: Version 2.33:

- -
    -
  • New mode: Sieve.
  • -
  • New getViewPort and onViewportChange API.
  • -
  • Configurable cursor blink rate.
  • -
  • Make binding a key to false disabling handling (again).
  • -
  • Show non-printing characters as red dots.
  • -
  • More tweaks to the scrolling model.
  • -
  • Expanded testsuite. Basic linter added.
  • -
  • Remove most uses of innerHTML. Remove CodeMirror.htmlEscape.
  • -
  • Full list of patches.
  • -
- -

23-07-2012: Version 2.32:

- -

Emergency fix for a bug where an editor with - line wrapping on IE will break when there is no - scrollbar.

- -

20-07-2012: Version 2.31:

- - - -

22-06-2012: Version 2.3:

- -
    -
  • New scrollbar implementation. Should flicker less. Changes DOM structure of the editor.
  • -
  • New theme: vibrant-ink.
  • -
  • Many extensions to the VIM keymap (including text objects).
  • -
  • Add mode-multiplexing utility script.
  • -
  • Fix bug where right-click paste works in read-only mode.
  • -
  • Add a getScrollInfo method.
  • -
  • Lots of other fixes.
  • -
- -

23-05-2012: Version 2.25:

- -
    -
  • New mode: Erlang.
  • -
  • Remove xmlpure mode (use xml.js).
  • -
  • Fix line-wrapping in Opera.
  • -
  • Fix X Windows middle-click paste in Chrome.
  • -
  • Fix bug that broke pasting of huge documents.
  • -
  • Fix backspace and tab key repeat in Opera.
  • -
- -

23-04-2012: Version 2.24:

- -
    -
  • Drop support for Internet Explorer 6.
  • -
  • New - modes: Shell, Tiki - wiki, Pig Latin.
  • -
  • New themes: Ambiance, Blackboard.
  • -
  • More control over drag/drop - with dragDrop - and onDragEvent - options.
  • -
  • Make HTML mode a bit less pedantic.
  • -
  • Add compoundChange API method.
  • -
  • Several fixes in undo history and line hiding.
  • -
  • Remove (broken) support for catchall in key maps, - add nofallthrough boolean field instead.
  • -
- -

26-03-2012: Version 2.23:

- -
    -
  • Change default binding for tab [more] - -
  • -
  • New modes: XQuery and VBScript.
  • -
  • Two new themes: lesser-dark and xq-dark.
  • -
  • Differentiate between background and text styles in setLineClass.
  • -
  • Fix drag-and-drop in IE9+.
  • -
  • Extend charCoords - and cursorCoords with a mode argument.
  • -
  • Add autofocus option.
  • -
  • Add findMarksAt method.
  • -
- -

27-02-2012: Version 2.22:

- - - -

27-01-2012: Version 2.21:

- -
    -
  • Added LESS, MySQL, - Go, and Verilog modes.
  • -
  • Add smartIndent - option.
  • -
  • Support a cursor in readOnly-mode.
  • -
  • Support assigning multiple styles to a token.
  • -
  • Use a new approach to drawing the selection.
  • -
  • Add scrollTo method.
  • -
  • Allow undo/redo events to span non-adjacent lines.
  • -
  • Lots and lots of bugfixes.
  • -
- -

20-12-2011: Version 2.2:

- - - -

21-11-2011: Version 2.18:

-

Fixes TextMarker.clear, which is broken in 2.17.

- -

21-11-2011: Version 2.17:

-
    -
  • Add support for line - wrapping and code - folding.
  • -
  • Add Github-style Markdown mode.
  • -
  • Add Monokai - and Rubyblue themes.
  • -
  • Add setBookmark method.
  • -
  • Move some of the demo code into reusable components - under lib/util.
  • -
  • Make screen-coord-finding code faster and more reliable.
  • -
  • Fix drag-and-drop in Firefox.
  • -
  • Improve support for IME.
  • -
  • Speed up content rendering.
  • -
  • Fix browser's built-in search in Webkit.
  • -
  • Make double- and triple-click work in IE.
  • -
  • Various fixes to modes.
  • -
- -

27-10-2011: Version 2.16:

-
    -
  • Add Perl, Rust, TiddlyWiki, and Groovy modes.
  • -
  • Dragging text inside the editor now moves, rather than copies.
  • -
  • Add a coordsFromIndex method.
  • -
  • API change: setValue now no longer clears history. Use clearHistory for that.
  • -
  • API change: markText now - returns an object with clear and find - methods. Marked text is now more robust when edited.
  • -
  • Fix editing code with tabs in Internet Explorer.
  • -
- -

26-09-2011: Version 2.15:

-

Fix bug that snuck into 2.14: Clicking the - character that currently has the cursor didn't re-focus the - editor.

- -

26-09-2011: Version 2.14:

- - - -

23-08-2011: Version 2.13:

- - -

25-07-2011: Version 2.12:

-
    -
  • Add a SPARQL mode.
  • -
  • Fix bug with cursor jumping around in an unfocused editor in IE.
  • -
  • Allow key and mouse events to bubble out of the editor. Ignore widget clicks.
  • -
  • Solve cursor flakiness after undo/redo.
  • -
  • Fix block-reindent ignoring the last few lines.
  • -
  • Fix parsing of multi-line attrs in XML mode.
  • -
  • Use innerHTML for HTML-escaping.
  • -
  • Some fixes to indentation in C-like mode.
  • -
  • Shrink horiz scrollbars when long lines removed.
  • -
  • Fix width feedback loop bug that caused the width of an inner DIV to shrink.
  • -
- -

04-07-2011: Version 2.11:

-
    -
  • Add a Scheme mode.
  • -
  • Add a replace method to search cursors, for cursor-preserving replacements.
  • -
  • Make the C-like mode mode more customizable.
  • -
  • Update XML mode to spot mismatched tags.
  • -
  • Add getStateAfter API and compareState mode API methods for finer-grained mode magic.
  • -
  • Add a getScrollerElement API method to manipulate the scrolling DIV.
  • -
  • Fix drag-and-drop for Firefox.
  • -
  • Add a C# configuration for the C-like mode.
  • -
  • Add full-screen editing and mode-changing demos.
  • -
- -

07-06-2011: Version 2.1:

-

Add - a theme system - (demo). Note that this is not - backwards-compatible—you'll have to update your styles and - modes!

- -

07-06-2011: Version 2.02:

-
    -
  • Add a Lua mode.
  • -
  • Fix reverse-searching for a regexp.
  • -
  • Empty lines can no longer break highlighting.
  • -
  • Rework scrolling model (the outer wrapper no longer does the scrolling).
  • -
  • Solve horizontal jittering on long lines.
  • -
  • Add runmode.js.
  • -
  • Immediately re-highlight text when typing.
  • -
  • Fix problem with 'sticking' horizontal scrollbar.
  • -
- -

26-05-2011: Version 2.01:

-
    -
  • Add a Smalltalk mode.
  • -
  • Add a reStructuredText mode.
  • -
  • Add a Python mode.
  • -
  • Add a PL/SQL mode.
  • -
  • coordsChar now works
  • -
  • Fix a problem where onCursorActivity interfered with onChange.
  • -
  • Fix a number of scrolling and mouse-click-position glitches.
  • -
  • Pass information about the changed lines to onChange.
  • -
  • Support cmd-up/down on OS X.
  • -
  • Add triple-click line selection.
  • -
  • Don't handle shift when changing the selection through the API.
  • -
  • Support "nocursor" mode for readOnly option.
  • -
  • Add an onHighlightComplete option.
  • -
  • Fix the context menu for Firefox.
  • -
- -

28-03-2011: Version 2.0:

-

CodeMirror 2 is a complete rewrite that's - faster, smaller, simpler to use, and less dependent on browser - quirks. See this - and this - for more information.

- -

22-02-2011: Version 2.0 beta 2:

-

Somewhat more mature API, lots of bugs shaken out.

- -

17-02-2011: Version 0.94:

-
    -
  • tabMode: "spaces" was modified slightly (now indents when something is selected).
  • -
  • Fixes a bug that would cause the selection code to break on some IE versions.
  • -
  • Disabling spell-check on WebKit browsers now works.
  • -
- -

08-02-2011: Version 2.0 beta 1:

-

CodeMirror 2 is a complete rewrite of - CodeMirror, no longer depending on an editable frame.

- -

19-01-2011: Version 0.93:

-
    -
  • Added a Regular Expression parser.
  • -
  • Fixes to the PHP parser.
  • -
  • Support for regular expression in search/replace.
  • -
  • Add save method to instances created with fromTextArea.
  • -
  • Add support for MS T-SQL in the SQL parser.
  • -
  • Support use of CSS classes for highlighting brackets.
  • -
  • Fix yet another hang with line-numbering in hidden editors.
  • -
-
- -
- -

Version 0.x

- -

28-03-2011: Version 1.0:

-
    -
  • Fix error when debug history overflows.
  • -
  • Refine handling of C# verbatim strings.
  • -
  • Fix some issues with JavaScript indentation.
  • -
- -

17-12-2010: Version 0.92:

-
    -
  • Make CodeMirror work in XHTML documents.
  • -
  • Fix bug in handling of backslashes in Python strings.
  • -
  • The styleNumbers option is now officially - supported and documented.
  • -
  • onLineNumberClick option added.
  • -
  • More consistent names onLoad and - onCursorActivity callbacks. Old names still work, but - are deprecated.
  • -
  • Add a Freemarker mode.
  • -
- -

11-11-2010: Version 0.91:

-
    -
  • Adds support for Java.
  • -
  • Small additions to the PHP and SQL parsers.
  • -
  • Work around various Webkit issues.
  • -
  • Fix toTextArea to update the code in the textarea.
  • -
  • Add a noScriptCaching option (hack to ease development).
  • -
  • Make sub-modes of HTML mixed mode configurable.
  • -
- -

02-10-2010: Version 0.9:

-
    -
  • Add support for searching backwards.
  • -
  • There are now parsers for Scheme, XQuery, and OmetaJS.
  • -
  • Makes height: "dynamic" more robust.
  • -
  • Fixes bug where paste did not work on OS X.
  • -
  • Add a enterMode and electricChars options to make indentation even more customizable.
  • -
  • Add firstLineNumber option.
  • -
  • Fix bad handling of @media rules by the CSS parser.
  • -
  • Take a new, more robust approach to working around the invisible-last-line bug in WebKit.
  • -
- -

22-07-2010: Version 0.8:

-
    -
  • Add a cursorCoords method to find the screen - coordinates of the cursor.
  • -
  • A number of fixes and support for more syntax in the PHP parser.
  • -
  • Fix indentation problem with JSON-mode JS parser in Webkit.
  • -
  • Add a minification UI.
  • -
  • Support a height: dynamic mode, where the editor's - height will adjust to the size of its content.
  • -
  • Better support for IME input mode.
  • -
  • Fix JavaScript parser getting confused when seeing a no-argument - function call.
  • -
  • Have CSS parser see the difference between selectors and other - identifiers.
  • -
  • Fix scrolling bug when pasting in a horizontally-scrolled - editor.
  • -
  • Support toTextArea method in instances created with - fromTextArea.
  • -
  • Work around new Opera cursor bug that causes the cursor to jump - when pressing backspace at the end of a line.
  • -
- -

27-04-2010: Version - 0.67:

-

More consistent page-up/page-down behaviour - across browsers. Fix some issues with hidden editors looping forever - when line-numbers were enabled. Make PHP parser parse - "\\" correctly. Have jumpToLine work on - line handles, and add cursorLine function to fetch the - line handle where the cursor currently is. Add new - setStylesheet function to switch style-sheets in a - running editor.

- -

01-03-2010: Version - 0.66:

-

Adds removeLine method to API. - Introduces the PLSQL parser. - Marks XML errors by adding (rather than replacing) a CSS class, so - that they can be disabled by modifying their style. Fixes several - selection bugs, and a number of small glitches.

- -

12-11-2009: Version - 0.65:

-

Add support for having both line-wrapping and - line-numbers turned on, make paren-highlighting style customisable - (markParen and unmarkParen config - options), work around a selection bug that Opera - reintroduced in version 10.

- -

23-10-2009: Version - 0.64:

-

Solves some issues introduced by the - paste-handling changes from the previous release. Adds - setSpellcheck, setTextWrapping, - setIndentUnit, setUndoDepth, - setTabMode, and setLineNumbers to - customise a running editor. Introduces an SQL parser. Fixes a few small - problems in the Python - parser. And, as usual, add workarounds for various newly discovered - browser incompatibilities.

- -

31-08-2009: Version 0.63:

-

Overhaul of paste-handling (less fragile), fixes for several - serious IE8 issues (cursor jumping, end-of-document bugs) and a number - of small problems.

- -

30-05-2009: Version 0.62:

-

Introduces Python - and Lua parsers. Add - setParser (on-the-fly mode changing) and - clearHistory methods. Make parsing passes time-based - instead of lines-based (see the passTime option).

- -
-
diff --git a/ThirdParty/codemirror-4.6/lib/codemirror.js b/ThirdParty/codemirror-4.6/lib/codemirror.js deleted file mode 100644 index 97f6668e73fd..000000000000 --- a/ThirdParty/codemirror-4.6/lib/codemirror.js +++ /dev/null @@ -1,7831 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// This is CodeMirror (http://codemirror.net), a code editor -// implemented in JavaScript on top of the browser's DOM. -// -// You can find some technical background for some of the code below -// at http://marijnhaverbeke.nl/blog/#cm-internals . - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - module.exports = mod(); - else if (typeof define == "function" && define.amd) // AMD - return define([], mod); - else // Plain browser env - this.CodeMirror = mod(); -})(function() { - "use strict"; - - // BROWSER SNIFFING - - // Kludges for bugs and behavior differences that can't be feature - // detected are enabled based on userAgent etc sniffing. - - var gecko = /gecko\/\d/i.test(navigator.userAgent); - // ie_uptoN means Internet Explorer version N or lower - var ie_upto10 = /MSIE \d/.test(navigator.userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); - var ie = ie_upto10 || ie_11up; - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); - var webkit = /WebKit\//.test(navigator.userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); - var chrome = /Chrome\//.test(navigator.userAgent); - var presto = /Opera\//.test(navigator.userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var khtml = /KHTML\//.test(navigator.userAgent); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); - var phantom = /PhantomJS/.test(navigator.userAgent); - - var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); - // This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent); - var mac = ios || /Mac/.test(navigator.platform); - var windows = /win/i.test(navigator.platform); - - var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/); - if (presto_version) presto_version = Number(presto_version[1]); - if (presto_version && presto_version >= 15) { presto = false; webkit = true; } - // Some browsers use the wrong event properties to signal cmd/ctrl on OS X - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || (ie && ie_version >= 9); - - // Optimize some code when these features are not used. - var sawReadOnlySpans = false, sawCollapsedSpans = false; - - // EDITOR CONSTRUCTOR - - // A CodeMirror instance represents an editor. This is the object - // that user code is usually dealing with. - - function CodeMirror(place, options) { - if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); - - this.options = options = options || {}; - // Determine effective options based on given values and defaults. - copyObj(defaults, options, false); - setGuttersForLineNumbers(options); - - var doc = options.value; - if (typeof doc == "string") doc = new Doc(doc, options.mode); - this.doc = doc; - - var display = this.display = new Display(place, doc); - display.wrapper.CodeMirror = this; - updateGutters(this); - themeChanged(this); - if (options.lineWrapping) - this.display.wrapper.className += " CodeMirror-wrap"; - if (options.autofocus && !mobile) focusInput(this); - - this.state = { - keyMaps: [], // stores maps added by addKeyMap - overlays: [], // highlighting overlays, as added by addOverlay - modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info - overwrite: false, focused: false, - suppressEdits: false, // used to disable editing during key handlers when in readOnly mode - pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in readInput - draggingText: false, - highlight: new Delayed() // stores highlight worker timeout - }; - - // Override magic textarea content restore that IE sometimes does - // on our hidden textarea on reload - if (ie && ie_version < 11) setTimeout(bind(resetInput, this, true), 20); - - registerEventHandlers(this); - ensureGlobalHandlers(); - - var cm = this; - runInOp(this, function() { - cm.curOp.forceUpdate = true; - attachDoc(cm, doc); - - if ((options.autofocus && !mobile) || activeElt() == display.input) - setTimeout(bind(onFocus, cm), 20); - else - onBlur(cm); - - for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) - optionHandlers[opt](cm, options[opt], Init); - maybeUpdateLineNumberWidth(cm); - for (var i = 0; i < initHooks.length; ++i) initHooks[i](cm); - }); - } - - // DISPLAY CONSTRUCTOR - - // The display handles the DOM integration, both for input reading - // and content drawing. It holds references to DOM nodes and - // display-related state. - - function Display(place, doc) { - var d = this; - - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); - // The textarea is kept positioned near the cursor to prevent the - // fact that it'll be scrolled into view on input from scrolling - // our fake cursor out of view. On webkit, when wrap=off, paste is - // very slow. So make the area wide instead. - if (webkit) input.style.width = "1000px"; - else input.setAttribute("wrap", "off"); - // If border: 0; -- iOS fails to open keyboard (issue #1287) - if (ios) input.style.border = "1px solid black"; - input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); input.setAttribute("spellcheck", "false"); - - // Wraps and hides input textarea - d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - // The fake scrollbar elements. - d.scrollbarH = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); - d.scrollbarV = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); - // Covers bottom-right square when both scrollbars are present. - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - // Covers bottom of gutter when coverGutterNextToScrollbar is on - // and h scrollbar is present. - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - // Will contain the actual code, positioned to cover the viewport. - d.lineDiv = elt("div", null, "CodeMirror-code"); - // Elements are added to these to represent selection and cursors. - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - // A visibility: hidden element used to find the size of things. - d.measure = elt("div", null, "CodeMirror-measure"); - // When lines outside of the viewport are measured, they are drawn in this. - d.lineMeasure = elt("div", null, "CodeMirror-measure"); - // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], - null, "position: relative; outline: none"); - // Moved around its parent to cover visible view. - d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); - // Set to the height of the document, allowing scrolling. - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - // Behavior of elts with overflow: auto and padding is - // inconsistent across browsers. This is used to ensure the - // scrollable area is big enough. - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerCutOff + "px; width: 1px;"); - // Will contain the gutters, if any. - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - // Actual scrollable element. - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - // The element in which the editor lives. - d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV, - d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - - // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } - // Needed to hide big blue blinking cursor on Mobile Safari - if (ios) input.style.width = "0px"; - if (!webkit) d.scroller.draggable = true; - // Needed to handle Tab key in KHTML - if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; } - // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = "18px"; - - if (place.appendChild) place.appendChild(d.wrapper); - else place(d.wrapper); - - // Current rendered range (may be bigger than the view window). - d.viewFrom = d.viewTo = doc.first; - // Information about the rendered lines. - d.view = []; - // Holds info about a single rendered line when it was rendered - // for measurement, while not in view. - d.externalMeasured = null; - // Empty space (in pixels) above the view - d.viewOffset = 0; - d.lastSizeC = 0; - d.updateLineNumbers = null; - - // Used to only resize the line number gutter when necessary (when - // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - // See readInput and resetInput - d.prevInput = ""; - // Set to true when a non-horizontal-scrolling line widget is - // added. As an optimization, line widget aligning is skipped when - // this is false. - d.alignWidgets = false; - // Flag that indicates whether we expect input to appear real soon - // now (after some event like 'keypress' or 'input') and are - // polling intensively. - d.pollingFast = false; - // Self-resetting timeout for the poller - d.poll = new Delayed(); - - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - - // Tracks when resetInput has punted to just putting a short - // string into the textarea instead of the full selection. - d.inaccurateSelection = false; - - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - d.maxLine = null; - d.maxLineLength = 0; - d.maxLineChanged = false; - - // Used for measuring wheel scrolling granularity - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - - // True when shift is held down. - d.shift = false; - - // Used to track whether anything happened since the context menu - // was opened. - d.selForContextMenu = null; - } - - // STATE UPDATES - - // Used to get the editor into a consistent state again when options change. - - function loadMode(cm) { - cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); - resetModeState(cm); - } - - function resetModeState(cm) { - cm.doc.iter(function(line) { - if (line.stateAfter) line.stateAfter = null; - if (line.styles) line.styles = null; - }); - cm.doc.frontier = cm.doc.first; - startWorker(cm, 100); - cm.state.modeGen++; - if (cm.curOp) regChange(cm); - } - - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap"); - cm.display.sizer.style.minWidth = ""; - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap"); - findMaxLine(cm); - } - estimateLineHeights(cm); - regChange(cm); - clearCaches(cm); - setTimeout(function(){updateScrollbars(cm);}, 100); - } - - // Returns a function that estimates the height of a line, to use as - // first approximation until the line becomes visible (and is thus - // properly measurable). - function estimateHeight(cm) { - var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); - return function(line) { - if (lineIsHidden(cm.doc, line)) return 0; - - var widgetsHeight = 0; - if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { - if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; - } - - if (wrapping) - return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; - else - return widgetsHeight + th; - }; - } - - function estimateLineHeights(cm) { - var doc = cm.doc, est = estimateHeight(cm); - doc.iter(function(line) { - var estHeight = est(line); - if (estHeight != line.height) updateLineHeight(line, estHeight); - }); - } - - function keyMapChanged(cm) { - var map = keyMap[cm.options.keyMap], style = map.style; - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") + - (style ? " cm-keymap-" + style : ""); - } - - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - - function guttersChanged(cm) { - updateGutters(cm); - regChange(cm); - setTimeout(function(){alignHorizontally(cm);}, 20); - } - - // Rebuild the gutter elements, ensure the margin to the left of the - // code matches their width. - function updateGutters(cm) { - var gutters = cm.display.gutters, specs = cm.options.gutters; - removeChildren(gutters); - for (var i = 0; i < specs.length; ++i) { - var gutterClass = specs[i]; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); - if (gutterClass == "CodeMirror-linenumbers") { - cm.display.lineGutter = gElt; - gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = i ? "" : "none"; - updateGutterSpace(cm); - } - - function updateGutterSpace(cm) { - var width = cm.display.gutters.offsetWidth; - cm.display.sizer.style.marginLeft = width + "px"; - cm.display.scrollbarH.style.left = cm.options.fixedGutter ? width + "px" : 0; - } - - // Compute the character length of a line, taking into account - // collapsed ranges (see markText) that might hide parts, and join - // other lines onto it. - function lineLength(line) { - if (line.height == 0) return 0; - var len = line.text.length, merged, cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true); - cur = found.from.line; - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found = merged.find(0, true); - len -= cur.text.length - found.from.ch; - cur = found.to.line; - len += cur.text.length - found.to.ch; - } - return len; - } - - // Find the longest line in the document. - function findMaxLine(cm) { - var d = cm.display, doc = cm.doc; - d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(d.maxLine); - d.maxLineChanged = true; - doc.iter(function(line) { - var len = lineLength(line); - if (len > d.maxLineLength) { - d.maxLineLength = len; - d.maxLine = line; - } - }); - } - - // Make sure the gutters options contains the element - // "CodeMirror-linenumbers" when the lineNumbers option is true. - function setGuttersForLineNumbers(options) { - var found = indexOf(options.gutters, "CodeMirror-linenumbers"); - if (found == -1 && options.lineNumbers) { - options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); - } else if (found > -1 && !options.lineNumbers) { - options.gutters = options.gutters.slice(0); - options.gutters.splice(found, 1); - } - } - - // SCROLLBARS - - function hScrollbarTakesSpace(cm) { - return cm.display.scroller.clientHeight - cm.display.wrapper.clientHeight < scrollerCutOff - 3; - } - - // Prepare DOM reads needed to update the scrollbars. Done in one - // shot to minimize update/measure roundtrips. - function measureForScrollbars(cm) { - var scroll = cm.display.scroller; - return { - clientHeight: scroll.clientHeight, - barHeight: cm.display.scrollbarV.clientHeight, - scrollWidth: scroll.scrollWidth, clientWidth: scroll.clientWidth, - hScrollbarTakesSpace: hScrollbarTakesSpace(cm), - barWidth: cm.display.scrollbarH.clientWidth, - docHeight: Math.round(cm.doc.height + paddingVert(cm.display)) - }; - } - - // Re-synchronize the fake scrollbars with the actual size of the - // content. - function updateScrollbars(cm, measure) { - if (!measure) measure = measureForScrollbars(cm); - var d = cm.display, sWidth = scrollbarWidth(d.measure); - var scrollHeight = measure.docHeight + scrollerCutOff; - var needsH = measure.scrollWidth > measure.clientWidth; - if (needsH && measure.scrollWidth <= measure.clientWidth + 1 && - sWidth > 0 && !measure.hScrollbarTakesSpace) - needsH = false; // (Issue #2562) - var needsV = scrollHeight > measure.clientHeight; - - if (needsV) { - d.scrollbarV.style.display = "block"; - d.scrollbarV.style.bottom = needsH ? sWidth + "px" : "0"; - // A bug in IE8 can cause this value to be negative, so guard it. - d.scrollbarV.firstChild.style.height = - Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + "px"; - } else { - d.scrollbarV.style.display = ""; - d.scrollbarV.firstChild.style.height = "0"; - } - if (needsH) { - d.scrollbarH.style.display = "block"; - d.scrollbarH.style.right = needsV ? sWidth + "px" : "0"; - d.scrollbarH.firstChild.style.width = - (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + "px"; - } else { - d.scrollbarH.style.display = ""; - d.scrollbarH.firstChild.style.width = "0"; - } - if (needsH && needsV) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + "px"; - } else d.scrollbarFiller.style.display = ""; - if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = sWidth + "px"; - d.gutterFiller.style.width = d.gutters.offsetWidth + "px"; - } else d.gutterFiller.style.display = ""; - - if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) { - if (sWidth === 0) { - var w = mac && !mac_geMountainLion ? "12px" : "18px"; - d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w; - var barMouseDown = function(e) { - if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH) - operation(cm, onMouseDown)(e); - }; - on(d.scrollbarV, "mousedown", barMouseDown); - on(d.scrollbarH, "mousedown", barMouseDown); - } - cm.state.checkedOverlayScrollbar = true; - } - } - - // Compute the lines that are visible in a given viewport (defaults - // the the current scroll position). viewport may contain top, - // height, and ensure (see op.scrollToPos) properties. - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; - top = Math.floor(top - paddingTop(display)); - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - - var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); - // Ensure is a {from: {line, ch}, to: {line, ch}} object, and - // forces those lines into the viewport (if possible). - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; - if (ensureFrom < from) - return {from: ensureFrom, - to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)}; - if (Math.min(ensureTo, doc.lastLine()) >= to) - return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight), - to: ensureTo}; - } - return {from: from, to: Math.max(to, from + 1)}; - } - - // LINE NUMBERS - - // Re-align line numbers and gutter marks to compensate for - // horizontal scrolling. - function alignHorizontally(cm) { - var display = cm.display, view = display.view; - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, left = comp + "px"; - for (var i = 0; i < view.length; i++) if (!view[i].hidden) { - if (cm.options.fixedGutter && view[i].gutter) - view[i].gutter.style.left = left; - var align = view[i].alignable; - if (align) for (var j = 0; j < align.length; j++) - align[j].style.left = left; - } - if (cm.options.fixedGutter) - display.gutters.style.left = (comp + gutterW) + "px"; - } - - // Used to ensure that the line number gutter is still the right - // size for the current document size. Returns true when an update - // is needed. - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) return false; - var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding); - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - updateGutterSpace(cm); - return true; - } - return false; - } - - function lineNumberFor(options, i) { - return String(options.lineNumberFormatter(i + options.firstLineNumber)); - } - - // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, - // but using getBoundingClientRect to get a sub-pixel-accurate - // result. - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; - } - - // DISPLAY DRAWING - - function DisplayUpdate(cm, viewport, force) { - var display = cm.display; - - this.viewport = viewport; - // Store some values that we'll need later (but don't want to force a relayout for) - this.visible = visibleLines(display, cm.doc, viewport); - this.editorIsHidden = !display.wrapper.offsetWidth; - this.wrapperHeight = display.wrapper.clientHeight; - this.oldViewFrom = display.viewFrom; this.oldViewTo = display.viewTo; - this.oldScrollerWidth = display.scroller.clientWidth; - this.force = force; - this.dims = getDimensions(cm); - } - - // Does the actual updating of the line display. Bails out - // (returning false) when there is nothing to be done and forced is - // false. - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc; - if (update.editorIsHidden) { - resetView(cm); - return false; - } - - // Bail out if the visible area is already rendered and nothing changed. - if (!update.force && - update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && - countDirtyView(cm) == 0) - return false; - - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm); - update.dims = getDimensions(cm); - } - - // Compute a suitable new viewport (from & to) - var end = doc.first + doc.size; - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, update.visible.to + cm.options.viewportMargin); - if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); - if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); - } - - var different = from != display.viewFrom || to != display.viewTo || - display.lastSizeC != update.wrapperHeight; - adjustView(cm, from, to); - - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); - // Position the mover div to align with the current scroll position - cm.display.mover.style.top = display.viewOffset + "px"; - - var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !update.force && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) - return false; - - // For big changes, we hide the enclosing element during the - // update, since that speeds up the operations on most browsers. - var focused = activeElt(); - if (toUpdate > 4) display.lineDiv.style.display = "none"; - patchDisplay(cm, display.updateLineNumbers, update.dims); - if (toUpdate > 4) display.lineDiv.style.display = ""; - // There might have been a widget with a focused element that got - // hidden or updated, if so re-focus it. - if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); - - // Prevent selection and cursors from interfering with the scroll - // width. - removeChildren(display.cursorDiv); - removeChildren(display.selectionDiv); - - if (different) { - display.lastSizeC = update.wrapperHeight; - startWorker(cm, 400); - } - - display.updateLineNumbers = null; - - return true; - } - - function postUpdateDisplay(cm, update) { - var force = update.force, viewport = update.viewport; - for (var first = true;; first = false) { - if (first && cm.options.lineWrapping && update.oldScrollerWidth != cm.display.scroller.clientWidth) { - force = true; - } else { - force = false; - // Clip forced viewport to actual scrollable area. - if (viewport && viewport.top != null) - viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - scrollerCutOff - - cm.display.scroller.clientHeight, viewport.top)}; - // Updated line heights might result in the drawn area not - // actually covering the viewport. Keep looping until it does. - update.visible = visibleLines(cm.display, cm.doc, viewport); - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) - break; - } - if (!updateDisplayIfNeeded(cm, update)) break; - updateHeightsInViewport(cm); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - setDocumentHeight(cm, barMeasure); - updateScrollbars(cm, barMeasure); - } - - signalLater(cm, "update", cm); - if (cm.display.viewFrom != update.oldViewFrom || cm.display.viewTo != update.oldViewTo) - signalLater(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - } - - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport); - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm); - postUpdateDisplay(cm, update); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - setDocumentHeight(cm, barMeasure); - updateScrollbars(cm, barMeasure); - } - } - - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = cm.display.heightForcer.style.top = measure.docHeight + "px"; - cm.display.gutters.style.height = Math.max(measure.docHeight, measure.clientHeight - scrollerCutOff) + "px"; - } - - function checkForWebkitWidthBug(cm, measure) { - // Work around Webkit bug where it sometimes reserves space for a - // non-existing phantom scrollbar in the scroller (Issue #2420) - if (cm.display.sizer.offsetWidth + cm.display.gutters.offsetWidth < cm.display.scroller.clientWidth - 1) { - cm.display.sizer.style.minHeight = cm.display.heightForcer.style.top = "0px"; - cm.display.gutters.style.height = measure.docHeight + "px"; - } - } - - // Read the actual heights of the rendered lines, and update their - // stored heights to match. - function updateHeightsInViewport(cm) { - var display = cm.display; - var prevBottom = display.lineDiv.offsetTop; - for (var i = 0; i < display.view.length; i++) { - var cur = display.view[i], height; - if (cur.hidden) continue; - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = cur.node.getBoundingClientRect(); - height = box.bottom - box.top; - } - var diff = cur.line.height - height; - if (height < 2) height = textHeight(display); - if (diff > .001 || diff < -.001) { - updateLineHeight(cur.line, height); - updateWidgetHeight(cur.line); - if (cur.rest) for (var j = 0; j < cur.rest.length; j++) - updateWidgetHeight(cur.rest[j]); - } - } - } - - // Read and store the height of line widgets associated with the - // given line. - function updateWidgetHeight(line) { - if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) - line.widgets[i].height = line.widgets[i].node.offsetHeight; - } - - // Do a bulk-read of the DOM positions and sizes needed to draw the - // view, so that we don't interleave reading and writing to the DOM. - function getDimensions(cm) { - var d = cm.display, left = {}, width = {}; - for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - left[cm.options.gutters[i]] = n.offsetLeft; - width[cm.options.gutters[i]] = n.offsetWidth; - } - return {fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth}; - } - - // Sync the actual display DOM structure with display.view, removing - // nodes for lines that are no longer in view, and creating the ones - // that are not there yet, and updating the ones that are out of - // date. - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, lineNumbers = cm.options.lineNumbers; - var container = display.lineDiv, cur = container.firstChild; - - function rm(node) { - var next = node.nextSibling; - // Works around a throw-scroll bug in OS X Webkit - if (webkit && mac && cm.display.currentWheelTarget == node) - node.style.display = "none"; - else - node.parentNode.removeChild(node); - return next; - } - - var view = display.view, lineN = display.viewFrom; - // Loop over the elements in the view, syncing cur (the DOM nodes - // in display.lineDiv) with the view as we go. - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (lineView.hidden) { - } else if (!lineView.node) { // Not drawn yet - var node = buildLineElement(cm, lineView, lineN, dims); - container.insertBefore(node, cur); - } else { // Already drawn - while (cur != lineView.node) cur = rm(cur); - var updateNumber = lineNumbers && updateNumbersFrom != null && - updateNumbersFrom <= lineN && lineView.lineNumber; - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; - updateLineForChanges(cm, lineView, lineN, dims); - } - if (updateNumber) { - removeChildren(lineView.lineNumber); - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); - } - cur = lineView.node.nextSibling; - } - lineN += lineView.size; - } - while (cur) cur = rm(cur); - } - - // When an aspect of a line changes, a string is added to - // lineView.changes. This updates the relevant part of the line's - // DOM structure. - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j]; - if (type == "text") updateLineText(cm, lineView); - else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); - else if (type == "class") updateLineClasses(lineView); - else if (type == "widget") updateLineWidgets(lineView, dims); - } - lineView.changes = null; - } - - // Lines with gutter elements, widgets or a background class need to - // be wrapped, and have the extra elements added to the wrapper div - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative"); - if (lineView.text.parentNode) - lineView.text.parentNode.replaceChild(lineView.node, lineView.text); - lineView.node.appendChild(lineView.text); - if (ie && ie_version < 8) lineView.node.style.zIndex = 2; - } - return lineView.node; - } - - function updateLineBackground(lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; - if (cls) cls += " CodeMirror-linebackground"; - if (lineView.background) { - if (cls) lineView.background.className = cls; - else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } - } else if (cls) { - var wrap = ensureLineWrapped(lineView); - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); - } - } - - // Wrapper around buildLineContent which will reuse the structure - // in display.externalMeasured when possible. - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured; - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null; - lineView.measure = ext.measure; - return ext.built; - } - return buildLineContent(cm, lineView); - } - - // Redraw the line's text. Interacts with the background and text - // classes because the mode may output tokens that influence these - // classes. - function updateLineText(cm, lineView) { - var cls = lineView.text.className; - var built = getLineContent(cm, lineView); - if (lineView.text == lineView.node) lineView.node = built.pre; - lineView.text.parentNode.replaceChild(built.pre, lineView.text); - lineView.text = built.pre; - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass; - lineView.textClass = built.textClass; - updateLineClasses(lineView); - } else if (cls) { - lineView.text.className = cls; - } - } - - function updateLineClasses(lineView) { - updateLineBackground(lineView); - if (lineView.line.wrapClass) - ensureLineWrapped(lineView).className = lineView.line.wrapClass; - else if (lineView.node != lineView.text) - lineView.node.className = ""; - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - lineView.text.className = textClass || ""; - } - - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter); - lineView.gutter = null; - } - var markers = lineView.line.gutterMarkers; - if (cm.options.lineNumbers || markers) { - var wrap = ensureLineWrapped(lineView); - var gutterWrap = lineView.gutter = - wrap.insertBefore(elt("div", null, "CodeMirror-gutter-wrapper", "position: absolute; left: " + - (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"), - lineView.text); - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - lineView.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineN), - "CodeMirror-linenumber CodeMirror-gutter-elt", - "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " - + cm.display.lineNumInnerWidth + "px")); - if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { - var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; - if (found) - gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + - dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); - } - } - } - - function updateLineWidgets(lineView, dims) { - if (lineView.alignable) lineView.alignable = null; - for (var node = lineView.node.firstChild, next; node; node = next) { - var next = node.nextSibling; - if (node.className == "CodeMirror-linewidget") - lineView.node.removeChild(node); - } - insertLineWidgets(lineView, dims); - } - - // Build a line's DOM representation from scratch - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView); - lineView.text = lineView.node = built.pre; - if (built.bgClass) lineView.bgClass = built.bgClass; - if (built.textClass) lineView.textClass = built.textClass; - - updateLineClasses(lineView); - updateLineGutter(cm, lineView, lineN, dims); - insertLineWidgets(lineView, dims); - return lineView.node; - } - - // A lineView may contain multiple logical lines (when merged by - // collapsed spans). The widgets for all of them need to be drawn. - function insertLineWidgets(lineView, dims) { - insertLineWidgetsFor(lineView.line, lineView, dims, true); - if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) - insertLineWidgetsFor(lineView.rest[i], lineView, dims, false); - } - - function insertLineWidgetsFor(line, lineView, dims, allowAbove) { - if (!line.widgets) return; - var wrap = ensureLineWrapped(lineView); - for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); - if (!widget.handleMouseEvents) node.ignoreEvents = true; - positionLineWidget(widget, node, lineView, dims); - if (allowAbove && widget.above) - wrap.insertBefore(node, lineView.gutter || lineView.text); - else - wrap.appendChild(node); - signalLater(widget, "redraw"); - } - } - - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - (lineView.alignable || (lineView.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; - } - } - - // POSITION OBJECT - - // A Pos instance represents a position within the text. - var Pos = CodeMirror.Pos = function(line, ch) { - if (!(this instanceof Pos)) return new Pos(line, ch); - this.line = line; this.ch = ch; - }; - - // Compare two positions, return 0 if they are the same, a negative - // number when a is less, and a positive number otherwise. - var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; - - function copyPos(x) {return Pos(x.line, x.ch);} - function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } - function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } - - // SELECTION / CURSOR - - // Selection objects are immutable. A new one is created every time - // the selection changes. A selection is one or more non-overlapping - // (and non-touching) ranges, sorted, and an integer that indicates - // which one is the primary selection (the one that's scrolled into - // view, that getCursor returns, etc). - function Selection(ranges, primIndex) { - this.ranges = ranges; - this.primIndex = primIndex; - } - - Selection.prototype = { - primary: function() { return this.ranges[this.primIndex]; }, - equals: function(other) { - if (other == this) return true; - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; - for (var i = 0; i < this.ranges.length; i++) { - var here = this.ranges[i], there = other.ranges[i]; - if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; - } - return true; - }, - deepCopy: function() { - for (var out = [], i = 0; i < this.ranges.length; i++) - out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); - return new Selection(out, this.primIndex); - }, - somethingSelected: function() { - for (var i = 0; i < this.ranges.length; i++) - if (!this.ranges[i].empty()) return true; - return false; - }, - contains: function(pos, end) { - if (!end) end = pos; - for (var i = 0; i < this.ranges.length; i++) { - var range = this.ranges[i]; - if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) - return i; - } - return -1; - } - }; - - function Range(anchor, head) { - this.anchor = anchor; this.head = head; - } - - Range.prototype = { - from: function() { return minPos(this.anchor, this.head); }, - to: function() { return maxPos(this.anchor, this.head); }, - empty: function() { - return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; - } - }; - - // Take an unsorted, potentially overlapping set of ranges, and - // build a selection out of it. 'Consumes' ranges array (modifying - // it). - function normalizeSelection(ranges, primIndex) { - var prim = ranges[primIndex]; - ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); - primIndex = indexOf(ranges, prim); - for (var i = 1; i < ranges.length; i++) { - var cur = ranges[i], prev = ranges[i - 1]; - if (cmp(prev.to(), cur.from()) >= 0) { - var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; - if (i <= primIndex) --primIndex; - ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); - } - } - return new Selection(ranges, primIndex); - } - - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0); - } - - // Most of the external API clips given positions to make sure they - // actually exist within the document. - function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} - function clipPos(doc, pos) { - if (pos.line < doc.first) return Pos(doc.first, 0); - var last = doc.first + doc.size - 1; - if (pos.line > last) return Pos(last, getLine(doc, last).text.length); - return clipToLen(pos, getLine(doc, pos.line).text.length); - } - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) return Pos(pos.line, linelen); - else if (ch < 0) return Pos(pos.line, 0); - else return pos; - } - function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} - function clipPosArray(doc, array) { - for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); - return out; - } - - // SELECTION UPDATES - - // The 'scroll' parameter given to many of these indicated whether - // the new cursor position should be scrolled into view after - // modifying the selection. - - // If shift is held or the extend flag is set, extends a range to - // include a given position (and optionally a second position). - // Otherwise, simply returns the range between the given positions. - // Used for cursor motion and such. - function extendRange(doc, range, head, other) { - if (doc.cm && doc.cm.display.shift || doc.extend) { - var anchor = range.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head; - head = other; - } else if (posBefore != (cmp(head, other) < 0)) { - head = other; - } - } - return new Range(anchor, head); - } else { - return new Range(other || head, head); - } - } - - // Extend the primary selection range, discard the rest. - function extendSelection(doc, head, other, options) { - setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); - } - - // Extend all selections (pos is an array of selections with length - // equal the number of selections) - function extendSelections(doc, heads, options) { - for (var out = [], i = 0; i < doc.sel.ranges.length; i++) - out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); - var newSel = normalizeSelection(out, doc.sel.primIndex); - setSelection(doc, newSel, options); - } - - // Updates a single range in the selection. - function replaceOneSelection(doc, i, range, options) { - var ranges = doc.sel.ranges.slice(0); - ranges[i] = range; - setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); - } - - // Reset the selection to a single range. - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options); - } - - // Give beforeSelectionChange handlers a change to influence a - // selection update. - function filterSelectionChange(doc, sel) { - var obj = { - ranges: sel.ranges, - update: function(ranges) { - this.ranges = []; - for (var i = 0; i < ranges.length; i++) - this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)); - } - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); - if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); - else return sel; - } - - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, last = lst(done); - if (last && last.ranges) { - done[done.length - 1] = sel; - setSelectionNoUndo(doc, sel, options); - } else { - setSelection(doc, sel, options); - } - } - - // Set a new selection. - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options); - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); - } - - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - sel = filterSelectionChange(doc, sel); - - var bias = options && options.bias || - (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - - if (!(options && options.scroll === false) && doc.cm) - ensureCursorVisible(doc.cm); - } - - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) return; - - doc.sel = sel; - - if (doc.cm) { - doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; - signalCursorActivity(doc.cm); - } - signalLater(doc, "cursorActivity", doc); - } - - // Verify that the selection does not partially select any atomic - // marked ranges. - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); - } - - // Return a selection that does not partially select any atomic - // ranges. - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range.head, bias, mayClear); - if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) out = sel.ranges.slice(0, i); - out[i] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(out, sel.primIndex) : sel; - } - - // Ensure a given position is not inside an atomic range. - function skipAtomic(doc, pos, bias, mayClear) { - var flipped = false, curPos = pos; - var dir = bias || 1; - doc.cantEdit = false; - search: for (;;) { - var line = getLine(doc, curPos.line); - if (line.markedSpans) { - for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && - (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) break; - else {--i; continue;} - } - } - if (!m.atomic) continue; - var newPos = m.find(dir < 0 ? -1 : 1); - if (cmp(newPos, curPos) == 0) { - newPos.ch += dir; - if (newPos.ch < 0) { - if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); - else newPos = null; - } else if (newPos.ch > line.text.length) { - if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); - else newPos = null; - } - if (!newPos) { - if (flipped) { - // Driven in a corner -- no valid cursor position found at all - // -- try again *with* clearing, if we didn't already - if (!mayClear) return skipAtomic(doc, pos, bias, true); - // Otherwise, turn off editing until further notice, and return the start of the doc - doc.cantEdit = true; - return Pos(doc.first, 0); - } - flipped = true; newPos = pos; dir = -dir; - } - } - curPos = newPos; - continue search; - } - } - } - return curPos; - } - } - - // SELECTION DRAWING - - // Redraw the selection and/or cursor - function drawSelection(cm) { - var display = cm.display, doc = cm.doc, result = {}; - var curFragment = result.cursors = document.createDocumentFragment(); - var selFragment = result.selection = document.createDocumentFragment(); - - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - var collapsed = range.empty(); - if (collapsed || cm.options.showCursorWhenSelecting) - drawSelectionCursor(cm, range, curFragment); - if (!collapsed) - drawSelectionRange(cm, range, selFragment); - } - - // Move the hidden textarea near the cursor to prevent scrolling artifacts - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)); - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)); - } - - return result; - } - - function showSelection(cm, drawn) { - removeChildrenAndAdd(cm.display.cursorDiv, drawn.cursors); - removeChildrenAndAdd(cm.display.selectionDiv, drawn.selection); - if (drawn.teTop != null) { - cm.display.inputDiv.style.top = drawn.teTop + "px"; - cm.display.inputDiv.style.left = drawn.teLeft + "px"; - } - } - - function updateSelection(cm) { - showSelection(cm, drawSelection(cm)); - } - - // Draws a cursor for the given range - function drawSelectionCursor(cm, range, output) { - var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine); - - var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); - cursor.style.left = pos.left + "px"; - cursor.style.top = pos.top + "px"; - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - - if (pos.other) { - // Secondary cursor, shown when on a 'jump' in bi-directional text - var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); - otherCursor.style.display = ""; - otherCursor.style.left = pos.other.left + "px"; - otherCursor.style.top = pos.other.top + "px"; - otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; - } - } - - // Draws the given range as a highlighted selection - function drawSelectionRange(cm, range, output) { - var display = cm.display, doc = cm.doc; - var fragment = document.createDocumentFragment(); - var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right; - - function add(left, top, width, bottom) { - if (top < 0) top = 0; - top = Math.round(top); - bottom = Math.round(bottom); - fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + - "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + - "px; height: " + (bottom - top) + "px")); - } - - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length; - var start, end; - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias); - } - - iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { - var leftPos = coords(from, "left"), rightPos, left, right; - if (from == to) { - rightPos = leftPos; - left = right = leftPos.left; - } else { - rightPos = coords(to - 1, "right"); - if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; } - left = leftPos.left; - right = rightPos.right; - } - if (fromArg == null && from == 0) left = leftSide; - if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part - add(left, leftPos.top, null, leftPos.bottom); - left = leftSide; - if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); - } - if (toArg == null && to == lineLen) right = rightSide; - if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) - start = leftPos; - if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) - end = rightPos; - if (left < leftSide + 1) left = leftSide; - add(left, rightPos.top, right - left, rightPos.bottom); - }); - return {start: start, end: end}; - } - - var sFrom = range.from(), sTo = range.to(); - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch); - } else { - var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); - var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); - } - } - if (leftEnd.bottom < rightStart.top) - add(leftSide, leftEnd.bottom, null, rightStart.top); - } - - output.appendChild(fragment); - } - - // Cursor-blinking - function restartBlink(cm) { - if (!cm.state.focused) return; - var display = cm.display; - clearInterval(display.blinker); - var on = true; - display.cursorDiv.style.visibility = ""; - if (cm.options.cursorBlinkRate > 0) - display.blinker = setInterval(function() { - display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); - else if (cm.options.cursorBlinkRate < 0) - display.cursorDiv.style.visibility = "hidden"; - } - - // HIGHLIGHT WORKER - - function startWorker(cm, time) { - if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) - cm.state.highlight.set(time, bind(highlightWorker, cm)); - } - - function highlightWorker(cm) { - var doc = cm.doc; - if (doc.frontier < doc.first) doc.frontier = doc.first; - if (doc.frontier >= cm.display.viewTo) return; - var end = +new Date + cm.options.workTime; - var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); - var changedLines = []; - - doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { - if (doc.frontier >= cm.display.viewFrom) { // Visible - var oldStyles = line.styles; - var highlighted = highlightLine(cm, line, state, true); - line.styles = highlighted.styles; - var oldCls = line.styleClasses, newCls = highlighted.classes; - if (newCls) line.styleClasses = newCls; - else if (oldCls) line.styleClasses = null; - var ischange = !oldStyles || oldStyles.length != line.styles.length || - oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); - for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; - if (ischange) changedLines.push(doc.frontier); - line.stateAfter = copyState(doc.mode, state); - } else { - processLine(cm, line.text, state); - line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; - } - ++doc.frontier; - if (+new Date > end) { - startWorker(cm, cm.options.workDelay); - return true; - } - }); - if (changedLines.length) runInOp(cm, function() { - for (var i = 0; i < changedLines.length; i++) - regLineChange(cm, changedLines[i], "text"); - }); - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(cm, n, precise) { - var minindent, minline, doc = cm.doc; - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); - for (var search = n; search > lim; --search) { - if (search <= doc.first) return doc.first; - var line = getLine(doc, search - 1); - if (line.stateAfter && (!precise || search <= doc.frontier)) return search; - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - - function getStateBefore(cm, n, precise) { - var doc = cm.doc, display = cm.display; - if (!doc.mode.startState) return true; - var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; - if (!state) state = startState(doc.mode); - else state = copyState(doc.mode, state); - doc.iter(pos, n, function(line) { - processLine(cm, line.text, state); - var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; - line.stateAfter = save ? copyState(doc.mode, state) : null; - ++pos; - }); - if (precise) doc.frontier = pos; - return state; - } - - // POSITION MEASUREMENT - - function paddingTop(display) {return display.lineSpace.offsetTop;} - function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} - function paddingH(display) { - if (display.cachedPaddingH) return display.cachedPaddingH; - var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; - if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; - return data; - } - - // Ensure the lineView.wrapping.heights array is populated. This is - // an array of bottom offsets for the lines that make up a drawn - // line. When lineWrapping is on, there might be more than one - // height. - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping; - var curWidth = wrapping && cm.display.scroller.clientWidth; - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = []; - if (wrapping) { - lineView.measure.width = curWidth; - var rects = lineView.text.firstChild.getClientRects(); - for (var i = 0; i < rects.length - 1; i++) { - var cur = rects[i], next = rects[i + 1]; - if (Math.abs(cur.bottom - next.bottom) > 2) - heights.push((cur.bottom + next.top) / 2 - rect.top); - } - } - heights.push(rect.bottom - rect.top); - } - } - - // Find a line map (mapping character offsets to text nodes) and a - // measurement cache for the given line number. (A line view might - // contain multiple lines when collapsed ranges are present.) - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) - return {map: lineView.measure.map, cache: lineView.measure.cache}; - for (var i = 0; i < lineView.rest.length; i++) - if (lineView.rest[i] == line) - return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; - for (var i = 0; i < lineView.rest.length; i++) - if (lineNo(lineView.rest[i]) > lineN) - return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; - } - - // Render a line into the hidden node display.externalMeasured. Used - // when measurement is needed for a line that's not in the viewport. - function updateExternalMeasurement(cm, line) { - line = visualLine(line); - var lineN = lineNo(line); - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); - view.lineN = lineN; - var built = view.built = buildLineContent(cm, view); - view.text = built.pre; - removeChildrenAndAdd(cm.display.lineMeasure, built.pre); - return view; - } - - // Get a {top, bottom, left, right} box (in line-local coordinates) - // for a given character. - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); - } - - // Find a line view that corresponds to the given line number. - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) - return cm.display.view[findViewIndex(cm, lineN)]; - var ext = cm.display.externalMeasured; - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) - return ext; - } - - // Measurement can be split in two steps, the set-up work that - // applies to the whole line, and the measurement of the actual - // character. Functions like coordsChar, that need to do a lot of - // measurements in a row, can thus ensure that the set-up work is - // only done once. - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line); - var view = findViewForLine(cm, lineN); - if (view && !view.text) - view = null; - else if (view && view.changes) - updateLineForChanges(cm, view, lineN, getDimensions(cm)); - if (!view) - view = updateExternalMeasurement(cm, line); - - var info = mapFromLineView(view, line, lineN); - return { - line: line, view: view, rect: null, - map: info.map, cache: info.cache, before: info.before, - hasHeights: false - }; - } - - // Given a prepared measurement object, measures the position of an - // actual character (or fetches it from the cache). - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) ch = -1; - var key = ch + (bias || ""), found; - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key]; - } else { - if (!prepared.rect) - prepared.rect = prepared.view.text.getBoundingClientRect(); - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect); - prepared.hasHeights = true; - } - found = measureCharInner(cm, prepared, ch, bias); - if (!found.bogus) prepared.cache[key] = found; - } - return {left: found.left, right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom}; - } - - var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; - - function measureCharInner(cm, prepared, ch, bias) { - var map = prepared.map; - - var node, start, end, collapse; - // First, search the line map for the text node corresponding to, - // or closest to, the target character. - for (var i = 0; i < map.length; i += 3) { - var mStart = map[i], mEnd = map[i + 1]; - if (ch < mStart) { - start = 0; end = 1; - collapse = "left"; - } else if (ch < mEnd) { - start = ch - mStart; - end = start + 1; - } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { - end = mEnd - mStart; - start = end - 1; - if (ch >= mEnd) collapse = "right"; - } - if (start != null) { - node = map[i + 2]; - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) - collapse = bias; - if (bias == "left" && start == 0) - while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { - node = map[(i -= 3) + 2]; - collapse = "left"; - } - if (bias == "right" && start == mEnd - mStart) - while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { - node = map[(i += 3) + 2]; - collapse = "right"; - } - break; - } - } - - var rect; - if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. - for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned - while (start && isExtendingChar(prepared.line.text.charAt(mStart + start))) --start; - while (mStart + end < mEnd && isExtendingChar(prepared.line.text.charAt(mStart + end))) ++end; - if (ie && ie_version < 9 && start == 0 && end == mEnd - mStart) { - rect = node.parentNode.getBoundingClientRect(); - } else if (ie && cm.options.lineWrapping) { - var rects = range(node, start, end).getClientRects(); - if (rects.length) - rect = rects[bias == "right" ? rects.length - 1 : 0]; - else - rect = nullRect; - } else { - rect = range(node, start, end).getBoundingClientRect() || nullRect; - } - if (rect.left || rect.right || start == 0) break; - end = start; - start = start - 1; - collapse = "right"; - } - if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); - } else { // If it is a widget, simply get the box for the whole widget. - if (start > 0) collapse = bias = "right"; - var rects; - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) - rect = rects[bias == "right" ? rects.length - 1 : 0]; - else - rect = node.getBoundingClientRect(); - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0]; - if (rSpan) - rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; - else - rect = nullRect; - } - - var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; - var mid = (rtop + rbot) / 2; - var heights = prepared.view.measure.heights; - for (var i = 0; i < heights.length - 1; i++) - if (mid < heights[i]) break; - var top = i ? heights[i - 1] : 0, bot = heights[i]; - var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top: top, bottom: bot}; - if (!rect.left && !rect.right) result.bogus = true; - if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } - - return result; - } - - // Work around problem with bounding client rects on ranges being - // returned incorrectly when zoomed on IE10 and below. - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || - screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) - return rect; - var scaleX = screen.logicalXDPI / screen.deviceXDPI; - var scaleY = screen.logicalYDPI / screen.deviceYDPI; - return {left: rect.left * scaleX, right: rect.right * scaleX, - top: rect.top * scaleY, bottom: rect.bottom * scaleY}; - } - - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {}; - lineView.measure.heights = null; - if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) - lineView.measure.caches[i] = {}; - } - } - - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null; - removeChildren(cm.display.lineMeasure); - for (var i = 0; i < cm.display.view.length; i++) - clearLineMeasurementCacheFor(cm.display.view[i]); - } - - function clearCaches(cm) { - clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; - if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; - cm.display.lineNumChars = null; - } - - function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } - function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } - - // Converts a {top, bottom, left, right} box from line-local - // coordinates into another coordinate system. Context may be one of - // "line", "div" (display.lineDiv), "local"/null (editor), or "page". - function intoCoordSystem(cm, lineObj, rect, context) { - if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { - var size = widgetHeight(lineObj.widgets[i]); - rect.top += size; rect.bottom += size; - } - if (context == "line") return rect; - if (!context) context = "local"; - var yOff = heightAtLine(lineObj); - if (context == "local") yOff += paddingTop(cm.display); - else yOff -= cm.display.viewOffset; - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); - rect.left += xOff; rect.right += xOff; - } - rect.top += yOff; rect.bottom += yOff; - return rect; - } - - // Coverts a box from "div" coords to another coordinate system. - // Context may be "window", "page", "div", or "local"/null. - function fromCoordSystem(cm, coords, context) { - if (context == "div") return coords; - var left = coords.left, top = coords.top; - // First move into "page" coordinate system - if (context == "page") { - left -= pageScrollX(); - top -= pageScrollY(); - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect(); - left += localBox.left; - top += localBox.top; - } - - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); - return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; - } - - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) lineObj = getLine(cm.doc, pos.line); - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); - } - - // Returns a box for a given cursor position, which may have an - // 'other' property containing the position of the secondary cursor - // on a bidi boundary. - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line); - if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); - function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); - if (right) m.left = m.right; else m.right = m.left; - return intoCoordSystem(cm, lineObj, m, context); - } - function getBidi(ch, partPos) { - var part = order[partPos], right = part.level % 2; - if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { - part = order[--partPos]; - ch = bidiRight(part) - (part.level % 2 ? 0 : 1); - right = true; - } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { - part = order[++partPos]; - ch = bidiLeft(part) - part.level % 2; - right = false; - } - if (right && ch == part.to && ch > part.from) return get(ch - 1); - return get(ch, right); - } - var order = getOrder(lineObj), ch = pos.ch; - if (!order) return get(ch); - var partPos = getBidiPartAt(order, ch); - var val = getBidi(ch, partPos); - if (bidiOther != null) val.other = getBidi(ch, bidiOther); - return val; - } - - // Used to cheaply estimate the coordinates for a position. Used for - // intermediate scroll updates. - function estimateCoords(cm, pos) { - var left = 0, pos = clipPos(cm.doc, pos); - if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; - var lineObj = getLine(cm.doc, pos.line); - var top = heightAtLine(lineObj) + paddingTop(cm.display); - return {left: left, right: left, top: top, bottom: top + lineObj.height}; - } - - // Positions returned by coordsChar contain some extra information. - // xRel is the relative x position of the input coordinates compared - // to the found position (so xRel > 0 means the coordinates are to - // the right of the character position, for example). When outside - // is true, that means the coordinates lie outside the line's - // vertical range. - function PosWithInfo(line, ch, outside, xRel) { - var pos = Pos(line, ch); - pos.xRel = xRel; - if (outside) pos.outside = true; - return pos; - } - - // Compute the character position closest to the given coordinates. - // Input must be lineSpace-local ("div" coordinate system). - function coordsChar(cm, x, y) { - var doc = cm.doc; - y += cm.display.viewOffset; - if (y < 0) return PosWithInfo(doc.first, 0, true, -1); - var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; - if (lineN > last) - return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); - if (x < 0) x = 0; - - var lineObj = getLine(doc, lineN); - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y); - var merged = collapsedSpanAtEnd(lineObj); - var mergedPos = merged && merged.find(0, true); - if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) - lineN = lineNo(lineObj = mergedPos.to.line); - else - return found; - } - } - - function coordsCharInner(cm, lineObj, lineNo, x, y) { - var innerOff = y - heightAtLine(lineObj); - var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; - var preparedMeasure = prepareMeasureForLine(cm, lineObj); - - function getX(ch) { - var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); - wrongLine = true; - if (innerOff > sp.bottom) return sp.left - adjust; - else if (innerOff < sp.top) return sp.left + adjust; - else wrongLine = false; - return sp.left; - } - - var bidi = getOrder(lineObj), dist = lineObj.text.length; - var from = lineLeft(lineObj), to = lineRight(lineObj); - var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; - - if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1); - // Do a binary search between these bounds. - for (;;) { - if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { - var ch = x < fromX || x - fromX <= toX - x ? from : to; - var xDiff = x - (ch == from ? fromX : toX); - while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; - var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside, - xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); - return pos; - } - var step = Math.ceil(dist / 2), middle = from + step; - if (bidi) { - middle = from; - for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); - } - var middleX = getX(middle); - if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;} - else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;} - } - } - - var measureText; - // Compute the default text height. - function textHeight(display) { - if (display.cachedTextHeight != null) return display.cachedTextHeight; - if (measureText == null) { - measureText = elt("pre"); - // Measure a bunch of lines, for browsers that compute - // fractional heights. - for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) display.cachedTextHeight = height; - removeChildren(display.measure); - return height || 1; - } - - // Compute the default character width. - function charWidth(display) { - if (display.cachedCharWidth != null) return display.cachedCharWidth; - var anchor = elt("span", "xxxxxxxxxx"); - var pre = elt("pre", [anchor]); - removeChildrenAndAdd(display.measure, pre); - var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; - if (width > 2) display.cachedCharWidth = width; - return width || 10; - } - - // OPERATIONS - - // Operations are used to wrap a series of changes to the editor - // state in such a way that each change won't have to update the - // cursor and display (which would be awkward, slow, and - // error-prone). Instead, display updates are batched and then all - // combined and executed at once. - - var operationGroup = null; - - var nextOpId = 0; - // Start a new operation. - function startOperation(cm) { - cm.curOp = { - cm: cm, - viewChanged: false, // Flag that indicates that lines might need to be redrawn - startHeight: cm.doc.height, // Used to detect need to update scrollbar - forceUpdate: false, // Used to force a redraw - updateInput: null, // Whether to reset the input textarea - typing: false, // Whether this reset should be careful to leave existing text (for compositing) - changeObjs: null, // Accumulated changes, for firing change events - cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on - cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already - selectionChanged: false, // Whether the selection needs to be redrawn - updateMaxLine: false, // Set when the widest line needs to be determined anew - scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, // Used to scroll to a specific position - id: ++nextOpId // Unique ID - }; - if (operationGroup) { - operationGroup.ops.push(cm.curOp); - } else { - cm.curOp.ownsGroup = operationGroup = { - ops: [cm.curOp], - delayedCallbacks: [] - }; - } - } - - function fireCallbacksForOps(group) { - // Calls delayed callbacks and cursorActivity handlers until no - // new ones appear - var callbacks = group.delayedCallbacks, i = 0; - do { - for (; i < callbacks.length; i++) - callbacks[i](); - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j]; - if (op.cursorActivityHandlers) - while (op.cursorActivityCalled < op.cursorActivityHandlers.length) - op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm); - } - } while (i < callbacks.length); - } - - // Finish an operation, updating the display and signalling delayed events - function endOperation(cm) { - var op = cm.curOp, group = op.ownsGroup; - if (!group) return; - - try { fireCallbacksForOps(group); } - finally { - operationGroup = null; - for (var i = 0; i < group.ops.length; i++) - group.ops[i].cm.curOp = null; - endOperations(group); - } - } - - // The DOM updates done when an operation finishes are batched so - // that the minimum number of relayouts are required. - function endOperations(group) { - var ops = group.ops; - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_R1(ops[i]); - for (var i = 0; i < ops.length; i++) // Write DOM (maybe) - endOperation_W1(ops[i]); - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_R2(ops[i]); - for (var i = 0; i < ops.length; i++) // Write DOM (maybe) - endOperation_W2(ops[i]); - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_finish(ops[i]); - } - - function endOperation_R1(op) { - var cm = op.cm, display = cm.display; - if (op.updateMaxLine) findMaxLine(cm); - - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || - op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping; - op.update = op.mustUpdate && - new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); - } - - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); - } - - function endOperation_R2(op) { - var cm = op.cm, display = cm.display; - if (op.updatedDisplay) updateHeightsInViewport(cm); - - op.barMeasure = measureForScrollbars(cm); - - // If the max line changed since it was last measured, measure it, - // and ensure the document's width matches it. - // updateDisplay_W2 will use these properties to do the actual resizing - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo + - scrollerCutOff - display.scroller.clientWidth); - } - - if (op.updatedDisplay || op.selectionChanged) - op.newSelectionNodes = drawSelection(cm); - } - - function endOperation_W2(op) { - var cm = op.cm; - - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; - if (op.maxScrollLeft < cm.doc.scrollLeft) - setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); - cm.display.maxLineChanged = false; - } - - if (op.newSelectionNodes) - showSelection(cm, op.newSelectionNodes); - if (op.updatedDisplay) - setDocumentHeight(cm, op.barMeasure); - if (op.updatedDisplay || op.startHeight != cm.doc.height) - updateScrollbars(cm, op.barMeasure); - - if (op.selectionChanged) restartBlink(cm); - - if (cm.state.focused && op.updateInput) - resetInput(cm, op.typing); - } - - function endOperation_finish(op) { - var cm = op.cm, display = cm.display, doc = cm.doc; - - if (op.adjustWidthTo != null && Math.abs(op.barMeasure.scrollWidth - cm.display.scroller.scrollWidth) > 1) - updateScrollbars(cm); - - if (op.updatedDisplay) postUpdateDisplay(cm, op.update); - - // Abort mouse wheel delta measurement, when scrolling explicitly - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) - display.wheelStartX = display.wheelStartY = null; - - // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { - var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); - display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top; - } - if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { - var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft)); - display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left; - alignHorizontally(cm); - } - // If we need to scroll a specific position into view, do so. - if (op.scrollToPos) { - var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), - clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); - if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); - } - - // Fire events for markers that are hidden/unidden by editing or - // undoing - var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; - if (hidden) for (var i = 0; i < hidden.length; ++i) - if (!hidden[i].lines.length) signal(hidden[i], "hide"); - if (unhidden) for (var i = 0; i < unhidden.length; ++i) - if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); - - if (display.wrapper.offsetHeight) - doc.scrollTop = cm.display.scroller.scrollTop; - - // Apply workaround for two webkit bugs - if (op.updatedDisplay && webkit) { - if (cm.options.lineWrapping) - checkForWebkitWidthBug(cm, op.barMeasure); // (Issue #2420) - if (op.barMeasure.scrollWidth > op.barMeasure.clientWidth && - op.barMeasure.scrollWidth < op.barMeasure.clientWidth + 1 && - !hScrollbarTakesSpace(cm)) - updateScrollbars(cm); // (Issue #2562) - } - - // Fire change events, and delayed event handlers - if (op.changeObjs) - signal(cm, "changes", cm, op.changeObjs); - } - - // Run the given function in an operation - function runInOp(cm, f) { - if (cm.curOp) return f(); - startOperation(cm); - try { return f(); } - finally { endOperation(cm); } - } - // Wraps a function in an operation. Returns the wrapped function. - function operation(cm, f) { - return function() { - if (cm.curOp) return f.apply(cm, arguments); - startOperation(cm); - try { return f.apply(cm, arguments); } - finally { endOperation(cm); } - }; - } - // Used to add methods to editor and doc instances, wrapping them in - // operations. - function methodOp(f) { - return function() { - if (this.curOp) return f.apply(this, arguments); - startOperation(this); - try { return f.apply(this, arguments); } - finally { endOperation(this); } - }; - } - function docMethodOp(f) { - return function() { - var cm = this.cm; - if (!cm || cm.curOp) return f.apply(this, arguments); - startOperation(cm); - try { return f.apply(this, arguments); } - finally { endOperation(cm); } - }; - } - - // VIEW TRACKING - - // These objects are used to represent the visible (currently drawn) - // part of the document. A LineView may correspond to multiple - // logical lines, if those are connected by collapsed ranges. - function LineView(doc, line, lineN) { - // The starting line - this.line = line; - // Continuing lines, if any - this.rest = visualLineContinued(line); - // Number of logical lines in this visual line - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - - // Create a range of LineView objects for the given lines. - function buildViewArray(cm, from, to) { - var array = [], nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); - } - return array; - } - - // Updates the display.view data structure for a given change to the - // document. From and to are in pre-change coordinates. Lendiff is - // the amount of lines added or subtracted by the change. This is - // used for changes that span multiple lines, or change the way - // lines are divided into visual lines. regLineChange (below) - // registers single-line changes. - function regChange(cm, from, to, lendiff) { - if (from == null) from = cm.doc.first; - if (to == null) to = cm.doc.first + cm.doc.size; - if (!lendiff) lendiff = 0; - - var display = cm.display; - if (lendiff && to < display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers > from)) - display.updateLineNumbers = from; - - cm.curOp.viewChanged = true; - - if (from >= display.viewTo) { // Change after - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) - resetView(cm); - } else if (to <= display.viewFrom) { // Change before - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm); - } else { - display.viewFrom += lendiff; - display.viewTo += lendiff; - } - } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap - resetView(cm); - } else if (from <= display.viewFrom) { // Top overlap - var cut = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cut) { - display.view = display.view.slice(cut.index); - display.viewFrom = cut.lineN; - display.viewTo += lendiff; - } else { - resetView(cm); - } - } else if (to >= display.viewTo) { // Bottom overlap - var cut = viewCuttingPoint(cm, from, from, -1); - if (cut) { - display.view = display.view.slice(0, cut.index); - display.viewTo = cut.lineN; - } else { - resetView(cm); - } - } else { // Gap in the middle - var cutTop = viewCuttingPoint(cm, from, from, -1); - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index) - .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) - .concat(display.view.slice(cutBot.index)); - display.viewTo += lendiff; - } else { - resetView(cm); - } - } - - var ext = display.externalMeasured; - if (ext) { - if (to < ext.lineN) - ext.lineN += lendiff; - else if (from < ext.lineN + ext.size) - display.externalMeasured = null; - } - } - - // Register a change to a single line. Type must be one of "text", - // "gutter", "class", "widget" - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true; - var display = cm.display, ext = cm.display.externalMeasured; - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) - display.externalMeasured = null; - - if (line < display.viewFrom || line >= display.viewTo) return; - var lineView = display.view[findViewIndex(cm, line)]; - if (lineView.node == null) return; - var arr = lineView.changes || (lineView.changes = []); - if (indexOf(arr, type) == -1) arr.push(type); - } - - // Clear the view. - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first; - cm.display.view = []; - cm.display.viewOffset = 0; - } - - // Find the view element corresponding to a given line. Return null - // when the line isn't visible. - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) return null; - n -= cm.display.viewFrom; - if (n < 0) return null; - var view = cm.display.view; - for (var i = 0; i < view.length; i++) { - n -= view[i].size; - if (n < 0) return i; - } - } - - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), diff, view = cm.display.view; - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) - return {index: index, lineN: newN}; - for (var i = 0, n = cm.display.viewFrom; i < index; i++) - n += view[i].size; - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) return null; - diff = (n + view[index].size) - oldN; - index++; - } else { - diff = n - oldN; - } - oldN += diff; newN += diff; - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) return null; - newN += dir * view[index - (dir < 0 ? 1 : 0)].size; - index += dir; - } - return {index: index, lineN: newN}; - } - - // Force the view to cover a given range, adding empty view element - // or clipping off existing ones as needed. - function adjustView(cm, from, to) { - var display = cm.display, view = display.view; - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to); - display.viewFrom = from; - } else { - if (display.viewFrom > from) - display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); - else if (display.viewFrom < from) - display.view = display.view.slice(findViewIndex(cm, from)); - display.viewFrom = from; - if (display.viewTo < to) - display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); - else if (display.viewTo > to) - display.view = display.view.slice(0, findViewIndex(cm, to)); - } - display.viewTo = to; - } - - // Count the number of lines in the view whose DOM representation is - // out of date (or nonexistent). - function countDirtyView(cm) { - var view = cm.display.view, dirty = 0; - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; - } - return dirty; - } - - // INPUT HANDLING - - // Poll for input changes, using the normal rate of polling. This - // runs as long as the editor is focused. - function slowPoll(cm) { - if (cm.display.pollingFast) return; - cm.display.poll.set(cm.options.pollInterval, function() { - readInput(cm); - if (cm.state.focused) slowPoll(cm); - }); - } - - // When an event has just come in that is likely to add or change - // something in the input textarea, we poll faster, to ensure that - // the change appears on the screen quickly. - function fastPoll(cm) { - var missed = false; - cm.display.pollingFast = true; - function p() { - var changed = readInput(cm); - if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);} - else {cm.display.pollingFast = false; slowPoll(cm);} - } - cm.display.poll.set(20, p); - } - - // This will be set to an array of strings when copying, so that, - // when pasting, we know what kind of selections the copied text - // was made out of. - var lastCopied = null; - - // Read input from the textarea, and update the document to match. - // When something is selected, it is present in the textarea, and - // selected (unless it is huge, in which case a placeholder is - // used). When nothing is selected, the cursor sits after previously - // seen text (can be empty), which is stored in prevInput (we must - // not reset the textarea when typing, because that breaks IME). - function readInput(cm) { - var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc; - // Since this is called a *lot*, try to bail out as cheaply as - // possible when it is clear that nothing happened. hasSelection - // will be the case when there is a lot of text in the textarea, - // in which case reading its value would be expensive. - if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput) - return false; - // See paste handler for more on the fakedLastChar kludge - if (cm.state.pasteIncoming && cm.state.fakedLastChar) { - input.value = input.value.substring(0, input.value.length - 1); - cm.state.fakedLastChar = false; - } - var text = input.value; - // If nothing changed, bail. - if (text == prevInput && !cm.somethingSelected()) return false; - // Work around nonsensical selection resetting in IE9/10, and - // inexplicable appearance of private area unicode characters on - // some key combos in Mac (#2689). - if (ie && ie_version >= 9 && cm.display.inputHasSelection === text || - mac && /[\uf700-\uf7ff]/.test(text)) { - resetInput(cm); - return false; - } - - var withOp = !cm.curOp; - if (withOp) startOperation(cm); - cm.display.shift = false; - - if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput) - prevInput = "\u200b"; - // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; - var inserted = text.slice(same), textLines = splitLines(inserted); - - // When pasing N lines into N selections, insert one line per selection - var multiPaste = null; - if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) { - if (lastCopied && lastCopied.join("\n") == inserted) - multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines); - else if (textLines.length == doc.sel.ranges.length) - multiPaste = map(textLines, function(l) { return [l]; }); - } - - // Normal behavior is to insert the new text into every selection - for (var i = doc.sel.ranges.length - 1; i >= 0; i--) { - var range = doc.sel.ranges[i]; - var from = range.from(), to = range.to(); - // Handle deletion - if (same < prevInput.length) - from = Pos(from.line, from.ch - (prevInput.length - same)); - // Handle overwrite - else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming) - to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); - var updateInput = cm.curOp.updateInput; - var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, - origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); - // When an 'electric' character is inserted, immediately trigger a reindent - if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && - cm.options.smartIndent && range.head.ch < 100 && - (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) { - var mode = cm.getModeAt(range.head); - var end = changeEnd(changeEvent); - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) - if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indentLine(cm, end.line, "smart"); - break; - } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch))) - indentLine(cm, end.line, "smart"); - } - } - } - ensureCursorVisible(cm); - cm.curOp.updateInput = updateInput; - cm.curOp.typing = true; - - // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = ""; - else cm.display.prevInput = text; - if (withOp) endOperation(cm); - cm.state.pasteIncoming = cm.state.cutIncoming = false; - return true; - } - - // Reset the input to correspond to the selection (or to be empty, - // when not typing and nothing is selected) - function resetInput(cm, typing) { - var minimal, selected, doc = cm.doc; - if (cm.somethingSelected()) { - cm.display.prevInput = ""; - var range = doc.sel.primary(); - minimal = hasCopyEvent && - (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); - var content = minimal ? "-" : selected || cm.getSelection(); - cm.display.input.value = content; - if (cm.state.focused) selectInput(cm.display.input); - if (ie && ie_version >= 9) cm.display.inputHasSelection = content; - } else if (!typing) { - cm.display.prevInput = cm.display.input.value = ""; - if (ie && ie_version >= 9) cm.display.inputHasSelection = null; - } - cm.display.inaccurateSelection = minimal; - } - - function focusInput(cm) { - if (cm.options.readOnly != "nocursor" && (!mobile || activeElt() != cm.display.input)) - cm.display.input.focus(); - } - - function ensureFocus(cm) { - if (!cm.state.focused) { focusInput(cm); onFocus(cm); } - } - - function isReadOnly(cm) { - return cm.options.readOnly || cm.doc.cantEdit; - } - - // EVENT HANDLERS - - // Attach the necessary event handlers when initializing the editor - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - // Older IE's will not fire a second mousedown for a double click - if (ie && ie_version < 11) - on(d.scroller, "dblclick", operation(cm, function(e) { - if (signalDOMEvent(cm, e)) return; - var pos = posFromMouse(cm, e); - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; - e_preventDefault(e); - var word = cm.findWordAt(pos); - extendSelection(cm.doc, word.anchor, word.head); - })); - else - on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); - // Prevent normal selection in the editor (we handle our own) - on(d.lineSpace, "selectstart", function(e) { - if (!eventInWidget(d, e)) e_preventDefault(e); - }); - // Some browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for these browsers. - if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); - - // Sync scrolling between fake scrollbars and real scrollable - // area, ensure viewport is updated when scrolling. - on(d.scroller, "scroll", function() { - if (d.scroller.clientHeight) { - setScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - } - }); - on(d.scrollbarV, "scroll", function() { - if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop); - }); - on(d.scrollbarH, "scroll", function() { - if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft); - }); - - // Listen to wheel events in order to try and update the viewport on time. - on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); - on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); - - // Prevent clicks in the scrollbars from killing focus - function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); } - on(d.scrollbarH, "mousedown", reFocus); - on(d.scrollbarV, "mousedown", reFocus); - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - - on(d.input, "keyup", function(e) { onKeyUp.call(cm, e); }); - on(d.input, "input", function() { - if (ie && ie_version >= 9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; - fastPoll(cm); - }); - on(d.input, "keydown", operation(cm, onKeyDown)); - on(d.input, "keypress", operation(cm, onKeyPress)); - on(d.input, "focus", bind(onFocus, cm)); - on(d.input, "blur", bind(onBlur, cm)); - - function drag_(e) { - if (!signalDOMEvent(cm, e)) e_stop(e); - } - if (cm.options.dragDrop) { - on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); - on(d.scroller, "dragenter", drag_); - on(d.scroller, "dragover", drag_); - on(d.scroller, "drop", operation(cm, onDrop)); - } - on(d.scroller, "paste", function(e) { - if (eventInWidget(d, e)) return; - cm.state.pasteIncoming = true; - focusInput(cm); - fastPoll(cm); - }); - on(d.input, "paste", function() { - // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206 - // Add a char to the end of textarea before paste occur so that - // selection doesn't span to the end of textarea. - if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) { - var start = d.input.selectionStart, end = d.input.selectionEnd; - d.input.value += "$"; - // The selection end needs to be set before the start, otherwise there - // can be an intermediate non-empty selection between the two, which - // can override the middle-click paste buffer on linux and cause the - // wrong thing to get pasted. - d.input.selectionEnd = end; - d.input.selectionStart = start; - cm.state.fakedLastChar = true; - } - cm.state.pasteIncoming = true; - fastPoll(cm); - }); - - function prepareCopyCut(e) { - if (cm.somethingSelected()) { - lastCopied = cm.getSelections(); - if (d.inaccurateSelection) { - d.prevInput = ""; - d.inaccurateSelection = false; - d.input.value = lastCopied.join("\n"); - selectInput(d.input); - } - } else { - var text = [], ranges = []; - for (var i = 0; i < cm.doc.sel.ranges.length; i++) { - var line = cm.doc.sel.ranges[i].head.line; - var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; - ranges.push(lineRange); - text.push(cm.getRange(lineRange.anchor, lineRange.head)); - } - if (e.type == "cut") { - cm.setSelections(ranges, null, sel_dontScroll); - } else { - d.prevInput = ""; - d.input.value = text.join("\n"); - selectInput(d.input); - } - lastCopied = text; - } - if (e.type == "cut") cm.state.cutIncoming = true; - } - on(d.input, "cut", prepareCopyCut); - on(d.input, "copy", prepareCopyCut); - - // Needed to handle Tab key in KHTML - if (khtml) on(d.sizer, "mouseup", function() { - if (activeElt() == d.input) d.input.blur(); - focusInput(cm); - }); - } - - // Called when the window resizes - function onResize(cm) { - // Might be a text scaling operation, clear size caches. - var d = cm.display; - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - cm.setSize(); - } - - // MOUSE EVENTS - - // Return true when the given mouse event happened in a widget - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true; - } - } - - // Given a mouse event, find the corresponding position. If liberal - // is false, it checks whether a gutter or scrollbar was clicked, - // and returns null if it was. forRect is used by rectangular - // selections, and tries to estimate a character position even for - // coordinates beyond the right of the text. - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display; - if (!liberal) { - var target = e_target(e); - if (target == display.scrollbarH || target == display.scrollbarV || - target == display.scrollbarFiller || target == display.gutterFiller) return null; - } - var x, y, space = display.lineSpace.getBoundingClientRect(); - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX - space.left; y = e.clientY - space.top; } - catch (e) { return null; } - var coords = coordsChar(cm, x, y), line; - if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); - } - return coords; - } - - // A mouse down can be a single click, double click, triple click, - // start of selection drag, start of text drag, new cursor - // (ctrl-click), rectangle drag (alt-drag), or xwin - // middle-click-paste. Or it might be a click on something we should - // not interfere with, such as a scrollbar or widget. - function onMouseDown(e) { - if (signalDOMEvent(this, e)) return; - var cm = this, display = cm.display; - display.shift = e.shiftKey; - - if (eventInWidget(display, e)) { - if (!webkit) { - // Briefly turn off draggability, to allow widgets to do - // normal dragging things. - display.scroller.draggable = false; - setTimeout(function(){display.scroller.draggable = true;}, 100); - } - return; - } - if (clickInGutter(cm, e)) return; - var start = posFromMouse(cm, e); - window.focus(); - - switch (e_button(e)) { - case 1: - if (start) - leftButtonDown(cm, e, start); - else if (e_target(e) == display.scroller) - e_preventDefault(e); - break; - case 2: - if (webkit) cm.state.lastMiddleDown = +new Date; - if (start) extendSelection(cm.doc, start); - setTimeout(bind(focusInput, cm), 20); - e_preventDefault(e); - break; - case 3: - if (captureRightClick) onContextMenu(cm, e); - break; - } - } - - var lastClick, lastDoubleClick; - function leftButtonDown(cm, e, start) { - setTimeout(bind(ensureFocus, cm), 0); - - var now = +new Date, type; - if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { - type = "triple"; - } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { - type = "double"; - lastDoubleClick = {time: now, pos: start}; - } else { - type = "single"; - lastClick = {time: now, pos: start}; - } - - var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey; - if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && - type == "single" && sel.contains(start) > -1 && sel.somethingSelected()) - leftButtonStartDrag(cm, e, start, modifier); - else - leftButtonSelect(cm, e, start, type, modifier); - } - - // Start a text drag. When it ends, see if any dragging actually - // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, e, start, modifier) { - var display = cm.display; - var dragEnd = operation(cm, function(e2) { - if (webkit) display.scroller.draggable = false; - cm.state.draggingText = false; - off(document, "mouseup", dragEnd); - off(display.scroller, "drop", dragEnd); - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2); - if (!modifier) - extendSelection(cm.doc, start); - focusInput(cm); - // Work around unexplainable focus problem in IE9 (#2127) - if (ie && ie_version == 9) - setTimeout(function() {document.body.focus(); focusInput(cm);}, 20); - } - }); - // Let the drag handler handle this. - if (webkit) display.scroller.draggable = true; - cm.state.draggingText = dragEnd; - // IE's approach to draggable - if (display.scroller.dragDrop) display.scroller.dragDrop(); - on(document, "mouseup", dragEnd); - on(display.scroller, "drop", dragEnd); - } - - // Normal selection, as opposed to text dragging. - function leftButtonSelect(cm, e, start, type, addNew) { - var display = cm.display, doc = cm.doc; - e_preventDefault(e); - - var ourRange, ourIndex, startSel = doc.sel; - if (addNew && !e.shiftKey) { - ourIndex = doc.sel.contains(start); - if (ourIndex > -1) - ourRange = doc.sel.ranges[ourIndex]; - else - ourRange = new Range(start, start); - } else { - ourRange = doc.sel.primary(); - } - - if (e.altKey) { - type = "rect"; - if (!addNew) ourRange = new Range(start, start); - start = posFromMouse(cm, e, true, true); - ourIndex = -1; - } else if (type == "double") { - var word = cm.findWordAt(start); - if (cm.display.shift || doc.extend) - ourRange = extendRange(doc, ourRange, word.anchor, word.head); - else - ourRange = word; - } else if (type == "triple") { - var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); - if (cm.display.shift || doc.extend) - ourRange = extendRange(doc, ourRange, line.anchor, line.head); - else - ourRange = line; - } else { - ourRange = extendRange(doc, ourRange, start); - } - - if (!addNew) { - ourIndex = 0; - setSelection(doc, new Selection([ourRange], 0), sel_mouse); - startSel = doc.sel; - } else if (ourIndex > -1) { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); - } else { - ourIndex = doc.sel.ranges.length; - setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}); - } - - var lastPos = start; - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) return; - lastPos = pos; - - if (type == "rect") { - var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); - var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); - line <= end; line++) { - var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); - if (left == right) - ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); - else if (text.length > leftPos) - ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); - } - if (!ranges.length) ranges.push(new Range(start, start)); - setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), - {origin: "*mouse", scroll: false}); - cm.scrollIntoView(pos); - } else { - var oldRange = ourRange; - var anchor = oldRange.anchor, head = pos; - if (type != "single") { - if (type == "double") - var range = cm.findWordAt(pos); - else - var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); - if (cmp(range.anchor, anchor) > 0) { - head = range.head; - anchor = minPos(oldRange.from(), range.anchor); - } else { - head = range.anchor; - anchor = maxPos(oldRange.to(), range.head); - } - } - var ranges = startSel.ranges.slice(0); - ranges[ourIndex] = new Range(clipPos(doc, anchor), head); - setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); - } - } - - var editorSize = display.wrapper.getBoundingClientRect(); - // Used to ensure timeout re-tries don't fire when another extend - // happened in the meantime (clearTimeout isn't reliable -- at - // least on Chrome, the timeouts still happen even when cleared, - // if the clear happens after their scheduled firing time). - var counter = 0; - - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true, type == "rect"); - if (!cur) return; - if (cmp(cur, lastPos) != 0) { - ensureFocus(cm); - extendTo(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) - setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) setTimeout(operation(cm, function() { - if (counter != curCount) return; - display.scroller.scrollTop += outside; - extend(e); - }), 50); - } - } - - function done(e) { - counter = Infinity; - e_preventDefault(e); - focusInput(cm); - off(document, "mousemove", move); - off(document, "mouseup", up); - doc.history.lastSelOrigin = null; - } - - var move = operation(cm, function(e) { - if (!e_button(e)) done(e); - else extend(e); - }); - var up = operation(cm, done); - on(document, "mousemove", move); - on(document, "mouseup", up); - } - - // Determines whether an event happened in the gutter, and fires the - // handlers for the corresponding event. - function gutterEvent(cm, e, type, prevent, signalfn) { - try { var mX = e.clientX, mY = e.clientY; } - catch(e) { return false; } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; - if (prevent) e_preventDefault(e); - - var display = cm.display; - var lineBox = display.lineDiv.getBoundingClientRect(); - - if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); - mY -= lineBox.top - display.viewOffset; - - for (var i = 0; i < cm.options.gutters.length; ++i) { - var g = display.gutters.childNodes[i]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY); - var gutter = cm.options.gutters[i]; - signalfn(cm, type, cm, line, gutter, e); - return e_defaultPrevented(e); - } - } - } - - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true, signalLater); - } - - // Kludge to work around strange IE behavior where it'll sometimes - // re-fire a series of drag-related events right after the drop (#1551) - var lastDrop = 0; - - function onDrop(e) { - var cm = this; - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) - return; - e_preventDefault(e); - if (ie) lastDrop = +new Date; - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; - if (!pos || isReadOnly(cm)) return; - // Might be a file drop, in which case we simply extract the text - // and insert it. - if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0; - var loadFile = function(file, i) { - var reader = new FileReader; - reader.onload = operation(cm, function() { - text[i] = reader.result; - if (++read == n) { - pos = clipPos(cm.doc, pos); - var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}; - makeChange(cm.doc, change); - setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); - } - }); - reader.readAsText(file); - }; - for (var i = 0; i < n; ++i) loadFile(files[i], i); - } else { // Normal drop - // Don't do a replace if the drop happened inside of the selected text. - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e); - // Ensure the editor is re-focused - setTimeout(bind(focusInput, cm), 20); - return; - } - try { - var text = e.dataTransfer.getData("Text"); - if (text) { - if (cm.state.draggingText && !(mac ? e.metaKey : e.ctrlKey)) - var selected = cm.listSelections(); - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) for (var i = 0; i < selected.length; ++i) - replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); - cm.replaceSelection(text, "around", "paste"); - focusInput(cm); - } - } - catch(e){} - } - } - - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; - - e.dataTransfer.setData("Text", cm.getSelection()); - - // Use dummy image instead of default browsers image. - // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (presto) { - img.width = img.height = 1; - cm.display.wrapper.appendChild(img); - // Force a relayout, or Opera won't use our image for some obscure reason - img._top = img.offsetTop; - } - e.dataTransfer.setDragImage(img, 0, 0); - if (presto) img.parentNode.removeChild(img); - } - } - - // SCROLL EVENTS - - // Sync the scrollable area and scrollbars, ensure the viewport - // covers the visible area. - function setScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) return; - cm.doc.scrollTop = val; - if (!gecko) updateDisplaySimple(cm, {top: val}); - if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; - if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val; - if (gecko) updateDisplaySimple(cm); - startWorker(cm, 100); - } - // Sync scroller and scrollbar, ensure the gutter elements are - // aligned. - function setScrollLeft(cm, val, isScroller) { - if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; - val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); - cm.doc.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; - if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val; - } - - // Since the delta values reported on mouse wheel events are - // unstandardized between browsers and even browser versions, and - // generally horribly unpredictable, this code starts by measuring - // the scroll effect that the first few mouse wheel events have, - // and, from that, detects the way it can convert deltas to pixel - // offsets afterwards. - // - // The reason we want to know the amount a wheel event will scroll - // is that it gives us a chance to update the display before the - // actual scrolling happens, reducing flickering. - - var wheelSamples = 0, wheelPixelsPerUnit = null; - // Fill in a browser-detected starting value on browsers where we - // know one. These don't have to be accurate -- the result of them - // being wrong would just be a slight flicker on the first wheel - // scroll (if it is large enough). - if (ie) wheelPixelsPerUnit = -.53; - else if (gecko) wheelPixelsPerUnit = 15; - else if (chrome) wheelPixelsPerUnit = -.7; - else if (safari) wheelPixelsPerUnit = -1/3; - - function onScrollWheel(cm, e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; - else if (dy == null) dy = e.wheelDelta; - - var display = cm.display, scroll = display.scroller; - // Quit if there's nothing to scroll here - if (!(dx && scroll.scrollWidth > scroll.clientWidth || - dy && scroll.scrollHeight > scroll.clientHeight)) return; - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i = 0; i < view.length; i++) { - if (view[i].node == cur) { - cm.display.currentWheelTarget = cur; - break outer; - } - } - } - } - - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { - if (dy) - setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); - setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); - e_preventDefault(e); - display.wheelStartX = null; // Abort measurement, if in progress - return; - } - - // 'Project' the visible viewport to cover the area that is being - // scrolled into view (if we know enough to estimate it). - if (dy && wheelPixelsPerUnit != null) { - var pixels = dy * wheelPixelsPerUnit; - var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; - if (pixels < 0) top = Math.max(0, top + pixels - 50); - else bot = Math.min(cm.doc.height, bot + pixels + 50); - updateDisplaySimple(cm, {top: top, bottom: bot}); - } - - if (wheelSamples < 20) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; - display.wheelDX = dx; display.wheelDY = dy; - setTimeout(function() { - if (display.wheelStartX == null) return; - var movedX = scroll.scrollLeft - display.wheelStartX; - var movedY = scroll.scrollTop - display.wheelStartY; - var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || - (movedX && display.wheelDX && movedX / display.wheelDX); - display.wheelStartX = display.wheelStartY = null; - if (!sample) return; - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - display.wheelDX += dx; display.wheelDY += dy; - } - } - } - - // KEY EVENTS - - // Run a handler that was bound to a key. - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) return false; - } - // Ensure previous input has been read, so that the handler sees a - // consistent view of the document - if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false; - var prevShift = cm.display.shift, done = false; - try { - if (isReadOnly(cm)) cm.state.suppressEdits = true; - if (dropShift) cm.display.shift = false; - done = bound(cm) != Pass; - } finally { - cm.display.shift = prevShift; - cm.state.suppressEdits = false; - } - return done; - } - - // Collect the currently active keymaps. - function allKeyMaps(cm) { - var maps = cm.state.keyMaps.slice(0); - if (cm.options.extraKeys) maps.push(cm.options.extraKeys); - maps.push(cm.options.keyMap); - return maps; - } - - var maybeTransition; - // Handle a key from the keydown event. - function handleKeyBinding(cm, e) { - // Handle automatic keymap transitions - var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto; - clearTimeout(maybeTransition); - if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() { - if (getKeyMap(cm.options.keyMap) == startMap) { - cm.options.keyMap = (next.call ? next.call(null, cm) : next); - keyMapChanged(cm); - } - }, 50); - - var name = keyName(e, true), handled = false; - if (!name) return false; - var keymaps = allKeyMaps(cm); - - if (e.shiftKey) { - // First try to resolve full name (including 'Shift-'). Failing - // that, see if there is a cursor-motion command (starting with - // 'go') bound to the keyname without 'Shift-'. - handled = lookupKey("Shift-" + name, keymaps, function(b) {return doHandleBinding(cm, b, true);}) - || lookupKey(name, keymaps, function(b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) - return doHandleBinding(cm, b); - }); - } else { - handled = lookupKey(name, keymaps, function(b) { return doHandleBinding(cm, b); }); - } - - if (handled) { - e_preventDefault(e); - restartBlink(cm); - signalLater(cm, "keyHandled", cm, name, e); - } - return handled; - } - - // Handle a key from the keypress event - function handleCharBinding(cm, e, ch) { - var handled = lookupKey("'" + ch + "'", allKeyMaps(cm), - function(b) { return doHandleBinding(cm, b, true); }); - if (handled) { - e_preventDefault(e); - restartBlink(cm); - signalLater(cm, "keyHandled", cm, "'" + ch + "'", e); - } - return handled; - } - - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - ensureFocus(cm); - if (signalDOMEvent(cm, e)) return; - // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; - var code = e.keyCode; - cm.display.shift = code == 16 || e.shiftKey; - var handled = handleKeyBinding(cm, e); - if (presto) { - lastStoppedKey = handled ? code : null; - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - cm.replaceSelection("", null, "cut"); - } - - // Turn mouse into crosshair when Alt is held on Mac. - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) - showCrossHair(cm); - } - - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv; - addClass(lineDiv, "CodeMirror-crosshair"); - - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair"); - off(document, "keyup", up); - off(document, "mouseover", up); - } - } - on(document, "keyup", up); - on(document, "mouseover", up); - } - - function onKeyUp(e) { - if (e.keyCode == 16) this.doc.sel.shift = false; - signalDOMEvent(this, e); - } - - function onKeyPress(e) { - var cm = this; - if (signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; - var keyCode = e.keyCode, charCode = e.charCode; - if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} - if (((presto && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - if (handleCharBinding(cm, e, ch)) return; - if (ie && ie_version >= 9) cm.display.inputHasSelection = null; - fastPoll(cm); - } - - // FOCUS/BLUR EVENTS - - function onFocus(cm) { - if (cm.options.readOnly == "nocursor") return; - if (!cm.state.focused) { - signal(cm, "focus", cm); - cm.state.focused = true; - addClass(cm.display.wrapper, "CodeMirror-focused"); - // The prevInput test prevents this from firing when a context - // menu is closed (since the resetInput would kill the - // select-all detection hack) - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - resetInput(cm); - if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730 - } - } - slowPoll(cm); - restartBlink(cm); - } - function onBlur(cm) { - if (cm.state.focused) { - signal(cm, "blur", cm); - cm.state.focused = false; - rmClass(cm.display.wrapper, "CodeMirror-focused"); - } - clearInterval(cm.display.blinker); - setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); - } - - // CONTEXT MENU HANDLING - - // To make the context menu work, we need to briefly unhide the - // textarea (making it as unobtrusive as possible) to let the - // right-click take effect on it. - function onContextMenu(cm, e) { - if (signalDOMEvent(cm, e, "contextmenu")) return; - var display = cm.display; - if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return; - - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; - if (!pos || presto) return; // Opera is difficult. - - // Reset the current text selection only if the click is done outside of the selection - // and 'resetSelectionOnContextMenu' option is true. - var reset = cm.options.resetSelectionOnContextMenu; - if (reset && cm.doc.sel.contains(pos) == -1) - operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); - - var oldCSS = display.input.style.cssText; - display.inputDiv.style.position = "absolute"; - display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + - "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + - (ie ? "rgba(255, 255, 255, .05)" : "transparent") + - "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) - focusInput(cm); - if (webkit) window.scrollTo(null, oldScrollY); - resetInput(cm); - // Adds "Select all" to context menu in FF - if (!cm.somethingSelected()) display.input.value = display.prevInput = " "; - display.selForContextMenu = cm.doc.sel; - clearTimeout(display.detectingSelectAll); - - // Select-all will be greyed out if there's nothing to select, so - // this adds a zero-width space so that we can later check whether - // it got selected. - function prepareSelectAllHack() { - if (display.input.selectionStart != null) { - var selected = cm.somethingSelected(); - var extval = display.input.value = "\u200b" + (selected ? display.input.value : ""); - display.prevInput = selected ? "" : "\u200b"; - display.input.selectionStart = 1; display.input.selectionEnd = extval.length; - // Re-set this, in case some other handler touched the - // selection in the meantime. - display.selForContextMenu = cm.doc.sel; - } - } - function rehide() { - display.inputDiv.style.position = "relative"; - display.input.style.cssText = oldCSS; - if (ie && ie_version < 9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos; - slowPoll(cm); - - // Try to detect the user choosing select-all - if (display.input.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); - var i = 0, poll = function() { - if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0) - operation(cm, commands.selectAll)(cm); - else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); - else resetInput(cm); - }; - display.detectingSelectAll = setTimeout(poll, 200); - } - } - - if (ie && ie_version >= 9) prepareSelectAllHack(); - if (captureRightClick) { - e_stop(e); - var mouseup = function() { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }; - on(window, "mouseup", mouseup); - } else { - setTimeout(rehide, 50); - } - } - - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) return false; - return gutterEvent(cm, e, "gutterContextMenu", false, signal); - } - - // UPDATING - - // Compute the position of the end of a change (its 'to' property - // refers to the pre-change end). - var changeEnd = CodeMirror.changeEnd = function(change) { - if (!change.text) return change.to; - return Pos(change.from.line + change.text.length - 1, - lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); - }; - - // Adjust a position to refer to the post-change position of the - // same text, or the end of the change if the change covers it. - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) return pos; - if (cmp(pos, change.to) <= 0) return changeEnd(change); - - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; - if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; - return Pos(line, ch); - } - - function computeSelAfterChange(doc, change) { - var out = []; - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - out.push(new Range(adjustForChange(range.anchor, change), - adjustForChange(range.head, change))); - } - return normalizeSelection(out, doc.sel.primIndex); - } - - function offsetPos(pos, old, nw) { - if (pos.line == old.line) - return Pos(nw.line, pos.ch - old.ch + nw.ch); - else - return Pos(nw.line + (pos.line - old.line), pos.ch); - } - - // Used by replaceSelections to allow moving the selection to the - // start or around the replaced test. Hint may be "start" or "around". - function computeReplacedSel(doc, changes, hint) { - var out = []; - var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - var from = offsetPos(change.from, oldPrev, newPrev); - var to = offsetPos(changeEnd(change), oldPrev, newPrev); - oldPrev = change.to; - newPrev = to; - if (hint == "around") { - var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; - out[i] = new Range(inv ? to : from, inv ? from : to); - } else { - out[i] = new Range(from, from); - } - } - return new Selection(out, doc.sel.primIndex); - } - - // Allow "beforeChange" event handlers to influence a change - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function() { this.canceled = true; } - }; - if (update) obj.update = function(from, to, text, origin) { - if (from) this.from = clipPos(doc, from); - if (to) this.to = clipPos(doc, to); - if (text) this.text = text; - if (origin !== undefined) this.origin = origin; - }; - signal(doc, "beforeChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); - - if (obj.canceled) return null; - return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; - } - - // Apply a change to a document, and add it to the document's - // history, and propagating it to all linked documents. - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); - if (doc.cm.state.suppressEdits) return; - } - - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true); - if (!change) return; - } - - // Possibly split or suppress the update based on the presence - // of read-only spans in its range. - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); - if (split) { - for (var i = split.length - 1; i >= 0; --i) - makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); - } else { - makeChangeInner(doc, change); - } - } - - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; - var selAfter = computeSelAfterChange(doc, change); - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); - var rebased = []; - - linkedDocs(doc, function(doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); - }); - } - - // Revert a change stored in a document's history. - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - if (doc.cm && doc.cm.state.suppressEdits) return; - - var hist = doc.history, event, selAfter = doc.sel; - var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; - - // Verify that there is a useable event (so that ctrl-z won't - // needlessly clear selection events) - for (var i = 0; i < source.length; i++) { - event = source[i]; - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) - break; - } - if (i == source.length) return; - hist.lastOrigin = hist.lastSelOrigin = null; - - for (;;) { - event = source.pop(); - if (event.ranges) { - pushSelectionToHistory(event, dest); - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, {clearRedo: false}); - return; - } - selAfter = event; - } - else break; - } - - // Build up a reverse change object to add to the opposite history - // stack (redo when undoing, and vice versa). - var antiChanges = []; - pushSelectionToHistory(selAfter, dest); - dest.push({changes: antiChanges, generation: hist.generation}); - hist.generation = event.generation || ++hist.maxGeneration; - - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); - - for (var i = event.changes.length - 1; i >= 0; --i) { - var change = event.changes[i]; - change.origin = type; - if (filter && !filterChange(doc, change, false)) { - source.length = 0; - return; - } - - antiChanges.push(historyChangeFromChange(doc, change)); - - var after = i ? computeSelAfterChange(doc, change) : lst(source); - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); - var rebased = []; - - // Propagate to the linked documents - linkedDocs(doc, function(doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); - }); - } - } - - // Sub-views need their line numbers shifted when text is added - // above or below them in the parent document. - function shiftDoc(doc, distance) { - if (distance == 0) return; - doc.first += distance; - doc.sel = new Selection(map(doc.sel.ranges, function(range) { - return new Range(Pos(range.anchor.line + distance, range.anchor.ch), - Pos(range.head.line + distance, range.head.ch)); - }), doc.sel.primIndex); - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance); - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) - regLineChange(doc.cm, l, "gutter"); - } - } - - // More lower-level change function, handling only a single document - // (not linked ones). - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) - return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); - - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); - return; - } - if (change.from.line > doc.lastLine()) return; - - // Clip the change to the size of this doc - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line); - shiftDoc(doc, shift); - change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], origin: change.origin}; - } - var last = doc.lastLine(); - if (change.to.line > last) { - change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], origin: change.origin}; - } - - change.removed = getBetween(doc, change.from, change.to); - - if (!selAfter) selAfter = computeSelAfterChange(doc, change); - if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); - else updateDoc(doc, change, spans); - setSelectionNoUndo(doc, selAfter, sel_dontScroll); - } - - // Handle the interaction of a change to a document with the editor - // that this document is part of. - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to; - - var recomputeMaxLength = false, checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function(line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true; - } - }); - } - - if (doc.sel.contains(change.from, change.to) > -1) - signalCursorActivity(cm); - - updateDoc(doc, change, spans, estimateHeight(cm)); - - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function(line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) cm.curOp.updateMaxLine = true; - } - - // Adjust frontier, schedule worker - doc.frontier = Math.min(doc.frontier, from.line); - startWorker(cm, 400); - - var lendiff = change.text.length - (to.line - from.line) - 1; - // Remember that these lines changed, for updating the display - if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - regLineChange(cm, from.line, "text"); - else - regChange(cm, from.line, to.line + 1, lendiff); - - var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); - if (changeHandler || changesHandler) { - var obj = { - from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin - }; - if (changeHandler) signalLater(cm, "change", cm, obj); - if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); - } - cm.display.selForContextMenu = null; - } - - function replaceRange(doc, code, from, to, origin) { - if (!to) to = from; - if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } - if (typeof code == "string") code = splitLines(code); - makeChange(doc, {from: from, to: to, text: code, origin: origin}); - } - - // SCROLLING THINGS INTO VIEW - - // If an editor sits on the top or bottom of the window, partially - // scrolled out of view, this ensures that the cursor is visible. - function maybeScrollWindow(cm, coords) { - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; - if (coords.top + box.top < 0) doScroll = true; - else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + - (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + - (coords.bottom - coords.top + scrollerCutOff) + "px; left: " + - coords.left + "px; width: 2px;"); - cm.display.lineSpace.appendChild(scrollNode); - scrollNode.scrollIntoView(doScroll); - cm.display.lineSpace.removeChild(scrollNode); - } - } - - // Scroll a given position into view (immediately), verifying that - // it actually became visible (as line heights are accurately - // measured, the position of something may 'drift' during drawing). - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) margin = 0; - for (;;) { - var changed = false, coords = cursorCoords(cm, pos); - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); - var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), - Math.min(coords.top, endCoords.top) - margin, - Math.max(coords.left, endCoords.left), - Math.max(coords.bottom, endCoords.bottom) + margin); - var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; - if (scrollPos.scrollTop != null) { - setScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; - } - if (!changed) return coords; - } - } - - // Scroll a given set of coordinates into view (immediately). - function scrollIntoView(cm, x1, y1, x2, y2) { - var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); - if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); - if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); - } - - // Calculate a new scroll position needed to scroll the given - // rectangle into view. Returns an object with scrollTop and - // scrollLeft properties. When these are undefined, the - // vertical/horizontal position does not need to be adjusted. - function calculateScrollPos(cm, x1, y1, x2, y2) { - var display = cm.display, snapMargin = textHeight(cm.display); - if (y1 < 0) y1 = 0; - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; - var screen = display.scroller.clientHeight - scrollerCutOff, result = {}; - if (y2 - y1 > screen) y2 = y1 + screen; - var docBottom = cm.doc.height + paddingVert(display); - var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; - if (y1 < screentop) { - result.scrollTop = atTop ? 0 : y1; - } else if (y2 > screentop + screen) { - var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); - if (newTop != screentop) result.scrollTop = newTop; - } - - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; - var screenw = display.scroller.clientWidth - scrollerCutOff - display.gutters.offsetWidth; - var tooWide = x2 - x1 > screenw; - if (tooWide) x2 = y1 + screen; - if (x1 < 10) - result.scrollLeft = 0; - else if (x1 < screenleft) - result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); - else if (x2 > screenw + screenleft - 3) - result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; - - return result; - } - - // Store a relative adjustment to the scroll position in the current - // operation (to be applied when the operation finishes). - function addToScrollPos(cm, left, top) { - if (left != null || top != null) resolveScrollToPos(cm); - if (left != null) - cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; - if (top != null) - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; - } - - // Make sure that at the end of the operation the current cursor is - // shown. - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(), from = cur, to = cur; - if (!cm.options.lineWrapping) { - from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; - to = Pos(cur.line, cur.ch + 1); - } - cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; - } - - // When an operation has its scrollToPos property set, and another - // scroll action is applied before the end of the operation, this - // 'simulates' scrolling that position into view in a cheap way, so - // that the effect of intermediate scroll commands is not ignored. - function resolveScrollToPos(cm) { - var range = cm.curOp.scrollToPos; - if (range) { - cm.curOp.scrollToPos = null; - var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); - var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), - Math.min(from.top, to.top) - range.margin, - Math.max(from.right, to.right), - Math.max(from.bottom, to.bottom) + range.margin); - cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); - } - } - - // API UTILITIES - - // Indent the given line. The how parameter can be "smart", - // "add"/null, "subtract", or "prev". When aggressive is false - // (typically set to true for forced single-line indents), empty - // lines are not indented, and places where the mode returns Pass - // are left alone. - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, state; - if (how == null) how = "add"; - if (how == "smart") { - // Fall back to "prev" when the mode doesn't have an indentation - // method. - if (!doc.mode.indent) how = "prev"; - else state = getStateBefore(cm, n); - } - - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); - if (line.stateAfter) line.stateAfter = null; - var curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0; - how = "not"; - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass || indentation > 150) { - if (!aggressive) return; - how = "prev"; - } - } - if (how == "prev") { - if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); - else indentation = 0; - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit; - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit; - } else if (typeof how == "number") { - indentation = curSpace + how; - } - indentation = Math.max(0, indentation); - - var indentString = "", pos = 0; - if (cm.options.indentWithTabs) - for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} - if (pos < indentation) indentString += spaceStr(indentation - pos); - - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - } else { - // Ensure that, if the cursor was in the whitespace at the start - // of the line, it is moved to the end of that space. - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - if (range.head.line == n && range.head.ch < curSpaceString.length) { - var pos = Pos(n, curSpaceString.length); - replaceOneSelection(doc, i, new Range(pos, pos)); - break; - } - } - } - line.stateAfter = null; - } - - // Utility for applying a change to a line by handle or number, - // returning the number and optionally registering the line as - // changed. - function changeLine(doc, handle, changeType, op) { - var no = handle, line = handle; - if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); - else no = lineNo(handle); - if (no == null) return null; - if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); - return line; - } - - // Helper for deleting text near the selection(s), used to implement - // backspace, delete, and similar functionality. - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, kill = []; - // Build up a set of ranges to kill first, merging overlapping - // ranges. - for (var i = 0; i < ranges.length; i++) { - var toKill = compute(ranges[i]); - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop(); - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from; - break; - } - } - kill.push(toKill); - } - // Next, remove those actual ranges. - runInOp(cm, function() { - for (var i = kill.length - 1; i >= 0; i--) - replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); - ensureCursorVisible(cm); - }); - } - - // Used for horizontal relative motion. Dir is -1 or 1 (left or - // right), unit can be "char", "column" (like char, but doesn't - // cross line boundaries), "word" (across next word), or "group" (to - // the start of next group of word or non-word-non-whitespace - // chars). The visually param controls whether, in right-to-left - // text, direction 1 means to move towards the next index in the - // string, or towards the character to the right of the current - // position. The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosH(doc, pos, dir, unit, visually) { - var line = pos.line, ch = pos.ch, origDir = dir; - var lineObj = getLine(doc, line); - var possible = true; - function findNextLine() { - var l = line + dir; - if (l < doc.first || l >= doc.first + doc.size) return (possible = false); - line = l; - return lineObj = getLine(doc, l); - } - function moveOnce(boundToLine) { - var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); - if (next == null) { - if (!boundToLine && findNextLine()) { - if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); - else ch = dir < 0 ? lineObj.text.length : 0; - } else return (possible = false); - } else ch = next; - return true; - } - - if (unit == "char") moveOnce(); - else if (unit == "column") moveOnce(true); - else if (unit == "word" || unit == "group") { - var sawType = null, group = unit == "group"; - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) break; - var cur = lineObj.text.charAt(ch) || "\n"; - var type = isWordChar(cur, helper) ? "w" - : group && cur == "\n" ? "n" - : !group || /\s/.test(cur) ? null - : "p"; - if (group && !first && !type) type = "s"; - if (sawType && sawType != type) { - if (dir < 0) {dir = 1; moveOnce();} - break; - } - - if (type) sawType = type; - if (dir > 0 && !moveOnce(!first)) break; - } - } - var result = skipAtomic(doc, Pos(line, ch), origDir, true); - if (!possible) result.hitSide = true; - return result; - } - - // For relative vertical movement. Dir may be -1 or 1. Unit can be - // "page" or "line". The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, x = pos.left, y; - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - for (;;) { - var target = coordsChar(cm, x, y); - if (!target.outside) break; - if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } - y += dir * 5; - } - return target; - } - - // EDITOR METHODS - - // The publicly visible API. Note that methodOp(f) means - // 'wrap f in an operation, performed on its `this` parameter'. - - // This is not the complete set of editor methods. Most of the - // methods defined on the Doc type are also injected into - // CodeMirror.prototype, for backwards compatibility and - // convenience. - - CodeMirror.prototype = { - constructor: CodeMirror, - focus: function(){window.focus(); focusInput(this); fastPoll(this);}, - - setOption: function(option, value) { - var options = this.options, old = options[option]; - if (options[option] == value && option != "mode") return; - options[option] = value; - if (optionHandlers.hasOwnProperty(option)) - operation(this, optionHandlers[option])(this, value, old); - }, - - getOption: function(option) {return this.options[option];}, - getDoc: function() {return this.doc;}, - - addKeyMap: function(map, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](map); - }, - removeKeyMap: function(map) { - var maps = this.state.keyMaps; - for (var i = 0; i < maps.length; ++i) - if (maps[i] == map || (typeof maps[i] != "string" && maps[i].name == map)) { - maps.splice(i, 1); - return true; - } - }, - - addOverlay: methodOp(function(spec, options) { - var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); - if (mode.startState) throw new Error("Overlays may not be stateful."); - this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); - this.state.modeGen++; - regChange(this); - }), - removeOverlay: methodOp(function(spec) { - var overlays = this.state.overlays; - for (var i = 0; i < overlays.length; ++i) { - var cur = overlays[i].modeSpec; - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i, 1); - this.state.modeGen++; - regChange(this); - return; - } - } - }), - - indentLine: methodOp(function(n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; - else dir = dir ? "add" : "subtract"; - } - if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); - }), - indentSelection: methodOp(function(how) { - var ranges = this.doc.sel.ranges, end = -1; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) { - var from = range.from(), to = range.to(); - var start = Math.max(end, from.line); - end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; - for (var j = start; j < end; ++j) - indentLine(this, j, how); - var newRanges = this.doc.sel.ranges; - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) - replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); - } else if (range.head.line > end) { - indentLine(this, range.head.line, how, true); - end = range.head.line; - if (i == this.doc.sel.primIndex) ensureCursorVisible(this); - } - } - }), - - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(pos, precise) { - var doc = this.doc; - pos = clipPos(doc, pos); - var state = getStateBefore(this, pos.line, precise), mode = this.doc.mode; - var line = getLine(doc, pos.line); - var stream = new StringStream(line.text, this.options.tabSize); - while (stream.pos < pos.ch && !stream.eol()) { - stream.start = stream.pos; - var style = readToken(mode, stream, state); - } - return {start: stream.start, - end: stream.pos, - string: stream.current(), - type: style || null, - state: state}; - }, - - getTokenTypeAt: function(pos) { - pos = clipPos(this.doc, pos); - var styles = getLineStyles(this, getLine(this.doc, pos.line)); - var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; - var type; - if (ch == 0) type = styles[2]; - else for (;;) { - var mid = (before + after) >> 1; - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; - else if (styles[mid * 2 + 1] < ch) before = mid + 1; - else { type = styles[mid * 2 + 2]; break; } - } - var cut = type ? type.indexOf("cm-overlay ") : -1; - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); - }, - - getModeAt: function(pos) { - var mode = this.doc.mode; - if (!mode.innerMode) return mode; - return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; - }, - - getHelper: function(pos, type) { - return this.getHelpers(pos, type)[0]; - }, - - getHelpers: function(pos, type) { - var found = []; - if (!helpers.hasOwnProperty(type)) return helpers; - var help = helpers[type], mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) found.push(help[mode[type]]); - } else if (mode[type]) { - for (var i = 0; i < mode[type].length; i++) { - var val = help[mode[type][i]]; - if (val) found.push(val); - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]); - } else if (help[mode.name]) { - found.push(help[mode.name]); - } - for (var i = 0; i < help._global.length; i++) { - var cur = help._global[i]; - if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) - found.push(cur.val); - } - return found; - }, - - getStateAfter: function(line, precise) { - var doc = this.doc; - line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); - return getStateBefore(this, line + 1, precise); - }, - - cursorCoords: function(start, mode) { - var pos, range = this.doc.sel.primary(); - if (start == null) pos = range.head; - else if (typeof start == "object") pos = clipPos(this.doc, start); - else pos = start ? range.from() : range.to(); - return cursorCoords(this, pos, mode || "page"); - }, - - charCoords: function(pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page"); - }, - - coordsChar: function(coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page"); - return coordsChar(this, coords.left, coords.top); - }, - - lineAtHeight: function(height, mode) { - height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; - return lineAtHeight(this.doc, height + this.display.viewOffset); - }, - heightAtLine: function(line, mode) { - var end = false, last = this.doc.first + this.doc.size - 1; - if (line < this.doc.first) line = this.doc.first; - else if (line > last) { line = last; end = true; } - var lineObj = getLine(this.doc, line); - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + - (end ? this.doc.height - heightAtLine(lineObj) : 0); - }, - - defaultTextHeight: function() { return textHeight(this.display); }, - defaultCharWidth: function() { return charWidth(this.display); }, - - setGutterMarker: methodOp(function(line, gutterID, value) { - return changeLine(this.doc, line, "gutter", function(line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) line.gutterMarkers = null; - return true; - }); - }), - - clearGutter: methodOp(function(gutterID) { - var cm = this, doc = cm.doc, i = doc.first; - doc.iter(function(line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - line.gutterMarkers[gutterID] = null; - regLineChange(cm, i, "gutter"); - if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; - } - ++i; - }); - }), - - addLineWidget: methodOp(function(handle, node, options) { - return addLineWidget(this, handle, node, options); - }), - - removeLineWidget: function(widget) { widget.clear(); }, - - lineInfo: function(line) { - if (typeof line == "number") { - if (!isLine(this.doc, line)) return null; - var n = line; - line = getLine(this.doc, line); - if (!line) return null; - } else { - var n = lineNo(line); - if (n == null) return null; - } - return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, - textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, - widgets: line.widgets}; - }, - - getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, - - addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.doc, pos)); - var top = pos.bottom, left = pos.left; - node.style.position = "absolute"; - display.sizer.appendChild(node); - if (vert == "over") { - top = pos.top; - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - // Default to positioning above (if specified and possible); otherwise default to positioning below - if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) - top = pos.top - node.offsetHeight; - else if (pos.bottom + node.offsetHeight <= vspace) - top = pos.bottom; - if (left + node.offsetWidth > hspace) - left = hspace - node.offsetWidth; - } - node.style.top = top + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") left = 0; - else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; - node.style.left = left + "px"; - } - if (scroll) - scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); - }, - - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - - execCommand: function(cmd) { - if (commands.hasOwnProperty(cmd)) - return commands[cmd](this); - }, - - findPosH: function(from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { dir = -1; amount = -amount; } - for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { - cur = findPosH(this.doc, cur, dir, unit, visually); - if (cur.hitSide) break; - } - return cur; - }, - - moveH: methodOp(function(dir, unit) { - var cm = this; - cm.extendSelectionsBy(function(range) { - if (cm.display.shift || cm.doc.extend || range.empty()) - return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); - else - return dir < 0 ? range.from() : range.to(); - }, sel_move); - }), - - deleteH: methodOp(function(dir, unit) { - var sel = this.doc.sel, doc = this.doc; - if (sel.somethingSelected()) - doc.replaceSelection("", null, "+delete"); - else - deleteNearSelection(this, function(range) { - var other = findPosH(doc, range.head, dir, unit, false); - return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; - }); - }), - - findPosV: function(from, amount, unit, goalColumn) { - var dir = 1, x = goalColumn; - if (amount < 0) { dir = -1; amount = -amount; } - for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { - var coords = cursorCoords(this, cur, "div"); - if (x == null) x = coords.left; - else coords.left = x; - cur = findPosV(this, coords, dir, unit); - if (cur.hitSide) break; - } - return cur; - }, - - moveV: methodOp(function(dir, unit) { - var cm = this, doc = this.doc, goals = []; - var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); - doc.extendSelectionsBy(function(range) { - if (collapse) - return dir < 0 ? range.from() : range.to(); - var headPos = cursorCoords(cm, range.head, "div"); - if (range.goalColumn != null) headPos.left = range.goalColumn; - goals.push(headPos.left); - var pos = findPosV(cm, headPos, dir, unit); - if (unit == "page" && range == doc.sel.primary()) - addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); - return pos; - }, sel_move); - if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) - doc.sel.ranges[i].goalColumn = goals[i]; - }), - - // Find the word at the given position (as returned by coordsChar). - findWordAt: function(pos) { - var doc = this.doc, line = getLine(doc, pos.line).text; - var start = pos.ch, end = pos.ch; - if (line) { - var helper = this.getHelper(pos, "wordChars"); - if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) - ? function(ch) { return isWordChar(ch, helper); } - : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} - : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; - while (start > 0 && check(line.charAt(start - 1))) --start; - while (end < line.length && check(line.charAt(end))) ++end; - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)); - }, - - toggleOverwrite: function(value) { - if (value != null && value == this.state.overwrite) return; - if (this.state.overwrite = !this.state.overwrite) - addClass(this.display.cursorDiv, "CodeMirror-overwrite"); - else - rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); - - signal(this, "overwriteToggle", this, this.state.overwrite); - }, - hasFocus: function() { return activeElt() == this.display.input; }, - - scrollTo: methodOp(function(x, y) { - if (x != null || y != null) resolveScrollToPos(this); - if (x != null) this.curOp.scrollLeft = x; - if (y != null) this.curOp.scrollTop = y; - }), - getScrollInfo: function() { - var scroller = this.display.scroller, co = scrollerCutOff; - return {left: scroller.scrollLeft, top: scroller.scrollTop, - height: scroller.scrollHeight - co, width: scroller.scrollWidth - co, - clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co}; - }, - - scrollIntoView: methodOp(function(range, margin) { - if (range == null) { - range = {from: this.doc.sel.primary().head, to: null}; - if (margin == null) margin = this.options.cursorScrollMargin; - } else if (typeof range == "number") { - range = {from: Pos(range, 0), to: null}; - } else if (range.from == null) { - range = {from: range, to: null}; - } - if (!range.to) range.to = range.from; - range.margin = margin || 0; - - if (range.from.line != null) { - resolveScrollToPos(this); - this.curOp.scrollToPos = range; - } else { - var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), - Math.min(range.from.top, range.to.top) - range.margin, - Math.max(range.from.right, range.to.right), - Math.max(range.from.bottom, range.to.bottom) + range.margin); - this.scrollTo(sPos.scrollLeft, sPos.scrollTop); - } - }), - - setSize: methodOp(function(width, height) { - var cm = this; - function interpret(val) { - return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; - } - if (width != null) cm.display.wrapper.style.width = interpret(width); - if (height != null) cm.display.wrapper.style.height = interpret(height); - if (cm.options.lineWrapping) clearLineMeasurementCache(this); - var lineNo = cm.display.viewFrom; - cm.doc.iter(lineNo, cm.display.viewTo, function(line) { - if (line.widgets) for (var i = 0; i < line.widgets.length; i++) - if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } - ++lineNo; - }); - cm.curOp.forceUpdate = true; - signal(cm, "refresh", this); - }), - - operation: function(f){return runInOp(this, f);}, - - refresh: methodOp(function() { - var oldHeight = this.display.cachedTextHeight; - regChange(this); - this.curOp.forceUpdate = true; - clearCaches(this); - this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); - updateGutterSpace(this); - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) - estimateLineHeights(this); - signal(this, "refresh", this); - }), - - swapDoc: methodOp(function(doc) { - var old = this.doc; - old.cm = null; - attachDoc(this, doc); - clearCaches(this); - resetInput(this); - this.scrollTo(doc.scrollLeft, doc.scrollTop); - this.curOp.forceScroll = true; - signalLater(this, "swapDoc", this, old); - return old; - }), - - getInputField: function(){return this.display.input;}, - getWrapperElement: function(){return this.display.wrapper;}, - getScrollerElement: function(){return this.display.scroller;}, - getGutterElement: function(){return this.display.gutters;} - }; - eventMixin(CodeMirror); - - // OPTION DEFAULTS - - // The default configuration options. - var defaults = CodeMirror.defaults = {}; - // Functions to run when options are changed. - var optionHandlers = CodeMirror.optionHandlers = {}; - - function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt; - if (handle) optionHandlers[name] = - notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; - } - - // Passed to option handlers when there is no old value. - var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; - - // These two are, on init, called from the constructor because they - // have to be initialized before the editor can start at all. - option("value", "", function(cm, val) { - cm.setValue(val); - }, true); - option("mode", null, function(cm, val) { - cm.doc.modeOption = val; - loadMode(cm); - }, true); - - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function(cm) { - resetModeState(cm); - clearCaches(cm); - regChange(cm); - }, true); - option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val) { - cm.options.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); - cm.refresh(); - }, true); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); - option("electricChars", true); - option("rtlMoveVisually", !windows); - option("wholeLineUpdateBefore", true); - - option("theme", "default", function(cm) { - themeChanged(cm); - guttersChanged(cm); - }, true); - option("keyMap", "default", keyMapChanged); - option("extraKeys", null); - - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("fixedGutter", true, function(cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; - cm.refresh(); - }, true); - option("coverGutterNextToScrollbar", false, updateScrollbars, true); - option("lineNumbers", false, function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("firstLineNumber", 1, guttersChanged, true); - option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); - option("showCursorWhenSelecting", false, updateSelection, true); - - option("resetSelectionOnContextMenu", true); - - option("readOnly", false, function(cm, val) { - if (val == "nocursor") { - onBlur(cm); - cm.display.input.blur(); - cm.display.disabled = true; - } else { - cm.display.disabled = false; - if (!val) resetInput(cm); - } - }); - option("disableInput", false, function(cm, val) {if (!val) resetInput(cm);}, true); - option("dragDrop", true); - - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); - option("cursorHeight", 1, updateSelection, true); - option("singleCursorHeightPerLine", true, updateSelection, true); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true, resetModeState, true); - option("addModeClass", false, resetModeState, true); - option("pollInterval", 100); - option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); - option("historyEventDelay", 1250); - option("viewportMargin", 10, function(cm){cm.refresh();}, true); - option("maxHighlightLength", 10000, resetModeState, true); - option("moveInputWithCursor", true, function(cm, val) { - if (!val) cm.display.inputDiv.style.top = cm.display.inputDiv.style.left = 0; - }); - - option("tabindex", null, function(cm, val) { - cm.display.input.tabIndex = val || ""; - }); - option("autofocus", null); - - // MODE DEFINITION AND QUERYING - - // Known modes, by name and by MIME - var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; - - // Extra arguments are stored as the mode's dependencies, which is - // used by (legacy) mechanisms like loadmode.js to automatically - // load a mode. (Preferred mechanism is the require/define calls.) - CodeMirror.defineMode = function(name, mode) { - if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; - if (arguments.length > 2) { - mode.dependencies = []; - for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]); - } - modes[name] = mode; - }; - - CodeMirror.defineMIME = function(mime, spec) { - mimeModes[mime] = spec; - }; - - // Given a MIME type, a {name, ...options} config object, or a name - // string, return a mode config object. - CodeMirror.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name]; - if (typeof found == "string") found = {name: found}; - spec = createObj(found, spec); - spec.name = found.name; - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return CodeMirror.resolveMode("application/xml"); - } - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; - }; - - // Given a mode spec (anything that resolveMode accepts), find and - // initialize an actual mode object. - CodeMirror.getMode = function(options, spec) { - var spec = CodeMirror.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) return CodeMirror.getMode(options, "text/plain"); - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) continue; - if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; - modeObj[prop] = exts[prop]; - } - } - modeObj.name = spec.name; - if (spec.helperType) modeObj.helperType = spec.helperType; - if (spec.modeProps) for (var prop in spec.modeProps) - modeObj[prop] = spec.modeProps[prop]; - - return modeObj; - }; - - // Minimal default mode. - CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; - }); - CodeMirror.defineMIME("text/plain", "null"); - - // This can be used to attach properties to mode objects from - // outside the actual mode definition. - var modeExtensions = CodeMirror.modeExtensions = {}; - CodeMirror.extendMode = function(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); - copyObj(properties, exts); - }; - - // EXTENSIONS - - CodeMirror.defineExtension = function(name, func) { - CodeMirror.prototype[name] = func; - }; - CodeMirror.defineDocExtension = function(name, func) { - Doc.prototype[name] = func; - }; - CodeMirror.defineOption = option; - - var initHooks = []; - CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; - - var helpers = CodeMirror.helpers = {}; - CodeMirror.registerHelper = function(type, name, value) { - if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []}; - helpers[type][name] = value; - }; - CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { - CodeMirror.registerHelper(type, name, value); - helpers[type]._global.push({pred: predicate, val: value}); - }; - - // MODE STATE HANDLING - - // Utility functions for working with state. Exported because nested - // modes need to do this for their inner modes. - - var copyState = CodeMirror.copyState = function(mode, state) { - if (state === true) return state; - if (mode.copyState) return mode.copyState(state); - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) val = val.concat([]); - nstate[n] = val; - } - return nstate; - }; - - var startState = CodeMirror.startState = function(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - }; - - // Given a mode and a state (for that mode), find the inner mode and - // state at the position that the state refers to. - CodeMirror.innerMode = function(mode, state) { - while (mode.innerMode) { - var info = mode.innerMode(state); - if (!info || info.mode == mode) break; - state = info.state; - mode = info.mode; - } - return info || {mode: mode, state: state}; - }; - - // STANDARD COMMANDS - - // Commands are parameter-less actions that can be performed on an - // editor, mostly used for keybindings. - var commands = CodeMirror.commands = { - selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, - singleSelection: function(cm) { - cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); - }, - killLine: function(cm) { - deleteNearSelection(cm, function(range) { - if (range.empty()) { - var len = getLine(cm.doc, range.head.line).text.length; - if (range.head.ch == len && range.head.line < cm.lastLine()) - return {from: range.head, to: Pos(range.head.line + 1, 0)}; - else - return {from: range.head, to: Pos(range.head.line, len)}; - } else { - return {from: range.from(), to: range.to()}; - } - }); - }, - deleteLine: function(cm) { - deleteNearSelection(cm, function(range) { - return {from: Pos(range.from().line, 0), - to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; - }); - }, - delLineLeft: function(cm) { - deleteNearSelection(cm, function(range) { - return {from: Pos(range.from().line, 0), to: range.from()}; - }); - }, - delWrappedLineLeft: function(cm) { - deleteNearSelection(cm, function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var leftPos = cm.coordsChar({left: 0, top: top}, "div"); - return {from: leftPos, to: range.from()}; - }); - }, - delWrappedLineRight: function(cm) { - deleteNearSelection(cm, function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - return {from: range.from(), to: rightPos }; - }); - }, - undo: function(cm) {cm.undo();}, - redo: function(cm) {cm.redo();}, - undoSelection: function(cm) {cm.undoSelection();}, - redoSelection: function(cm) {cm.redoSelection();}, - goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, - goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, - goLineStart: function(cm) { - cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, - {origin: "+move", bias: 1}); - }, - goLineStartSmart: function(cm) { - cm.extendSelectionsBy(function(range) { - return lineStartSmart(cm, range.head); - }, {origin: "+move", bias: 1}); - }, - goLineEnd: function(cm) { - cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, - {origin: "+move", bias: -1}); - }, - goLineRight: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - }, sel_move); - }, - goLineLeft: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - return cm.coordsChar({left: 0, top: top}, "div"); - }, sel_move); - }, - goLineLeftSmart: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var pos = cm.coordsChar({left: 0, top: top}, "div"); - if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); - return pos; - }, sel_move); - }, - goLineUp: function(cm) {cm.moveV(-1, "line");}, - goLineDown: function(cm) {cm.moveV(1, "line");}, - goPageUp: function(cm) {cm.moveV(-1, "page");}, - goPageDown: function(cm) {cm.moveV(1, "page");}, - goCharLeft: function(cm) {cm.moveH(-1, "char");}, - goCharRight: function(cm) {cm.moveH(1, "char");}, - goColumnLeft: function(cm) {cm.moveH(-1, "column");}, - goColumnRight: function(cm) {cm.moveH(1, "column");}, - goWordLeft: function(cm) {cm.moveH(-1, "word");}, - goGroupRight: function(cm) {cm.moveH(1, "group");}, - goGroupLeft: function(cm) {cm.moveH(-1, "group");}, - goWordRight: function(cm) {cm.moveH(1, "word");}, - delCharBefore: function(cm) {cm.deleteH(-1, "char");}, - delCharAfter: function(cm) {cm.deleteH(1, "char");}, - delWordBefore: function(cm) {cm.deleteH(-1, "word");}, - delWordAfter: function(cm) {cm.deleteH(1, "word");}, - delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, - delGroupAfter: function(cm) {cm.deleteH(1, "group");}, - indentAuto: function(cm) {cm.indentSelection("smart");}, - indentMore: function(cm) {cm.indentSelection("add");}, - indentLess: function(cm) {cm.indentSelection("subtract");}, - insertTab: function(cm) {cm.replaceSelection("\t");}, - insertSoftTab: function(cm) { - var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].from(); - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(new Array(tabSize - col % tabSize + 1).join(" ")); - } - cm.replaceSelections(spaces); - }, - defaultTab: function(cm) { - if (cm.somethingSelected()) cm.indentSelection("add"); - else cm.execCommand("insertTab"); - }, - transposeChars: function(cm) { - runInOp(cm, function() { - var ranges = cm.listSelections(), newSel = []; - for (var i = 0; i < ranges.length; i++) { - var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; - if (line) { - if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1); - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), - Pos(cur.line, cur.ch - 2), cur, "+transpose"); - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text; - if (prev) - cm.replaceRange(line.charAt(0) + "\n" + prev.charAt(prev.length - 1), - Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); - } - } - newSel.push(new Range(cur, cur)); - } - cm.setSelections(newSel); - }); - }, - newlineAndIndent: function(cm) { - runInOp(cm, function() { - var len = cm.listSelections().length; - for (var i = 0; i < len; i++) { - var range = cm.listSelections()[i]; - cm.replaceRange("\n", range.anchor, range.head, "+input"); - cm.indentLine(range.from().line + 1, null, true); - ensureCursorVisible(cm); - } - }); - }, - toggleOverwrite: function(cm) {cm.toggleOverwrite();} - }; - - // STANDARD KEYMAPS - - var keyMap = CodeMirror.keyMap = {}; - keyMap.basic = { - "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", - "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", - "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", - "Tab": "defaultTab", "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", - "Esc": "singleSelection" - }; - // Note that the save and find-related commands aren't defined by - // default. User code or addons can define them. Unknown commands - // are simply ignored. - keyMap.pcDefault = { - "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Ctrl-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", - "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", - "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", - "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", - fallthrough: "basic" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", - "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", - "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", - "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", - fallthrough: ["basic", "emacsy"] - }; - // Very basic readline/emacs-style bindings, which are standard on Mac. - keyMap.emacsy = { - "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", - "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", - "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - - // KEYMAP DISPATCH - - function getKeyMap(val) { - if (typeof val == "string") return keyMap[val]; - else return val; - } - - // Given an array of keymaps and a key name, call handle on any - // bindings found, until that returns a truthy value, at which point - // we consider the key handled. Implements things like binding a key - // to false stopping further handling and keymap fallthrough. - var lookupKey = CodeMirror.lookupKey = function(name, maps, handle) { - function lookup(map) { - map = getKeyMap(map); - var found = map[name]; - if (found === false) return "stop"; - if (found != null && handle(found)) return true; - if (map.nofallthrough) return "stop"; - - var fallthrough = map.fallthrough; - if (fallthrough == null) return false; - if (Object.prototype.toString.call(fallthrough) != "[object Array]") - return lookup(fallthrough); - for (var i = 0; i < fallthrough.length; ++i) { - var done = lookup(fallthrough[i]); - if (done) return done; - } - return false; - } - - for (var i = 0; i < maps.length; ++i) { - var done = lookup(maps[i]); - if (done) return done != "stop"; - } - }; - - // Modifier key presses don't count as 'real' key presses for the - // purpose of keymap fallthrough. - var isModifierKey = CodeMirror.isModifierKey = function(event) { - var name = keyNames[event.keyCode]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - }; - - // Look up the name of a key as indicated by an event object. - var keyName = CodeMirror.keyName = function(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) return false; - var name = keyNames[event.keyCode]; - if (name == null || event.altGraphKey) return false; - if (event.altKey) name = "Alt-" + name; - if (flipCtrlCmd ? event.metaKey : event.ctrlKey) name = "Ctrl-" + name; - if (flipCtrlCmd ? event.ctrlKey : event.metaKey) name = "Cmd-" + name; - if (!noShift && event.shiftKey) name = "Shift-" + name; - return name; - }; - - // FROMTEXTAREA - - CodeMirror.fromTextArea = function(textarea, options) { - if (!options) options = {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabindex) - options.tabindex = textarea.tabindex; - if (!options.placeholder && textarea.placeholder) - options.placeholder = textarea.placeholder; - // Set autofocus to true if this textarea is focused, or if it has - // autofocus and no other element is focused. - if (options.autofocus == null) { - var hasFocus = activeElt(); - options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - - function save() {textarea.value = cm.getValue();} - if (textarea.form) { - on(textarea.form, "submit", save); - // Deplorable hack to make the submit method do the right thing. - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form, realSubmit = form.submit; - try { - var wrappedSubmit = form.submit = function() { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch(e) {} - } - } - - textarea.style.display = "none"; - var cm = CodeMirror(function(node) { - textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - cm.save = save; - cm.getTextArea = function() { return textarea; }; - cm.toTextArea = function() { - save(); - textarea.parentNode.removeChild(cm.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (typeof textarea.form.submit == "function") - textarea.form.submit = realSubmit; - } - }; - return cm; - }; - - // STRING STREAM - - // Fed to the mode parsers, provides helper functions to make - // parsers more succinct. - - var StringStream = CodeMirror.StringStream = function(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - }; - - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == this.lineStart;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - indentation: function() { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } - }; - - // TEXTMARKERS - - // Created with markText and setBookmark methods. A TextMarker is a - // handle that can be used to clear or find a marked position in the - // document. Line objects hold arrays (markedSpans) containing - // {from, to, marker} object pointing to such marker objects, and - // indicating that such a marker is present on that line. Multiple - // lines may point to the same marker when it spans across lines. - // The spans will have null for their from/to properties when the - // marker continues beyond the start/end of the line. Markers have - // links back to the lines they currently touch. - - var TextMarker = CodeMirror.TextMarker = function(doc, type) { - this.lines = []; - this.type = type; - this.doc = doc; - }; - eventMixin(TextMarker); - - // Clear the marker. - TextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - var cm = this.doc.cm, withOp = cm && !cm.curOp; - if (withOp) startOperation(cm); - if (hasHandler(this, "clear")) { - var found = this.find(); - if (found) signalLater(this, "clear", found.from, found.to); - } - var min = null, max = null; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); - else if (cm) { - if (span.to != null) max = lineNo(line); - if (span.from != null) min = lineNo(line); - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) - updateLineHeight(line, textHeight(cm.display)); - } - if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { - var visual = visualLine(this.lines[i]), len = lineLength(visual); - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual; - cm.display.maxLineLength = len; - cm.display.maxLineChanged = true; - } - } - - if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false; - if (cm) reCheckSelection(cm.doc); - } - if (cm) signalLater(cm, "markerCleared", cm, this); - if (withOp) endOperation(cm); - if (this.parent) this.parent.clear(); - }; - - // Find the position of the marker in the document. Returns a {from, - // to} object by default. Side can be passed to get a specific side - // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the - // Pos objects returned contain a line object, rather than a line - // number (used to prevent looking up the same line twice). - TextMarker.prototype.find = function(side, lineObj) { - if (side == null && this.type == "bookmark") side = 1; - var from, to; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from); - if (side == -1) return from; - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to); - if (side == 1) return to; - } - } - return from && {from: from, to: to}; - }; - - // Signals that the marker's widget changed, and surrounding layout - // should be recomputed. - TextMarker.prototype.changed = function() { - var pos = this.find(-1, true), widget = this, cm = this.doc.cm; - if (!pos || !cm) return; - runInOp(cm, function() { - var line = pos.line, lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) { - clearLineMeasurementCacheFor(view); - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; - } - cm.curOp.updateMaxLine = true; - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height; - widget.height = null; - var dHeight = widgetHeight(widget) - oldHeight; - if (dHeight) - updateLineHeight(line, line.height + dHeight); - } - }); - }; - - TextMarker.prototype.attachLine = function(line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) - (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); - } - this.lines.push(line); - }; - TextMarker.prototype.detachLine = function(line) { - this.lines.splice(indexOf(this.lines, line), 1); - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); - } - }; - - // Collapsed markers have unique ids, in order to be able to order - // them, which is needed for uniquely determining an outer marker - // when they overlap (they may nest, but not partially overlap). - var nextMarkerId = 0; - - // Create a marker, wire it up to the right lines, and - function markText(doc, from, to, options, type) { - // Shared markers (across linked documents) are handled separately - // (markTextShared will call out to this again, once per - // document). - if (options && options.shared) return markTextShared(doc, from, to, options, type); - // Ensure we are in an operation. - if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); - - var marker = new TextMarker(doc, type), diff = cmp(from, to); - if (options) copyObj(options, marker, false); - // Don't connect empty markers unless clearWhenEmpty is false - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) - return marker; - if (marker.replacedWith) { - // Showing up as a widget implies collapsed (widget replaces text) - marker.collapsed = true; - marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) marker.widgetNode.ignoreEvents = true; - if (options.insertLeft) marker.widgetNode.insertLeft = true; - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || - from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) - throw new Error("Inserting collapsed marker partially overlapping an existing one"); - sawCollapsedSpans = true; - } - - if (marker.addToHistory) - addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); - - var curLine = from.line, cm = doc.cm, updateMaxLine; - doc.iter(curLine, to.line + 1, function(line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) - updateMaxLine = true; - if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); - addMarkedSpan(line, new MarkedSpan(marker, - curLine == from.line ? from.ch : null, - curLine == to.line ? to.ch : null)); - ++curLine; - }); - // lineIsHidden depends on the presence of the spans, so needs a second pass - if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { - if (lineIsHidden(doc, line)) updateLineHeight(line, 0); - }); - - if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); - - if (marker.readOnly) { - sawReadOnlySpans = true; - if (doc.history.done.length || doc.history.undone.length) - doc.clearHistory(); - } - if (marker.collapsed) { - marker.id = ++nextMarkerId; - marker.atomic = true; - } - if (cm) { - // Sync editor state - if (updateMaxLine) cm.curOp.updateMaxLine = true; - if (marker.collapsed) - regChange(cm, from.line, to.line + 1); - else if (marker.className || marker.title || marker.startStyle || marker.endStyle) - for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); - if (marker.atomic) reCheckSelection(cm.doc); - signalLater(cm, "markerAdded", cm, marker); - } - return marker; - } - - // SHARED TEXTMARKERS - - // A shared marker spans multiple linked documents. It is - // implemented as a meta-marker-object controlling multiple normal - // markers. - var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { - this.markers = markers; - this.primary = primary; - for (var i = 0; i < markers.length; ++i) - markers[i].parent = this; - }; - eventMixin(SharedTextMarker); - - SharedTextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - this.explicitlyCleared = true; - for (var i = 0; i < this.markers.length; ++i) - this.markers[i].clear(); - signalLater(this, "clear"); - }; - SharedTextMarker.prototype.find = function(side, lineObj) { - return this.primary.find(side, lineObj); - }; - - function markTextShared(doc, from, to, options, type) { - options = copyObj(options); - options.shared = false; - var markers = [markText(doc, from, to, options, type)], primary = markers[0]; - var widget = options.widgetNode; - linkedDocs(doc, function(doc) { - if (widget) options.widgetNode = widget.cloneNode(true); - markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); - for (var i = 0; i < doc.linked.length; ++i) - if (doc.linked[i].isParent) return; - primary = lst(markers); - }); - return new SharedTextMarker(markers, primary); - } - - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), - function(m) { return m.parent; }); - } - - function copySharedMarkers(doc, markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], pos = marker.find(); - var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); - marker.markers.push(subMark); - subMark.parent = marker; - } - } - } - - function detachSharedMarkers(markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], linked = [marker.primary.doc];; - linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j]; - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null; - marker.markers.splice(j--, 1); - } - } - } - } - - // TEXTMARKER SPANS - - function MarkedSpan(marker, from, to) { - this.marker = marker; - this.from = from; this.to = to; - } - - // Search an array of spans for a span matching the given marker. - function getMarkedSpanFor(spans, marker) { - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.marker == marker) return span; - } - } - // Remove a span from an array, returning undefined if no spans are - // left (we don't store arrays for lines without spans). - function removeMarkedSpan(spans, span) { - for (var r, i = 0; i < spans.length; ++i) - if (spans[i] != span) (r || (r = [])).push(spans[i]); - return r; - } - // Add a span to a line. - function addMarkedSpan(line, span) { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - span.marker.attachLine(line); - } - - // Used for the algorithm that adjusts markers for a change in the - // document. These functions cut an array of spans at a given - // character position, returning an array of remaining chunks (or - // undefined if nothing remains). - function markedSpansBefore(old, startCh, isInsert) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); - (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); - } - } - return nw; - } - function markedSpansAfter(old, endCh, isInsert) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); - (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, - span.to == null ? null : span.to - endCh)); - } - } - return nw; - } - - // Given a change object, compute the new set of marker spans that - // cover the line in which the change took place. Removes spans - // entirely within the change, reconnects spans belonging to the - // same marker that appear on both sides of the change, and cuts off - // spans partially within the change. Returns an array of span - // arrays with one element for each line in (after) the change. - function stretchSpansOverChange(doc, change) { - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; - if (!oldFirst && !oldLast) return null; - - var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; - // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh, isInsert); - var last = markedSpansAfter(oldLast, endCh, isInsert); - - // Next, merge those two ends - var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); - if (first) { - // Fix up .to properties of first - for (var i = 0; i < first.length; ++i) { - var span = first[i]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) span.to = startCh; - else if (sameLine) span.to = found.to == null ? null : found.to + offset; - } - } - } - if (last) { - // Fix up .from in last (or move them into first in case of sameLine) - for (var i = 0; i < last.length; ++i) { - var span = last[i]; - if (span.to != null) span.to += offset; - if (span.from == null) { - var found = getMarkedSpanFor(first, span.marker); - if (!found) { - span.from = offset; - if (sameLine) (first || (first = [])).push(span); - } - } else { - span.from += offset; - if (sameLine) (first || (first = [])).push(span); - } - } - } - // Make sure we didn't create any zero-length spans - if (first) first = clearEmptySpans(first); - if (last && last != first) last = clearEmptySpans(last); - - var newMarkers = [first]; - if (!sameLine) { - // Fill gap with whole-line-spans - var gap = change.text.length - 2, gapMarkers; - if (gap > 0 && first) - for (var i = 0; i < first.length; ++i) - if (first[i].to == null) - (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); - for (var i = 0; i < gap; ++i) - newMarkers.push(gapMarkers); - newMarkers.push(last); - } - return newMarkers; - } - - // Remove spans that are empty and don't have a clearWhenEmpty - // option of false. - function clearEmptySpans(spans) { - for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) - spans.splice(i--, 1); - } - if (!spans.length) return null; - return spans; - } - - // Used for un/re-doing changes from the history. Combines the - // result of computing the existing spans with the set of spans that - // existed in the history (so that deleting around a span and then - // undoing brings back the span). - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change); - var stretched = stretchSpansOverChange(doc, change); - if (!old) return stretched; - if (!stretched) return old; - - for (var i = 0; i < old.length; ++i) { - var oldCur = old[i], stretchCur = stretched[i]; - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j]; - for (var k = 0; k < oldCur.length; ++k) - if (oldCur[k].marker == span.marker) continue spans; - oldCur.push(span); - } - } else if (stretchCur) { - old[i] = stretchCur; - } - } - return old; - } - - // Used to 'clip' out readOnly ranges when making a change. - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function(line) { - if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - (markers || (markers = [])).push(mark); - } - }); - if (!markers) return null; - var parts = [{from: from, to: to}]; - for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(0); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; - var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) - newParts.push({from: p.from, to: m.from}); - if (dto > 0 || !mk.inclusiveRight && !dto) - newParts.push({from: m.to, to: p.to}); - parts.splice.apply(parts, newParts); - j += newParts.length - 1; - } - } - return parts; - } - - // Connect or disconnect spans from a line. - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.detachLine(line); - line.markedSpans = null; - } - function attachMarkedSpans(line, spans) { - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.attachLine(line); - line.markedSpans = spans; - } - - // Helpers used when computing which overlapping collapsed span - // counts as the larger one. - function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } - function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } - - // Returns a number indicating which of two overlapping collapsed - // spans is larger (and thus includes the other). Falls back to - // comparing ids when the spans cover exactly the same range. - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length; - if (lenDiff != 0) return lenDiff; - var aPos = a.find(), bPos = b.find(); - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); - if (fromCmp) return -fromCmp; - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); - if (toCmp) return toCmp; - return b.id - a.id; - } - - // Find out whether a line ends or starts in a collapsed span. If - // so, return the marker for that span. - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) - found = sp.marker; - } - return found; - } - function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } - function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } - - // Test whether there exists a collapsed span that partially - // overlaps (covers the start or end, but not both) of a new span. - // Such overlap is not allowed. - function conflictingCollapsedRange(doc, lineNo, from, to, marker) { - var line = getLine(doc, lineNo); - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var i = 0; i < sps.length; ++i) { - var sp = sps[i]; - if (!sp.marker.collapsed) continue; - var found = sp.marker.find(0); - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; - if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) || - fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight))) - return true; - } - } - - // A visual line is a line as drawn on the screen. Folding, for - // example, can cause multiple logical lines to appear on the same - // visual line. This finds the start of the visual line that the - // given line is part of (usually that is the line itself). - function visualLine(line) { - var merged; - while (merged = collapsedSpanAtStart(line)) - line = merged.find(-1, true).line; - return line; - } - - // Returns an array of logical lines that continue the visual line - // started by the argument, or undefined if there are no such lines. - function visualLineContinued(line) { - var merged, lines; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - (lines || (lines = [])).push(line); - } - return lines; - } - - // Get the line number of the start of the visual line that the - // given line number is part of. - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), vis = visualLine(line); - if (line == vis) return lineN; - return lineNo(vis); - } - // Get the line number of the start of the next visual line after - // the given line. - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) return lineN; - var line = getLine(doc, lineN), merged; - if (!lineIsHidden(doc, line)) return lineN; - while (merged = collapsedSpanAtEnd(line)) - line = merged.find(1, true).line; - return lineNo(line) + 1; - } - - // Compute whether a line is hidden. Lines count as hidden when they - // are part of a visual line that starts with another line, or when - // they are entirely covered by collapsed, non-widget span. - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (!sp.marker.collapsed) continue; - if (sp.from == null) return true; - if (sp.marker.widgetNode) continue; - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) - return true; - } - } - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true); - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); - } - if (span.marker.inclusiveRight && span.to == line.text.length) - return true; - for (var sp, i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i]; - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && - (sp.to == null || sp.to != span.from) && - (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && - lineIsHiddenInner(doc, line, sp)) return true; - } - } - - // LINE WIDGETS - - // Line widgets are block elements displayed above or below a line. - - var LineWidget = CodeMirror.LineWidget = function(cm, node, options) { - if (options) for (var opt in options) if (options.hasOwnProperty(opt)) - this[opt] = options[opt]; - this.cm = cm; - this.node = node; - }; - eventMixin(LineWidget); - - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) - addToScrollPos(cm, null, diff); - } - - LineWidget.prototype.clear = function() { - var cm = this.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); - if (no == null || !ws) return; - for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); - if (!ws.length) line.widgets = null; - var height = widgetHeight(this); - runInOp(cm, function() { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); - updateLineHeight(line, Math.max(0, line.height - height)); - }); - }; - LineWidget.prototype.changed = function() { - var oldH = this.height, cm = this.cm, line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) return; - runInOp(cm, function() { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); - updateLineHeight(line, line.height + diff); - }); - }; - - function widgetHeight(widget) { - if (widget.height != null) return widget.height; - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) - parentStyle += "margin-left: -" + widget.cm.getGutterElement().offsetWidth + "px;"; - removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.offsetHeight; - } - - function addLineWidget(cm, handle, node, options) { - var widget = new LineWidget(cm, node, options); - if (widget.noHScroll) cm.display.alignWidgets = true; - changeLine(cm.doc, handle, "widget", function(line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) widgets.push(widget); - else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); - widget.line = line; - if (!lineIsHidden(cm.doc, line)) { - var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) addToScrollPos(cm, null, widget.height); - cm.curOp.forceUpdate = true; - } - return true; - }); - return widget; - } - - // LINE DATA STRUCTURE - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) { - this.text = text; - attachMarkedSpans(this, markedSpans); - this.height = estimateHeight ? estimateHeight(this) : 1; - }; - eventMixin(Line); - Line.prototype.lineNo = function() { return lineNo(this); }; - - // Change the content (text, markers) of a line. Automatically - // invalidates cached information and tries to re-estimate the - // line's height. - function updateLine(line, text, markedSpans, estimateHeight) { - line.text = text; - if (line.stateAfter) line.stateAfter = null; - if (line.styles) line.styles = null; - if (line.order != null) line.order = null; - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - var estHeight = estimateHeight ? estimateHeight(line) : 1; - if (estHeight != line.height) updateLineHeight(line, estHeight); - } - - // Detach a line from the document tree and its markers. - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); - } - - function extractLineClasses(type, output) { - if (type) for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) break; - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); - var prop = lineClass[1] ? "bgClass" : "textClass"; - if (output[prop] == null) - output[prop] = lineClass[2]; - else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) - output[prop] += " " + lineClass[2]; - } - return type; - } - - function callBlankLine(mode, state) { - if (mode.blankLine) return mode.blankLine(state); - if (!mode.innerMode) return; - var inner = CodeMirror.innerMode(mode, state); - if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); - } - - function readToken(mode, stream, state) { - for (var i = 0; i < 10; i++) { - var style = mode.token(stream, state); - if (stream.pos > stream.start) return style; - } - throw new Error("Mode " + mode.name + " failed to advance stream."); - } - - // Run the given mode's parser over a line, calling f for each token. - function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans; - if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; - var curStart = 0, curStyle = null; - var stream = new StringStream(text, cm.options.tabSize), style; - if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false; - if (forceToEnd) processLine(cm, text, state, stream.pos); - stream.pos = text.length; - style = null; - } else { - style = extractLineClasses(readToken(mode, stream, state), lineClasses); - } - if (cm.options.addModeClass) { - var mName = CodeMirror.innerMode(mode, state).mode.name; - if (mName) style = "m-" + (style ? mName + " " + style : mName); - } - if (!flattenSpans || curStyle != style) { - if (curStart < stream.start) f(stream.start, curStyle); - curStart = stream.start; curStyle = style; - } - stream.start = stream.pos; - } - while (curStart < stream.pos) { - // Webkit seems to refuse to render text nodes longer than 57444 characters - var pos = Math.min(stream.pos, curStart + 50000); - f(pos, curStyle); - curStart = pos; - } - } - - // Compute a style array (an array starting with a mode generation - // -- for invalidation -- followed by pairs of end positions and - // style strings), which is used to highlight the tokens on the - // line. - function highlightLine(cm, line, state, forceToEnd) { - // A styles array always starts with a number identifying the - // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen], lineClasses = {}; - // Compute the base array of styles - runMode(cm, line.text, cm.doc.mode, state, function(end, style) { - st.push(end, style); - }, lineClasses, forceToEnd); - - // Run overlays, adjust style array. - for (var o = 0; o < cm.state.overlays.length; ++o) { - var overlay = cm.state.overlays[o], i = 1, at = 0; - runMode(cm, line.text, overlay.mode, true, function(end, style) { - var start = i; - // Ensure there's a token end at the current position, and that i points at it - while (at < end) { - var i_end = st[i]; - if (i_end > end) - st.splice(i, 1, end, st[i+1], i_end); - i += 2; - at = Math.min(end, i_end); - } - if (!style) return; - if (overlay.opaque) { - st.splice(start, i - start, end, "cm-overlay " + style); - i = start + 2; - } else { - for (; start < i; start += 2) { - var cur = st[start+1]; - st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; - } - } - }, lineClasses); - } - - return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; - } - - function getLineStyles(cm, line) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); - line.styles = result.styles; - if (result.classes) line.styleClasses = result.classes; - else if (line.styleClasses) line.styleClasses = null; - } - return line.styles; - } - - // Lightweight form of highlight -- proceed over this line and - // update state, but don't save a style array. Used for lines that - // aren't currently visible. - function processLine(cm, text, state, startAt) { - var mode = cm.doc.mode; - var stream = new StringStream(text, cm.options.tabSize); - stream.start = stream.pos = startAt || 0; - if (text == "") callBlankLine(mode, state); - while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) { - readToken(mode, stream, state); - stream.start = stream.pos; - } - } - - // Convert a style as returned by a mode (either null, or a string - // containing one or more styles) to a CSS style. This is cached, - // and also looks for line-wide styles. - var styleToClassCache = {}, styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) return null; - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; - return cache[style] || - (cache[style] = style.replace(/\S+/g, "cm-$&")); - } - - // Render the DOM representation of the text of a line. Also builds - // up a 'line map', which points at the DOM nodes that represent - // specific stretches of text, and is used by the measuring code. - // The returned object contains the DOM node, this map, and - // information about line-wide styles that were set by the mode. - function buildLineContent(cm, lineView) { - // The padding-right forces the element to have a 'border', which - // is needed on Webkit to be able to get line-level bounding - // rectangles for it (in measureChar). - var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); - var builder = {pre: elt("pre", [content]), content: content, col: 0, pos: 0, cm: cm}; - lineView.measure = {}; - - // Iterate over the logical lines that make up this visual line. - for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { - var line = i ? lineView.rest[i - 1] : lineView.line, order; - builder.pos = 0; - builder.addToken = buildToken; - // Optionally wire in some hacks into the token-rendering - // algorithm, to deal with browser quirks. - if ((ie || webkit) && cm.getOption("lineWrapping")) - builder.addToken = buildTokenSplitSpaces(builder.addToken); - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) - builder.addToken = buildTokenBadBidi(builder.addToken, order); - builder.map = []; - insertLineContent(line, builder, getLineStyles(cm, line)); - if (line.styleClasses) { - if (line.styleClasses.bgClass) - builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); - if (line.styleClasses.textClass) - builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); - } - - // Ensure at least a single node is present, for measuring. - if (builder.map.length == 0) - builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); - - // Store the map and a cache object for the current logical line - if (i == 0) { - lineView.measure.map = builder.map; - lineView.measure.cache = {}; - } else { - (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); - (lineView.measure.caches || (lineView.measure.caches = [])).push({}); - } - } - - signal(cm, "renderLine", cm, lineView.line, builder.pre); - if (builder.pre.className) - builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); - return builder; - } - - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar"); - token.title = "\\u" + ch.charCodeAt(0).toString(16); - return token; - } - - // Build up the DOM representation for a single token, and add it to - // the line map. Takes care to render special characters separately. - function buildToken(builder, text, style, startStyle, endStyle, title) { - if (!text) return; - var special = builder.cm.options.specialChars, mustWrap = false; - if (!special.test(text)) { - builder.col += text.length; - var content = document.createTextNode(text); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) mustWrap = true; - builder.pos += text.length; - } else { - var content = document.createDocumentFragment(), pos = 0; - while (true) { - special.lastIndex = pos; - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - var txt = document.createTextNode(text.slice(pos, pos + skipped)); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.map.push(builder.pos, builder.pos + skipped, txt); - builder.col += skipped; - builder.pos += skipped; - } - if (!m) break; - pos += skipped + 1; - if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; - var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - builder.col += tabWidth; - } else { - var txt = builder.cm.options.specialCharPlaceholder(m[0]); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.col += 1; - } - builder.map.push(builder.pos, builder.pos + 1, txt); - builder.pos++; - } - } - if (style || startStyle || endStyle || mustWrap) { - var fullStyle = style || ""; - if (startStyle) fullStyle += startStyle; - if (endStyle) fullStyle += endStyle; - var token = elt("span", [content], fullStyle); - if (title) token.title = title; - return builder.content.appendChild(token); - } - builder.content.appendChild(content); - } - - function buildTokenSplitSpaces(inner) { - function split(old) { - var out = " "; - for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; - out += " "; - return out; - } - return function(builder, text, style, startStyle, endStyle, title) { - inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title); - }; - } - - // Work around nonsense dimensions being reported for stretches of - // right-to-left text. - function buildTokenBadBidi(inner, order) { - return function(builder, text, style, startStyle, endStyle, title) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, end = start + text.length; - for (;;) { - // Find the part that overlaps with the start of this text - for (var i = 0; i < order.length; i++) { - var part = order[i]; - if (part.to > start && part.from <= start) break; - } - if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title); - inner(builder, text.slice(0, part.to - start), style, startStyle, null, title); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; - } - }; - } - - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode; - if (widget) { - builder.map.push(builder.pos, builder.pos + size, widget); - builder.content.appendChild(widget); - } - builder.pos += size; - } - - // Outputs a number of spans to make up a line, taking highlighting - // and marked text into account. - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, allText = line.text, at = 0; - if (!spans) { - for (var i = 1; i < styles.length; i+=2) - builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); - return; - } - - var len = allText.length, pos = 0, i = 1, text = "", style; - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; - for (;;) { - if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = title = ""; - collapsed = null; nextChange = Infinity; - var foundBookmarks = []; - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker; - if (sp.from <= pos && (sp.to == null || sp.to > pos)) { - if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } - if (m.className) spanStyle += " " + m.className; - if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; - if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; - if (m.title && !title) title = m.title; - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) - collapsed = sp; - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) foundBookmarks.push(m); - } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null); - if (collapsed.to == null) return; - } - if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) - buildCollapsedSpan(builder, 0, foundBookmarks[j]); - } - if (pos >= len) break; - - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title); - } - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} - pos = end; - spanStartStyle = ""; - } - text = allText.slice(at, at = styles[i++]); - style = interpretTokenStyle(styles[i++], builder.cm.options); - } - } - } - - // DOCUMENT DATA STRUCTURE - - // By default, updates that start and end at the beginning of a line - // are treated specially, in order to make the association of line - // widgets and marker elements with the text behave more intuitive. - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && - (!doc.cm || doc.cm.options.wholeLineUpdateBefore); - } - - // Perform a change on the document data structure. - function updateDoc(doc, change, markedSpans, estimateHeight) { - function spansFor(n) {return markedSpans ? markedSpans[n] : null;} - function update(line, text, spans) { - updateLine(line, text, spans, estimateHeight); - signalLater(line, "change", line, change); - } - - var from = change.from, to = change.to, text = change.text; - var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); - var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; - - // Adjust the line structure - if (isWholeLineUpdate(doc, change)) { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - for (var i = 0, added = []; i < text.length - 1; ++i) - added.push(new Line(text[i], spansFor(i), estimateHeight)); - update(lastLine, lastLine.text, lastSpans); - if (nlines) doc.remove(from.line, nlines); - if (added.length) doc.insert(from.line, added); - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); - } else { - for (var added = [], i = 1; i < text.length - 1; ++i) - added.push(new Line(text[i], spansFor(i), estimateHeight)); - added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - doc.insert(from.line + 1, added); - } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); - doc.remove(from.line + 1, nlines); - } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - for (var i = 1, added = []; i < text.length - 1; ++i) - added.push(new Line(text[i], spansFor(i), estimateHeight)); - if (nlines > 1) doc.remove(from.line + 1, nlines - 1); - doc.insert(from.line + 1, added); - } - - signalLater(doc, "change", doc, change); - } - - // The document is represented as a BTree consisting of leaves, with - // chunk of lines in them, and branches, with up to ten leaves or - // other branch nodes below them. The top node is always a branch - // node, and is the document object itself (meaning it has - // additional methods and properties). - // - // All nodes have parent links. The tree is used both to go from - // line numbers to line objects, and to go from objects to numbers. - // It also indexes by height, and is used to convert between height - // and line object, and to find the total height of the document. - // - // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html - - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - for (var i = 0, height = 0; i < lines.length; ++i) { - lines[i].parent = this; - height += lines[i].height; - } - this.height = height; - } - - LeafChunk.prototype = { - chunkSize: function() { return this.lines.length; }, - // Remove the n lines at offset 'at'. - removeInner: function(at, n) { - for (var i = at, e = at + n; i < e; ++i) { - var line = this.lines[i]; - this.height -= line.height; - cleanUpLine(line); - signalLater(line, "delete"); - } - this.lines.splice(at, n); - }, - // Helper used to collapse a small branch into a single leaf. - collapse: function(lines) { - lines.push.apply(lines, this.lines); - }, - // Insert the given array of lines at offset 'at', count them as - // having the given height. - insertInner: function(at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i = 0; i < lines.length; ++i) lines[i].parent = this; - }, - // Used to iterate over a part of the tree. - iterN: function(at, n, op) { - for (var e = at + n; at < e; ++at) - if (op(this.lines[at])) return true; - } - }; - - function BranchChunk(children) { - this.children = children; - var size = 0, height = 0; - for (var i = 0; i < children.length; ++i) { - var ch = children[i]; - size += ch.chunkSize(); height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - - BranchChunk.prototype = { - chunkSize: function() { return this.size; }, - removeInner: function(at, n) { - this.size -= n; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height; - child.removeInner(at, rm); - this.height -= oldHeight - child.height; - if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } - if ((n -= rm) == 0) break; - at = 0; - } else at -= sz; - } - // If the result is smaller than 25 lines, ensure that it is a - // single leaf node. - if (this.size - n < 25 && - (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - collapse: function(lines) { - for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); - }, - insertInner: function(at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at <= sz) { - child.insertInner(at, lines, height); - if (child.lines && child.lines.length > 50) { - while (child.lines.length > 50) { - var spilled = child.lines.splice(child.lines.length - 25, 25); - var newleaf = new LeafChunk(spilled); - child.height -= newleaf.height; - this.children.splice(i + 1, 0, newleaf); - newleaf.parent = this; - } - this.maybeSpill(); - } - break; - } - at -= sz; - } - }, - // When a node has grown, check whether it should be split. - maybeSpill: function() { - if (this.children.length <= 10) return; - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10); - me.parent.maybeSpill(); - }, - iterN: function(at, n, op) { - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) return true; - if ((n -= used) == 0) break; - at = 0; - } else at -= sz; - } - } - }; - - var nextDocId = 0; - var Doc = CodeMirror.Doc = function(text, mode, firstLine) { - if (!(this instanceof Doc)) return new Doc(text, mode, firstLine); - if (firstLine == null) firstLine = 0; - - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); - this.first = firstLine; - this.scrollTop = this.scrollLeft = 0; - this.cantEdit = false; - this.cleanGeneration = 1; - this.frontier = firstLine; - var start = Pos(firstLine, 0); - this.sel = simpleSelection(start); - this.history = new History(null); - this.id = ++nextDocId; - this.modeOption = mode; - - if (typeof text == "string") text = splitLines(text); - updateDoc(this, {from: start, to: start, text: text}); - setSelection(this, simpleSelection(start), sel_dontScroll); - }; - - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - // Iterate over the document. Supports two forms -- with only one - // argument, it calls that for each line in the document. With - // three, it iterates over the range given by the first two (with - // the second being non-inclusive). - iter: function(from, to, op) { - if (op) this.iterN(from - this.first, to - from, op); - else this.iterN(this.first, this.first + this.size, from); - }, - - // Non-public interface for adding and removing lines. - insert: function(at, lines) { - var height = 0; - for (var i = 0; i < lines.length; ++i) height += lines[i].height; - this.insertInner(at - this.first, lines, height); - }, - remove: function(at, n) { this.removeInner(at - this.first, n); }, - - // From here, the methods are part of the public interface. Most - // are also available from CodeMirror (editor) instances. - - getValue: function(lineSep) { - var lines = getLines(this, this.first, this.first + this.size); - if (lineSep === false) return lines; - return lines.join(lineSep || "\n"); - }, - setValue: docMethodOp(function(code) { - var top = Pos(this.first, 0), last = this.first + this.size - 1; - makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: splitLines(code), origin: "setValue"}, true); - setSelection(this, simpleSelection(top)); - }), - replaceRange: function(code, from, to, origin) { - from = clipPos(this, from); - to = to ? clipPos(this, to) : from; - replaceRange(this, code, from, to, origin); - }, - getRange: function(from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); - if (lineSep === false) return lines; - return lines.join(lineSep || "\n"); - }, - - getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, - - getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, - getLineNumber: function(line) {return lineNo(line);}, - - getLineHandleVisualStart: function(line) { - if (typeof line == "number") line = getLine(this, line); - return visualLine(line); - }, - - lineCount: function() {return this.size;}, - firstLine: function() {return this.first;}, - lastLine: function() {return this.first + this.size - 1;}, - - clipPos: function(pos) {return clipPos(this, pos);}, - - getCursor: function(start) { - var range = this.sel.primary(), pos; - if (start == null || start == "head") pos = range.head; - else if (start == "anchor") pos = range.anchor; - else if (start == "end" || start == "to" || start === false) pos = range.to(); - else pos = range.from(); - return pos; - }, - listSelections: function() { return this.sel.ranges; }, - somethingSelected: function() {return this.sel.somethingSelected();}, - - setCursor: docMethodOp(function(line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); - }), - setSelection: docMethodOp(function(anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); - }), - extendSelection: docMethodOp(function(head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); - }), - extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads, options)); - }), - extendSelectionsBy: docMethodOp(function(f, options) { - extendSelections(this, map(this.sel.ranges, f), options); - }), - setSelections: docMethodOp(function(ranges, primary, options) { - if (!ranges.length) return; - for (var i = 0, out = []; i < ranges.length; i++) - out[i] = new Range(clipPos(this, ranges[i].anchor), - clipPos(this, ranges[i].head)); - if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); - setSelection(this, normalizeSelection(out, primary), options); - }), - addSelection: docMethodOp(function(anchor, head, options) { - var ranges = this.sel.ranges.slice(0); - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); - }), - - getSelection: function(lineSep) { - var ranges = this.sel.ranges, lines; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - lines = lines ? lines.concat(sel) : sel; - } - if (lineSep === false) return lines; - else return lines.join(lineSep || "\n"); - }, - getSelections: function(lineSep) { - var parts = [], ranges = this.sel.ranges; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - if (lineSep !== false) sel = sel.join(lineSep || "\n"); - parts[i] = sel; - } - return parts; - }, - replaceSelection: function(code, collapse, origin) { - var dup = []; - for (var i = 0; i < this.sel.ranges.length; i++) - dup[i] = code; - this.replaceSelections(dup, collapse, origin || "+input"); - }, - replaceSelections: docMethodOp(function(code, collapse, origin) { - var changes = [], sel = this.sel; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin}; - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); - for (var i = changes.length - 1; i >= 0; i--) - makeChange(this, changes[i]); - if (newSel) setSelectionReplaceHistory(this, newSel); - else if (this.cm) ensureCursorVisible(this.cm); - }), - undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), - redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), - undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), - redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), - - setExtending: function(val) {this.extend = val;}, - getExtending: function() {return this.extend;}, - - historySize: function() { - var hist = this.history, done = 0, undone = 0; - for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; - for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; - return {undo: done, redo: undone}; - }, - clearHistory: function() {this.history = new History(this.history.maxGeneration);}, - - markClean: function() { - this.cleanGeneration = this.changeGeneration(true); - }, - changeGeneration: function(forceSplit) { - if (forceSplit) - this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; - return this.history.generation; - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration); - }, - - getHistory: function() { - return {done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone)}; - }, - setHistory: function(histData) { - var hist = this.history = new History(this.history.maxGeneration); - hist.done = copyHistoryArray(histData.done.slice(0), null, true); - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); - }, - - addLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, "class", function(line) { - var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; - if (!line[prop]) line[prop] = cls; - else if (new RegExp("(?:^|\\s)" + cls + "(?:$|\\s)").test(line[prop])) return false; - else line[prop] += " " + cls; - return true; - }); - }), - removeLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, "class", function(line) { - var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; - var cur = line[prop]; - if (!cur) return false; - else if (cls == null) line[prop] = null; - else { - var found = cur.match(new RegExp("(?:^|\\s+)" + cls + "(?:$|\\s+)")); - if (!found) return false; - var end = found.index + found[0].length; - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true; - }); - }), - - markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); - }, - setBookmark: function(pos, options) { - var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, shared: options && options.shared}; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark"); - }, - findMarksAt: function(pos) { - pos = clipPos(this, pos); - var markers = [], spans = getLine(this, pos.line).markedSpans; - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if ((span.from == null || span.from <= pos.ch) && - (span.to == null || span.to >= pos.ch)) - markers.push(span.marker.parent || span.marker); - } - return markers; - }, - findMarks: function(from, to, filter) { - from = clipPos(this, from); to = clipPos(this, to); - var found = [], lineNo = from.line; - this.iter(from.line, to.line + 1, function(line) { - var spans = line.markedSpans; - if (spans) for (var i = 0; i < spans.length; i++) { - var span = spans[i]; - if (!(lineNo == from.line && from.ch > span.to || - span.from == null && lineNo != from.line|| - lineNo == to.line && span.from > to.ch) && - (!filter || filter(span.marker))) - found.push(span.marker.parent || span.marker); - } - ++lineNo; - }); - return found; - }, - getAllMarks: function() { - var markers = []; - this.iter(function(line) { - var sps = line.markedSpans; - if (sps) for (var i = 0; i < sps.length; ++i) - if (sps[i].from != null) markers.push(sps[i].marker); - }); - return markers; - }, - - posFromIndex: function(off) { - var ch, lineNo = this.first; - this.iter(function(line) { - var sz = line.text.length + 1; - if (sz > off) { ch = off; return true; } - off -= sz; - ++lineNo; - }); - return clipPos(this, Pos(lineNo, ch)); - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords); - var index = coords.ch; - if (coords.line < this.first || coords.ch < 0) return 0; - this.iter(this.first, coords.line, function (line) { - index += line.text.length + 1; - }); - return index; - }, - - copy: function(copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first); - doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; - doc.sel = this.sel; - doc.extend = false; - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth; - doc.setHistory(this.getHistory()); - } - return doc; - }, - - linkedDoc: function(options) { - if (!options) options = {}; - var from = this.first, to = this.first + this.size; - if (options.from != null && options.from > from) from = options.from; - if (options.to != null && options.to < to) to = options.to; - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from); - if (options.sharedHist) copy.history = this.history; - (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); - copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; - copySharedMarkers(copy, findSharedMarkers(this)); - return copy; - }, - unlinkDoc: function(other) { - if (other instanceof CodeMirror) other = other.doc; - if (this.linked) for (var i = 0; i < this.linked.length; ++i) { - var link = this.linked[i]; - if (link.doc != other) continue; - this.linked.splice(i, 1); - other.unlinkDoc(this); - detachSharedMarkers(findSharedMarkers(this)); - break; - } - // If the histories were shared, split them again - if (other.history == this.history) { - var splitIds = [other.id]; - linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); - other.history = new History(null); - other.history.done = copyHistoryArray(this.history.done, splitIds); - other.history.undone = copyHistoryArray(this.history.undone, splitIds); - } - }, - iterLinkedDocs: function(f) {linkedDocs(this, f);}, - - getMode: function() {return this.mode;}, - getEditor: function() {return this.cm;} - }); - - // Public alias. - Doc.prototype.eachLine = Doc.prototype.iter; - - // Set up methods on CodeMirror's prototype to redirect to the editor's document. - var dontDelegate = "iter insert remove copy getEditor".split(" "); - for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) - CodeMirror.prototype[prop] = (function(method) { - return function() {return method.apply(this.doc, arguments);}; - })(Doc.prototype[prop]); - - eventMixin(Doc); - - // Call f for all linked documents. - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc, skip, sharedHist) { - if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { - var rel = doc.linked[i]; - if (rel.doc == skip) continue; - var shared = sharedHist && rel.sharedHist; - if (sharedHistOnly && !shared) continue; - f(rel.doc, shared); - propagate(rel.doc, doc, shared); - } - } - propagate(doc, null, true); - } - - // Attach a document to an editor. - function attachDoc(cm, doc) { - if (doc.cm) throw new Error("This document is already in use."); - cm.doc = doc; - doc.cm = cm; - estimateLineHeights(cm); - loadMode(cm); - if (!cm.options.lineWrapping) findMaxLine(cm); - cm.options.mode = doc.modeOption; - regChange(cm); - } - - // LINE UTILITIES - - // Find the line object corresponding to the given line number. - function getLine(doc, n) { - n -= doc.first; - if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); - for (var chunk = doc; !chunk.lines;) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; break; } - n -= sz; - } - } - return chunk.lines[n]; - } - - // Get the part of a document between two positions, as an array of - // strings. - function getBetween(doc, start, end) { - var out = [], n = start.line; - doc.iter(start.line, end.line + 1, function(line) { - var text = line.text; - if (n == end.line) text = text.slice(0, end.ch); - if (n == start.line) text = text.slice(start.ch); - out.push(text); - ++n; - }); - return out; - } - // Get the lines between from and to, as array of strings. - function getLines(doc, from, to) { - var out = []; - doc.iter(from, to, function(line) { out.push(line.text); }); - return out; - } - - // Update the height of a line, propagating the height change - // upwards to parent nodes. - function updateLineHeight(line, height) { - var diff = height - line.height; - if (diff) for (var n = line; n; n = n.parent) n.height += diff; - } - - // Given a line object, find its line number by walking up through - // its parent links. - function lineNo(line) { - if (line.parent == null) return null; - var cur = line.parent, no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0;; ++i) { - if (chunk.children[i] == cur) break; - no += chunk.children[i].chunkSize(); - } - } - return no + cur.first; - } - - // Find the line at the given vertical position, using the height - // information in the document tree. - function lineAtHeight(chunk, h) { - var n = chunk.first; - outer: do { - for (var i = 0; i < chunk.children.length; ++i) { - var child = chunk.children[i], ch = child.height; - if (h < ch) { chunk = child; continue outer; } - h -= ch; - n += child.chunkSize(); - } - return n; - } while (!chunk.lines); - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i], lh = line.height; - if (h < lh) break; - h -= lh; - } - return n + i; - } - - - // Find the height above the given line. - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj); - - var h = 0, chunk = lineObj.parent; - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i]; - if (line == lineObj) break; - else h += line.height; - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i = 0; i < p.children.length; ++i) { - var cur = p.children[i]; - if (cur == chunk) break; - else h += cur.height; - } - } - return h; - } - - // Get the bidi ordering for the given line (and cache it). Returns - // false for lines that are fully left-to-right, and an array of - // BidiSpan objects otherwise. - function getOrder(line) { - var order = line.order; - if (order == null) order = line.order = bidiOrdering(line.text); - return order; - } - - // HISTORY - - function History(startGen) { - // Arrays of change events and selections. Doing something adds an - // event to done and clears undo. Undoing moves events from done - // to undone, redoing moves them in the other direction. - this.done = []; this.undone = []; - this.undoDepth = Infinity; - // Used to track when changes can be merged into a single undo - // event - this.lastModTime = this.lastSelTime = 0; - this.lastOp = this.lastSelOp = null; - this.lastOrigin = this.lastSelOrigin = null; - // Used by the isClean() method - this.generation = this.maxGeneration = startGen || 1; - } - - // Create a history change event from an updateDoc-style change - // object. - function historyChangeFromChange(doc, change) { - var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); - linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); - return histChange; - } - - // Pop all selection events off the end of a history array. Stop at - // a change event. - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array); - if (last.ranges) array.pop(); - else break; - } - } - - // Find the top change event in the history. Pop off selection - // events that are in the way. - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done); - return lst(hist.done); - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done); - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop(); - return lst(hist.done); - } - } - - // Register a change in the history. Merges changes that are within - // a single operation, ore are close together with an origin that - // allows merging (starting with "+") into a single event. - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history; - hist.undone.length = 0; - var time = +new Date, cur; - - if ((hist.lastOp == opId || - hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || - change.origin.charAt(0) == "*")) && - (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - // Merge this change into the last event - var last = lst(cur.changes); - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - // Optimized case for simple insertion -- don't want to add - // new changesets for every character typed - last.to = changeEnd(change); - } else { - // Add new sub-event - cur.changes.push(historyChangeFromChange(doc, change)); - } - } else { - // Can not be merged, start a new event. - var before = lst(hist.done); - if (!before || !before.ranges) - pushSelectionToHistory(doc.sel, hist.done); - cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation}; - hist.done.push(cur); - while (hist.done.length > hist.undoDepth) { - hist.done.shift(); - if (!hist.done[0].ranges) hist.done.shift(); - } - } - hist.done.push(selAfter); - hist.generation = ++hist.maxGeneration; - hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = hist.lastSelOp = opId; - hist.lastOrigin = hist.lastSelOrigin = change.origin; - - if (!last) signal(doc, "historyAdded"); - } - - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0); - return ch == "*" || - ch == "+" && - prev.ranges.length == sel.ranges.length && - prev.somethingSelected() == sel.somethingSelected() && - new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); - } - - // Called whenever the selection changes, sets the new selection as - // the pending selection in the history, and pushes the old pending - // selection into the 'done' array when it was significantly - // different (in number of selected ranges, emptiness, or time). - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, origin = options && options.origin; - - // A new event is started when the previous origin does not match - // the current, or the origins don't allow matching. Origins - // starting with * are always merged, those starting with + are - // merged when similar and close together in time. - if (opId == hist.lastSelOp || - (origin && hist.lastSelOrigin == origin && - (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || - selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) - hist.done[hist.done.length - 1] = sel; - else - pushSelectionToHistory(sel, hist.done); - - hist.lastSelTime = +new Date; - hist.lastSelOrigin = origin; - hist.lastSelOp = opId; - if (options && options.clearRedo !== false) - clearSelectionEvents(hist.undone); - } - - function pushSelectionToHistory(sel, dest) { - var top = lst(dest); - if (!(top && top.ranges && top.equals(sel))) - dest.push(sel); - } - - // Used to store marked span information in the history. - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { - if (line.markedSpans) - (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; - ++n; - }); - } - - // When un/re-doing restores text containing marked spans, those - // that have been explicitly cleared should not be restored. - function removeClearedSpans(spans) { - if (!spans) return null; - for (var i = 0, out; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } - else if (out) out.push(spans[i]); - } - return !out ? spans : out.length ? out : null; - } - - // Retrieve and filter the old marked spans stored in a change event. - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id]; - if (!found) return null; - for (var i = 0, nw = []; i < change.text.length; ++i) - nw.push(removeClearedSpans(found[i])); - return nw; - } - - // Used both to provide a JSON-safe object in .getHistory, and, when - // detaching a document, to split the history in two - function copyHistoryArray(events, newGroup, instantiateSel) { - for (var i = 0, copy = []; i < events.length; ++i) { - var event = events[i]; - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); - continue; - } - var changes = event.changes, newChanges = []; - copy.push({changes: newChanges}); - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], m; - newChanges.push({from: change.from, to: change.to, text: change.text}); - if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop] = change[prop]; - delete change[prop]; - } - } - } - } - return copy; - } - - // Rebasing/resetting history to deal with externally-sourced changes - - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff; - } else if (from < pos.line) { - pos.line = from; - pos.ch = 0; - } - } - - // Tries to rebase an array of history events given a change in the - // document. If the change touches the same lines as the event, the - // event, and everything 'behind' it, is discarded. If the change is - // before the event, the event's positions are updated. Uses a - // copy-on-write scheme for the positions, to avoid having to - // reallocate them all on every rebase, but also avoid problems with - // shared position objects being unsafely updated. - function rebaseHistArray(array, from, to, diff) { - for (var i = 0; i < array.length; ++i) { - var sub = array[i], ok = true; - if (sub.ranges) { - if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); - } - continue; - } - for (var j = 0; j < sub.changes.length; ++j) { - var cur = sub.changes[j]; - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch); - cur.to = Pos(cur.to.line + diff, cur.to.ch); - } else if (from <= cur.to.line) { - ok = false; - break; - } - } - if (!ok) { - array.splice(0, i + 1); - i = 0; - } - } - } - - function rebaseHist(hist, change) { - var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; - rebaseHistArray(hist.done, from, to, diff); - rebaseHistArray(hist.undone, from, to, diff); - } - - // EVENT UTILITIES - - // Due to the fact that we still support jurassic IE versions, some - // compatibility wrappers are needed. - - var e_preventDefault = CodeMirror.e_preventDefault = function(e) { - if (e.preventDefault) e.preventDefault(); - else e.returnValue = false; - }; - var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { - if (e.stopPropagation) e.stopPropagation(); - else e.cancelBubble = true; - }; - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; - } - var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; - - function e_target(e) {return e.target || e.srcElement;} - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) b = 1; - else if (e.button & 2) b = 3; - else if (e.button & 4) b = 2; - } - if (mac && e.ctrlKey && b == 1) b = 3; - return b; - } - - // EVENT HANDLING - - // Lightweight event framework. on/off also work on DOM nodes, - // registering native DOM handlers. - - var on = CodeMirror.on = function(emitter, type, f) { - if (emitter.addEventListener) - emitter.addEventListener(type, f, false); - else if (emitter.attachEvent) - emitter.attachEvent("on" + type, f); - else { - var map = emitter._handlers || (emitter._handlers = {}); - var arr = map[type] || (map[type] = []); - arr.push(f); - } - }; - - var off = CodeMirror.off = function(emitter, type, f) { - if (emitter.removeEventListener) - emitter.removeEventListener(type, f, false); - else if (emitter.detachEvent) - emitter.detachEvent("on" + type, f); - else { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - for (var i = 0; i < arr.length; ++i) - if (arr[i] == f) { arr.splice(i, 1); break; } - } - }; - - var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - var args = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); - }; - - var orphanDelayedCallbacks = null; - - // Often, we want to signal events at a point where we are in the - // middle of some work, but don't want the handler to start calling - // other methods on the editor, which might be in an inconsistent - // state or simply not expect any other events to happen. - // signalLater looks whether there are any handlers, and schedules - // them to be executed when the last operation ends, or, if no - // operation is active, when a timeout fires. - function signalLater(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - var args = Array.prototype.slice.call(arguments, 2), list; - if (operationGroup) { - list = operationGroup.delayedCallbacks; - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks; - } else { - list = orphanDelayedCallbacks = []; - setTimeout(fireOrphanDelayed, 0); - } - function bnd(f) {return function(){f.apply(null, args);};}; - for (var i = 0; i < arr.length; ++i) - list.push(bnd(arr[i])); - } - - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks; - orphanDelayedCallbacks = null; - for (var i = 0; i < delayed.length; ++i) delayed[i](); - } - - // The DOM events that CodeMirror handles can be overridden by - // registering a (non-DOM) handler on the editor for the event name, - // and preventDefault-ing the event in that handler. - function signalDOMEvent(cm, e, override) { - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore; - } - - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity; - if (!arr) return; - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); - for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) - set.push(arr[i]); - } - - function hasHandler(emitter, type) { - var arr = emitter._handlers && emitter._handlers[type]; - return arr && arr.length > 0; - } - - // Add on and off methods to a constructor's prototype, to make - // registering events on such objects more convenient. - function eventMixin(ctor) { - ctor.prototype.on = function(type, f) {on(this, type, f);}; - ctor.prototype.off = function(type, f) {off(this, type, f);}; - } - - // MISC UTILITIES - - // Number of pixels added to scroller and sizer to hide scrollbar - var scrollerCutOff = 30; - - // Returned or thrown by various protocols to signal 'I'm not - // handling this'. - var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; - - // Reused option objects for setSelection & friends - var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; - - function Delayed() {this.id = null;} - Delayed.prototype.set = function(ms, f) { - clearTimeout(this.id); - this.id = setTimeout(f, ms); - }; - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) end = string.length; - } - for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i); - if (nextTab < 0 || nextTab >= end) - return n + (end - i); - n += nextTab - i; - n += tabSize - (n % tabSize); - i = nextTab + 1; - } - }; - - // The inverse of countColumn -- find the offset that corresponds to - // a particular column. - function findColumn(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf("\t", pos); - if (nextTab == -1) nextTab = string.length; - var skipped = nextTab - pos; - if (nextTab == string.length || col + skipped >= goal) - return pos + Math.min(skipped, goal - col); - col += nextTab - pos; - col += tabSize - (col % tabSize); - pos = nextTab + 1; - if (col >= goal) return pos; - } - } - - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) - spaceStrs.push(lst(spaceStrs) + " "); - return spaceStrs[n]; - } - - function lst(arr) { return arr[arr.length-1]; } - - var selectInput = function(node) { node.select(); }; - if (ios) // Mobile Safari apparently has a bug where select() is broken. - selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; - else if (ie) // Suppress mysterious IE10 errors - selectInput = function(node) { try { node.select(); } catch(_e) {} }; - - function indexOf(array, elt) { - for (var i = 0; i < array.length; ++i) - if (array[i] == elt) return i; - return -1; - } - if ([].indexOf) indexOf = function(array, elt) { return array.indexOf(elt); }; - function map(array, f) { - var out = []; - for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); - return out; - } - if ([].map) map = function(array, f) { return array.map(f); }; - - function createObj(base, props) { - var inst; - if (Object.create) { - inst = Object.create(base); - } else { - var ctor = function() {}; - ctor.prototype = base; - inst = new ctor(); - } - if (props) copyObj(props, inst); - return inst; - }; - - function copyObj(obj, target, overwrite) { - if (!target) target = {}; - for (var prop in obj) - if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - target[prop] = obj[prop]; - return target; - } - - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function(){return f.apply(null, args);}; - } - - var nonASCIISingleCaseWordChar = /[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - var isWordCharBasic = CodeMirror.isWordChar = function(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); - }; - function isWordChar(ch, helper) { - if (!helper) return isWordCharBasic(ch); - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; - return helper.test(ch); - } - - function isEmpty(obj) { - for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; - return true; - } - - // Extending unicode characters. A series of a non-extending char + - // any number of extending chars is treated as a single unit as far - // as editing and measuring is concerned. This is not fully correct, - // since some scripts/fonts/browsers also treat other configurations - // of code points as a group. - var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; - function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } - - // DOM UTILITIES - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) e.className = className; - if (style) e.style.cssText = style; - if (typeof content == "string") e.appendChild(document.createTextNode(content)); - else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); - return e; - } - - var range; - if (document.createRange) range = function(node, start, end) { - var r = document.createRange(); - r.setEnd(node, end); - r.setStart(node, start); - return r; - }; - else range = function(node, start, end) { - var r = document.body.createTextRange(); - r.moveToElementText(node.parentNode); - r.collapse(true); - r.moveEnd("character", end); - r.moveStart("character", start); - return r; - }; - - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) - e.removeChild(e.firstChild); - return e; - } - - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e); - } - - function contains(parent, child) { - if (parent.contains) - return parent.contains(child); - while (child = child.parentNode) - if (child == parent) return true; - } - - function activeElt() { return document.activeElement; } - // Older versions of IE throws unspecified error when touching - // document.activeElement in some cases (during loading, in iframe) - if (ie && ie_version < 11) activeElt = function() { - try { return document.activeElement; } - catch(e) { return document.body; } - }; - - function classTest(cls) { return new RegExp("\\b" + cls + "\\b\\s*"); } - function rmClass(node, cls) { - var test = classTest(cls); - if (test.test(node.className)) node.className = node.className.replace(test, ""); - } - function addClass(node, cls) { - if (!classTest(cls).test(node.className)) node.className += " " + cls; - } - function joinClasses(a, b) { - var as = a.split(" "); - for (var i = 0; i < as.length; i++) - if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; - return b; - } - - // WINDOW-WIDE EVENTS - - // These must be handled carefully, because naively registering a - // handler for each editor will cause the editors to never be - // garbage collected. - - function forEachCodeMirror(f) { - if (!document.body.getElementsByClassName) return; - var byClass = document.body.getElementsByClassName("CodeMirror"); - for (var i = 0; i < byClass.length; i++) { - var cm = byClass[i].CodeMirror; - if (cm) f(cm); - } - } - - var globalsRegistered = false; - function ensureGlobalHandlers() { - if (globalsRegistered) return; - registerGlobalHandlers(); - globalsRegistered = true; - } - function registerGlobalHandlers() { - // When the window resizes, we need to refresh active editors. - var resizeTimer; - on(window, "resize", function() { - if (resizeTimer == null) resizeTimer = setTimeout(function() { - resizeTimer = null; - knownScrollbarWidth = null; - forEachCodeMirror(onResize); - }, 100); - }); - // When the window loses focus, we want to show the editor as blurred - on(window, "blur", function() { - forEachCodeMirror(onBlur); - }); - } - - // FEATURE DETECTION - - // Detect drag-and-drop - var dragAndDrop = function() { - // There is *some* kind of drag-and-drop support in IE6-8, but I - // couldn't get it to work yet. - if (ie && ie_version < 9) return false; - var div = elt('div'); - return "draggable" in div || "dragDrop" in div; - }(); - - var knownScrollbarWidth; - function scrollbarWidth(measure) { - if (knownScrollbarWidth != null) return knownScrollbarWidth; - var test = elt("div", null, null, "width: 50px; height: 50px; overflow-x: scroll"); - removeChildrenAndAdd(measure, test); - if (test.offsetWidth) - knownScrollbarWidth = test.offsetHeight - test.clientHeight; - return knownScrollbarWidth || 0; - } - - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200b"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); - } - if (zwspSupported) return elt("span", "\u200b"); - else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); - } - - // Feature-detect IE's crummy client rect reporting for bidi text - var badBidiRects; - function hasBadBidiRects(measure) { - if (badBidiRects != null) return badBidiRects; - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); - var r0 = range(txt, 0, 1).getBoundingClientRect(); - if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) - var r1 = range(txt, 1, 2).getBoundingClientRect(); - return badBidiRects = (r1.right - r0.right < 3); - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLines = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { - var pos = 0, result = [], l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) nl = string.length; - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result; - } : function(string){return string.split(/\r\n?|\n/);}; - - var hasSelection = window.getSelection ? function(te) { - try { return te.selectionStart != te.selectionEnd; } - catch(e) { return false; } - } : function(te) { - try {var range = te.ownerDocument.selection.createRange();} - catch(e) {} - if (!range || range.parentElement() != te) return false; - return range.compareEndPoints("StartToEnd", range) != 0; - }; - - var hasCopyEvent = (function() { - var e = elt("div"); - if ("oncopy" in e) return true; - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == "function"; - })(); - - var badZoomedRects = null; - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) return badZoomedRects; - var node = removeChildrenAndAdd(measure, elt("span", "x")); - var normal = node.getBoundingClientRect(); - var fromRange = range(node, 0, 1).getBoundingClientRect(); - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; - } - - // KEY NAMES - - var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete", - 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", - 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"}; - CodeMirror.keyNames = keyNames; - (function() { - // Number keys - for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); - // Alphabetic keys - for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); - // Function keys - for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; - })(); - - // BIDI HELPERS - - function iterateBidiSections(order, from, to, f) { - if (!order) return f(from, to, "ltr"); - var found = false; - for (var i = 0; i < order.length; ++i) { - var part = order[i]; - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); - found = true; - } - } - if (!found) f(from, to, "ltr"); - } - - function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } - function bidiRight(part) { return part.level % 2 ? part.from : part.to; } - - function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } - function lineRight(line) { - var order = getOrder(line); - if (!order) return line.text.length; - return bidiRight(lst(order)); - } - - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLine(line); - if (visual != line) lineN = lineNo(visual); - var order = getOrder(visual); - var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); - return Pos(lineN, ch); - } - function lineEnd(cm, lineN) { - var merged, line = getLine(cm.doc, lineN); - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - lineN = null; - } - var order = getOrder(line); - var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); - return Pos(lineN == null ? lineNo(line) : lineN, ch); - } - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line); - var line = getLine(cm.doc, start.line); - var order = getOrder(line); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)); - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; - return Pos(start.line, inWS ? 0 : firstNonWS); - } - return start; - } - - function compareBidiLevel(order, a, b) { - var linedir = order[0].level; - if (a == linedir) return true; - if (b == linedir) return false; - return a < b; - } - var bidiOther; - function getBidiPartAt(order, pos) { - bidiOther = null; - for (var i = 0, found; i < order.length; ++i) { - var cur = order[i]; - if (cur.from < pos && cur.to > pos) return i; - if ((cur.from == pos || cur.to == pos)) { - if (found == null) { - found = i; - } else if (compareBidiLevel(order, cur.level, order[found].level)) { - if (cur.from != cur.to) bidiOther = found; - return i; - } else { - if (cur.from != cur.to) bidiOther = i; - return found; - } - } - } - return found; - } - - function moveInLine(line, pos, dir, byUnit) { - if (!byUnit) return pos + dir; - do pos += dir; - while (pos > 0 && isExtendingChar(line.text.charAt(pos))); - return pos; - } - - // This is needed in order to move 'visually' through bi-directional - // text -- i.e., pressing left should make the cursor go left, even - // when in RTL text. The tricky part is the 'jumps', where RTL and - // LTR text touch each other. This often requires the cursor offset - // to move more than one unit, in order to visually move one unit. - function moveVisually(line, start, dir, byUnit) { - var bidi = getOrder(line); - if (!bidi) return moveLogically(line, start, dir, byUnit); - var pos = getBidiPartAt(bidi, start), part = bidi[pos]; - var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit); - - for (;;) { - if (target > part.from && target < part.to) return target; - if (target == part.from || target == part.to) { - if (getBidiPartAt(bidi, target) == pos) return target; - part = bidi[pos += dir]; - return (dir > 0) == part.level % 2 ? part.to : part.from; - } else { - part = bidi[pos += dir]; - if (!part) return null; - if ((dir > 0) == part.level % 2) - target = moveInLine(line, part.to, -1, byUnit); - else - target = moveInLine(line, part.from, 1, byUnit); - } - } - } - - function moveLogically(line, start, dir, byUnit) { - var target = start + dir; - if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir; - return target < 0 || target > line.text.length ? null : target; - } - - // Bidirectional ordering algorithm - // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm - // that this (partially) implements. - - // One-char codes used for character types: - // L (L): Left-to-Right - // R (R): Right-to-Left - // r (AL): Right-to-Left Arabic - // 1 (EN): European Number - // + (ES): European Number Separator - // % (ET): European Number Terminator - // n (AN): Arabic Number - // , (CS): Common Number Separator - // m (NSM): Non-Spacing Mark - // b (BN): Boundary Neutral - // s (B): Paragraph Separator - // t (S): Segment Separator - // w (WS): Whitespace - // N (ON): Other Neutrals - - // Returns null if characters are ordered as they appear - // (left-to-right), or an array of sections ({from, to, level} - // objects) in the order in which they occur visually. - var bidiOrdering = (function() { - // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; - // Character types for codepoints 0x600 to 0x6ff - var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; - function charType(code) { - if (code <= 0xf7) return lowTypes.charAt(code); - else if (0x590 <= code && code <= 0x5f4) return "R"; - else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); - else if (0x6ee <= code && code <= 0x8ac) return "r"; - else if (0x2000 <= code && code <= 0x200b) return "w"; - else if (code == 0x200c) return "b"; - else return "L"; - } - - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; - // Browsers seem to always treat the boundaries of block elements as being L. - var outerType = "L"; - - function BidiSpan(level, from, to) { - this.level = level; - this.from = from; this.to = to; - } - - return function(str) { - if (!bidiRE.test(str)) return false; - var len = str.length, types = []; - for (var i = 0, type; i < len; ++i) - types.push(type = charType(str.charCodeAt(i))); - - // W1. Examine each non-spacing mark (NSM) in the level run, and - // change the type of the NSM to the type of the previous - // character. If the NSM is at the start of the level run, it will - // get the type of sor. - for (var i = 0, prev = outerType; i < len; ++i) { - var type = types[i]; - if (type == "m") types[i] = prev; - else prev = type; - } - - // W2. Search backwards from each instance of a European number - // until the first strong type (R, L, AL, or sor) is found. If an - // AL is found, change the type of the European number to Arabic - // number. - // W3. Change all ALs to R. - for (var i = 0, cur = outerType; i < len; ++i) { - var type = types[i]; - if (type == "1" && cur == "r") types[i] = "n"; - else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } - } - - // W4. A single European separator between two European numbers - // changes to a European number. A single common separator between - // two numbers of the same type changes to that type. - for (var i = 1, prev = types[0]; i < len - 1; ++i) { - var type = types[i]; - if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; - else if (type == "," && prev == types[i+1] && - (prev == "1" || prev == "n")) types[i] = prev; - prev = type; - } - - // W5. A sequence of European terminators adjacent to European - // numbers changes to all European numbers. - // W6. Otherwise, separators and terminators change to Other - // Neutral. - for (var i = 0; i < len; ++i) { - var type = types[i]; - if (type == ",") types[i] = "N"; - else if (type == "%") { - for (var end = i + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // W7. Search backwards from each instance of a European number - // until the first strong type (R, L, or sor) is found. If an L is - // found, then change the type of the European number to L. - for (var i = 0, cur = outerType; i < len; ++i) { - var type = types[i]; - if (cur == "L" && type == "1") types[i] = "L"; - else if (isStrong.test(type)) cur = type; - } - - // N1. A sequence of neutrals takes the direction of the - // surrounding strong text if the text on both sides has the same - // direction. European and Arabic numbers act as if they were R in - // terms of their influence on neutrals. Start-of-level-run (sor) - // and end-of-level-run (eor) are used at level run boundaries. - // N2. Any remaining neutrals take the embedding direction. - for (var i = 0; i < len; ++i) { - if (isNeutral.test(types[i])) { - for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} - var before = (i ? types[i-1] : outerType) == "L"; - var after = (end < len ? types[end] : outerType) == "L"; - var replace = before || after ? "L" : "R"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // Here we depart from the documented algorithm, in order to avoid - // building up an actual levels array. Since there are only three - // levels (0, 1, 2) in an implementation that doesn't take - // explicit embedding into account, we can build up the order on - // the fly, without following the level-based algorithm. - var order = [], m; - for (var i = 0; i < len;) { - if (countsAsLeft.test(types[i])) { - var start = i; - for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} - order.push(new BidiSpan(0, start, i)); - } else { - var pos = i, at = order.length; - for (++i; i < len && types[i] != "L"; ++i) {} - for (var j = pos; j < i;) { - if (countsAsNum.test(types[j])) { - if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); - var nstart = j; - for (++j; j < i && countsAsNum.test(types[j]); ++j) {} - order.splice(at, 0, new BidiSpan(2, nstart, j)); - pos = j; - } else ++j; - } - if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); - } - } - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift(new BidiSpan(0, 0, m[0].length)); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } - if (order[0].level != lst(order).level) - order.push(new BidiSpan(order[0].level, len, len)); - - return order; - }; - })(); - - // THE END - - CodeMirror.version = "4.6.0"; - - return CodeMirror; -}); diff --git a/ThirdParty/codemirror-4.6/mode/clike/clike.js b/ThirdParty/codemirror-4.6/mode/clike/clike.js deleted file mode 100644 index ee2c77a025e9..000000000000 --- a/ThirdParty/codemirror-4.6/mode/clike/clike.js +++ /dev/null @@ -1,451 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("clike", function(config, parserConfig) { - var indentUnit = config.indentUnit, - statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, - dontAlignCalls = parserConfig.dontAlignCalls, - keywords = parserConfig.keywords || {}, - builtin = parserConfig.builtin || {}, - blockKeywords = parserConfig.blockKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (builtin.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "builtin"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - var indent = state.indented; - if (state.context && state.context.type == "statement") - indent = state.context.indented; - return state.context = new Context(indent, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); - else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1); - else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - fold: "brace" - }; -}); - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var cKeywords = "auto if break int case long char register continue return default short do sizeof " + - "double static else struct entry switch extern typedef float union for unsigned " + - "goto while enum void const signed volatile"; - - function cppHook(stream, state) { - if (!state.startOfLine) return false; - for (;;) { - if (stream.skipTo("\\")) { - stream.next(); - if (stream.eol()) { - state.tokenize = cppHook; - break; - } - } else { - stream.skipToEnd(); - state.tokenize = null; - break; - } - } - return "meta"; - } - - function cpp11StringHook(stream, state) { - stream.backUp(1); - // Raw strings. - if (stream.match(/(R|u8R|uR|UR|LR)/)) { - var match = stream.match(/"([^\s\\()]{0,16})\(/); - if (!match) { - return false; - } - state.cpp11RawStringDelim = match[1]; - state.tokenize = tokenRawString; - return tokenRawString(stream, state); - } - // Unicode strings/chars. - if (stream.match(/(u8|u|U|L)/)) { - if (stream.match(/["']/, /* eat */ false)) { - return "string"; - } - return false; - } - // Ignore this hook. - stream.next(); - return false; - } - - // C#-style strings where "" escapes a quote. - function tokenAtString(stream, state) { - var next; - while ((next = stream.next()) != null) { - if (next == '"' && !stream.eat('"')) { - state.tokenize = null; - break; - } - } - return "string"; - } - - // C++11 raw string literal is "( anything )", where - // can be a string up to 16 characters long. - function tokenRawString(stream, state) { - // Escape characters that have special regex meanings. - var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&'); - var match = stream.match(new RegExp(".*?\\)" + delim + '"')); - if (match) - state.tokenize = null; - else - stream.skipToEnd(); - return "string"; - } - - function def(mimes, mode) { - if (typeof mimes == "string") mimes = [mimes]; - var words = []; - function add(obj) { - if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) - words.push(prop); - } - add(mode.keywords); - add(mode.builtin); - add(mode.atoms); - if (words.length) { - mode.helperType = mimes[0]; - CodeMirror.registerHelper("hintWords", mimes[0], words); - } - - for (var i = 0; i < mimes.length; ++i) - CodeMirror.defineMIME(mimes[i], mode); - } - - def(["text/x-csrc", "text/x-c", "text/x-chdr"], { - name: "clike", - keywords: words(cKeywords), - blockKeywords: words("case do else for if switch while struct"), - atoms: words("null"), - hooks: {"#": cppHook}, - modeProps: {fold: ["brace", "include"]} - }); - - def(["text/x-c++src", "text/x-c++hdr"], { - name: "clike", - keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + - "static_cast typeid catch operator template typename class friend private " + - "this using const_cast inline public throw virtual delete mutable protected " + - "wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final " + - "static_assert override"), - blockKeywords: words("catch class do else finally for if struct switch try while"), - atoms: words("true false null"), - hooks: { - "#": cppHook, - "u": cpp11StringHook, - "U": cpp11StringHook, - "L": cpp11StringHook, - "R": cpp11StringHook - }, - modeProps: {fold: ["brace", "include"]} - }); - def("text/x-java", { - name: "clike", - keywords: words("abstract assert boolean break byte case catch char class const continue default " + - "do double else enum extends final finally float for goto if implements import " + - "instanceof int interface long native new package private protected public " + - "return short static strictfp super switch synchronized this throw throws transient " + - "try void volatile while"), - blockKeywords: words("catch class do else finally for if switch try while"), - atoms: words("true false null"), - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - }, - modeProps: {fold: ["brace", "import"]} - }); - def("text/x-csharp", { - name: "clike", - keywords: words("abstract as base break case catch checked class const continue" + - " default delegate do else enum event explicit extern finally fixed for" + - " foreach goto if implicit in interface internal is lock namespace new" + - " operator out override params private protected public readonly ref return sealed" + - " sizeof stackalloc static struct switch this throw try typeof unchecked" + - " unsafe using virtual void volatile while add alias ascending descending dynamic from get" + - " global group into join let orderby partial remove select set value var yield"), - blockKeywords: words("catch class do else finally for foreach if struct switch try while"), - builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" + - " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" + - " UInt64 bool byte char decimal double short int long object" + - " sbyte float string ushort uint ulong"), - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { - if (stream.eat('"')) { - state.tokenize = tokenAtString; - return tokenAtString(stream, state); - } - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - def("text/x-scala", { - name: "clike", - keywords: words( - - /* scala */ - "abstract case catch class def do else extends false final finally for forSome if " + - "implicit import lazy match new null object override package private protected return " + - "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " + - "<% >: # @ " + - - /* package scala */ - "assert assume require print println printf readLine readBoolean readByte readShort " + - "readChar readInt readLong readFloat readDouble " + - - "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + - "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " + - "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " + - "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " + - "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " + - - /* package java.lang */ - "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + - "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + - "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + - "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" - - - ), - multiLineStrings: true, - blockKeywords: words("catch class do else finally for forSome if match switch try while"), - atoms: words("true false null"), - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - def(["x-shader/x-vertex", "x-shader/x-fragment"], { - name: "clike", - keywords: words("float int bool void " + - "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + - "mat2 mat3 mat4 " + - "sampler1D sampler2D sampler3D samplerCube " + - "sampler1DShadow sampler2DShadow" + - "const attribute uniform varying " + - "break continue discard return " + - "for while do if else struct " + - "in out inout"), - blockKeywords: words("for while do if else struct"), - builtin: words("radians degrees sin cos tan asin acos atan " + - "pow exp log exp2 sqrt inversesqrt " + - "abs sign floor ceil fract mod min max clamp mix step smootstep " + - "length distance dot cross normalize ftransform faceforward " + - "reflect refract matrixCompMult " + - "lessThan lessThanEqual greaterThan greaterThanEqual " + - "equal notEqual any all not " + - "texture1D texture1DProj texture1DLod texture1DProjLod " + - "texture2D texture2DProj texture2DLod texture2DProjLod " + - "texture3D texture3DProj texture3DLod texture3DProjLod " + - "textureCube textureCubeLod " + - "shadow1D shadow2D shadow1DProj shadow2DProj " + - "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " + - "dFdx dFdy fwidth " + - "noise1 noise2 noise3 noise4"), - atoms: words("true false " + - "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " + - "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " + - "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " + - "gl_FogCoord " + - "gl_Position gl_PointSize gl_ClipVertex " + - "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " + - "gl_TexCoord gl_FogFragCoord " + - "gl_FragCoord gl_FrontFacing " + - "gl_FragColor gl_FragData gl_FragDepth " + - "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " + - "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " + - "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " + - "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + - "gl_ProjectionMatrixInverseTranspose " + - "gl_ModelViewProjectionMatrixInverseTranspose " + - "gl_TextureMatrixInverseTranspose " + - "gl_NormalScale gl_DepthRange gl_ClipPlane " + - "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " + - "gl_FrontLightModelProduct gl_BackLightModelProduct " + - "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " + - "gl_FogParameters " + - "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " + - "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " + - "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " + - "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " + - "gl_MaxDrawBuffers"), - hooks: {"#": cppHook}, - modeProps: {fold: ["brace", "include"]} - }); - - def("text/x-nesc", { - name: "clike", - keywords: words(cKeywords + "as atomic async call command component components configuration event generic " + - "implementation includes interface module new norace nx_struct nx_union post provides " + - "signal task uses abstract extends"), - blockKeywords: words("case do else for if switch while struct"), - atoms: words("null"), - hooks: {"#": cppHook}, - modeProps: {fold: ["brace", "include"]} - }); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/clike/index.html b/ThirdParty/codemirror-4.6/mode/clike/index.html deleted file mode 100644 index d1abf9359d1c..000000000000 --- a/ThirdParty/codemirror-4.6/mode/clike/index.html +++ /dev/null @@ -1,204 +0,0 @@ - - -CodeMirror: C-like mode - - - - - - - - - - - - -
-

C-like mode

- -
- -

C++ example

- -
- -

Java example

- -
- - - -

Simple mode that tries to handle C-like languages as well as it - can. Takes two configuration parameters: keywords, an - object whose property names are the keywords in the language, - and useCPP, which determines whether C preprocessor - directives are recognized.

- -

MIME types defined: text/x-csrc - (C code), text/x-c++src (C++ - code), text/x-java (Java - code), text/x-csharp (C#).

-
diff --git a/ThirdParty/codemirror-4.6/mode/clojure/clojure.js b/ThirdParty/codemirror-4.6/mode/clojure/clojure.js deleted file mode 100644 index 73bfcd39b5a8..000000000000 --- a/ThirdParty/codemirror-4.6/mode/clojure/clojure.js +++ /dev/null @@ -1,241 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Author: Hans Engel - * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("clojure", function (options) { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHARACTER = "string-2", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword"; - var INDENT_WORD_SKIP = options.indentUnit || 2; - var NORMAL_INDENT_UNIT = options.indentUnit || 2; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var atoms = makeKeywords("true false nil"); - - var keywords = makeKeywords( - "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); - - var builtins = makeKeywords( - "* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"); - - var indentKeys = makeKeywords( - // Built-ins - "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch " + - - // Binding forms - "let letfn binding loop for doseq dotimes when-let if-let " + - - // Data structures - "defstruct struct-map assoc " + - - // clojure.test - "testing deftest " + - - // contrib - "handler-case handle dotrace deftrace"); - - var tests = { - digit: /\d/, - digit_or_colon: /[\d:]/, - hex: /[0-9a-f]/i, - sign: /[+-]/, - exponent: /e/i, - keyword_char: /[^\s\(\[\;\)\]]/, - symbol: /[\w*+!\-\._?:<>\/]/ - }; - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - function isNumber(ch, stream){ - // hex - if ( ch === '0' && stream.eat(/x/i) ) { - stream.eatWhile(tests.hex); - return true; - } - - // leading sign - if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { - stream.eat(tests.sign); - ch = stream.next(); - } - - if ( tests.digit.test(ch) ) { - stream.eat(ch); - stream.eatWhile(tests.digit); - - if ( '.' == stream.peek() ) { - stream.eat('.'); - stream.eatWhile(tests.digit); - } - - if ( stream.eat(tests.exponent) ) { - stream.eat(tests.sign); - stream.eatWhile(tests.digit); - } - - return true; - } - - return false; - } - - // Eat character that starts after backslash \ - function eatCharacter(stream) { - var first = stream.next(); - // Read special literals: backspace, newline, space, return. - // Just read all lowercase letters. - if (first && first.match(/[a-z]/) && stream.match(/[a-z]+/, true)) { - return; - } - // Read unicode character: \u1000 \uA0a1 - if (first === "u") { - stream.match(/[0-9a-z]{4}/i, true); - } - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in string mode - break; - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - } else if (ch == "\\") { - eatCharacter(stream); - returnType = CHARACTER; - } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { - returnType = ATOM; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (isNumber(ch,stream)){ - returnType = NUMBER; - } else if (ch == "(" || ch == "[" || ch == "{" ) { - var keyWord = '', indentTemp = stream.column(), letter; - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) || - /^(?:def|with)/.test(keyWord))) { // indent-word - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation the user defined spaces after - pushStack(state, indentTemp + NORMAL_INDENT_UNIT, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - returnType = BRACKET; - } else if (ch == ")" || ch == "]" || ch == "}") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : (ch == "]" ? "[" :"{"))) { - popStack(state); - } - } else if ( ch == ":" ) { - stream.eatWhile(tests.symbol); - return ATOM; - } else { - stream.eatWhile(tests.symbol); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = KEYWORD; - } else if (builtins && builtins.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else if (atoms && atoms.propertyIsEnumerable(stream.current())) { - returnType = ATOM; - } else returnType = null; - } - } - - return returnType; - }, - - indent: function (state) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - }, - - lineComment: ";;" - }; -}); - -CodeMirror.defineMIME("text/x-clojure", "clojure"); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/clojure/index.html b/ThirdParty/codemirror-4.6/mode/clojure/index.html deleted file mode 100644 index 5a50c566fc80..000000000000 --- a/ThirdParty/codemirror-4.6/mode/clojure/index.html +++ /dev/null @@ -1,88 +0,0 @@ - - -CodeMirror: Clojure mode - - - - - - - - - -
-

Clojure mode

-
- - -

MIME types defined: text/x-clojure.

- -
diff --git a/ThirdParty/codemirror-4.6/mode/css/test.js b/ThirdParty/codemirror-4.6/mode/css/test.js deleted file mode 100644 index d236e2a7384a..000000000000 --- a/ThirdParty/codemirror-4.6/mode/css/test.js +++ /dev/null @@ -1,135 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "css"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - // Error, because "foobarhello" is neither a known type or property, but - // property was expected (after "and"), and it should be in parenthese. - MT("atMediaUnknownType", - "[def @media] [attribute screen] [keyword and] [error foobarhello] { }"); - - // Soft error, because "foobarhello" is not a known property or type. - MT("atMediaUnknownProperty", - "[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"); - - // Make sure nesting works with media queries - MT("atMediaMaxWidthNested", - "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"); - - MT("tagSelector", - "[tag foo] { }"); - - MT("classSelector", - "[qualifier .foo-bar_hello] { }"); - - MT("idSelector", - "[builtin #foo] { [error #foo] }"); - - MT("tagSelectorUnclosed", - "[tag foo] { [property margin]: [number 0] } [tag bar] { }"); - - MT("tagStringNoQuotes", - "[tag foo] { [property font-family]: [variable hello] [variable world]; }"); - - MT("tagStringDouble", - "[tag foo] { [property font-family]: [string \"hello world\"]; }"); - - MT("tagStringSingle", - "[tag foo] { [property font-family]: [string 'hello world']; }"); - - MT("tagColorKeyword", - "[tag foo] {", - " [property color]: [keyword black];", - " [property color]: [keyword navy];", - " [property color]: [keyword yellow];", - "}"); - - MT("tagColorHex3", - "[tag foo] { [property background]: [atom #fff]; }"); - - MT("tagColorHex6", - "[tag foo] { [property background]: [atom #ffffff]; }"); - - MT("tagColorHex4", - "[tag foo] { [property background]: [atom&error #ffff]; }"); - - MT("tagColorHexInvalid", - "[tag foo] { [property background]: [atom&error #ffg]; }"); - - MT("tagNegativeNumber", - "[tag foo] { [property margin]: [number -5px]; }"); - - MT("tagPositiveNumber", - "[tag foo] { [property padding]: [number 5px]; }"); - - MT("tagVendor", - "[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"); - - MT("tagBogusProperty", - "[tag foo] { [property&error barhelloworld]: [number 0]; }"); - - MT("tagTwoProperties", - "[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"); - - MT("tagTwoPropertiesURL", - "[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"); - - MT("commentSGML", - "[comment ]"); - - MT("commentSGML2", - "[comment ] [tag div] {}"); - - MT("indent_tagSelector", - "[tag strong], [tag em] {", - " [property background]: [atom rgba](", - " [number 255], [number 255], [number 0], [number .2]", - " );", - "}"); - - MT("indent_atMedia", - "[def @media] {", - " [tag foo] {", - " [property color]:", - " [keyword yellow];", - " }", - "}"); - - MT("indent_comma", - "[tag foo] {", - " [property font-family]: [variable verdana],", - " [atom sans-serif];", - "}"); - - MT("indent_parentheses", - "[tag foo]:[variable-3 before] {", - " [property background]: [atom url](", - "[string blahblah]", - "[string etc]", - "[string ]) [keyword !important];", - "}"); - - MT("font_face", - "[def @font-face] {", - " [property font-family]: [string 'myfont'];", - " [error nonsense]: [string 'abc'];", - " [property src]: [atom url]([string http://blah]),", - " [atom url]([string http://foo]);", - "}"); - - MT("empty_url", - "[def @import] [tag url]() [tag screen];"); - - MT("parens", - "[qualifier .foo] {", - " [property background-image]: [variable fade]([atom #000], [number 20%]);", - " [property border-image]: [variable linear-gradient](", - " [atom to] [atom bottom],", - " [variable fade]([atom #000], [number 20%]) [number 0%],", - " [variable fade]([atom #000], [number 20%]) [number 100%]", - " );", - "}"); -})(); diff --git a/ThirdParty/codemirror-4.6/mode/gfm/test.js b/ThirdParty/codemirror-4.6/mode/gfm/test.js deleted file mode 100644 index 78ffff2d7b51..000000000000 --- a/ThirdParty/codemirror-4.6/mode/gfm/test.js +++ /dev/null @@ -1,153 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "gfm"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true}); - function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } - - FT("codeBackticks", - "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); - - FT("doubleBackticks", - "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); - - FT("codeBlock", - "[comment&formatting&formatting-code-block ```css]", - "[tag foo]", - "[comment&formatting&formatting-code-block ```]"); - - FT("taskList", - "[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]", - "[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]"); - - MT("emInWordAsterisk", - "foo[em *bar*]hello"); - - MT("emInWordUnderscore", - "foo_bar_hello"); - - MT("emStrongUnderscore", - "[strong __][em&strong _foo__][em _] bar"); - - MT("fencedCodeBlocks", - "[comment ```]", - "[comment foo]", - "", - "[comment ```]", - "bar"); - - MT("fencedCodeBlockModeSwitching", - "[comment ```javascript]", - "[variable foo]", - "", - "[comment ```]", - "bar"); - - MT("taskListAsterisk", - "[variable-2 * []] foo]", // Invalid; must have space or x between [] - "[variable-2 * [ ]]bar]", // Invalid; must have space after ] - "[variable-2 * [x]]hello]", // Invalid; must have space after ] - "[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links - " [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested - - MT("taskListPlus", - "[variable-2 + []] foo]", // Invalid; must have space or x between [] - "[variable-2 + [ ]]bar]", // Invalid; must have space after ] - "[variable-2 + [x]]hello]", // Invalid; must have space after ] - "[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links - " [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested - - MT("taskListDash", - "[variable-2 - []] foo]", // Invalid; must have space or x between [] - "[variable-2 - [ ]]bar]", // Invalid; must have space after ] - "[variable-2 - [x]]hello]", // Invalid; must have space after ] - "[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links - " [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested - - MT("taskListNumber", - "[variable-2 1. []] foo]", // Invalid; must have space or x between [] - "[variable-2 2. [ ]]bar]", // Invalid; must have space after ] - "[variable-2 3. [x]]hello]", // Invalid; must have space after ] - "[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links - " [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested - - MT("SHA", - "foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"); - - MT("SHAEmphasis", - "[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); - - MT("shortSHA", - "foo [link be6a8cc] bar"); - - MT("tooShortSHA", - "foo be6a8c bar"); - - MT("longSHA", - "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"); - - MT("badSHA", - "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"); - - MT("userSHA", - "foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"); - - MT("userSHAEmphasis", - "[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); - - MT("userProjectSHA", - "foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"); - - MT("userProjectSHAEmphasis", - "[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); - - MT("num", - "foo [link #1] bar"); - - MT("numEmphasis", - "[em *foo ][em&link #1][em *]"); - - MT("badNum", - "foo #1bar hello"); - - MT("userNum", - "foo [link bar#1] hello"); - - MT("userNumEmphasis", - "[em *foo ][em&link bar#1][em *]"); - - MT("userProjectNum", - "foo [link bar/hello#1] world"); - - MT("userProjectNumEmphasis", - "[em *foo ][em&link bar/hello#1][em *]"); - - MT("vanillaLink", - "foo [link http://www.example.com/] bar"); - - MT("vanillaLinkPunctuation", - "foo [link http://www.example.com/]. bar"); - - MT("vanillaLinkExtension", - "foo [link http://www.example.com/index.html] bar"); - - MT("vanillaLinkEmphasis", - "foo [em *][em&link http://www.example.com/index.html][em *] bar"); - - MT("notALink", - "[comment ```css]", - "[tag foo] {[property color]:[keyword black];}", - "[comment ```][link http://www.example.com/]"); - - MT("notALink", - "[comment ``foo `bar` http://www.example.com/``] hello"); - - MT("notALink", - "[comment `foo]", - "[link http://www.example.com/]", - "[comment `foo]", - "", - "[link http://www.example.com/]"); -})(); diff --git a/ThirdParty/codemirror-4.6/mode/htmlembedded/htmlembedded.js b/ThirdParty/codemirror-4.6/mode/htmlembedded/htmlembedded.js deleted file mode 100644 index e8f7ba803f64..000000000000 --- a/ThirdParty/codemirror-4.6/mode/htmlembedded/htmlembedded.js +++ /dev/null @@ -1,86 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { - - //config settings - var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, - scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; - - //inner modes - var scriptingMode, htmlMixedMode; - - //tokenizer when in html mode - function htmlDispatch(stream, state) { - if (stream.match(scriptStartRegex, false)) { - state.token=scriptingDispatch; - return scriptingMode.token(stream, state.scriptState); - } - else - return htmlMixedMode.token(stream, state.htmlState); - } - - //tokenizer when in scripting mode - function scriptingDispatch(stream, state) { - if (stream.match(scriptEndRegex, false)) { - state.token=htmlDispatch; - return htmlMixedMode.token(stream, state.htmlState); - } - else - return scriptingMode.token(stream, state.scriptState); - } - - - return { - startState: function() { - scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); - htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); - return { - token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, - htmlState : CodeMirror.startState(htmlMixedMode), - scriptState : CodeMirror.startState(scriptingMode) - }; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (state.token == htmlDispatch) - return htmlMixedMode.indent(state.htmlState, textAfter); - else if (scriptingMode.indent) - return scriptingMode.indent(state.scriptState, textAfter); - }, - - copyState: function(state) { - return { - token : state.token, - htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), - scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) - }; - }, - - innerMode: function(state) { - if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; - else return {state: state.htmlState, mode: htmlMixedMode}; - } - }; -}, "htmlmixed"); - -CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); -CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); -CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); -CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/htmlmixed/htmlmixed.js b/ThirdParty/codemirror-4.6/mode/htmlmixed/htmlmixed.js deleted file mode 100644 index 250ef8cd243f..000000000000 --- a/ThirdParty/codemirror-4.6/mode/htmlmixed/htmlmixed.js +++ /dev/null @@ -1,121 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, {name: "xml", - htmlMode: true, - multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, - multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag}); - var cssMode = CodeMirror.getMode(config, "css"); - - var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes; - scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, - mode: CodeMirror.getMode(config, "javascript")}); - if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) { - var conf = scriptTypesConf[i]; - scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)}); - } - scriptTypes.push({matches: /./, - mode: CodeMirror.getMode(config, "text/plain")}); - - function html(stream, state) { - var tagName = state.htmlState.tagName; - if (tagName) tagName = tagName.toLowerCase(); - var style = htmlMode.token(stream, state.htmlState); - if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") { - // Script block: mode to change to depends on type attribute - var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); - scriptType = scriptType ? scriptType[1] : ""; - if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); - for (var i = 0; i < scriptTypes.length; ++i) { - var tp = scriptTypes[i]; - if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { - if (tp.mode) { - state.token = script; - state.localMode = tp.mode; - state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); - } - break; - } - } - } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { - state.token = css; - state.localMode = cssMode; - state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); - } - return style; - } - function maybeBackup(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat), m; - if (close > -1) stream.backUp(cur.length - close); - else if (m = cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur); - } - return style; - } - function script(stream, state) { - if (stream.match(/^<\/\s*script\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*script\s*>/, - state.localMode.token(stream, state.localState)); - } - function css(stream, state) { - if (stream.match(/^<\/\s*style\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*style\s*>/, - cssMode.token(stream, state.localState)); - } - - return { - startState: function() { - var state = htmlMode.startState(); - return {token: html, localMode: null, localState: null, htmlState: state}; - }, - - copyState: function(state) { - if (state.localState) - var local = CodeMirror.copyState(state.localMode, state.localState); - return {token: state.token, localMode: state.localMode, localState: local, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (!state.localMode || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.localMode.indent) - return state.localMode.indent(state.localState, textAfter); - else - return CodeMirror.Pass; - }, - - innerMode: function(state) { - return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; - } - }; -}, "xml", "javascript", "css"); - -CodeMirror.defineMIME("text/html", "htmlmixed"); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/javascript/test.js b/ThirdParty/codemirror-4.6/mode/javascript/test.js deleted file mode 100644 index 77cc695fef4d..000000000000 --- a/ThirdParty/codemirror-4.6/mode/javascript/test.js +++ /dev/null @@ -1,187 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "javascript"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("locals", - "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); - - MT("comma-and-binop", - "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"); - - MT("destructuring", - "([keyword function]([def a], [[[def b], [def c] ]]) {", - " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);", - " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];", - "})();"); - - MT("class_body", - "[keyword class] [variable Foo] {", - " [property constructor]() {}", - " [property sayName]() {", - " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];", - " }", - "}"); - - MT("class", - "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {", - " [property get] [property prop]() { [keyword return] [number 24]; }", - " [property constructor]([def x], [def y]) {", - " [keyword super]([string 'something']);", - " [keyword this].[property x] [operator =] [variable-2 x];", - " }", - "}"); - - MT("module", - "[keyword module] [string 'foo'] {", - " [keyword export] [keyword let] [def x] [operator =] [number 42];", - " [keyword export] [keyword *] [keyword from] [string 'somewhere'];", - "}"); - - MT("import", - "[keyword function] [variable foo]() {", - " [keyword import] [def $] [keyword from] [string 'jquery'];", - " [keyword module] [def crypto] [keyword from] [string 'crypto'];", - " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];", - "}"); - - MT("const", - "[keyword function] [variable f]() {", - " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];", - "}"); - - MT("for/of", - "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"); - - MT("generator", - "[keyword function*] [variable repeat]([def n]) {", - " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])", - " [keyword yield] [variable-2 i];", - "}"); - - MT("fatArrow", - "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);", - "[variable a];", // No longer in scope - "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", - "[variable c];"); - - MT("spread", - "[keyword function] [variable f]([def a], [meta ...][def b]) {", - " [variable something]([variable-2 a], [meta ...][variable-2 b]);", - "}"); - - MT("comprehension", - "[keyword function] [variable f]() {", - " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];", - " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));", - "}"); - - MT("quasi", - "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); - - MT("quasi_no_function", - "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); - - MT("indent_statement", - "[keyword var] [variable x] [operator =] [number 10]", - "[variable x] [operator +=] [variable y] [operator +]", - " [atom Infinity]", - "[keyword debugger];"); - - MT("indent_if", - "[keyword if] ([number 1])", - " [keyword break];", - "[keyword else] [keyword if] ([number 2])", - " [keyword continue];", - "[keyword else]", - " [number 10];", - "[keyword if] ([number 1]) {", - " [keyword break];", - "} [keyword else] [keyword if] ([number 2]) {", - " [keyword continue];", - "} [keyword else] {", - " [number 10];", - "}"); - - MT("indent_for", - "[keyword for] ([keyword var] [variable i] [operator =] [number 0];", - " [variable i] [operator <] [number 100];", - " [variable i][operator ++])", - " [variable doSomething]([variable i]);", - "[keyword debugger];"); - - MT("indent_c_style", - "[keyword function] [variable foo]()", - "{", - " [keyword debugger];", - "}"); - - MT("indent_else", - "[keyword for] (;;)", - " [keyword if] ([variable foo])", - " [keyword if] ([variable bar])", - " [number 1];", - " [keyword else]", - " [number 2];", - " [keyword else]", - " [number 3];"); - - MT("indent_funarg", - "[variable foo]([number 10000],", - " [keyword function]([def a]) {", - " [keyword debugger];", - "};"); - - MT("indent_below_if", - "[keyword for] (;;)", - " [keyword if] ([variable foo])", - " [number 1];", - "[number 2];"); - - MT("multilinestring", - "[keyword var] [variable x] [operator =] [string 'foo\\]", - "[string bar'];"); - - MT("scary_regexp", - "[string-2 /foo[[/]]bar/];"); - - var jsonld_mode = CodeMirror.getMode( - {indentUnit: 2}, - {name: "javascript", jsonld: true} - ); - function LD(name) { - test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1)); - } - - LD("json_ld_keywords", - '{', - ' [meta "@context"]: {', - ' [meta "@base"]: [string "http://example.com"],', - ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],', - ' [property "likesFlavor"]: {', - ' [meta "@container"]: [meta "@list"]', - ' [meta "@reverse"]: [string "@beFavoriteOf"]', - ' },', - ' [property "nick"]: { [meta "@container"]: [meta "@set"] },', - ' [property "nick"]: { [meta "@container"]: [meta "@index"] }', - ' },', - ' [meta "@graph"]: [[ {', - ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],', - ' [property "name"]: [string "John Lennon"],', - ' [property "modified"]: {', - ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],', - ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]', - ' }', - ' } ]]', - '}'); - - LD("json_ld_fake", - '{', - ' [property "@fake"]: [string "@fake"],', - ' [property "@contextual"]: [string "@identifier"],', - ' [property "user@domain.com"]: [string "@graphical"],', - ' [property "@ID"]: [string "@@ID"]', - '}'); -})(); diff --git a/ThirdParty/codemirror-4.6/mode/julia/julia.js b/ThirdParty/codemirror-4.6/mode/julia/julia.js deleted file mode 100644 index 5dd1afce90e6..000000000000 --- a/ThirdParty/codemirror-4.6/mode/julia/julia.js +++ /dev/null @@ -1,301 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("julia", function(_conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/; - var delimiters = parserConf.delimiters || /^[;,()[\]{}]/; - var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*!*/; - var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"]; - var blockClosers = ["end", "else", "elseif", "catch", "finally"]; - var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall']; - var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf']; - - //var stringPrefixes = new RegExp("^[br]?('|\")") - var stringPrefixes = /^(`|'|"{3}|([br]?"))/; - var keywords = wordRegexp(keywordList); - var builtins = wordRegexp(builtinList); - var openers = wordRegexp(blockOpeners); - var closers = wordRegexp(blockClosers); - var macro = /^@[_A-Za-z][_A-Za-z0-9]*/; - var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/; - var indentInfo = null; - - function in_array(state) { - var ch = cur_scope(state); - if(ch=="[" || ch=="{") { - return true; - } - else { - return false; - } - } - - function cur_scope(state) { - if(state.scopes.length==0) { - return null; - } - return state.scopes[state.scopes.length - 1]; - } - - // tokenizers - function tokenBase(stream, state) { - // Handle scope changes - var leaving_expr = state.leaving_expr; - if(stream.sol()) { - leaving_expr = false; - } - state.leaving_expr = false; - if(leaving_expr) { - if(stream.match(/^'+/)) { - return 'operator'; - } - - } - - if(stream.match(/^\.{2,3}/)) { - return 'operator'; - } - - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - // Handle Comments - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - if(ch==='[') { - state.scopes.push("["); - } - - if(ch==='{') { - state.scopes.push("{"); - } - - var scope=cur_scope(state); - - if(scope==='[' && ch===']') { - state.scopes.pop(); - state.leaving_expr=true; - } - - if(scope==='{' && ch==='}') { - state.scopes.pop(); - state.leaving_expr=true; - } - - if(ch===')') { - state.leaving_expr = true; - } - - var match; - if(!in_array(state) && (match=stream.match(openers, false))) { - state.scopes.push(match); - } - - if(!in_array(state) && stream.match(closers, false)) { - state.scopes.pop(); - } - - if(in_array(state)) { - if(stream.match(/^end/)) { - return 'number'; - } - - } - - if(stream.match(/^=>/)) { - return 'operator'; - } - - - // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { - var imMatcher = RegExp(/^im\b/); - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; } - if (stream.match(/^\.\d+/)) { floatLiteral = true; } - if (floatLiteral) { - // Float literals may be "imaginary" - stream.match(imMatcher); - state.leaving_expr = true; - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; } - // Binary - if (stream.match(/^0b[01]+/i)) { intLiteral = true; } - // Octal - if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; } - // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.match(imMatcher); - state.leaving_expr = true; - return 'number'; - } - } - - if(stream.match(/^(::)|(<:)/)) { - return 'operator'; - } - - // Handle symbols - if(!leaving_expr && stream.match(symbol)) { - return 'string'; - } - - // Handle operators and Delimiters - if (stream.match(operators)) { - return 'operator'; - } - - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - if (stream.match(macro)) { - return 'meta'; - } - - - if (stream.match(delimiters)) { - return null; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(builtins)) { - return 'builtin'; - } - - - if (stream.match(identifiers)) { - state.leaving_expr=true; - return 'variable'; - } - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { - delimiter = delimiter.substr(1); - } - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\\]/); - if (stream.eat('\\')) { - stream.next(); - if (singleline && stream.eol()) { - return OUTCLASS; - } - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - } - tokenString.isString = true; - return tokenString; - } - - function tokenLexer(stream, state) { - indentInfo = null; - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = stream.match(identifiers, false) ? null : ERRORCLASS; - if (style === null && state.lastStyle === 'meta') { - // Apply 'meta' style to '.' connected identifiers when - // appropriate. - style = 'meta'; - } - return style; - } - - return style; - } - - var external = { - startState: function() { - return { - tokenize: tokenBase, - scopes: [], - leaving_expr: false - }; - }, - - token: function(stream, state) { - var style = tokenLexer(stream, state); - state.lastStyle = style; - return style; - }, - - indent: function(state, textAfter) { - var delta = 0; - if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") { - delta = -1; - } - return (state.scopes.length + delta) * 4; - }, - - lineComment: "#", - fold: "indent", - electricChars: "edlsifyh]}" - }; - return external; -}); - - -CodeMirror.defineMIME("text/x-julia", "julia"); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/kotlin/index.html b/ThirdParty/codemirror-4.6/mode/kotlin/index.html deleted file mode 100644 index 38700f32268e..000000000000 --- a/ThirdParty/codemirror-4.6/mode/kotlin/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -CodeMirror: Kotlin mode - - - - - - - - - -
-

Kotlin mode

- - -
- - -

Mode for Kotlin (http://kotlin.jetbrains.org/)

-

Developed by Hadi Hariri (https://github.com/hhariri).

-

MIME type defined: text/x-kotlin.

-
diff --git a/ThirdParty/codemirror-4.6/mode/kotlin/kotlin.js b/ThirdParty/codemirror-4.6/mode/kotlin/kotlin.js deleted file mode 100644 index 73c84f6c4f8a..000000000000 --- a/ThirdParty/codemirror-4.6/mode/kotlin/kotlin.js +++ /dev/null @@ -1,280 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("kotlin", function (config, parserConfig) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var multiLineStrings = parserConfig.multiLineStrings; - - var keywords = words( - "package continue return object while break class data trait throw super" + - " when type this else This try val var fun for is in if do as true false null get set"); - var softKeywords = words("import" + - " where by get set abstract enum open annotation override private public internal" + - " protected catch out vararg inline finally final ref"); - var blockKeywords = words("catch class do else finally for if where try while enum"); - var atoms = words("null true false this"); - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - return startString(ch, stream, state); - } - // Wildcard import w/o trailing semicolon (import smth.*) - if (ch == "." && stream.eat("*")) { - return "word"; - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - if (stream.eat(/eE/)) { - stream.eat(/\+\-/); - stream.eatWhile(/\d/); - } - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize.push(tokenComment); - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - if (expectExpression(state.lastToken)) { - return startString(ch, stream, state); - } - } - // Commented - if (ch == "-" && stream.eat(">")) { - curPunc = "->"; - return null; - } - if (/[\-+*&%=<>!?|\/~]/.test(ch)) { - stream.eatWhile(/[\-+*&%=<>|~]/); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - - var cur = stream.current(); - if (atoms.propertyIsEnumerable(cur)) { - return "atom"; - } - if (softKeywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "softKeyword"; - } - - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - return "word"; - } - - tokenBase.isBase = true; - - function startString(quote, stream, state) { - var tripleQuoted = false; - if (quote != "/" && stream.eat(quote)) { - if (stream.eat(quote)) tripleQuoted = true; - else return "string"; - } - function t(stream, state) { - var escaped = false, next, end = !tripleQuoted; - - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - if (!tripleQuoted) { - break; - } - if (stream.match(quote + quote)) { - end = true; - break; - } - } - - if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace()); - return "string"; - } - - if (next == "$" && !escaped && !stream.eat(" ")) { - state.tokenize.push(tokenBaseUntilSpace()); - return "string"; - } - escaped = !escaped && next == "\\"; - } - if (multiLineStrings) - state.tokenize.push(t); - if (end) state.tokenize.pop(); - return "string"; - } - - state.tokenize.push(t); - return t(stream, state); - } - - function tokenBaseUntilBrace() { - var depth = 1; - - function t(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length - 1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - } - - t.isBase = true; - return t; - } - - function tokenBaseUntilSpace() { - function t(stream, state) { - if (stream.eat(/[\w]/)) { - var isWord = stream.eatWhile(/[\w]/); - if (isWord) { - state.tokenize.pop(); - return "word"; - } - } - state.tokenize.pop(); - return "string"; - } - - t.isBase = true; - return t; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize.pop(); - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function expectExpression(last) { - return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || - last == "newstatement" || last == "keyword" || last == "proplabel"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function (basecolumn) { - return { - tokenize: [tokenBase], - context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), - indented: 0, - startOfLine: true, - lastToken: null - }; - }, - - token: function (stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - // Automatic semicolon insertion - if (ctx.type == "statement" && !expectExpression(state.lastToken)) { - popContext(state); - ctx = state.context; - } - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = state.tokenize[state.tokenize.length - 1](stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - // Handle indentation for {x -> \n ... } - else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { - popContext(state); - state.context.align = false; - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - state.lastToken = curPunc || style; - return style; - }, - - indent: function (state, textAfter) { - if (!state.tokenize[state.tokenize.length - 1].isBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; - if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") { - return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); - } - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : config.indentUnit); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-kotlin", "kotlin"); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/markdown/markdown.js b/ThirdParty/codemirror-4.6/mode/markdown/markdown.js deleted file mode 100644 index 1bad78d65ed1..000000000000 --- a/ThirdParty/codemirror-4.6/mode/markdown/markdown.js +++ /dev/null @@ -1,757 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror", require("../xml/xml"))); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../xml/xml"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - - var htmlFound = CodeMirror.modes.hasOwnProperty("xml"); - var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? {name: "xml", htmlMode: true} : "text/plain"); - var aliases = { - html: "htmlmixed", - js: "javascript", - json: "application/json", - c: "text/x-csrc", - "c++": "text/x-c++src", - java: "text/x-java", - csharp: "text/x-csharp", - "c#": "text/x-csharp", - scala: "text/x-scala" - }; - - var getMode = (function () { - var i, modes = {}, mimes = {}, mime; - - var list = []; - for (var m in CodeMirror.modes) - if (CodeMirror.modes.propertyIsEnumerable(m)) list.push(m); - for (i = 0; i < list.length; i++) { - modes[list[i]] = list[i]; - } - var mimesList = []; - for (var m in CodeMirror.mimeModes) - if (CodeMirror.mimeModes.propertyIsEnumerable(m)) - mimesList.push({mime: m, mode: CodeMirror.mimeModes[m]}); - for (i = 0; i < mimesList.length; i++) { - mime = mimesList[i].mime; - mimes[mime] = mimesList[i].mime; - } - - for (var a in aliases) { - if (aliases[a] in modes || aliases[a] in mimes) - modes[a] = aliases[a]; - } - - return function (lang) { - return modes[lang] ? CodeMirror.getMode(cmCfg, modes[lang]) : null; - }; - }()); - - // Should characters that affect highlighting be highlighted separate? - // Does not include characters that will be output (such as `1.` and `-` for lists) - if (modeCfg.highlightFormatting === undefined) - modeCfg.highlightFormatting = false; - - // Maximum number of nested blockquotes. Set to 0 for infinite nesting. - // Excess `>` will emit `error` token. - if (modeCfg.maxBlockquoteDepth === undefined) - modeCfg.maxBlockquoteDepth = 0; - - // Should underscores in words open/close em/strong? - if (modeCfg.underscoresBreakWords === undefined) - modeCfg.underscoresBreakWords = true; - - // Turn on fenced code blocks? ("```" to start/end) - if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false; - - // Turn on task lists? ("- [ ] " and "- [x] ") - if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; - - var codeDepth = 0; - - var header = 'header' - , code = 'comment' - , quote = 'quote' - , list1 = 'variable-2' - , list2 = 'variable-3' - , list3 = 'keyword' - , hr = 'hr' - , image = 'tag' - , formatting = 'formatting' - , linkinline = 'link' - , linkemail = 'link' - , linktext = 'link' - , linkhref = 'string' - , em = 'em' - , strong = 'strong'; - - var hrRE = /^([*\-=_])(?:\s*\1){2,}\s*$/ - , ulRE = /^[*\-+]\s+/ - , olRE = /^[0-9]+\.\s+/ - , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE - , atxHeaderRE = /^#+/ - , setextHeaderRE = /^(?:\={1,}|-{1,})$/ - , textRE = /^[^#!\[\]*_\\<>` "'(]+/; - - function switchInline(stream, state, f) { - state.f = state.inline = f; - return f(stream, state); - } - - function switchBlock(stream, state, f) { - state.f = state.block = f; - return f(stream, state); - } - - - // Blocks - - function blankLine(state) { - // Reset linkTitle state - state.linkTitle = false; - // Reset EM state - state.em = false; - // Reset STRONG state - state.strong = false; - // Reset state.quote - state.quote = 0; - if (!htmlFound && state.f == htmlBlock) { - state.f = inlineNormal; - state.block = blockNormal; - } - // Reset state.trailingSpace - state.trailingSpace = 0; - state.trailingSpaceNewLine = false; - // Mark this line as blank - state.thisLineHasContent = false; - return null; - } - - function blockNormal(stream, state) { - - var sol = stream.sol(); - - var prevLineIsList = (state.list !== false); - if (state.list !== false && state.indentationDiff >= 0) { // Continued list - if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block - state.indentation -= state.indentationDiff; - } - state.list = null; - } else if (state.list !== false && state.indentation > 0) { - state.list = null; - state.listDepth = Math.floor(state.indentation / 4); - } else if (state.list !== false) { // No longer a list - state.list = false; - state.listDepth = 0; - } - - var match = null; - if (state.indentationDiff >= 4) { - state.indentation -= 4; - stream.skipToEnd(); - return code; - } else if (stream.eatSpace()) { - return null; - } else if (match = stream.match(atxHeaderRE)) { - state.header = match[0].length <= 6 ? match[0].length : 6; - if (modeCfg.highlightFormatting) state.formatting = "header"; - state.f = state.inline; - return getType(state); - } else if (state.prevLineHasContent && (match = stream.match(setextHeaderRE))) { - state.header = match[0].charAt(0) == '=' ? 1 : 2; - if (modeCfg.highlightFormatting) state.formatting = "header"; - state.f = state.inline; - return getType(state); - } else if (stream.eat('>')) { - state.indentation++; - state.quote = sol ? 1 : state.quote + 1; - if (modeCfg.highlightFormatting) state.formatting = "quote"; - stream.eatSpace(); - return getType(state); - } else if (stream.peek() === '[') { - return switchInline(stream, state, footnoteLink); - } else if (stream.match(hrRE, true)) { - return hr; - } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { - var listType = null; - if (stream.match(ulRE, true)) { - listType = 'ul'; - } else { - stream.match(olRE, true); - listType = 'ol'; - } - state.indentation += 4; - state.list = true; - state.listDepth++; - if (modeCfg.taskLists && stream.match(taskListRE, false)) { - state.taskList = true; - } - state.f = state.inline; - if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; - return getType(state); - } else if (modeCfg.fencedCodeBlocks && stream.match(/^```([\w+#]*)/, true)) { - // try switching mode - state.localMode = getMode(RegExp.$1); - if (state.localMode) state.localState = state.localMode.startState(); - switchBlock(stream, state, local); - if (modeCfg.highlightFormatting) state.formatting = "code-block"; - state.code = true; - return getType(state); - } - - return switchInline(stream, state, state.inline); - } - - function htmlBlock(stream, state) { - var style = htmlMode.token(stream, state.htmlState); - if ((htmlFound && state.htmlState.tagStart === null && !state.htmlState.context) || - (state.md_inside && stream.current().indexOf(">") > -1)) { - state.f = inlineNormal; - state.block = blockNormal; - state.htmlState = null; - } - return style; - } - - function local(stream, state) { - if (stream.sol() && stream.match(/^```/, true)) { - state.localMode = state.localState = null; - state.f = inlineNormal; - state.block = blockNormal; - if (modeCfg.highlightFormatting) state.formatting = "code-block"; - state.code = true; - var returnType = getType(state); - state.code = false; - return returnType; - } else if (state.localMode) { - return state.localMode.token(stream, state.localState); - } else { - stream.skipToEnd(); - return code; - } - } - - // Inline - function getType(state) { - var styles = []; - - if (state.formatting) { - styles.push(formatting); - - if (typeof state.formatting === "string") state.formatting = [state.formatting]; - - for (var i = 0; i < state.formatting.length; i++) { - styles.push(formatting + "-" + state.formatting[i]); - - if (state.formatting[i] === "header") { - styles.push(formatting + "-" + state.formatting[i] + "-" + state.header); - } - - // Add `formatting-quote` and `formatting-quote-#` for blockquotes - // Add `error` instead if the maximum blockquote nesting depth is passed - if (state.formatting[i] === "quote") { - if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote); - } else { - styles.push("error"); - } - } - } - } - - if (state.taskOpen) { - styles.push("meta"); - return styles.length ? styles.join(' ') : null; - } - if (state.taskClosed) { - styles.push("property"); - return styles.length ? styles.join(' ') : null; - } - - if (state.linkHref) { - styles.push(linkhref); - return styles.length ? styles.join(' ') : null; - } - - if (state.strong) { styles.push(strong); } - if (state.em) { styles.push(em); } - - if (state.linkText) { styles.push(linktext); } - - if (state.code) { styles.push(code); } - - if (state.header) { styles.push(header); styles.push(header + "-" + state.header); } - - if (state.quote) { - styles.push(quote); - - // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth - if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(quote + "-" + state.quote); - } else { - styles.push(quote + "-" + modeCfg.maxBlockquoteDepth); - } - } - - if (state.list !== false) { - var listMod = (state.listDepth - 1) % 3; - if (!listMod) { - styles.push(list1); - } else if (listMod === 1) { - styles.push(list2); - } else { - styles.push(list3); - } - } - - if (state.trailingSpaceNewLine) { - styles.push("trailing-space-new-line"); - } else if (state.trailingSpace) { - styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b")); - } - - return styles.length ? styles.join(' ') : null; - } - - function handleText(stream, state) { - if (stream.match(textRE, true)) { - return getType(state); - } - return undefined; - } - - function inlineNormal(stream, state) { - var style = state.text(stream, state); - if (typeof style !== 'undefined') - return style; - - if (state.list) { // List marker (*, +, -, 1., etc) - state.list = null; - return getType(state); - } - - if (state.taskList) { - var taskOpen = stream.match(taskListRE, true)[1] !== "x"; - if (taskOpen) state.taskOpen = true; - else state.taskClosed = true; - if (modeCfg.highlightFormatting) state.formatting = "task"; - state.taskList = false; - return getType(state); - } - - state.taskOpen = false; - state.taskClosed = false; - - if (state.header && stream.match(/^#+$/, true)) { - if (modeCfg.highlightFormatting) state.formatting = "header"; - return getType(state); - } - - // Get sol() value now, before character is consumed - var sol = stream.sol(); - - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - if (modeCfg.highlightFormatting) { - var type = getType(state); - return type ? type + " formatting-escape" : "formatting-escape"; - } - } - - // Matches link titles present on next line - if (state.linkTitle) { - state.linkTitle = false; - var matchCh = ch; - if (ch === '(') { - matchCh = ')'; - } - matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; - if (stream.match(new RegExp(regex), true)) { - return linkhref; - } - } - - // If this block is changed, it may need to be updated in GFM mode - if (ch === '`') { - var previousFormatting = state.formatting; - if (modeCfg.highlightFormatting) state.formatting = "code"; - var t = getType(state); - var before = stream.pos; - stream.eatWhile('`'); - var difference = 1 + stream.pos - before; - if (!state.code) { - codeDepth = difference; - state.code = true; - return getType(state); - } else { - if (difference === codeDepth) { // Must be exact - state.code = false; - return t; - } - state.formatting = previousFormatting; - return getType(state); - } - } else if (state.code) { - return getType(state); - } - - if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { - stream.match(/\[[^\]]*\]/); - state.inline = state.f = linkHref; - return image; - } - - if (ch === '[' && stream.match(/.*\](\(| ?\[)/, false)) { - state.linkText = true; - if (modeCfg.highlightFormatting) state.formatting = "link"; - return getType(state); - } - - if (ch === ']' && state.linkText) { - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - state.linkText = false; - state.inline = state.f = linkHref; - return type; - } - - if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) { - state.f = state.inline = linkInline; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + linkinline; - } - - if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { - state.f = state.inline = linkInline; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + linkemail; - } - - if (ch === '<' && stream.match(/^\w/, false)) { - if (stream.string.indexOf(">") != -1) { - var atts = stream.string.substring(1,stream.string.indexOf(">")); - if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) { - state.md_inside = true; - } - } - stream.backUp(1); - state.htmlState = CodeMirror.startState(htmlMode); - return switchBlock(stream, state, htmlBlock); - } - - if (ch === '<' && stream.match(/^\/\w*?>/)) { - state.md_inside = false; - return "tag"; - } - - var ignoreUnderscore = false; - if (!modeCfg.underscoresBreakWords) { - if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) { - var prevPos = stream.pos - 2; - if (prevPos >= 0) { - var prevCh = stream.string.charAt(prevPos); - if (prevCh !== '_' && prevCh.match(/(\w)/, false)) { - ignoreUnderscore = true; - } - } - } - } - if (ch === '*' || (ch === '_' && !ignoreUnderscore)) { - if (sol && stream.peek() === ' ') { - // Do nothing, surrounded by newline and space - } else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG - if (modeCfg.highlightFormatting) state.formatting = "strong"; - var t = getType(state); - state.strong = false; - return t; - } else if (!state.strong && stream.eat(ch)) { // Add STRONG - state.strong = ch; - if (modeCfg.highlightFormatting) state.formatting = "strong"; - return getType(state); - } else if (state.em === ch) { // Remove EM - if (modeCfg.highlightFormatting) state.formatting = "em"; - var t = getType(state); - state.em = false; - return t; - } else if (!state.em) { // Add EM - state.em = ch; - if (modeCfg.highlightFormatting) state.formatting = "em"; - return getType(state); - } - } else if (ch === ' ') { - if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces - if (stream.peek() === ' ') { // Surrounded by spaces, ignore - return getType(state); - } else { // Not surrounded by spaces, back up pointer - stream.backUp(1); - } - } - } - - if (ch === ' ') { - if (stream.match(/ +$/, false)) { - state.trailingSpace++; - } else if (state.trailingSpace) { - state.trailingSpaceNewLine = true; - } - } - - return getType(state); - } - - function linkInline(stream, state) { - var ch = stream.next(); - - if (ch === ">") { - state.f = state.inline = inlineNormal; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + linkinline; - } - - stream.match(/^[^>]+/, true); - - return linkinline; - } - - function linkHref(stream, state) { - // Check if space, and return NULL if so (to avoid marking the space) - if(stream.eatSpace()){ - return null; - } - var ch = stream.next(); - if (ch === '(' || ch === '[') { - state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]"); - if (modeCfg.highlightFormatting) state.formatting = "link-string"; - state.linkHref = true; - return getType(state); - } - return 'error'; - } - - function getLinkHrefInside(endChar) { - return function(stream, state) { - var ch = stream.next(); - - if (ch === endChar) { - state.f = state.inline = inlineNormal; - if (modeCfg.highlightFormatting) state.formatting = "link-string"; - var returnState = getType(state); - state.linkHref = false; - return returnState; - } - - if (stream.match(inlineRE(endChar), true)) { - stream.backUp(1); - } - - state.linkHref = true; - return getType(state); - }; - } - - function footnoteLink(stream, state) { - if (stream.match(/^[^\]]*\]:/, false)) { - state.f = footnoteLinkInside; - stream.next(); // Consume [ - if (modeCfg.highlightFormatting) state.formatting = "link"; - state.linkText = true; - return getType(state); - } - return switchInline(stream, state, inlineNormal); - } - - function footnoteLinkInside(stream, state) { - if (stream.match(/^\]:/, true)) { - state.f = state.inline = footnoteUrl; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var returnType = getType(state); - state.linkText = false; - return returnType; - } - - stream.match(/^[^\]]+/, true); - - return linktext; - } - - function footnoteUrl(stream, state) { - // Check if space, and return NULL if so (to avoid marking the space) - if(stream.eatSpace()){ - return null; - } - // Match URL - stream.match(/^[^\s]+/, true); - // Check for link title - if (stream.peek() === undefined) { // End of line, set flag to check next line - state.linkTitle = true; - } else { // More content on line, check if link title - stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); - } - state.f = state.inline = inlineNormal; - return linkhref; - } - - var savedInlineRE = []; - function inlineRE(endChar) { - if (!savedInlineRE[endChar]) { - // Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741) - endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - // Match any non-endChar, escaped character, as well as the closing - // endChar. - savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')'); - } - return savedInlineRE[endChar]; - } - - var mode = { - startState: function() { - return { - f: blockNormal, - - prevLineHasContent: false, - thisLineHasContent: false, - - block: blockNormal, - htmlState: null, - indentation: 0, - - inline: inlineNormal, - text: handleText, - - formatting: false, - linkText: false, - linkHref: false, - linkTitle: false, - em: false, - strong: false, - header: 0, - taskList: false, - list: false, - listDepth: 0, - quote: 0, - trailingSpace: 0, - trailingSpaceNewLine: false - }; - }, - - copyState: function(s) { - return { - f: s.f, - - prevLineHasContent: s.prevLineHasContent, - thisLineHasContent: s.thisLineHasContent, - - block: s.block, - htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), - indentation: s.indentation, - - localMode: s.localMode, - localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null, - - inline: s.inline, - text: s.text, - formatting: false, - linkTitle: s.linkTitle, - em: s.em, - strong: s.strong, - header: s.header, - taskList: s.taskList, - list: s.list, - listDepth: s.listDepth, - quote: s.quote, - trailingSpace: s.trailingSpace, - trailingSpaceNewLine: s.trailingSpaceNewLine, - md_inside: s.md_inside - }; - }, - - token: function(stream, state) { - - // Reset state.formatting - state.formatting = false; - - if (stream.sol()) { - var forceBlankLine = stream.match(/^\s*$/, true) || state.header; - - // Reset state.header - state.header = 0; - - if (forceBlankLine) { - state.prevLineHasContent = false; - return blankLine(state); - } else { - state.prevLineHasContent = state.thisLineHasContent; - state.thisLineHasContent = true; - } - - // Reset state.taskList - state.taskList = false; - - // Reset state.code - state.code = false; - - // Reset state.trailingSpace - state.trailingSpace = 0; - state.trailingSpaceNewLine = false; - - state.f = state.block; - var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; - var difference = Math.floor((indentation - state.indentation) / 4) * 4; - if (difference > 4) difference = 4; - var adjustedIndentation = state.indentation + difference; - state.indentationDiff = adjustedIndentation - state.indentation; - state.indentation = adjustedIndentation; - if (indentation > 0) return null; - } - var result = state.f(stream, state); - if (stream.start == stream.pos) return this.token(stream, state); - else return result; - }, - - innerMode: function(state) { - if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode}; - if (state.localState) return {state: state.localState, mode: state.localMode}; - return {state: state, mode: mode}; - }, - - blankLine: blankLine, - - getType: getType, - - fold: "markdown" - }; - return mode; -}, "xml"); - -CodeMirror.defineMIME("text/x-markdown", "markdown"); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/markdown/test.js b/ThirdParty/codemirror-4.6/mode/markdown/test.js deleted file mode 100644 index 96ca1aefc7b8..000000000000 --- a/ThirdParty/codemirror-4.6/mode/markdown/test.js +++ /dev/null @@ -1,754 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "markdown"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true}); - function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } - - FT("formatting_emAsterisk", - "[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"); - - FT("formatting_emUnderscore", - "[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"); - - FT("formatting_strongAsterisk", - "[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"); - - FT("formatting_strongUnderscore", - "[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"); - - FT("formatting_codeBackticks", - "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); - - FT("formatting_doubleBackticks", - "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); - - FT("formatting_atxHeader", - "[header&header-1&formatting&formatting-header&formatting-header-1 #][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"); - - FT("formatting_setextHeader", - "foo", - "[header&header-1&formatting&formatting-header&formatting-header-1 =]"); - - FT("formatting_blockquote", - "[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"); - - FT("formatting_list", - "[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"); - FT("formatting_list", - "[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"); - - FT("formatting_link", - "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]"); - - FT("formatting_linkReference", - "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]", - "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]"); - - FT("formatting_linkWeb", - "[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"); - - FT("formatting_linkEmail", - "[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"); - - FT("formatting_escape", - "[formatting-escape \\*]"); - - MT("plainText", - "foo"); - - // Don't style single trailing space - MT("trailingSpace1", - "foo "); - - // Two or more trailing spaces should be styled with line break character - MT("trailingSpace2", - "foo[trailing-space-a ][trailing-space-new-line ]"); - - MT("trailingSpace3", - "foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"); - - MT("trailingSpace4", - "foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"); - - // Code blocks using 4 spaces (regardless of CodeMirror.tabSize value) - MT("codeBlocksUsing4Spaces", - " [comment foo]"); - - // Code blocks using 4 spaces with internal indentation - MT("codeBlocksUsing4SpacesIndentation", - " [comment bar]", - " [comment hello]", - " [comment world]", - " [comment foo]", - "bar"); - - // Code blocks using 4 spaces with internal indentation - MT("codeBlocksUsing4SpacesIndentation", - " foo", - " [comment bar]", - " [comment hello]", - " [comment world]"); - - // Code blocks should end even after extra indented lines - MT("codeBlocksWithTrailingIndentedLine", - " [comment foo]", - " [comment bar]", - " [comment baz]", - " ", - "hello"); - - // Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value) - MT("codeBlocksUsing1Tab", - "\t[comment foo]"); - - // Inline code using backticks - MT("inlineCodeUsingBackticks", - "foo [comment `bar`]"); - - // Block code using single backtick (shouldn't work) - MT("blockCodeSingleBacktick", - "[comment `]", - "foo", - "[comment `]"); - - // Unclosed backticks - // Instead of simply marking as CODE, it would be nice to have an - // incomplete flag for CODE, that is styled slightly different. - MT("unclosedBackticks", - "foo [comment `bar]"); - - // Per documentation: "To include a literal backtick character within a - // code span, you can use multiple backticks as the opening and closing - // delimiters" - MT("doubleBackticks", - "[comment ``foo ` bar``]"); - - // Tests based on Dingus - // http://daringfireball.net/projects/markdown/dingus - // - // Multiple backticks within an inline code block - MT("consecutiveBackticks", - "[comment `foo```bar`]"); - - // Multiple backticks within an inline code block with a second code block - MT("consecutiveBackticks", - "[comment `foo```bar`] hello [comment `world`]"); - - // Unclosed with several different groups of backticks - MT("unclosedBackticks", - "[comment ``foo ``` bar` hello]"); - - // Closed with several different groups of backticks - MT("closedBackticks", - "[comment ``foo ``` bar` hello``] world"); - - // atx headers - // http://daringfireball.net/projects/markdown/syntax#header - - MT("atxH1", - "[header&header-1 # foo]"); - - MT("atxH2", - "[header&header-2 ## foo]"); - - MT("atxH3", - "[header&header-3 ### foo]"); - - MT("atxH4", - "[header&header-4 #### foo]"); - - MT("atxH5", - "[header&header-5 ##### foo]"); - - MT("atxH6", - "[header&header-6 ###### foo]"); - - // H6 - 7x '#' should still be H6, per Dingus - // http://daringfireball.net/projects/markdown/dingus - MT("atxH6NotH7", - "[header&header-6 ####### foo]"); - - // Inline styles should be parsed inside headers - MT("atxH1inline", - "[header&header-1 # foo ][header&header-1&em *bar*]"); - - // Setext headers - H1, H2 - // Per documentation, "Any number of underlining =’s or -’s will work." - // http://daringfireball.net/projects/markdown/syntax#header - // Ideally, the text would be marked as `header` as well, but this is - // not really feasible at the moment. So, instead, we're testing against - // what works today, to avoid any regressions. - // - // Check if single underlining = works - MT("setextH1", - "foo", - "[header&header-1 =]"); - - // Check if 3+ ='s work - MT("setextH1", - "foo", - "[header&header-1 ===]"); - - // Check if single underlining - works - MT("setextH2", - "foo", - "[header&header-2 -]"); - - // Check if 3+ -'s work - MT("setextH2", - "foo", - "[header&header-2 ---]"); - - // Single-line blockquote with trailing space - MT("blockquoteSpace", - "[quote"e-1 > foo]"); - - // Single-line blockquote - MT("blockquoteNoSpace", - "[quote"e-1 >foo]"); - - // No blank line before blockquote - MT("blockquoteNoBlankLine", - "foo", - "[quote"e-1 > bar]"); - - // Nested blockquote - MT("blockquoteSpace", - "[quote"e-1 > foo]", - "[quote"e-1 >][quote"e-2 > foo]", - "[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"); - - // Single-line blockquote followed by normal paragraph - MT("blockquoteThenParagraph", - "[quote"e-1 >foo]", - "", - "bar"); - - // Multi-line blockquote (lazy mode) - MT("multiBlockquoteLazy", - "[quote"e-1 >foo]", - "[quote"e-1 bar]"); - - // Multi-line blockquote followed by normal paragraph (lazy mode) - MT("multiBlockquoteLazyThenParagraph", - "[quote"e-1 >foo]", - "[quote"e-1 bar]", - "", - "hello"); - - // Multi-line blockquote (non-lazy mode) - MT("multiBlockquote", - "[quote"e-1 >foo]", - "[quote"e-1 >bar]"); - - // Multi-line blockquote followed by normal paragraph (non-lazy mode) - MT("multiBlockquoteThenParagraph", - "[quote"e-1 >foo]", - "[quote"e-1 >bar]", - "", - "hello"); - - // Check list types - - MT("listAsterisk", - "foo", - "bar", - "", - "[variable-2 * foo]", - "[variable-2 * bar]"); - - MT("listPlus", - "foo", - "bar", - "", - "[variable-2 + foo]", - "[variable-2 + bar]"); - - MT("listDash", - "foo", - "bar", - "", - "[variable-2 - foo]", - "[variable-2 - bar]"); - - MT("listNumber", - "foo", - "bar", - "", - "[variable-2 1. foo]", - "[variable-2 2. bar]"); - - // Lists require a preceding blank line (per Dingus) - MT("listBogus", - "foo", - "1. bar", - "2. hello"); - - // List after header - MT("listAfterHeader", - "[header&header-1 # foo]", - "[variable-2 - bar]"); - - // Formatting in lists (*) - MT("listAsteriskFormatting", - "[variable-2 * ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 * ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (+) - MT("listPlusFormatting", - "[variable-2 + ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 + ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (-) - MT("listDashFormatting", - "[variable-2 - ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 - ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (1.) - MT("listNumberFormatting", - "[variable-2 1. ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"); - - // Paragraph lists - MT("listParagraph", - "[variable-2 * foo]", - "", - "[variable-2 * bar]"); - - // Multi-paragraph lists - // - // 4 spaces - MT("listMultiParagraph", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2 hello]"); - - // 4 spaces, extra blank lines (should still be list, per Dingus) - MT("listMultiParagraphExtra", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "", - " [variable-2 hello]"); - - // 4 spaces, plus 1 space (should still be list, per Dingus) - MT("listMultiParagraphExtraSpace", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2 hello]", - "", - " [variable-2 world]"); - - // 1 tab - MT("listTab", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "\t[variable-2 hello]"); - - // No indent - MT("listNoIndent", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "hello"); - - // Blockquote - MT("blockquote", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2"e"e-1 > hello]"); - - // Code block - MT("blockquoteCode", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [comment > hello]", - "", - " [variable-2 world]"); - - // Code block followed by text - MT("blockquoteCodeText", - "[variable-2 * foo]", - "", - " [variable-2 bar]", - "", - " [comment hello]", - "", - " [variable-2 world]"); - - // Nested list - - MT("listAsteriskNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]"); - - MT("listPlusNested", - "[variable-2 + foo]", - "", - " [variable-3 + bar]"); - - MT("listDashNested", - "[variable-2 - foo]", - "", - " [variable-3 - bar]"); - - MT("listNumberNested", - "[variable-2 1. foo]", - "", - " [variable-3 2. bar]"); - - MT("listMixed", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [keyword - hello]", - "", - " [variable-2 1. world]"); - - MT("listBlockquote", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [quote"e-1&variable-3 > hello]"); - - MT("listCode", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [comment hello]"); - - // Code with internal indentation - MT("listCodeIndentation", - "[variable-2 * foo]", - "", - " [comment bar]", - " [comment hello]", - " [comment world]", - " [comment foo]", - " [variable-2 bar]"); - - // List nesting edge cases - MT("listNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]", - "", - " [variable-2 hello]" - ); - MT("listNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]", - "", - " [variable-3 * foo]" - ); - - // Code followed by text - MT("listCodeText", - "[variable-2 * foo]", - "", - " [comment bar]", - "", - "hello"); - - // Following tests directly from official Markdown documentation - // http://daringfireball.net/projects/markdown/syntax#hr - - MT("hrSpace", - "[hr * * *]"); - - MT("hr", - "[hr ***]"); - - MT("hrLong", - "[hr *****]"); - - MT("hrSpaceDash", - "[hr - - -]"); - - MT("hrDashLong", - "[hr ---------------------------------------]"); - - // Inline link with title - MT("linkTitle", - "[link [[foo]]][string (http://example.com/ \"bar\")] hello"); - - // Inline link without title - MT("linkNoTitle", - "[link [[foo]]][string (http://example.com/)] bar"); - - // Inline link with image - MT("linkImage", - "[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar"); - - // Inline link with Em - MT("linkEm", - "[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar"); - - // Inline link with Strong - MT("linkStrong", - "[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar"); - - // Inline link with EmStrong - MT("linkEmStrong", - "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar"); - - // Image with title - MT("imageTitle", - "[tag ![[foo]]][string (http://example.com/ \"bar\")] hello"); - - // Image without title - MT("imageNoTitle", - "[tag ![[foo]]][string (http://example.com/)] bar"); - - // Image with asterisks - MT("imageAsterisks", - "[tag ![[*foo*]]][string (http://example.com/)] bar"); - - // Not a link. Should be normal text due to square brackets being used - // regularly in text, especially in quoted material, and no space is allowed - // between square brackets and parentheses (per Dingus). - MT("notALink", - "[[foo]] (bar)"); - - // Reference-style links - MT("linkReference", - "[link [[foo]]][string [[bar]]] hello"); - - // Reference-style links with Em - MT("linkReferenceEm", - "[link [[][link&em *foo*][link ]]][string [[bar]]] hello"); - - // Reference-style links with Strong - MT("linkReferenceStrong", - "[link [[][link&strong **foo**][link ]]][string [[bar]]] hello"); - - // Reference-style links with EmStrong - MT("linkReferenceEmStrong", - "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello"); - - // Reference-style links with optional space separator (per docuentation) - // "You can optionally use a space to separate the sets of brackets" - MT("linkReferenceSpace", - "[link [[foo]]] [string [[bar]]] hello"); - - // Should only allow a single space ("...use *a* space...") - MT("linkReferenceDoubleSpace", - "[[foo]] [[bar]] hello"); - - // Reference-style links with implicit link name - MT("linkImplicit", - "[link [[foo]]][string [[]]] hello"); - - // @todo It would be nice if, at some point, the document was actually - // checked to see if the referenced link exists - - // Link label, for reference-style links (taken from documentation) - - MT("labelNoTitle", - "[link [[foo]]:] [string http://example.com/]"); - - MT("labelIndented", - " [link [[foo]]:] [string http://example.com/]"); - - MT("labelSpaceTitle", - "[link [[foo bar]]:] [string http://example.com/ \"hello\"]"); - - MT("labelDoubleTitle", - "[link [[foo bar]]:] [string http://example.com/ \"hello\"] \"world\""); - - MT("labelTitleDoubleQuotes", - "[link [[foo]]:] [string http://example.com/ \"bar\"]"); - - MT("labelTitleSingleQuotes", - "[link [[foo]]:] [string http://example.com/ 'bar']"); - - MT("labelTitleParenthese", - "[link [[foo]]:] [string http://example.com/ (bar)]"); - - MT("labelTitleInvalid", - "[link [[foo]]:] [string http://example.com/] bar"); - - MT("labelLinkAngleBrackets", - "[link [[foo]]:] [string \"bar\"]"); - - MT("labelTitleNextDoubleQuotes", - "[link [[foo]]:] [string http://example.com/]", - "[string \"bar\"] hello"); - - MT("labelTitleNextSingleQuotes", - "[link [[foo]]:] [string http://example.com/]", - "[string 'bar'] hello"); - - MT("labelTitleNextParenthese", - "[link [[foo]]:] [string http://example.com/]", - "[string (bar)] hello"); - - MT("labelTitleNextMixed", - "[link [[foo]]:] [string http://example.com/]", - "(bar\" hello"); - - MT("linkWeb", - "[link ] foo"); - - MT("linkWebDouble", - "[link ] foo [link ]"); - - MT("linkEmail", - "[link ] foo"); - - MT("linkEmailDouble", - "[link ] foo [link ]"); - - MT("emAsterisk", - "[em *foo*] bar"); - - MT("emUnderscore", - "[em _foo_] bar"); - - MT("emInWordAsterisk", - "foo[em *bar*]hello"); - - MT("emInWordUnderscore", - "foo[em _bar_]hello"); - - // Per documentation: "...surround an * or _ with spaces, it’ll be - // treated as a literal asterisk or underscore." - - MT("emEscapedBySpaceIn", - "foo [em _bar _ hello_] world"); - - MT("emEscapedBySpaceOut", - "foo _ bar[em _hello_]world"); - - MT("emEscapedByNewline", - "foo", - "_ bar[em _hello_]world"); - - // Unclosed emphasis characters - // Instead of simply marking as EM / STRONG, it would be nice to have an - // incomplete flag for EM and STRONG, that is styled slightly different. - MT("emIncompleteAsterisk", - "foo [em *bar]"); - - MT("emIncompleteUnderscore", - "foo [em _bar]"); - - MT("strongAsterisk", - "[strong **foo**] bar"); - - MT("strongUnderscore", - "[strong __foo__] bar"); - - MT("emStrongAsterisk", - "[em *foo][em&strong **bar*][strong hello**] world"); - - MT("emStrongUnderscore", - "[em _foo][em&strong __bar_][strong hello__] world"); - - // "...same character must be used to open and close an emphasis span."" - MT("emStrongMixed", - "[em _foo][em&strong **bar*hello__ world]"); - - MT("emStrongMixed", - "[em *foo][em&strong __bar_hello** world]"); - - // These characters should be escaped: - // \ backslash - // ` backtick - // * asterisk - // _ underscore - // {} curly braces - // [] square brackets - // () parentheses - // # hash mark - // + plus sign - // - minus sign (hyphen) - // . dot - // ! exclamation mark - - MT("escapeBacktick", - "foo \\`bar\\`"); - - MT("doubleEscapeBacktick", - "foo \\\\[comment `bar\\\\`]"); - - MT("escapeAsterisk", - "foo \\*bar\\*"); - - MT("doubleEscapeAsterisk", - "foo \\\\[em *bar\\\\*]"); - - MT("escapeUnderscore", - "foo \\_bar\\_"); - - MT("doubleEscapeUnderscore", - "foo \\\\[em _bar\\\\_]"); - - MT("escapeHash", - "\\# foo"); - - MT("doubleEscapeHash", - "\\\\# foo"); - - MT("escapeNewline", - "\\", - "[em *foo*]"); - - - // Tests to make sure GFM-specific things aren't getting through - - MT("taskList", - "[variable-2 * [ ]] bar]"); - - MT("fencedCodeBlocks", - "[comment ```]", - "foo", - "[comment ```]"); - - // Tests that require XML mode - - MT("xmlMode", - "[tag&bracket <][tag div][tag&bracket >]", - "*foo*", - "[tag&bracket <][tag http://github.com][tag&bracket />]", - "[tag&bracket ]", - "[link ]"); - - MT("xmlModeWithMarkdownInside", - "[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]", - "[em *foo*]", - "[link ]", - "[tag ]", - "[link ]", - "[tag&bracket <][tag div][tag&bracket >]", - "[tag&bracket ]"); - -})(); diff --git a/ThirdParty/codemirror-4.6/mode/meta.js b/ThirdParty/codemirror-4.6/mode/meta.js deleted file mode 100644 index d8ddd474c5c0..000000000000 --- a/ThirdParty/codemirror-4.6/mode/meta.js +++ /dev/null @@ -1,116 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - -CodeMirror.modeInfo = [ - {name: "APL", mime: "text/apl", mode: "apl"}, - {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk"}, - {name: "C", mime: "text/x-csrc", mode: "clike"}, - {name: "C++", mime: "text/x-c++src", mode: "clike"}, - {name: "Cobol", mime: "text/x-cobol", mode: "cobol"}, - {name: "Java", mime: "text/x-java", mode: "clike"}, - {name: "C#", mime: "text/x-csharp", mode: "clike"}, - {name: "Scala", mime: "text/x-scala", mode: "clike"}, - {name: "Clojure", mime: "text/x-clojure", mode: "clojure"}, - {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript"}, - {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp"}, - {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher"}, - {name: "CSS", mime: "text/css", mode: "css"}, - {name: "D", mime: "text/x-d", mode: "d"}, - {name: "diff", mime: "text/x-diff", mode: "diff"}, - {name: "DTD", mime: "application/xml-dtd", mode: "dtd"}, - {name: "Dylan", mime: "text/x-dylan", mode: "dylan"}, - {name: "ECL", mime: "text/x-ecl", mode: "ecl"}, - {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel"}, - {name: "Erlang", mime: "text/x-erlang", mode: "erlang"}, - {name: "Fortran", mime: "text/x-fortran", mode: "fortran"}, - {name: "F#", mime: "text/x-fsharp", mode: "mllike"}, - {name: "Gas", mime: "text/x-gas", mode: "gas"}, - {name: "Gherkin", mime: "text/x-feature", mode: "gherkin"}, - {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm"}, - {name: "Go", mime: "text/x-go", mode: "go"}, - {name: "Groovy", mime: "text/x-groovy", mode: "groovy"}, - {name: "HAML", mime: "text/x-haml", mode: "haml"}, - {name: "Haskell", mime: "text/x-haskell", mode: "haskell"}, - {name: "Haxe", mime: "text/x-haxe", mode: "haxe"}, - {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded"}, - {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded"}, - {name: "JavaServer Pages", mime: "application/x-jsp", mode: "htmlembedded"}, - {name: "HTML", mime: "text/html", mode: "htmlmixed"}, - {name: "HTTP", mime: "message/http", mode: "http"}, - {name: "Jade", mime: "text/x-jade", mode: "jade"}, - {name: "JavaScript", mime: "text/javascript", mode: "javascript"}, - {name: "JavaScript", mime: "application/javascript", mode: "javascript"}, - {name: "JSON", mime: "application/x-json", mode: "javascript"}, - {name: "JSON", mime: "application/json", mode: "javascript"}, - {name: "JSON-LD", mime: "application/ld+json", mode: "javascript"}, - {name: "TypeScript", mime: "application/typescript", mode: "javascript"}, - {name: "Jinja2", mime: null, mode: "jinja2"}, - {name: "Julia", mime: "text/x-julia", mode: "julia"}, - {name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin"}, - {name: "LESS", mime: "text/x-less", mode: "css"}, - {name: "LiveScript", mime: "text/x-livescript", mode: "livescript"}, - {name: "Lua", mime: "text/x-lua", mode: "lua"}, - {name: "Markdown (GitHub-flavour)", mime: "text/x-markdown", mode: "markdown"}, - {name: "mIRC", mime: "text/mirc", mode: "mirc"}, - {name: "Modelica", mime: "text/x-modelica", mode: "modelica"}, - {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx"}, - {name: "NTriples", mime: "text/n-triples", mode: "ntriples"}, - {name: "OCaml", mime: "text/x-ocaml", mode: "mllike"}, - {name: "Octave", mime: "text/x-octave", mode: "octave"}, - {name: "Pascal", mime: "text/x-pascal", mode: "pascal"}, - {name: "PEG.js", mime: null, mode: "pegjs"}, - {name: "Perl", mime: "text/x-perl", mode: "perl"}, - {name: "PHP", mime: "text/x-php", mode: "php"}, - {name: "PHP(HTML)", mime: "application/x-httpd-php", mode: "php"}, - {name: "Pig", mime: "text/x-pig", mode: "pig"}, - {name: "Plain Text", mime: "text/plain", mode: "null"}, - {name: "Properties files", mime: "text/x-properties", mode: "properties"}, - {name: "Python", mime: "text/x-python", mode: "python"}, - {name: "Puppet", mime: "text/x-puppet", mode: "puppet"}, - {name: "Cython", mime: "text/x-cython", mode: "python"}, - {name: "R", mime: "text/x-rsrc", mode: "r"}, - {name: "reStructuredText", mime: "text/x-rst", mode: "rst"}, - {name: "Ruby", mime: "text/x-ruby", mode: "ruby"}, - {name: "Rust", mime: "text/x-rustsrc", mode: "rust"}, - {name: "Sass", mime: "text/x-sass", mode: "sass"}, - {name: "Scheme", mime: "text/x-scheme", mode: "scheme"}, - {name: "SCSS", mime: "text/x-scss", mode: "css"}, - {name: "Shell", mime: "text/x-sh", mode: "shell"}, - {name: "Sieve", mime: "application/sieve", mode: "sieve"}, - {name: "Slim", mime: "text/x-slim", mode: "slim"}, - {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk"}, - {name: "Smarty", mime: "text/x-smarty", mode: "smarty"}, - {name: "SmartyMixed", mime: "text/x-smarty", mode: "smartymixed"}, - {name: "Solr", mime: "text/x-solr", mode: "solr"}, - {name: "SPARQL", mime: "application/x-sparql-query", mode: "sparql"}, - {name: "SQL", mime: "text/x-sql", mode: "sql"}, - {name: "MariaDB", mime: "text/x-mariadb", mode: "sql"}, - {name: "sTeX", mime: "text/x-stex", mode: "stex"}, - {name: "LaTeX", mime: "text/x-latex", mode: "stex"}, - {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog"}, - {name: "Tcl", mime: "text/x-tcl", mode: "tcl"}, - {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"}, - {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, - {name: "TOML", mime: "text/x-toml", mode: "toml"}, - {name: "Turtle", mime: "text/turtle", mode: "turtle"}, - {name: "VB.NET", mime: "text/x-vb", mode: "vb"}, - {name: "VBScript", mime: "text/vbscript", mode: "vbscript"}, - {name: "Velocity", mime: "text/velocity", mode: "velocity"}, - {name: "Verilog", mime: "text/x-verilog", mode: "verilog"}, - {name: "XML", mime: "application/xml", mode: "xml"}, - {name: "XQuery", mime: "application/xquery", mode: "xquery"}, - {name: "YAML", mime: "text/x-yaml", mode: "yaml"}, - {name: "Z80", mime: "text/x-z80", mode: "z80"} -]; - -}); diff --git a/ThirdParty/codemirror-4.6/mode/ntriples/index.html b/ThirdParty/codemirror-4.6/mode/ntriples/index.html deleted file mode 100644 index c8a67916d57a..000000000000 --- a/ThirdParty/codemirror-4.6/mode/ntriples/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: NTriples mode - - - - - - - - - -
-

NTriples mode

-
- -
- - -

MIME types defined: text/n-triples.

-
diff --git a/ThirdParty/codemirror-4.6/mode/php/php.js b/ThirdParty/codemirror-4.6/mode/php/php.js deleted file mode 100644 index f8821ed6510b..000000000000 --- a/ThirdParty/codemirror-4.6/mode/php/php.js +++ /dev/null @@ -1,233 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../clike/clike")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../clike/clike"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - function heredoc(delim) { - return function(stream, state) { - if (stream.match(delim)) state.tokenize = null; - else stream.skipToEnd(); - return "string"; - }; - } - - // Helper for stringWithEscapes - function matchSequence(list) { - if (list.length == 0) return stringWithEscapes; - return function (stream, state) { - var patterns = list[0]; - for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) { - state.tokenize = matchSequence(list.slice(1)); - return patterns[i][1]; - } - state.tokenize = stringWithEscapes; - return "string"; - }; - } - function stringWithEscapes(stream, state) { - var escaped = false, next, end = false; - - if (stream.current() == '"') return "string"; - - // "Complex" syntax - if (stream.match("${", false) || stream.match("{$", false)) { - state.tokenize = null; - return "string"; - } - - // Simple syntax - if (stream.match(/\$[a-zA-Z_][a-zA-Z0-9_]*/)) { - // After the variable name there may appear array or object operator. - if (stream.match("[", false)) { - // Match array operator - state.tokenize = matchSequence([ - [["[", null]], - [[/\d[\w\.]*/, "number"], - [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"], - [/[\w\$]+/, "variable"]], - [["]", null]] - ]); - } - if (stream.match(/\-\>\w/, false)) { - // Match object operator - state.tokenize = matchSequence([ - [["->", null]], - [[/[\w]+/, "variable"]] - ]); - } - return "variable-2"; - } - - // Normal string - while ( - !stream.eol() && - (!stream.match("{$", false)) && - (!stream.match(/(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false) || escaped) - ) { - next = stream.next(); - if (!escaped && next == '"') { end = true; break; } - escaped = !escaped && next == "\\"; - } - if (end) { - state.tokenize = null; - state.phpEncapsStack.pop(); - } - return "string"; - } - - var phpKeywords = "abstract and array as break case catch class clone const continue declare default " + - "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + - "for foreach function global goto if implements interface instanceof namespace " + - "new or private protected public static switch throw trait try use var while xor " + - "die echo empty exit eval include include_once isset list require require_once return " + - "print unset __halt_compiler self static parent yield insteadof finally"; - var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"; - var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; - CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" ")); - CodeMirror.registerHelper("wordChars", "php", /[\w$]/); - - var phpConfig = { - name: "clike", - helperType: "php", - keywords: keywords(phpKeywords), - blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), - atoms: keywords(phpAtoms), - builtin: keywords(phpBuiltin), - multiLineStrings: true, - hooks: { - "$": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "variable-2"; - }, - "<": function(stream, state) { - if (stream.match(/<", false)) stream.next(); - return "comment"; - }, - "/": function(stream) { - if (stream.eat("/")) { - while (!stream.eol() && !stream.match("?>", false)) stream.next(); - return "comment"; - } - return false; - }, - '"': function(stream, state) { - if (!state.phpEncapsStack) - state.phpEncapsStack = []; - state.phpEncapsStack.push(0); - state.tokenize = stringWithEscapes; - return state.tokenize(stream, state); - }, - "{": function(_stream, state) { - if (state.phpEncapsStack && state.phpEncapsStack.length > 0) - state.phpEncapsStack[state.phpEncapsStack.length - 1]++; - return false; - }, - "}": function(_stream, state) { - if (state.phpEncapsStack && state.phpEncapsStack.length > 0) - if (--state.phpEncapsStack[state.phpEncapsStack.length - 1] == 0) - state.tokenize = stringWithEscapes; - return false; - } - } - }; - - CodeMirror.defineMode("php", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, "text/html"); - var phpMode = CodeMirror.getMode(config, phpConfig); - - function dispatch(stream, state) { - var isPHP = state.curMode == phpMode; - if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null; - if (!isPHP) { - if (stream.match(/^<\?\w*/)) { - state.curMode = phpMode; - state.curState = state.php; - return "meta"; - } - if (state.pending == '"' || state.pending == "'") { - while (!stream.eol() && stream.next() != state.pending) {} - var style = "string"; - } else if (state.pending && stream.pos < state.pending.end) { - stream.pos = state.pending.end; - var style = state.pending.style; - } else { - var style = htmlMode.token(stream, state.curState); - } - if (state.pending) state.pending = null; - var cur = stream.current(), openPHP = cur.search(/<\?/), m; - if (openPHP != -1) { - if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0]; - else state.pending = {end: stream.pos, style: style}; - stream.backUp(cur.length - openPHP); - } - return style; - } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { - state.curMode = htmlMode; - state.curState = state.html; - return "meta"; - } else { - return phpMode.token(stream, state.curState); - } - } - - return { - startState: function() { - var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); - return {html: html, - php: php, - curMode: parserConfig.startOpen ? phpMode : htmlMode, - curState: parserConfig.startOpen ? php : html, - pending: null}; - }, - - copyState: function(state) { - var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; - if (state.curMode == htmlMode) cur = htmlNew; - else cur = phpNew; - return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, - pending: state.pending}; - }, - - token: dispatch, - - indent: function(state, textAfter) { - if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || - (state.curMode == phpMode && /^\?>/.test(textAfter))) - return htmlMode.indent(state.html, textAfter); - return state.curMode.indent(state.curState, textAfter); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - - innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } - }; - }, "htmlmixed", "clike"); - - CodeMirror.defineMIME("application/x-httpd-php", "php"); - CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); - CodeMirror.defineMIME("text/x-php", phpConfig); -}); diff --git a/ThirdParty/codemirror-4.6/mode/ruby/test.js b/ThirdParty/codemirror-4.6/mode/ruby/test.js deleted file mode 100644 index cade864ff966..000000000000 --- a/ThirdParty/codemirror-4.6/mode/ruby/test.js +++ /dev/null @@ -1,14 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("divide_equal_operator", - "[variable bar] [operator /=] [variable foo]"); - - MT("divide_equal_operator_no_spacing", - "[variable foo][operator /=][number 42]"); - -})(); diff --git a/ThirdParty/codemirror-4.6/mode/rust/rust.js b/ThirdParty/codemirror-4.6/mode/rust/rust.js deleted file mode 100644 index 4ca1a76af6a0..000000000000 --- a/ThirdParty/codemirror-4.6/mode/rust/rust.js +++ /dev/null @@ -1,451 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("rust", function() { - var indentUnit = 4, altIndentUnit = 2; - var valKeywords = { - "if": "if-style", "while": "if-style", "else": "else-style", - "do": "else-style", "ret": "else-style", "fail": "else-style", - "break": "atom", "cont": "atom", "const": "let", "resource": "fn", - "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface", - "impl": "impl", "type": "type", "enum": "enum", "mod": "mod", - "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op", - "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style", - "export": "else-style", "copy": "op", "log": "op", "log_err": "op", - "use": "op", "bind": "op", "self": "atom" - }; - var typeKeywords = function() { - var keywords = {"fn": "fn", "block": "fn", "obj": "obj"}; - var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "); - for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom"; - return keywords; - }(); - var operatorChar = /[+\-*&%=<>!?|\.@]/; - - // Tokenizer - - // Used as scratch variable to communicate multiple values without - // consing up tons of objects. - var tcat, content; - function r(tc, style) { - tcat = tc; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - if (ch == "'") { - tcat = "atom"; - if (stream.eat("\\")) { - if (stream.skipTo("'")) { stream.next(); return "string"; } - else { return "error"; } - } else { - stream.next(); - return stream.eat("'") ? "string" : "error"; - } - } - if (ch == "/") { - if (stream.eat("/")) { stream.skipToEnd(); return "comment"; } - if (stream.eat("*")) { - state.tokenize = tokenComment(1); - return state.tokenize(stream, state); - } - } - if (ch == "#") { - if (stream.eat("[")) { tcat = "open-attr"; return null; } - stream.eatWhile(/\w/); - return r("macro", "meta"); - } - if (ch == ":" && stream.match(":<")) { - return r("op", null); - } - if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) { - var flp = false; - if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) { - stream.eatWhile(/\d/); - if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); } - if (stream.match(/^e[+\-]?\d+/i)) { flp = true; } - } - if (flp) stream.match(/^f(?:32|64)/); - else stream.match(/^[ui](?:8|16|32|64)/); - return r("atom", "number"); - } - if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null); - if (ch == "-" && stream.eat(">")) return r("->", null); - if (ch.match(operatorChar)) { - stream.eatWhile(operatorChar); - return r("op", null); - } - stream.eatWhile(/\w/); - content = stream.current(); - if (stream.match(/^::\w/)) { - stream.backUp(1); - return r("prefix", "variable-2"); - } - if (state.keywords.propertyIsEnumerable(content)) - return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword"); - return r("name", "variable"); - } - - function tokenString(stream, state) { - var ch, escaped = false; - while (ch = stream.next()) { - if (ch == '"' && !escaped) { - state.tokenize = tokenBase; - return r("atom", "string"); - } - escaped = !escaped && ch == "\\"; - } - // Hack to not confuse the parser when a string is split in - // pieces. - return r("op", "string"); - } - - function tokenComment(depth) { - return function(stream, state) { - var lastCh = null, ch; - while (ch = stream.next()) { - if (ch == "/" && lastCh == "*") { - if (depth == 1) { - state.tokenize = tokenBase; - break; - } else { - state.tokenize = tokenComment(depth - 1); - return state.tokenize(stream, state); - } - } - if (ch == "*" && lastCh == "/") { - state.tokenize = tokenComment(depth + 1); - return state.tokenize(stream, state); - } - lastCh = ch; - } - return "comment"; - }; - } - - // Parser - - var cx = {state: null, stream: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = {indented: state.indented, column: cx.stream.column(), - type: type, prev: state.lexical, info: info}; - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - function typecx() { cx.state.keywords = typeKeywords; } - function valcx() { cx.state.keywords = valKeywords; } - poplex.lex = typecx.lex = valcx.lex = true; - - function commasep(comb, end) { - function more(type) { - if (type == ",") return cont(comb, more); - if (type == end) return cont(); - return cont(more); - } - return function(type) { - if (type == end) return cont(); - return pass(comb, more); - }; - } - - function stat_of(comb, tag) { - return cont(pushlex("stat", tag), comb, poplex, block); - } - function block(type) { - if (type == "}") return cont(); - if (type == "let") return stat_of(letdef1, "let"); - if (type == "fn") return stat_of(fndef); - if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block); - if (type == "enum") return stat_of(enumdef); - if (type == "mod") return stat_of(mod); - if (type == "iface") return stat_of(iface); - if (type == "impl") return stat_of(impl); - if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex); - if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block); - return pass(pushlex("stat"), expression, poplex, endstatement, block); - } - function endstatement(type) { - if (type == ";") return cont(); - return pass(); - } - function expression(type) { - if (type == "atom" || type == "name") return cont(maybeop); - if (type == "{") return cont(pushlex("}"), exprbrace, poplex); - if (type.match(/[\[\(]/)) return matchBrackets(type, expression); - if (type.match(/[\]\)\};,]/)) return pass(); - if (type == "if-style") return cont(expression, expression); - if (type == "else-style" || type == "op") return cont(expression); - if (type == "for") return cont(pattern, maybetype, inop, expression, expression); - if (type == "alt") return cont(expression, altbody); - if (type == "fn") return cont(fndef); - if (type == "macro") return cont(macro); - return cont(); - } - function maybeop(type) { - if (content == ".") return cont(maybeprop); - if (content == "::<"){return cont(typarams, maybeop);} - if (type == "op" || content == ":") return cont(expression); - if (type == "(" || type == "[") return matchBrackets(type, expression); - return pass(); - } - function maybeprop() { - if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);} - return pass(expression); - } - function exprbrace(type) { - if (type == "op") { - if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block); - if (content == "||") return cont(poplex, pushlex("}", "block"), block); - } - if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":" - && !cx.stream.match("::", false))) - return pass(record_of(expression)); - return pass(block); - } - function record_of(comb) { - function ro(type) { - if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);} - if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);} - if (type == ":") return cont(comb, ro); - if (type == "}") return cont(); - return cont(ro); - } - return ro; - } - function blockvars(type) { - if (type == "name") {cx.marked = "def"; return cont(blockvars);} - if (type == "op" && content == "|") return cont(); - return cont(blockvars); - } - - function letdef1(type) { - if (type.match(/[\]\)\};]/)) return cont(); - if (content == "=") return cont(expression, letdef2); - if (type == ",") return cont(letdef1); - return pass(pattern, maybetype, letdef1); - } - function letdef2(type) { - if (type.match(/[\]\)\};,]/)) return pass(letdef1); - else return pass(expression, letdef2); - } - function maybetype(type) { - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function inop(type) { - if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();} - return pass(); - } - function fndef(type) { - if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);} - if (type == "name") {cx.marked = "def"; return cont(fndef);} - if (content == "<") return cont(typarams, fndef); - if (type == "{") return pass(expression); - if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef); - if (type == "->") return cont(typecx, rtype, valcx, fndef); - if (type == ";") return cont(); - return cont(fndef); - } - function tydef(type) { - if (type == "name") {cx.marked = "def"; return cont(tydef);} - if (content == "<") return cont(typarams, tydef); - if (content == "=") return cont(typecx, rtype, valcx); - return cont(tydef); - } - function enumdef(type) { - if (type == "name") {cx.marked = "def"; return cont(enumdef);} - if (content == "<") return cont(typarams, enumdef); - if (content == "=") return cont(typecx, rtype, valcx, endstatement); - if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex); - return cont(enumdef); - } - function enumblock(type) { - if (type == "}") return cont(); - if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock); - if (content.match(/^\w+$/)) cx.marked = "def"; - return cont(enumblock); - } - function mod(type) { - if (type == "name") {cx.marked = "def"; return cont(mod);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function iface(type) { - if (type == "name") {cx.marked = "def"; return cont(iface);} - if (content == "<") return cont(typarams, iface); - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function impl(type) { - if (content == "<") return cont(typarams, impl); - if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);} - if (type == "name") {cx.marked = "def"; return cont(impl);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function typarams() { - if (content == ">") return cont(); - if (content == ",") return cont(typarams); - if (content == ":") return cont(rtype, typarams); - return pass(rtype, typarams); - } - function argdef(type) { - if (type == "name") {cx.marked = "def"; return cont(argdef);} - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function rtype(type) { - if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); } - if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);} - if (type == "atom") return cont(rtypemaybeparam); - if (type == "op" || type == "obj") return cont(rtype); - if (type == "fn") return cont(fntype); - if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex); - return matchBrackets(type, rtype); - } - function rtypemaybeparam() { - if (content == "<") return cont(typarams); - return pass(); - } - function fntype(type) { - if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype); - if (type == "->") return cont(rtype); - return pass(); - } - function pattern(type) { - if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);} - if (type == "atom") return cont(patternmaybeop); - if (type == "op") return cont(pattern); - if (type.match(/[\]\)\};,]/)) return pass(); - return matchBrackets(type, pattern); - } - function patternmaybeop(type) { - if (type == "op" && content == ".") return cont(); - if (content == "to") {cx.marked = "keyword"; return cont(pattern);} - else return pass(); - } - function altbody(type) { - if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex); - return pass(); - } - function altblock1(type) { - if (type == "}") return cont(); - if (type == "|") return cont(altblock1); - if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);} - if (type.match(/[\]\);,]/)) return cont(altblock1); - return pass(pattern, altblock2); - } - function altblock2(type) { - if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1); - else return pass(altblock1); - } - - function macro(type) { - if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression); - return pass(); - } - function matchBrackets(type, comb) { - if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex); - if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex); - if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex); - return cont(); - } - - function parse(state, stream, style) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - while (true) { - var combinator = cc.length ? cc.pop() : block; - if (combinator(tcat)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - return cx.marked || style; - } - } - } - - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - lexical: {indented: -indentUnit, column: 0, type: "top", align: false}, - keywords: valKeywords, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - tcat = content = null; - var style = state.tokenize(stream, state); - if (style == "comment") return style; - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - if (tcat == "prefix") return style; - if (!content) content = stream.current(); - return parse(state, stream, style); - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, - type = lexical.type, closing = firstChar == type; - if (type == "stat") return lexical.indented + indentUnit; - if (lexical.align) return lexical.column + (closing ? 0 : 1); - return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit)); - }, - - electricChars: "{}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - fold: "brace" - }; -}); - -CodeMirror.defineMIME("text/x-rustsrc", "rust"); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/sass/sass.js b/ThirdParty/codemirror-4.6/mode/sass/sass.js deleted file mode 100644 index b792a02aa3ea..000000000000 --- a/ThirdParty/codemirror-4.6/mode/sass/sass.js +++ /dev/null @@ -1,327 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sass", function(config) { - function tokenRegexp(words) { - return new RegExp("^" + words.join("|")); - } - - var keywords = ["true", "false", "null", "auto"]; - var keywordsRegexp = new RegExp("^" + keywords.join("|")); - - var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", "\\!=", "/", "\\*", "%", "and", "or", "not"]; - var opRegexp = tokenRegexp(operators); - - var pseudoElementsRegexp = /^::?[\w\-]+/; - - function urlTokens(stream, state) { - var ch = stream.peek(); - - if (ch === ")") { - stream.next(); - state.tokenizer = tokenBase; - return "operator"; - } else if (ch === "(") { - stream.next(); - stream.eatSpace(); - - return "operator"; - } else if (ch === "'" || ch === '"') { - state.tokenizer = buildStringTokenizer(stream.next()); - return "string"; - } else { - state.tokenizer = buildStringTokenizer(")", false); - return "string"; - } - } - function comment(indentation, multiLine) { - return function(stream, state) { - if (stream.sol() && stream.indentation() <= indentation) { - state.tokenizer = tokenBase; - return tokenBase(stream, state); - } - - if (multiLine && stream.skipTo("*/")) { - stream.next(); - stream.next(); - state.tokenizer = tokenBase; - } else { - stream.next(); - } - - return "comment"; - }; - } - - function buildStringTokenizer(quote, greedy) { - if(greedy == null) { greedy = true; } - - function stringTokenizer(stream, state) { - var nextChar = stream.next(); - var peekChar = stream.peek(); - var previousChar = stream.string.charAt(stream.pos-2); - - var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); - - if (endingString) { - if (nextChar !== quote && greedy) { stream.next(); } - state.tokenizer = tokenBase; - return "string"; - } else if (nextChar === "#" && peekChar === "{") { - state.tokenizer = buildInterpolationTokenizer(stringTokenizer); - stream.next(); - return "operator"; - } else { - return "string"; - } - } - - return stringTokenizer; - } - - function buildInterpolationTokenizer(currentTokenizer) { - return function(stream, state) { - if (stream.peek() === "}") { - stream.next(); - state.tokenizer = currentTokenizer; - return "operator"; - } else { - return tokenBase(stream, state); - } - }; - } - - function indent(state) { - if (state.indentCount == 0) { - state.indentCount++; - var lastScopeOffset = state.scopes[0].offset; - var currentOffset = lastScopeOffset + config.indentUnit; - state.scopes.unshift({ offset:currentOffset }); - } - } - - function dedent(state) { - if (state.scopes.length == 1) return; - - state.scopes.shift(); - } - - function tokenBase(stream, state) { - var ch = stream.peek(); - - // Comment - if (stream.match("/*")) { - state.tokenizer = comment(stream.indentation(), true); - return state.tokenizer(stream, state); - } - if (stream.match("//")) { - state.tokenizer = comment(stream.indentation(), false); - return state.tokenizer(stream, state); - } - - // Interpolation - if (stream.match("#{")) { - state.tokenizer = buildInterpolationTokenizer(tokenBase); - return "operator"; - } - - if (ch === ".") { - stream.next(); - - // Match class selectors - if (stream.match(/^[\w-]+/)) { - indent(state); - return "atom"; - } else if (stream.peek() === "#") { - indent(state); - return "atom"; - } else { - return "operator"; - } - } - - if (ch === "#") { - stream.next(); - - // Hex numbers - if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)) - return "number"; - - // ID selectors - if (stream.match(/^[\w-]+/)) { - indent(state); - return "atom"; - } - - if (stream.peek() === "#") { - indent(state); - return "atom"; - } - } - - // Numbers - if (stream.match(/^-?[0-9\.]+/)) - return "number"; - - // Units - if (stream.match(/^(px|em|in)\b/)) - return "unit"; - - if (stream.match(keywordsRegexp)) - return "keyword"; - - if (stream.match(/^url/) && stream.peek() === "(") { - state.tokenizer = urlTokens; - return "atom"; - } - - // Variables - if (ch === "$") { - stream.next(); - stream.eatWhile(/[\w-]/); - - if (stream.peek() === ":") { - stream.next(); - return "variable-2"; - } else { - return "variable-3"; - } - } - - if (ch === "!") { - stream.next(); - return stream.match(/^[\w]+/) ? "keyword": "operator"; - } - - if (ch === "=") { - stream.next(); - - // Match shortcut mixin definition - if (stream.match(/^[\w-]+/)) { - indent(state); - return "meta"; - } else { - return "operator"; - } - } - - if (ch === "+") { - stream.next(); - - // Match shortcut mixin definition - if (stream.match(/^[\w-]+/)) - return "variable-3"; - else - return "operator"; - } - - // Indent Directives - if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) { - indent(state); - return "meta"; - } - - // Other Directives - if (ch === "@") { - stream.next(); - stream.eatWhile(/[\w-]/); - return "meta"; - } - - // Strings - if (ch === '"' || ch === "'") { - stream.next(); - state.tokenizer = buildStringTokenizer(ch); - return "string"; - } - - // Pseudo element selectors - if (ch == ":" && stream.match(pseudoElementsRegexp)) - return "keyword"; - - // atoms - if (stream.eatWhile(/[\w-&]/)) { - // matches a property definition - if (stream.peek() === ":" && !stream.match(pseudoElementsRegexp, false)) - return "property"; - else - return "atom"; - } - - if (stream.match(opRegexp)) - return "operator"; - - // If we haven't returned by now, we move 1 character - // and return an error - stream.next(); - return null; - } - - function tokenLexer(stream, state) { - if (stream.sol()) state.indentCount = 0; - var style = state.tokenizer(stream, state); - var current = stream.current(); - - if (current === "@return") - dedent(state); - - if (style === "atom") - indent(state); - - if (style !== null) { - var startOfToken = stream.pos - current.length; - var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); - - var newScopes = []; - - for (var i = 0; i < state.scopes.length; i++) { - var scope = state.scopes[i]; - - if (scope.offset <= withCurrentIndent) - newScopes.push(scope); - } - - state.scopes = newScopes; - } - - - return style; - } - - return { - startState: function() { - return { - tokenizer: tokenBase, - scopes: [{offset: 0, type: "sass"}], - indentCount: 0, - definedVars: [], - definedMixins: [] - }; - }, - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = { style: style, content: stream.current() }; - - return style; - }, - - indent: function(state) { - return state.scopes[0].offset; - } - }; -}); - -CodeMirror.defineMIME("text/x-sass", "sass"); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/shell/shell.js b/ThirdParty/codemirror-4.6/mode/shell/shell.js deleted file mode 100644 index 8e31f6f30be9..000000000000 --- a/ThirdParty/codemirror-4.6/mode/shell/shell.js +++ /dev/null @@ -1,138 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('shell', function() { - - var words = {}; - function define(style, string) { - var split = string.split(' '); - for(var i = 0; i < split.length; i++) { - words[split[i]] = style; - } - }; - - // Atoms - define('atom', 'true false'); - - // Keywords - define('keyword', 'if then do else elif while until for in esac fi fin ' + - 'fil done exit set unset export function'); - - // Commands - define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + - 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' + - 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + - 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' + - 'touch vi vim wall wc wget who write yes zsh'); - - function tokenBase(stream, state) { - if (stream.eatSpace()) return null; - - var sol = stream.sol(); - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - return null; - } - if (ch === '\'' || ch === '"' || ch === '`') { - state.tokens.unshift(tokenString(ch)); - return tokenize(stream, state); - } - if (ch === '#') { - if (sol && stream.eat('!')) { - stream.skipToEnd(); - return 'meta'; // 'comment'? - } - stream.skipToEnd(); - return 'comment'; - } - if (ch === '$') { - state.tokens.unshift(tokenDollar); - return tokenize(stream, state); - } - if (ch === '+' || ch === '=') { - return 'operator'; - } - if (ch === '-') { - stream.eat('-'); - stream.eatWhile(/\w/); - return 'attribute'; - } - if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - if(stream.eol() || !/\w/.test(stream.peek())) { - return 'number'; - } - } - stream.eatWhile(/[\w-]/); - var cur = stream.current(); - if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; - return words.hasOwnProperty(cur) ? words[cur] : null; - } - - function tokenString(quote) { - return function(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === quote && !escaped) { - end = true; - break; - } - if (next === '$' && !escaped && quote !== '\'') { - escaped = true; - stream.backUp(1); - state.tokens.unshift(tokenDollar); - break; - } - escaped = !escaped && next === '\\'; - } - if (end || !escaped) { - state.tokens.shift(); - } - return (quote === '`' || quote === ')' ? 'quote' : 'string'); - }; - }; - - var tokenDollar = function(stream, state) { - if (state.tokens.length > 1) stream.eat('$'); - var ch = stream.next(), hungry = /\w/; - if (ch === '{') hungry = /[^}]/; - if (ch === '(') { - state.tokens[0] = tokenString(')'); - return tokenize(stream, state); - } - if (!/\d/.test(ch)) { - stream.eatWhile(hungry); - stream.eat('}'); - } - state.tokens.shift(); - return 'def'; - }; - - function tokenize(stream, state) { - return (state.tokens[0] || tokenBase) (stream, state); - }; - - return { - startState: function() {return {tokens:[]};}, - token: function(stream, state) { - return tokenize(stream, state); - }, - lineComment: '#' - }; -}); - -CodeMirror.defineMIME('text/x-sh', 'shell'); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/smarty/smarty.js b/ThirdParty/codemirror-4.6/mode/smarty/smarty.js deleted file mode 100644 index bb053245d358..000000000000 --- a/ThirdParty/codemirror-4.6/mode/smarty/smarty.js +++ /dev/null @@ -1,221 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Smarty 2 and 3 mode. - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("smarty", function(config) { - "use strict"; - - // our default settings; check to see if they're overridden - var settings = { - rightDelimiter: '}', - leftDelimiter: '{', - smartyVersion: 2 // for backward compatibility - }; - if (config.hasOwnProperty("leftDelimiter")) { - settings.leftDelimiter = config.leftDelimiter; - } - if (config.hasOwnProperty("rightDelimiter")) { - settings.rightDelimiter = config.rightDelimiter; - } - if (config.hasOwnProperty("smartyVersion") && config.smartyVersion === 3) { - settings.smartyVersion = 3; - } - - var keyFunctions = ["debug", "extends", "function", "include", "literal"]; - var last; - var regs = { - operatorChars: /[+\-*&%=<>!?]/, - validIdentifier: /[a-zA-Z0-9_]/, - stringChar: /['"]/ - }; - - var helpers = { - cont: function(style, lastType) { - last = lastType; - return style; - }, - chain: function(stream, state, parser) { - state.tokenize = parser; - return parser(stream, state); - } - }; - - - // our various parsers - var parsers = { - - // the main tokenizer - tokenizer: function(stream, state) { - if (stream.match(settings.leftDelimiter, true)) { - if (stream.eat("*")) { - return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); - } else { - // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode - state.depth++; - var isEol = stream.eol(); - var isFollowedByWhitespace = /\s/.test(stream.peek()); - if (settings.smartyVersion === 3 && settings.leftDelimiter === "{" && (isEol || isFollowedByWhitespace)) { - state.depth--; - return null; - } else { - state.tokenize = parsers.smarty; - last = "startTag"; - return "tag"; - } - } - } else { - stream.next(); - return null; - } - }, - - // parsing Smarty content - smarty: function(stream, state) { - if (stream.match(settings.rightDelimiter, true)) { - if (settings.smartyVersion === 3) { - state.depth--; - if (state.depth <= 0) { - state.tokenize = parsers.tokenizer; - } - } else { - state.tokenize = parsers.tokenizer; - } - return helpers.cont("tag", null); - } - - if (stream.match(settings.leftDelimiter, true)) { - state.depth++; - return helpers.cont("tag", "startTag"); - } - - var ch = stream.next(); - if (ch == "$") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("variable-2", "variable"); - } else if (ch == "|") { - return helpers.cont("operator", "pipe"); - } else if (ch == ".") { - return helpers.cont("operator", "property"); - } else if (regs.stringChar.test(ch)) { - state.tokenize = parsers.inAttribute(ch); - return helpers.cont("string", "string"); - } else if (regs.operatorChars.test(ch)) { - stream.eatWhile(regs.operatorChars); - return helpers.cont("operator", "operator"); - } else if (ch == "[" || ch == "]") { - return helpers.cont("bracket", "bracket"); - } else if (ch == "(" || ch == ")") { - return helpers.cont("bracket", "operator"); - } else if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - return helpers.cont("number", "number"); - } else { - - if (state.last == "variable") { - if (ch == "@") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("property", "property"); - } else if (ch == "|") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("qualifier", "modifier"); - } - } else if (state.last == "pipe") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("qualifier", "modifier"); - } else if (state.last == "whitespace") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("attribute", "modifier"); - } if (state.last == "property") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("property", null); - } else if (/\s/.test(ch)) { - last = "whitespace"; - return null; - } - - var str = ""; - if (ch != "/") { - str += ch; - } - var c = null; - while (c = stream.eat(regs.validIdentifier)) { - str += c; - } - for (var i=0, j=keyFunctions.length; i - -CodeMirror: Smarty mixed mode - - - - - - - - - - - - - -
-

Smarty mixed mode

-
- - - -

The Smarty mixed mode depends on the Smarty and HTML mixed modes. HTML - mixed mode itself depends on XML, JavaScript, and CSS modes.

- -

It takes the same options, as Smarty and HTML mixed modes.

- -

MIME types defined: text/x-smarty.

-
diff --git a/ThirdParty/codemirror-4.6/mode/smartymixed/smartymixed.js b/ThirdParty/codemirror-4.6/mode/smartymixed/smartymixed.js deleted file mode 100644 index 3290d17d80ed..000000000000 --- a/ThirdParty/codemirror-4.6/mode/smartymixed/smartymixed.js +++ /dev/null @@ -1,193 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** -* @file smartymixed.js -* @brief Smarty Mixed Codemirror mode (Smarty + Mixed HTML) -* @author Ruslan Osmanov -* @version 3.0 -* @date 05.07.2013 -*/ - -// Warning: Don't base other modes on this one. This here is a -// terrible way to write a mixed mode. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../smarty/smarty")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../smarty/smarty"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("smartymixed", function(config) { - var htmlMixedMode = CodeMirror.getMode(config, "htmlmixed"); - var smartyMode = CodeMirror.getMode(config, "smarty"); - - var settings = { - rightDelimiter: '}', - leftDelimiter: '{' - }; - - if (config.hasOwnProperty("leftDelimiter")) { - settings.leftDelimiter = config.leftDelimiter; - } - if (config.hasOwnProperty("rightDelimiter")) { - settings.rightDelimiter = config.rightDelimiter; - } - - function reEsc(str) { return str.replace(/[^\s\w]/g, "\\$&"); } - - var reLeft = reEsc(settings.leftDelimiter), reRight = reEsc(settings.rightDelimiter); - var regs = { - smartyComment: new RegExp("^" + reRight + "\\*"), - literalOpen: new RegExp(reLeft + "literal" + reRight), - literalClose: new RegExp(reLeft + "\/literal" + reRight), - hasLeftDelimeter: new RegExp(".*" + reLeft), - htmlHasLeftDelimeter: new RegExp("[^<>]*" + reLeft) - }; - - var helpers = { - chain: function(stream, state, parser) { - state.tokenize = parser; - return parser(stream, state); - }, - - cleanChain: function(stream, state, parser) { - state.tokenize = null; - state.localState = null; - state.localMode = null; - return (typeof parser == "string") ? (parser ? parser : null) : parser(stream, state); - }, - - maybeBackup: function(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat), - m; - if (close > - 1) stream.backUp(cur.length - close); - else if (m = cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur[0]); - } - return style; - } - }; - - var parsers = { - html: function(stream, state) { - if (!state.inLiteral && stream.match(regs.htmlHasLeftDelimeter, false) && state.htmlMixedState.htmlState.tagName === null) { - state.tokenize = parsers.smarty; - state.localMode = smartyMode; - state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); - return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState)); - } else if (!state.inLiteral && stream.match(settings.leftDelimiter, false)) { - state.tokenize = parsers.smarty; - state.localMode = smartyMode; - state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); - return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState)); - } - return htmlMixedMode.token(stream, state.htmlMixedState); - }, - - smarty: function(stream, state) { - if (stream.match(settings.leftDelimiter, false)) { - if (stream.match(regs.smartyComment, false)) { - return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); - } - } else if (stream.match(settings.rightDelimiter, false)) { - stream.eat(settings.rightDelimiter); - state.tokenize = parsers.html; - state.localMode = htmlMixedMode; - state.localState = state.htmlMixedState; - return "tag"; - } - - return helpers.maybeBackup(stream, settings.rightDelimiter, smartyMode.token(stream, state.localState)); - }, - - inBlock: function(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - helpers.cleanChain(stream, state, ""); - break; - } - stream.next(); - } - return style; - }; - } - }; - - return { - startState: function() { - var state = htmlMixedMode.startState(); - return { - token: parsers.html, - localMode: null, - localState: null, - htmlMixedState: state, - tokenize: null, - inLiteral: false - }; - }, - - copyState: function(state) { - var local = null, tok = (state.tokenize || state.token); - if (state.localState) { - local = CodeMirror.copyState((tok != parsers.html ? smartyMode : htmlMixedMode), state.localState); - } - return { - token: state.token, - tokenize: state.tokenize, - localMode: state.localMode, - localState: local, - htmlMixedState: CodeMirror.copyState(htmlMixedMode, state.htmlMixedState), - inLiteral: state.inLiteral - }; - }, - - token: function(stream, state) { - if (stream.match(settings.leftDelimiter, false)) { - if (!state.inLiteral && stream.match(regs.literalOpen, true)) { - state.inLiteral = true; - return "keyword"; - } else if (state.inLiteral && stream.match(regs.literalClose, true)) { - state.inLiteral = false; - return "keyword"; - } - } - if (state.inLiteral && state.localState != state.htmlMixedState) { - state.tokenize = parsers.html; - state.localMode = htmlMixedMode; - state.localState = state.htmlMixedState; - } - - var style = (state.tokenize || state.token)(stream, state); - return style; - }, - - indent: function(state, textAfter) { - if (state.localMode == smartyMode - || (state.inLiteral && !state.localMode) - || regs.hasLeftDelimeter.test(textAfter)) { - return CodeMirror.Pass; - } - return htmlMixedMode.indent(state.htmlMixedState, textAfter); - }, - - innerMode: function(state) { - return { - state: state.localState || state.htmlMixedState, - mode: state.localMode || htmlMixedMode - }; - } - }; -}, "htmlmixed", "smarty"); - -CodeMirror.defineMIME("text/x-smarty", "smartymixed"); -// vim: et ts=2 sts=2 sw=2 - -}); diff --git a/ThirdParty/codemirror-4.6/mode/sql/sql.js b/ThirdParty/codemirror-4.6/mode/sql/sql.js deleted file mode 100644 index 6c02f4e94741..000000000000 --- a/ThirdParty/codemirror-4.6/mode/sql/sql.js +++ /dev/null @@ -1,392 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sql", function(config, parserConfig) { - "use strict"; - - var client = parserConfig.client || {}, - atoms = parserConfig.atoms || {"false": true, "true": true, "null": true}, - builtin = parserConfig.builtin || {}, - keywords = parserConfig.keywords || {}, - operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/, - support = parserConfig.support || {}, - hooks = parserConfig.hooks || {}, - dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}; - - function tokenBase(stream, state) { - var ch = stream.next(); - - // call hooks from the mime type - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - - if (support.hexNumber == true && - ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) - || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { - // hex - // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html - return "number"; - } else if (support.binaryNumber == true && - (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) - || (ch == "0" && stream.match(/^b[01]+/)))) { - // bitstring - // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html - return "number"; - } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { - // numbers - // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html - stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/); - support.decimallessFloat == true && stream.eat('.'); - return "number"; - } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { - // placeholders - return "variable-3"; - } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { - // strings - // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } else if ((((support.nCharCast == true && (ch == "n" || ch == "N")) - || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) - && (stream.peek() == "'" || stream.peek() == '"'))) { - // charset casting: _utf8'str', N'str', n'str' - // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html - return "keyword"; - } else if (/^[\(\),\;\[\]]/.test(ch)) { - // no highlightning - return null; - } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { - // 1-line comment - stream.skipToEnd(); - return "comment"; - } else if ((support.commentHash && ch == "#") - || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { - // 1-line comments - // ref: https://kb.askmonty.org/en/comment-syntax/ - stream.skipToEnd(); - return "comment"; - } else if (ch == "/" && stream.eat("*")) { - // multi-line comments - // ref: https://kb.askmonty.org/en/comment-syntax/ - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } else if (ch == ".") { - // .1 for 0.1 - if (support.zerolessFloat == true && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) { - return "number"; - } - // .table_name (ODBC) - // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html - if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) { - return "variable-2"; - } - } else if (operatorChars.test(ch)) { - // operators - stream.eatWhile(operatorChars); - return null; - } else if (ch == '{' && - (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) { - // dates (weird ODBC syntax) - // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html - return "number"; - } else { - stream.eatWhile(/^[_\w\d]/); - var word = stream.current().toLowerCase(); - // dates (standard SQL syntax) - // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html - if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) - return "number"; - if (atoms.hasOwnProperty(word)) return "atom"; - if (builtin.hasOwnProperty(word)) return "builtin"; - if (keywords.hasOwnProperty(word)) return "keyword"; - if (client.hasOwnProperty(word)) return "string-2"; - return null; - } - } - - // 'string', with char specified in quote escaped by '\' - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - function tokenComment(stream, state) { - while (true) { - if (stream.skipTo("*")) { - stream.next(); - if (stream.eat("/")) { - state.tokenize = tokenBase; - break; - } - } else { - stream.skipToEnd(); - break; - } - } - return "comment"; - } - - function pushContext(stream, state, type) { - state.context = { - prev: state.context, - indent: stream.indentation(), - col: stream.column(), - type: type - }; - } - - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, context: null}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) - state.context.align = false; - } - if (stream.eatSpace()) return null; - - var style = state.tokenize(stream, state); - if (style == "comment") return style; - - if (state.context && state.context.align == null) - state.context.align = true; - - var tok = stream.current(); - if (tok == "(") - pushContext(stream, state, ")"); - else if (tok == "[") - pushContext(stream, state, "]"); - else if (state.context && state.context.type == tok) - popContext(state); - return style; - }, - - indent: function(state, textAfter) { - var cx = state.context; - if (!cx) return 0; - var closing = textAfter.charAt(0) == cx.type; - if (cx.align) return cx.col + (closing ? 0 : 1); - else return cx.indent + (closing ? 0 : config.indentUnit); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : null - }; -}); - -(function() { - "use strict"; - - // `identifier` - function hookIdentifier(stream) { - // MySQL/MariaDB identifiers - // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html - var ch; - while ((ch = stream.next()) != null) { - if (ch == "`" && !stream.eat("`")) return "variable-2"; - } - return null; - } - - // variable token - function hookVar(stream) { - // variables - // @@prefix.varName @varName - // varName can be quoted with ` or ' or " - // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html - if (stream.eat("@")) { - stream.match(/^session\./); - stream.match(/^local\./); - stream.match(/^global\./); - } - - if (stream.eat("'")) { - stream.match(/^.*'/); - return "variable-2"; - } else if (stream.eat('"')) { - stream.match(/^.*"/); - return "variable-2"; - } else if (stream.eat("`")) { - stream.match(/^.*`/); - return "variable-2"; - } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) { - return "variable-2"; - } - return null; - }; - - // short client keyword token - function hookClient(stream) { - // \N means NULL - // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html - if (stream.eat("N")) { - return "atom"; - } - // \g, etc - // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html - return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null; - } - - // these keywords are used by all SQL dialects (however, a mode can still overwrite it) - var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where "; - - // turn a space-separated list into an array - function set(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // A generic SQL Mode. It's not a standard, it just try to support what is generally supported - CodeMirror.defineMIME("text/x-sql", { - name: "sql", - keywords: set(sqlKeywords + "begin"), - builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") - }); - - CodeMirror.defineMIME("text/x-mssql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"), - builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"), - hooks: { - "@": hookVar - } - }); - - CodeMirror.defineMIME("text/x-mysql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), - builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), - hooks: { - "@": hookVar, - "`": hookIdentifier, - "\\": hookClient - } - }); - - CodeMirror.defineMIME("text/x-mariadb", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), - builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), - hooks: { - "@": hookVar, - "`": hookIdentifier, - "\\": hookClient - } - }); - - // the query language used by Apache Cassandra is called CQL, but this mime type - // is called Cassandra to avoid confusion with Contextual Query Language - CodeMirror.defineMIME("text/x-cassandra", { - name: "sql", - client: { }, - keywords: set("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"), - builtin: set("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"), - atoms: set("false true"), - operatorChars: /^[<>=]/, - dateSQL: { }, - support: set("commentSlashSlash decimallessFloat"), - hooks: { } - }); - - // this is based on Peter Raganitsch's 'plsql' mode - CodeMirror.defineMIME("text/x-plsql", { - name: "sql", - client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), - keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), - builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), - operatorChars: /^[*+\-%<>!=~]/, - dateSQL: set("date time timestamp"), - support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") - }); - - // Created to support specific hive keywords - CodeMirror.defineMIME("text/x-hive", { - name: "sql", - keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"), - builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date timestamp"), - support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") - }); -}()); - -}); - -/* - How Properties of Mime Types are used by SQL Mode - ================================================= - - keywords: - A list of keywords you want to be highlighted. - functions: - A list of function names you want to be highlighted. - builtin: - A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword"). - operatorChars: - All characters that must be handled as operators. - client: - Commands parsed and executed by the client (not the server). - support: - A list of supported syntaxes which are not common, but are supported by more than 1 DBMS. - * ODBCdotTable: .tableName - * zerolessFloat: .1 - * doubleQuote - * nCharCast: N'string' - * charsetCast: _utf8'string' - * commentHash: use # char for comments - * commentSlashSlash: use // for comments - * commentSpaceRequired: require a space after -- for comments - atoms: - Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others: - UNKNOWN, INFINITY, UNDERFLOW, NaN... - dateSQL: - Used for date/time SQL standard syntax, because not all DBMS's support same temporal types. -*/ diff --git a/ThirdParty/codemirror-4.6/mode/stex/stex.js b/ThirdParty/codemirror-4.6/mode/stex/stex.js deleted file mode 100644 index 09a33e56da20..000000000000 --- a/ThirdParty/codemirror-4.6/mode/stex/stex.js +++ /dev/null @@ -1,261 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) - * Licence: MIT - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("stex", function() { - "use strict"; - - function pushCommand(state, command) { - state.cmdState.push(command); - } - - function peekCommand(state) { - if (state.cmdState.length > 0) { - return state.cmdState[state.cmdState.length - 1]; - } else { - return null; - } - } - - function popCommand(state) { - var plug = state.cmdState.pop(); - if (plug) { - plug.closeBracket(); - } - } - - // returns the non-default plugin closest to the end of the list - function getMostPowerful(state) { - var context = state.cmdState; - for (var i = context.length - 1; i >= 0; i--) { - var plug = context[i]; - if (plug.name == "DEFAULT") { - continue; - } - return plug; - } - return { styleIdentifier: function() { return null; } }; - } - - function addPluginPattern(pluginName, cmdStyle, styles) { - return function () { - this.name = pluginName; - this.bracketNo = 0; - this.style = cmdStyle; - this.styles = styles; - this.argument = null; // \begin and \end have arguments that follow. These are stored in the plugin - - this.styleIdentifier = function() { - return this.styles[this.bracketNo - 1] || null; - }; - this.openBracket = function() { - this.bracketNo++; - return "bracket"; - }; - this.closeBracket = function() {}; - }; - } - - var plugins = {}; - - plugins["importmodule"] = addPluginPattern("importmodule", "tag", ["string", "builtin"]); - plugins["documentclass"] = addPluginPattern("documentclass", "tag", ["", "atom"]); - plugins["usepackage"] = addPluginPattern("usepackage", "tag", ["atom"]); - plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]); - plugins["end"] = addPluginPattern("end", "tag", ["atom"]); - - plugins["DEFAULT"] = function () { - this.name = "DEFAULT"; - this.style = "tag"; - - this.styleIdentifier = this.openBracket = this.closeBracket = function() {}; - }; - - function setState(state, f) { - state.f = f; - } - - // called when in a normal (no environment) context - function normal(source, state) { - var plug; - // Do we look like '\command' ? If so, attempt to apply the plugin 'command' - if (source.match(/^\\[a-zA-Z@]+/)) { - var cmdName = source.current().slice(1); - plug = plugins[cmdName] || plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - setState(state, beginParams); - return plug.style; - } - - // escape characters - if (source.match(/^\\[$&%#{}_]/)) { - return "tag"; - } - - // white space control characters - if (source.match(/^\\[,;!\/\\]/)) { - return "tag"; - } - - // find if we're starting various math modes - if (source.match("\\[")) { - setState(state, function(source, state){ return inMathMode(source, state, "\\]"); }); - return "keyword"; - } - if (source.match("$$")) { - setState(state, function(source, state){ return inMathMode(source, state, "$$"); }); - return "keyword"; - } - if (source.match("$")) { - setState(state, function(source, state){ return inMathMode(source, state, "$"); }); - return "keyword"; - } - - var ch = source.next(); - if (ch == "%") { - // special case: % at end of its own line; stay in same state - if (!source.eol()) { - setState(state, inCComment); - } - return "comment"; - } - else if (ch == '}' || ch == ']') { - plug = peekCommand(state); - if (plug) { - plug.closeBracket(ch); - setState(state, beginParams); - } else { - return "error"; - } - return "bracket"; - } else if (ch == '{' || ch == '[') { - plug = plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - return "bracket"; - } - else if (/\d/.test(ch)) { - source.eatWhile(/[\w.%]/); - return "atom"; - } - else { - source.eatWhile(/[\w\-_]/); - plug = getMostPowerful(state); - if (plug.name == 'begin') { - plug.argument = source.current(); - } - return plug.styleIdentifier(); - } - } - - function inCComment(source, state) { - source.skipToEnd(); - setState(state, normal); - return "comment"; - } - - function inMathMode(source, state, endModeSeq) { - if (source.eatSpace()) { - return null; - } - if (source.match(endModeSeq)) { - setState(state, normal); - return "keyword"; - } - if (source.match(/^\\[a-zA-Z@]+/)) { - return "tag"; - } - if (source.match(/^[a-zA-Z]+/)) { - return "variable-2"; - } - // escape characters - if (source.match(/^\\[$&%#{}_]/)) { - return "tag"; - } - // white space control characters - if (source.match(/^\\[,;!\/]/)) { - return "tag"; - } - // special math-mode characters - if (source.match(/^[\^_&]/)) { - return "tag"; - } - // non-special characters - if (source.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)) { - return null; - } - if (source.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)) { - return "number"; - } - var ch = source.next(); - if (ch == "{" || ch == "}" || ch == "[" || ch == "]" || ch == "(" || ch == ")") { - return "bracket"; - } - - // eat comments here, because inCComment returns us to normal state! - if (ch == "%") { - if (!source.eol()) { - source.skipToEnd(); - } - return "comment"; - } - return "error"; - } - - function beginParams(source, state) { - var ch = source.peek(), lastPlug; - if (ch == '{' || ch == '[') { - lastPlug = peekCommand(state); - lastPlug.openBracket(ch); - source.eat(ch); - setState(state, normal); - return "bracket"; - } - if (/[ \t\r]/.test(ch)) { - source.eat(ch); - return null; - } - setState(state, normal); - popCommand(state); - - return normal(source, state); - } - - return { - startState: function() { - return { - cmdState: [], - f: normal - }; - }, - copyState: function(s) { - return { - cmdState: s.cmdState.slice(), - f: s.f - }; - }, - token: function(stream, state) { - return state.f(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/x-stex", "stex"); -CodeMirror.defineMIME("text/x-latex", "stex"); - -}); diff --git a/ThirdParty/codemirror-4.6/mode/tiddlywiki/tiddlywiki.js b/ThirdParty/codemirror-4.6/mode/tiddlywiki/tiddlywiki.js deleted file mode 100644 index 88c9768a7270..000000000000 --- a/ThirdParty/codemirror-4.6/mode/tiddlywiki/tiddlywiki.js +++ /dev/null @@ -1,369 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/*** - |''Name''|tiddlywiki.js| - |''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror| - |''Author''|PMario| - |''Version''|0.1.7| - |''Status''|''stable''| - |''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]| - |''Documentation''|http://codemirror.tiddlyspace.com/| - |''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]| - |''CoreVersion''|2.5.0| - |''Requires''|codemirror.js| - |''Keywords''|syntax highlighting color code mirror codemirror| - ! Info - CoreVersion parameter is needed for TiddlyWiki only! -***/ -//{{{ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("tiddlywiki", function () { - // Tokenizer - var textwords = {}; - - var keywords = function () { - function kw(type) { - return { type: type, style: "macro"}; - } - return { - "allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'), - "newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'), - "permaview": kw('permaview'), "saveChanges": kw('saveChanges'), - "search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'), - "tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'), - "tiddler": kw('tiddler'), "timeline": kw('timeline'), - "today": kw('today'), "version": kw('version'), "option": kw('option'), - - "with": kw('with'), - "filter": kw('filter') - }; - }(); - - var isSpaceName = /[\w_\-]/i, - reHR = /^\-\-\-\-+$/, //
- reWikiCommentStart = /^\/\*\*\*$/, // /*** - reWikiCommentStop = /^\*\*\*\/$/, // ***/ - reBlockQuote = /^<<<$/, - - reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start - reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop - reXmlCodeStart = /^$/, // xml block start - reXmlCodeStop = /^$/, // xml stop - - reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start - reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop - - reUntilCodeStop = /.*?\}\}\}/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - - function ret(tp, style, cont) { - type = tp; - content = cont; - return style; - } - - function jsTokenBase(stream, state) { - var sol = stream.sol(), ch; - - state.block = false; // indicates the start of a code block. - - ch = stream.peek(); // don't eat, to make matching simpler - - // check start of blocks - if (sol && /[<\/\*{}\-]/.test(ch)) { - if (stream.match(reCodeBlockStart)) { - state.block = true; - return chain(stream, state, twTokenCode); - } - if (stream.match(reBlockQuote)) { - return ret('quote', 'quote'); - } - if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { - return ret('code', 'comment'); - } - if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { - return ret('code', 'comment'); - } - if (stream.match(reHR)) { - return ret('hr', 'hr'); - } - } // sol - ch = stream.next(); - - if (sol && /[\/\*!#;:>|]/.test(ch)) { - if (ch == "!") { // tw header - stream.skipToEnd(); - return ret("header", "header"); - } - if (ch == "*") { // tw list - stream.eatWhile('*'); - return ret("list", "comment"); - } - if (ch == "#") { // tw numbered list - stream.eatWhile('#'); - return ret("list", "comment"); - } - if (ch == ";") { // definition list, term - stream.eatWhile(';'); - return ret("list", "comment"); - } - if (ch == ":") { // definition list, description - stream.eatWhile(':'); - return ret("list", "comment"); - } - if (ch == ">") { // single line quote - stream.eatWhile(">"); - return ret("quote", "quote"); - } - if (ch == '|') { - return ret('table', 'header'); - } - } - - if (ch == '{' && stream.match(/\{\{/)) { - return chain(stream, state, twTokenCode); - } - - // rudimentary html:// file:// link matching. TW knows much more ... - if (/[hf]/i.test(ch)) { - if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { - return ret("link", "link"); - } - } - // just a little string indicator, don't want to have the whole string covered - if (ch == '"') { - return ret('string', 'string'); - } - if (ch == '~') { // _no_ CamelCase indicator should be bold - return ret('text', 'brace'); - } - if (/[\[\]]/.test(ch)) { // check for [[..]] - if (stream.peek() == ch) { - stream.next(); - return ret('brace', 'brace'); - } - } - if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting - stream.eatWhile(isSpaceName); - return ret("link", "link"); - } - if (/\d/.test(ch)) { // numbers - stream.eatWhile(/\d/); - return ret("number", "number"); - } - if (ch == "/") { // tw invisible comment - if (stream.eat("%")) { - return chain(stream, state, twTokenComment); - } - else if (stream.eat("/")) { // - return chain(stream, state, twTokenEm); - } - } - if (ch == "_") { // tw underline - if (stream.eat("_")) { - return chain(stream, state, twTokenUnderline); - } - } - // strikethrough and mdash handling - if (ch == "-") { - if (stream.eat("-")) { - // if strikethrough looks ugly, change CSS. - if (stream.peek() != ' ') - return chain(stream, state, twTokenStrike); - // mdash - if (stream.peek() == ' ') - return ret('text', 'brace'); - } - } - if (ch == "'") { // tw bold - if (stream.eat("'")) { - return chain(stream, state, twTokenStrong); - } - } - if (ch == "<") { // tw macro - if (stream.eat("<")) { - return chain(stream, state, twTokenMacro); - } - } - else { - return ret(ch); - } - - // core macro handling - stream.eatWhile(/[\w\$_]/); - var word = stream.current(), - known = textwords.propertyIsEnumerable(word) && textwords[word]; - - return known ? ret(known.type, known.style, word) : ret("text", null, word); - - } // jsTokenBase() - - // tw invisible comment - function twTokenComment(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "%"); - } - return ret("comment", "comment"); - } - - // tw strong / bold - function twTokenStrong(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "'" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "'"); - } - return ret("text", "strong"); - } - - // tw code - function twTokenCode(stream, state) { - var ch, sb = state.block; - - if (sb && stream.current()) { - return ret("code", "comment"); - } - - if (!sb && stream.match(reUntilCodeStop)) { - state.tokenize = jsTokenBase; - return ret("code", "comment"); - } - - if (sb && stream.sol() && stream.match(reCodeBlockStop)) { - state.tokenize = jsTokenBase; - return ret("code", "comment"); - } - - ch = stream.next(); - return (sb) ? ret("code", "comment") : ret("code", "comment"); - } - - // tw em / italic - function twTokenEm(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "/"); - } - return ret("text", "em"); - } - - // tw underlined text - function twTokenUnderline(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "_" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "_"); - } - return ret("text", "underlined"); - } - - // tw strike through text looks ugly - // change CSS if needed - function twTokenStrike(stream, state) { - var maybeEnd = false, ch; - - while (ch = stream.next()) { - if (ch == "-" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "-"); - } - return ret("text", "strikethrough"); - } - - // macro - function twTokenMacro(stream, state) { - var ch, word, known; - - if (stream.current() == '<<') { - return ret('brace', 'macro'); - } - - ch = stream.next(); - if (!ch) { - state.tokenize = jsTokenBase; - return ret(ch); - } - if (ch == ">") { - if (stream.peek() == '>') { - stream.next(); - state.tokenize = jsTokenBase; - return ret("brace", "macro"); - } - } - - stream.eatWhile(/[\w\$_]/); - word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - if (known) { - return ret(known.type, known.style, word); - } - else { - return ret("macro", null, word); - } - } - - // Interface - return { - startState: function () { - return { - tokenize: jsTokenBase, - indented: 0, - level: 0 - }; - }, - - token: function (stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - }, - - electricChars: "" - }; -}); - -CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); -}); - -//}}} diff --git a/ThirdParty/codemirror-4.6/mode/vb/index.html b/ThirdParty/codemirror-4.6/mode/vb/index.html deleted file mode 100644 index 8b81a88b91e0..000000000000 --- a/ThirdParty/codemirror-4.6/mode/vb/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - -CodeMirror: VB.NET mode - - - - - - - - - - - -
-

VB.NET mode

- - - -
- -
-

-  

MIME type defined: text/x-vb.

- -
diff --git a/ThirdParty/codemirror-4.6/mode/verilog/verilog.js b/ThirdParty/codemirror-4.6/mode/verilog/verilog.js deleted file mode 100644 index 46209b24924f..000000000000 --- a/ThirdParty/codemirror-4.6/mode/verilog/verilog.js +++ /dev/null @@ -1,359 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("verilog", function(config, parserConfig) { - - var indentUnit = config.indentUnit, - statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, - dontAlignCalls = parserConfig.dontAlignCalls, - noIndentKeywords = parserConfig.noIndentKeywords || [], - multiLineStrings = parserConfig.multiLineStrings; - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - /** - * Keywords from IEEE 1800-2012 - */ - var keywords = words( - "accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind " + - "bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config " + - "const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable " + - "dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup " + - "endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask " + - "enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin " + - "function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import " + - "incdir include initial inout input inside instance int integer interconnect interface intersect join join_any " + - "join_none large let liblist library local localparam logic longint macromodule matches medium modport module " + - "nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed " + - "parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup " + - "pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg " + - "reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime " + - "s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify " + - "specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on " + - "table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior " + - "trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void " + - "wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"); - - /** Operators from IEEE 1800-2012 - unary_operator ::= - + | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ - binary_operator ::= - + | - | * | / | % | == | != | === | !== | ==? | !=? | && | || | ** - | < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<< - | -> | <-> - inc_or_dec_operator ::= ++ | -- - unary_module_path_operator ::= - ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ - binary_module_path_operator ::= - == | != | && | || | & | | | ^ | ^~ | ~^ - */ - var isOperatorChar = /[\+\-\*\/!~&|^%=?:]/; - var isBracketChar = /[\[\]{}()]/; - - var unsignedNumber = /\d[0-9_]*/; - var decimalLiteral = /\d*\s*'s?d\s*\d[0-9_]*/i; - var binaryLiteral = /\d*\s*'s?b\s*[xz01][xz01_]*/i; - var octLiteral = /\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i; - var hexLiteral = /\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i; - var realLiteral = /(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i; - - var closingBracketOrWord = /^((\w+)|[)}\]])/; - var closingBracket = /[)}\]]/; - - var curPunc; - var curKeyword; - - // Block openings which are closed by a matching keyword in the form of ("end" + keyword) - // E.g. "task" => "endtask" - var blockKeywords = words( - "case checker class clocking config function generate group interface module package" + - "primitive program property specify sequence table task" - ); - - // Opening/closing pairs - var openClose = {}; - for (var keyword in blockKeywords) { - openClose[keyword] = "end" + keyword; - } - openClose["begin"] = "end"; - openClose["casex"] = "endcase"; - openClose["casez"] = "endcase"; - openClose["do" ] = "while"; - openClose["fork" ] = "join;join_any;join_none"; - - // This is a bit of a hack but will work to not indent after import/epxort statements - // as long as the function/task name is on the same line - openClose["import"] = "function;task"; - openClose["export"] = "function;task"; - - for (var i in noIndentKeywords) { - var keyword = noIndentKeywords[i]; - if (openClose[keyword]) { - openClose[keyword] = undefined; - } - } - - var statementKeywords = words("always always_comb always_ff always_latch assert assign assume else for foreach forever if initial repeat while"); - - function tokenBase(stream, state) { - var ch = stream.peek(); - if (/[,;:\.]/.test(ch)) { - curPunc = stream.next(); - return null; - } - if (isBracketChar.test(ch)) { - curPunc = stream.next(); - return "bracket"; - } - // Macros (tick-defines) - if (ch == '`') { - stream.next(); - if (stream.eatWhile(/[\w\$_]/)) { - return "def"; - } else { - return null; - } - } - // System calls - if (ch == '$') { - stream.next(); - if (stream.eatWhile(/[\w\$_]/)) { - return "meta"; - } else { - return null; - } - } - // Time literals - if (ch == '#') { - stream.next(); - stream.eatWhile(/[\d_.]/); - return "def"; - } - // Strings - if (ch == '"') { - stream.next(); - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - // Comments - if (ch == "/") { - stream.next(); - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - stream.backUp(1); - } - - // Numeric literals - if (stream.match(realLiteral) || - stream.match(decimalLiteral) || - stream.match(binaryLiteral) || - stream.match(octLiteral) || - stream.match(hexLiteral) || - stream.match(unsignedNumber) || - stream.match(realLiteral)) { - return "number"; - } - - // Operators - if (stream.eatWhile(isOperatorChar)) { - return "meta"; - } - - // Keywords / plain variables - if (stream.eatWhile(/[\w\$_]/)) { - var cur = stream.current(); - if (keywords[cur]) { - if (openClose[cur]) { - curPunc = "newblock"; - } - if (statementKeywords[cur]) { - curPunc = "newstatement"; - } - curKeyword = cur; - return "keyword"; - } - return "variable"; - } - - stream.next(); - return null; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - var indent = state.indented; - var c = new Context(indent, col, type, null, state.context); - return state.context = c; - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") { - state.indented = state.context.indented; - } - return state.context = state.context.prev; - } - - function isClosing(text, contextClosing) { - if (text == contextClosing) { - return true; - } else { - // contextClosing may be mulitple keywords separated by ; - var closingKeywords = contextClosing.split(";"); - for (var i in closingKeywords) { - if (text == closingKeywords[i]) { - return true; - } - } - return false; - } - } - - function buildElectricInputRegEx() { - // Reindentation should occur on any bracket char: {}()[] - // or on a match of any of the block closing keywords, at - // the end of a line - var allClosings = []; - for (var i in openClose) { - if (openClose[i]) { - var closings = openClose[i].split(";"); - for (var j in closings) { - allClosings.push(closings[j]); - } - } - } - var re = new RegExp("[{}()\\[\\]]|(" + allClosings.join("|") + ")$"); - return re; - } - - // Interface - return { - - // Regex to force current line to reindent - electricInput: buildElectricInputRegEx(), - - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - curKeyword = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta" || style == "variable") return style; - if (ctx.align == null) ctx.align = true; - - if (curPunc == ctx.type) { - popContext(state); - } - else if ((curPunc == ";" && ctx.type == "statement") || - (ctx.type && isClosing(curKeyword, ctx.type))) { - ctx = popContext(state); - while (ctx && ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == "{") { pushContext(state, stream.column(), "}"); } - else if (curPunc == "[") { pushContext(state, stream.column(), "]"); } - else if (curPunc == "(") { pushContext(state, stream.column(), ")"); } - else if (ctx && ctx.type == "endcase" && curPunc == ":") { pushContext(state, stream.column(), "statement"); } - else if (curPunc == "newstatement") { - pushContext(state, stream.column(), "statement"); - } else if (curPunc == "newblock") { - var close = openClose[curKeyword]; - pushContext(state, stream.column(), close); - } - - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = false; - var possibleClosing = textAfter.match(closingBracketOrWord); - if (possibleClosing) { - closing = isClosing(possibleClosing[0], ctx.type); - } - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); - else if (closingBracket.test(ctx.type) && ctx.align && !dontAlignCalls) return ctx.column + (closing ? 0 : 1); - else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME("text/x-verilog", { - name: "verilog" -}); -CodeMirror.defineMIME("text/x-systemverilog", { - name: "systemverilog" -}); - -}); diff --git a/ThirdParty/codemirror-4.6/package.json b/ThirdParty/codemirror-4.6/package.json deleted file mode 100644 index 924c076f2c00..000000000000 --- a/ThirdParty/codemirror-4.6/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "codemirror", - "version":"4.6.0", - "main": "lib/codemirror.js", - "description": "In-browser code editing made bearable", - "licenses": [{"type": "MIT", - "url": "http://codemirror.net/LICENSE"}], - "directories": {"lib": "./lib"}, - "scripts": {"test": "node ./test/run.js"}, - "devDependencies": {"node-static": "0.6.0", - "phantomjs": "1.9.2-5"}, - "bugs": "http://github.com/marijnh/CodeMirror/issues", - "keywords": ["JavaScript", "CodeMirror", "Editor"], - "homepage": "http://codemirror.net", - "maintainers":[{"name": "Marijn Haverbeke", - "email": "marijnh@gmail.com", - "web": "http://marijnhaverbeke.nl"}], - "repository": {"type": "git", - "url": "https://github.com/marijnh/CodeMirror.git"} -} diff --git a/ThirdParty/codemirror-4.6/test/lint/acorn.js b/ThirdParty/codemirror-4.6/test/lint/acorn.js deleted file mode 100644 index 0f1193175290..000000000000 --- a/ThirdParty/codemirror-4.6/test/lint/acorn.js +++ /dev/null @@ -1,1782 +0,0 @@ -// Acorn is a tiny, fast JavaScript parser written in JavaScript. -// -// Acorn was written by Marijn Haverbeke and released under an MIT -// license. The Unicode regexps (for identifiers and whitespace) were -// taken from [Esprima](http://esprima.org) by Ariya Hidayat. -// -// Git repositories for Acorn are available at -// -// http://marijnhaverbeke.nl/git/acorn -// https://github.com/marijnh/acorn.git -// -// Please use the [github bug tracker][ghbt] to report issues. -// -// [ghbt]: https://github.com/marijnh/acorn/issues -// -// This file defines the main parser interface. The library also comes -// with a [error-tolerant parser][dammit] and an -// [abstract syntax tree walker][walk], defined in other files. -// -// [dammit]: acorn_loose.js -// [walk]: util/walk.js - -(function(root, mod) { - if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS - if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD - mod(root.acorn || (root.acorn = {})); // Plain browser env -})(this, function(exports) { - "use strict"; - - exports.version = "0.4.1"; - - // The main exported interface (under `self.acorn` when in the - // browser) is a `parse` function that takes a code string and - // returns an abstract syntax tree as specified by [Mozilla parser - // API][api], with the caveat that the SpiderMonkey-specific syntax - // (`let`, `yield`, inline XML, etc) is not recognized. - // - // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - - var options, input, inputLen, sourceFile; - - exports.parse = function(inpt, opts) { - input = String(inpt); inputLen = input.length; - setOptions(opts); - initTokenState(); - return parseTopLevel(options.program); - }; - - // A second optional argument can be given to further configure - // the parser process. These options are recognized: - - var defaultOptions = exports.defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must - // be either 3 or 5. This - // influences support for strict mode, the set of reserved words, and - // support for getters and setter. - ecmaVersion: 5, - // Turn on `strictSemicolons` to prevent the parser from doing - // automatic semicolon insertion. - strictSemicolons: false, - // When `allowTrailingCommas` is false, the parser will not allow - // trailing commas in array and object literals. - allowTrailingCommas: true, - // By default, reserved words are not enforced. Enable - // `forbidReserved` to enforce them. When this option has the - // value "everywhere", reserved words and keywords can also not be - // used as property names. - forbidReserved: false, - // When enabled, a return at the top level is not considered an - // error. - allowReturnOutsideFunction: false, - // When `locations` is on, `loc` properties holding objects with - // `start` and `end` properties in `{line, column}` form (with - // line being 1-based and column 0-based) will be attached to the - // nodes. - locations: false, - // A function can be passed as `onComment` option, which will - // cause Acorn to call that function with `(block, text, start, - // end)` parameters whenever a comment is skipped. `block` is a - // boolean indicating whether this is a block (`/* */`) comment, - // `text` is the content of the comment, and `start` and `end` are - // character offsets that denote the start and end of the comment. - // When the `locations` option is on, two more parameters are - // passed, the full `{line, column}` locations of the start and - // end of the comments. Note that you are not allowed to call the - // parser from the callback—that will corrupt its internal state. - onComment: null, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // It is possible to parse multiple files into a single AST by - // passing the tree produced by parsing the first file as - // `program` option in subsequent parses. This will add the - // toplevel forms of the parsed file to the `Program` (top) node - // of an existing parse tree. - program: null, - // When `locations` is on, you can pass this to record the source - // file in every node's `loc` object. - sourceFile: null, - // This value, if given, is stored in every node, whether - // `locations` is on or off. - directSourceFile: null - }; - - function setOptions(opts) { - options = opts || {}; - for (var opt in defaultOptions) if (!Object.prototype.hasOwnProperty.call(options, opt)) - options[opt] = defaultOptions[opt]; - sourceFile = options.sourceFile || null; - } - - // The `getLineInfo` function is mostly useful when the - // `locations` option is off (for performance reasons) and you - // want to find the line/column position for a given character - // offset. `input` should be the code string that the offset refers - // into. - - var getLineInfo = exports.getLineInfo = function(input, offset) { - for (var line = 1, cur = 0;;) { - lineBreak.lastIndex = cur; - var match = lineBreak.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else break; - } - return {line: line, column: offset - cur}; - }; - - // Acorn is organized as a tokenizer and a recursive-descent parser. - // The `tokenize` export provides an interface to the tokenizer. - // Because the tokenizer is optimized for being efficiently used by - // the Acorn parser itself, this interface is somewhat crude and not - // very modular. Performing another parse or call to `tokenize` will - // reset the internal state, and invalidate existing tokenizers. - - exports.tokenize = function(inpt, opts) { - input = String(inpt); inputLen = input.length; - setOptions(opts); - initTokenState(); - - var t = {}; - function getToken(forceRegexp) { - lastEnd = tokEnd; - readToken(forceRegexp); - t.start = tokStart; t.end = tokEnd; - t.startLoc = tokStartLoc; t.endLoc = tokEndLoc; - t.type = tokType; t.value = tokVal; - return t; - } - getToken.jumpTo = function(pos, reAllowed) { - tokPos = pos; - if (options.locations) { - tokCurLine = 1; - tokLineStart = lineBreak.lastIndex = 0; - var match; - while ((match = lineBreak.exec(input)) && match.index < pos) { - ++tokCurLine; - tokLineStart = match.index + match[0].length; - } - } - tokRegexpAllowed = reAllowed; - skipSpace(); - }; - return getToken; - }; - - // State is kept in (closure-)global variables. We already saw the - // `options`, `input`, and `inputLen` variables above. - - // The current position of the tokenizer in the input. - - var tokPos; - - // The start and end offsets of the current token. - - var tokStart, tokEnd; - - // When `options.locations` is true, these hold objects - // containing the tokens start and end line/column pairs. - - var tokStartLoc, tokEndLoc; - - // The type and value of the current token. Token types are objects, - // named by variables against which they can be compared, and - // holding properties that describe them (indicating, for example, - // the precedence of an infix operator, and the original name of a - // keyword token). The kind of value that's held in `tokVal` depends - // on the type of the token. For literals, it is the literal value, - // for operators, the operator name, and so on. - - var tokType, tokVal; - - // Interal state for the tokenizer. To distinguish between division - // operators and regular expressions, it remembers whether the last - // token was one that is allowed to be followed by an expression. - // (If it is, a slash is probably a regexp, if it isn't it's a - // division operator. See the `parseStatement` function for a - // caveat.) - - var tokRegexpAllowed; - - // When `options.locations` is true, these are used to keep - // track of the current line, and know when a new line has been - // entered. - - var tokCurLine, tokLineStart; - - // These store the position of the previous token, which is useful - // when finishing a node and assigning its `end` position. - - var lastStart, lastEnd, lastEndLoc; - - // This is the parser's state. `inFunction` is used to reject - // `return` statements outside of functions, `labels` to verify that - // `break` and `continue` have somewhere to jump to, and `strict` - // indicates whether strict mode is on. - - var inFunction, labels, strict; - - // This function is used to raise exceptions on parse errors. It - // takes an offset integer (into the current `input`) to indicate - // the location of the error, attaches the position to the end - // of the error message, and then raises a `SyntaxError` with that - // message. - - function raise(pos, message) { - var loc = getLineInfo(input, pos); - message += " (" + loc.line + ":" + loc.column + ")"; - var err = new SyntaxError(message); - err.pos = pos; err.loc = loc; err.raisedAt = tokPos; - throw err; - } - - // Reused empty array added for node fields that are always empty. - - var empty = []; - - // ## Token types - - // The assignment of fine-grained, information-carrying type objects - // allows the tokenizer to store the information it has about a - // token in a way that is very cheap for the parser to look up. - - // All token type variables start with an underscore, to make them - // easy to recognize. - - // These are the general types. The `type` property is only used to - // make them recognizeable when debugging. - - var _num = {type: "num"}, _regexp = {type: "regexp"}, _string = {type: "string"}; - var _name = {type: "name"}, _eof = {type: "eof"}; - - // Keyword tokens. The `keyword` property (also used in keyword-like - // operators) indicates that the token originated from an - // identifier-like word, which is used when parsing property names. - // - // The `beforeExpr` property is used to disambiguate between regular - // expressions and divisions. It is set on all token types that can - // be followed by an expression (thus, a slash after them would be a - // regular expression). - // - // `isLoop` marks a keyword as starting a loop, which is important - // to know when parsing a label, in order to allow or disallow - // continue jumps to that label. - - var _break = {keyword: "break"}, _case = {keyword: "case", beforeExpr: true}, _catch = {keyword: "catch"}; - var _continue = {keyword: "continue"}, _debugger = {keyword: "debugger"}, _default = {keyword: "default"}; - var _do = {keyword: "do", isLoop: true}, _else = {keyword: "else", beforeExpr: true}; - var _finally = {keyword: "finally"}, _for = {keyword: "for", isLoop: true}, _function = {keyword: "function"}; - var _if = {keyword: "if"}, _return = {keyword: "return", beforeExpr: true}, _switch = {keyword: "switch"}; - var _throw = {keyword: "throw", beforeExpr: true}, _try = {keyword: "try"}, _var = {keyword: "var"}; - var _while = {keyword: "while", isLoop: true}, _with = {keyword: "with"}, _new = {keyword: "new", beforeExpr: true}; - var _this = {keyword: "this"}; - - // The keywords that denote values. - - var _null = {keyword: "null", atomValue: null}, _true = {keyword: "true", atomValue: true}; - var _false = {keyword: "false", atomValue: false}; - - // Some keywords are treated as regular operators. `in` sometimes - // (when parsing `for`) needs to be tested against specifically, so - // we assign a variable name to it for quick comparing. - - var _in = {keyword: "in", binop: 7, beforeExpr: true}; - - // Map keyword names to token types. - - var keywordTypes = {"break": _break, "case": _case, "catch": _catch, - "continue": _continue, "debugger": _debugger, "default": _default, - "do": _do, "else": _else, "finally": _finally, "for": _for, - "function": _function, "if": _if, "return": _return, "switch": _switch, - "throw": _throw, "try": _try, "var": _var, "while": _while, "with": _with, - "null": _null, "true": _true, "false": _false, "new": _new, "in": _in, - "instanceof": {keyword: "instanceof", binop: 7, beforeExpr: true}, "this": _this, - "typeof": {keyword: "typeof", prefix: true, beforeExpr: true}, - "void": {keyword: "void", prefix: true, beforeExpr: true}, - "delete": {keyword: "delete", prefix: true, beforeExpr: true}}; - - // Punctuation token types. Again, the `type` property is purely for debugging. - - var _bracketL = {type: "[", beforeExpr: true}, _bracketR = {type: "]"}, _braceL = {type: "{", beforeExpr: true}; - var _braceR = {type: "}"}, _parenL = {type: "(", beforeExpr: true}, _parenR = {type: ")"}; - var _comma = {type: ",", beforeExpr: true}, _semi = {type: ";", beforeExpr: true}; - var _colon = {type: ":", beforeExpr: true}, _dot = {type: "."}, _question = {type: "?", beforeExpr: true}; - - // Operators. These carry several kinds of properties to help the - // parser use them properly (the presence of these properties is - // what categorizes them as operators). - // - // `binop`, when present, specifies that this operator is a binary - // operator, and will refer to its precedence. - // - // `prefix` and `postfix` mark the operator as a prefix or postfix - // unary operator. `isUpdate` specifies that the node produced by - // the operator should be of type UpdateExpression rather than - // simply UnaryExpression (`++` and `--`). - // - // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as - // binary operators with a very low precedence, that should result - // in AssignmentExpression nodes. - - var _slash = {binop: 10, beforeExpr: true}, _eq = {isAssign: true, beforeExpr: true}; - var _assign = {isAssign: true, beforeExpr: true}; - var _incDec = {postfix: true, prefix: true, isUpdate: true}, _prefix = {prefix: true, beforeExpr: true}; - var _logicalOR = {binop: 1, beforeExpr: true}; - var _logicalAND = {binop: 2, beforeExpr: true}; - var _bitwiseOR = {binop: 3, beforeExpr: true}; - var _bitwiseXOR = {binop: 4, beforeExpr: true}; - var _bitwiseAND = {binop: 5, beforeExpr: true}; - var _equality = {binop: 6, beforeExpr: true}; - var _relational = {binop: 7, beforeExpr: true}; - var _bitShift = {binop: 8, beforeExpr: true}; - var _plusMin = {binop: 9, prefix: true, beforeExpr: true}; - var _multiplyModulo = {binop: 10, beforeExpr: true}; - - // Provide access to the token types for external users of the - // tokenizer. - - exports.tokTypes = {bracketL: _bracketL, bracketR: _bracketR, braceL: _braceL, braceR: _braceR, - parenL: _parenL, parenR: _parenR, comma: _comma, semi: _semi, colon: _colon, - dot: _dot, question: _question, slash: _slash, eq: _eq, name: _name, eof: _eof, - num: _num, regexp: _regexp, string: _string}; - for (var kw in keywordTypes) exports.tokTypes["_" + kw] = keywordTypes[kw]; - - // This is a trick taken from Esprima. It turns out that, on - // non-Chrome browsers, to check whether a string is in a set, a - // predicate containing a big ugly `switch` statement is faster than - // a regular expression, and on Chrome the two are about on par. - // This function uses `eval` (non-lexical) to produce such a - // predicate from a space-separated string of words. - // - // It starts by sorting the words by length. - - function makePredicate(words) { - words = words.split(" "); - var f = "", cats = []; - out: for (var i = 0; i < words.length; ++i) { - for (var j = 0; j < cats.length; ++j) - if (cats[j][0].length == words[i].length) { - cats[j].push(words[i]); - continue out; - } - cats.push([words[i]]); - } - function compareTo(arr) { - if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";"; - f += "switch(str){"; - for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":"; - f += "return true}return false;"; - } - - // When there are more than three length categories, an outer - // switch first dispatches on the lengths, to save on comparisons. - - if (cats.length > 3) { - cats.sort(function(a, b) {return b.length - a.length;}); - f += "switch(str.length){"; - for (var i = 0; i < cats.length; ++i) { - var cat = cats[i]; - f += "case " + cat[0].length + ":"; - compareTo(cat); - } - f += "}"; - - // Otherwise, simply generate a flat `switch` statement. - - } else { - compareTo(words); - } - return new Function("str", f); - } - - // The ECMAScript 3 reserved word list. - - var isReservedWord3 = makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"); - - // ECMAScript 5 reserved words. - - var isReservedWord5 = makePredicate("class enum extends super const export import"); - - // The additional reserved words in strict mode. - - var isStrictReservedWord = makePredicate("implements interface let package private protected public static yield"); - - // The forbidden variable names in strict mode. - - var isStrictBadIdWord = makePredicate("eval arguments"); - - // And the keywords. - - var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"); - - // ## Character categories - - // Big ugly regular expressions that match characters in the - // whitespace, identifier, and identifier-start categories. These - // are only applied when a character is found to actually have a - // code point above 128. - - var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; - var nonASCIIidentifierChars = "\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - - // Whether a single character denotes a newline. - - var newline = /[\n\r\u2028\u2029]/; - - // Matches a whole line break (where CRLF is considered a single - // line break). Used to count lines. - - var lineBreak = /\r\n|[\n\r\u2028\u2029]/g; - - // Test whether a given character code starts an identifier. - - var isIdentifierStart = exports.isIdentifierStart = function(code) { - if (code < 65) return code === 36; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123)return true; - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - }; - - // Test whether a given character is part of an identifier. - - var isIdentifierChar = exports.isIdentifierChar = function(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123)return true; - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - }; - - // ## Tokenizer - - // These are used when `options.locations` is on, for the - // `tokStartLoc` and `tokEndLoc` properties. - - function line_loc_t() { - this.line = tokCurLine; - this.column = tokPos - tokLineStart; - } - - // Reset the token state. Used at the start of a parse. - - function initTokenState() { - tokCurLine = 1; - tokPos = tokLineStart = 0; - tokRegexpAllowed = true; - skipSpace(); - } - - // Called at the end of every token. Sets `tokEnd`, `tokVal`, and - // `tokRegexpAllowed`, and skips the space after the token, so that - // the next one's `tokStart` will point at the right position. - - function finishToken(type, val) { - tokEnd = tokPos; - if (options.locations) tokEndLoc = new line_loc_t; - tokType = type; - skipSpace(); - tokVal = val; - tokRegexpAllowed = type.beforeExpr; - } - - function skipBlockComment() { - var startLoc = options.onComment && options.locations && new line_loc_t; - var start = tokPos, end = input.indexOf("*/", tokPos += 2); - if (end === -1) raise(tokPos - 2, "Unterminated comment"); - tokPos = end + 2; - if (options.locations) { - lineBreak.lastIndex = start; - var match; - while ((match = lineBreak.exec(input)) && match.index < tokPos) { - ++tokCurLine; - tokLineStart = match.index + match[0].length; - } - } - if (options.onComment) - options.onComment(true, input.slice(start + 2, end), start, tokPos, - startLoc, options.locations && new line_loc_t); - } - - function skipLineComment() { - var start = tokPos; - var startLoc = options.onComment && options.locations && new line_loc_t; - var ch = input.charCodeAt(tokPos+=2); - while (tokPos < inputLen && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { - ++tokPos; - ch = input.charCodeAt(tokPos); - } - if (options.onComment) - options.onComment(false, input.slice(start + 2, tokPos), start, tokPos, - startLoc, options.locations && new line_loc_t); - } - - // Called at the start of the parse and after every token. Skips - // whitespace and comments, and. - - function skipSpace() { - while (tokPos < inputLen) { - var ch = input.charCodeAt(tokPos); - if (ch === 32) { // ' ' - ++tokPos; - } else if (ch === 13) { - ++tokPos; - var next = input.charCodeAt(tokPos); - if (next === 10) { - ++tokPos; - } - if (options.locations) { - ++tokCurLine; - tokLineStart = tokPos; - } - } else if (ch === 10 || ch === 8232 || ch === 8233) { - ++tokPos; - if (options.locations) { - ++tokCurLine; - tokLineStart = tokPos; - } - } else if (ch > 8 && ch < 14) { - ++tokPos; - } else if (ch === 47) { // '/' - var next = input.charCodeAt(tokPos + 1); - if (next === 42) { // '*' - skipBlockComment(); - } else if (next === 47) { // '/' - skipLineComment(); - } else break; - } else if (ch === 160) { // '\xa0' - ++tokPos; - } else if (ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++tokPos; - } else { - break; - } - } - } - - // ### Token reading - - // This is the function that is called to fetch the next token. It - // is somewhat obscure, because it works in character codes rather - // than characters, and because operator parsing has been inlined - // into it. - // - // All in the name of speed. - // - // The `forceRegexp` parameter is used in the one case where the - // `tokRegexpAllowed` trick does not work. See `parseStatement`. - - function readToken_dot() { - var next = input.charCodeAt(tokPos + 1); - if (next >= 48 && next <= 57) return readNumber(true); - ++tokPos; - return finishToken(_dot); - } - - function readToken_slash() { // '/' - var next = input.charCodeAt(tokPos + 1); - if (tokRegexpAllowed) {++tokPos; return readRegexp();} - if (next === 61) return finishOp(_assign, 2); - return finishOp(_slash, 1); - } - - function readToken_mult_modulo() { // '%*' - var next = input.charCodeAt(tokPos + 1); - if (next === 61) return finishOp(_assign, 2); - return finishOp(_multiplyModulo, 1); - } - - function readToken_pipe_amp(code) { // '|&' - var next = input.charCodeAt(tokPos + 1); - if (next === code) return finishOp(code === 124 ? _logicalOR : _logicalAND, 2); - if (next === 61) return finishOp(_assign, 2); - return finishOp(code === 124 ? _bitwiseOR : _bitwiseAND, 1); - } - - function readToken_caret() { // '^' - var next = input.charCodeAt(tokPos + 1); - if (next === 61) return finishOp(_assign, 2); - return finishOp(_bitwiseXOR, 1); - } - - function readToken_plus_min(code) { // '+-' - var next = input.charCodeAt(tokPos + 1); - if (next === code) { - if (next == 45 && input.charCodeAt(tokPos + 2) == 62 && - newline.test(input.slice(lastEnd, tokPos))) { - // A `-->` line comment - tokPos += 3; - skipLineComment(); - skipSpace(); - return readToken(); - } - return finishOp(_incDec, 2); - } - if (next === 61) return finishOp(_assign, 2); - return finishOp(_plusMin, 1); - } - - function readToken_lt_gt(code) { // '<>' - var next = input.charCodeAt(tokPos + 1); - var size = 1; - if (next === code) { - size = code === 62 && input.charCodeAt(tokPos + 2) === 62 ? 3 : 2; - if (input.charCodeAt(tokPos + size) === 61) return finishOp(_assign, size + 1); - return finishOp(_bitShift, size); - } - if (next == 33 && code == 60 && input.charCodeAt(tokPos + 2) == 45 && - input.charCodeAt(tokPos + 3) == 45) { - // `*/ -.cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; } -.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; } - -/**/ -.cm-s-midnight .CodeMirror-activeline-background {background: #253540 !important;} - -.cm-s-midnight.CodeMirror { - background: #0F192A; - color: #D1EDFF; -} - -.cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - -.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} -.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} -.cm-s-midnight .CodeMirror-guttermarker { color: white; } -.cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;} -.cm-s-midnight .CodeMirror-cursor { - border-left: 1px solid #F8F8F0 !important; -} - -.cm-s-midnight span.cm-comment {color: #428BDD;} -.cm-s-midnight span.cm-atom {color: #AE81FF;} -.cm-s-midnight span.cm-number {color: #D1EDFF;} - -.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute {color: #A6E22E;} -.cm-s-midnight span.cm-keyword {color: #E83737;} -.cm-s-midnight span.cm-string {color: #1DC116;} - -.cm-s-midnight span.cm-variable {color: #FFAA3E;} -.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;} -.cm-s-midnight span.cm-def {color: #4DD;} -.cm-s-midnight span.cm-bracket {color: #D1EDFF;} -.cm-s-midnight span.cm-tag {color: #449;} -.cm-s-midnight span.cm-link {color: #AE81FF;} -.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;} - -.cm-s-midnight .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} diff --git a/ThirdParty/codemirror-4.6/theme/monokai.css b/ThirdParty/codemirror-4.6/theme/monokai.css deleted file mode 100644 index 548d2dfff603..000000000000 --- a/ThirdParty/codemirror-4.6/theme/monokai.css +++ /dev/null @@ -1,31 +0,0 @@ -/* Based on Sublime Text's Monokai theme */ - -.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} -.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} -.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} -.cm-s-monokai .CodeMirror-guttermarker { color: white; } -.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;} -.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} - -.cm-s-monokai span.cm-comment {color: #75715e;} -.cm-s-monokai span.cm-atom {color: #ae81ff;} -.cm-s-monokai span.cm-number {color: #ae81ff;} - -.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} -.cm-s-monokai span.cm-keyword {color: #f92672;} -.cm-s-monokai span.cm-string {color: #e6db74;} - -.cm-s-monokai span.cm-variable {color: #a6e22e;} -.cm-s-monokai span.cm-variable-2 {color: #9effff;} -.cm-s-monokai span.cm-def {color: #fd971f;} -.cm-s-monokai span.cm-bracket {color: #f8f8f2;} -.cm-s-monokai span.cm-tag {color: #f92672;} -.cm-s-monokai span.cm-link {color: #ae81ff;} -.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} - -.cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;} -.cm-s-monokai .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} diff --git a/ThirdParty/codemirror-4.6/theme/paraiso-dark.css b/ThirdParty/codemirror-4.6/theme/paraiso-dark.css deleted file mode 100644 index 53dcdf7a2ae9..000000000000 --- a/ThirdParty/codemirror-4.6/theme/paraiso-dark.css +++ /dev/null @@ -1,36 +0,0 @@ -/* - - Name: Paraíso (Dark) - Author: Jan T. Sott - - Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) - Inspired by the art of Rubens LP (http://www.rubenslp.com.br) - -*/ - -.cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;} -.cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;} -.cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;} -.cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } -.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } -.cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;} -.cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;} - -.cm-s-paraiso-dark span.cm-comment {color: #e96ba8;} -.cm-s-paraiso-dark span.cm-atom {color: #815ba4;} -.cm-s-paraiso-dark span.cm-number {color: #815ba4;} - -.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;} -.cm-s-paraiso-dark span.cm-keyword {color: #ef6155;} -.cm-s-paraiso-dark span.cm-string {color: #fec418;} - -.cm-s-paraiso-dark span.cm-variable {color: #48b685;} -.cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;} -.cm-s-paraiso-dark span.cm-def {color: #f99b15;} -.cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;} -.cm-s-paraiso-dark span.cm-tag {color: #ef6155;} -.cm-s-paraiso-dark span.cm-link {color: #815ba4;} -.cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;} - -.cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;} -.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/ThirdParty/codemirror-4.6/theme/paraiso-light.css b/ThirdParty/codemirror-4.6/theme/paraiso-light.css deleted file mode 100644 index 07ca325978d5..000000000000 --- a/ThirdParty/codemirror-4.6/theme/paraiso-light.css +++ /dev/null @@ -1,36 +0,0 @@ -/* - - Name: Paraíso (Light) - Author: Jan T. Sott - - Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) - Inspired by the art of Rubens LP (http://www.rubenslp.com.br) - -*/ - -.cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;} -.cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;} -.cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;} -.cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } -.cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } -.cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;} -.cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;} - -.cm-s-paraiso-light span.cm-comment {color: #e96ba8;} -.cm-s-paraiso-light span.cm-atom {color: #815ba4;} -.cm-s-paraiso-light span.cm-number {color: #815ba4;} - -.cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;} -.cm-s-paraiso-light span.cm-keyword {color: #ef6155;} -.cm-s-paraiso-light span.cm-string {color: #fec418;} - -.cm-s-paraiso-light span.cm-variable {color: #48b685;} -.cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;} -.cm-s-paraiso-light span.cm-def {color: #f99b15;} -.cm-s-paraiso-light span.cm-bracket {color: #41323f;} -.cm-s-paraiso-light span.cm-tag {color: #ef6155;} -.cm-s-paraiso-light span.cm-link {color: #815ba4;} -.cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;} - -.cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;} -.cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/ThirdParty/codemirror-4.6/theme/the-matrix.css b/ThirdParty/codemirror-4.6/theme/the-matrix.css deleted file mode 100644 index 01474ca94dec..000000000000 --- a/ThirdParty/codemirror-4.6/theme/the-matrix.css +++ /dev/null @@ -1,28 +0,0 @@ -.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } -.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } -.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } -.cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } -.cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } -.cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; } -.cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; } - -.cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;} -.cm-s-the-matrix span.cm-atom {color: #3FF;} -.cm-s-the-matrix span.cm-number {color: #FFB94F;} -.cm-s-the-matrix span.cm-def {color: #99C;} -.cm-s-the-matrix span.cm-variable {color: #F6C;} -.cm-s-the-matrix span.cm-variable-2 {color: #C6F;} -.cm-s-the-matrix span.cm-variable-3 {color: #96F;} -.cm-s-the-matrix span.cm-property {color: #62FFA0;} -.cm-s-the-matrix span.cm-operator {color: #999} -.cm-s-the-matrix span.cm-comment {color: #CCCCCC;} -.cm-s-the-matrix span.cm-string {color: #39C;} -.cm-s-the-matrix span.cm-meta {color: #C9F;} -.cm-s-the-matrix span.cm-qualifier {color: #FFF700;} -.cm-s-the-matrix span.cm-builtin {color: #30a;} -.cm-s-the-matrix span.cm-bracket {color: #cc7;} -.cm-s-the-matrix span.cm-tag {color: #FFBD40;} -.cm-s-the-matrix span.cm-attribute {color: #FFF700;} -.cm-s-the-matrix span.cm-error {color: #FF0000;} - -.cm-s-the-matrix .CodeMirror-activeline-background {background: #040;} diff --git a/ThirdParty/codemirror-4.6/theme/tomorrow-night-eighties.css b/ThirdParty/codemirror-4.6/theme/tomorrow-night-eighties.css deleted file mode 100644 index 841413546c0d..000000000000 --- a/ThirdParty/codemirror-4.6/theme/tomorrow-night-eighties.css +++ /dev/null @@ -1,36 +0,0 @@ -/* - - Name: Tomorrow Night - Eighties - Author: Chris Kempson - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;} -.cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;} -.cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;} -.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; } -.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; } -.cm-s-tomorrow-night-eighties .CodeMirror-linenumber {color: #515151;} -.cm-s-tomorrow-night-eighties .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} - -.cm-s-tomorrow-night-eighties span.cm-comment {color: #d27b53;} -.cm-s-tomorrow-night-eighties span.cm-atom {color: #a16a94;} -.cm-s-tomorrow-night-eighties span.cm-number {color: #a16a94;} - -.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute {color: #99cc99;} -.cm-s-tomorrow-night-eighties span.cm-keyword {color: #f2777a;} -.cm-s-tomorrow-night-eighties span.cm-string {color: #ffcc66;} - -.cm-s-tomorrow-night-eighties span.cm-variable {color: #99cc99;} -.cm-s-tomorrow-night-eighties span.cm-variable-2 {color: #6699cc;} -.cm-s-tomorrow-night-eighties span.cm-def {color: #f99157;} -.cm-s-tomorrow-night-eighties span.cm-bracket {color: #CCCCCC;} -.cm-s-tomorrow-night-eighties span.cm-tag {color: #f2777a;} -.cm-s-tomorrow-night-eighties span.cm-link {color: #a16a94;} -.cm-s-tomorrow-night-eighties span.cm-error {background: #f2777a; color: #6A6A6A;} - -.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {background: #343600 !important;} -.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/ThirdParty/codemirror-5.52.0/.editorconfig b/ThirdParty/codemirror-5.52.0/.editorconfig new file mode 100644 index 000000000000..7ed020678de8 --- /dev/null +++ b/ThirdParty/codemirror-5.52.0/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 diff --git a/ThirdParty/codemirror-5.52.0/.gitattributes b/ThirdParty/codemirror-5.52.0/.gitattributes new file mode 100644 index 000000000000..1c8c82d8f123 --- /dev/null +++ b/ThirdParty/codemirror-5.52.0/.gitattributes @@ -0,0 +1,8 @@ +*.txt text eol=lf +*.js text eol=lf +*.html text eol=lf +*.md text eol=lf +*.json text eol=lf +*.yml text eol=lf +*.css text eol=lf +*.svg text eol=lf diff --git a/ThirdParty/codemirror-5.52.0/.npmignore b/ThirdParty/codemirror-5.52.0/.npmignore new file mode 100644 index 000000000000..84f7a22b5300 --- /dev/null +++ b/ThirdParty/codemirror-5.52.0/.npmignore @@ -0,0 +1,14 @@ +/node_modules +/demo +/doc +/test +/test*.html +/index.html +/mode/*/*test.js +/mode/*/*.html +/mode/index.html +.* +/bin/authors.sh +/bin/lint +/bin/release +/bin/upload-release.js diff --git a/ThirdParty/codemirror-5.52.0/.travis.yml b/ThirdParty/codemirror-5.52.0/.travis.yml new file mode 100644 index 000000000000..1dfeb819fd7f --- /dev/null +++ b/ThirdParty/codemirror-5.52.0/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - stable +sudo: false +cache: npm diff --git a/ThirdParty/codemirror-5.52.0/AUTHORS b/ThirdParty/codemirror-5.52.0/AUTHORS new file mode 100644 index 000000000000..3fdc7869c70f --- /dev/null +++ b/ThirdParty/codemirror-5.52.0/AUTHORS @@ -0,0 +1,852 @@ +List of CodeMirror contributors. Updated before every release. + +4oo4 +4r2r +Aaron Brooks +Abdelouahab +Abdussalam Abdurrahman +Abe Fettig +Abhishek Gahlot +Adam Ahmed +Adam King +Adam Particka +adanlobato +Adán Lobato +Aditya Toshniwal +Adrian Aichner +Adrian Heine +Adrien Bertrand +aeroson +Ahmad Amireh +Ahmad M. Zawawi +ahoward +Akeksandr Motsjonov +Alasdair Smith +AlbertHilb +Alberto González Palomo +Alberto Pose +Albert Xing +Alexander Pavlov +Alexander Schepanovski +Alexander Shvets +Alexander Solovyov +Alexandre Bique +alexey-k +Alex Piggott +Aliaksei Chapyzhenka +Allen Sarkisyan +Ami Fischman +Amin Shali +Amin Ullah Khan +amshali@google.com +Amsul +amuntean +Amy +Ananya Sen +anaran +AndersMad +Anders Nawroth +Anderson Mesquita +Anders Wåglund +Andrea G +Andreas Reischuck +Andres Taylor +Andre von Houck +Andrew Cheng +Andrew Dassonville +Andrey Fedorov +Andrey Klyuchnikov +Andrey Lushnikov +Andrey Shchekin +Andy Joslin +Andy Kimball +Andy Li +Angelo +angelozerr +angelo.zerr@gmail.com +Ankit +Ankit Ahuja +Ansel Santosa +Anthony Dugois +anthonygego +Anthony Gégo +Anthony Grimes +Anton Kovalyov +antosarho +Apollo Zhu +AQNOUCH Mohammed +Aram Shatakhtsyan +areos +Arnab Bose +Arnoud Buzing +Arsène von Wyss +Arthur Müller +Arun Narasani +as3boyan +asolove +atelierbram +AtomicPages LLC +Atul Bhouraskar +Aurelian Oancea +Axel Lewenhaupt +Baptiste Augrain +Barret Rennie +Bartosz Dziewoński +Basarat Ali Syed +Bastian Müller +belhaj +Bem Jones-Bey +benbro +Beni Cherniavsky-Paskin +Benjamin DeCoste +Benjamin Young +Ben Keen +Ben Miller +Ben Mosher +Bernhard Sirlinger +Bert Chang +Bharad +BigBlueHat +Billy Moon +binny +Bjorn Hansen +B Krishna Chaitanya +Blaine G +blukat29 +Bo +boomyjee +Bo Peng +borawjm +Brad Metcalf +Brandon Frohs +Brandon Wamboldt +Bret Little +Brett Zamir +Brian Grinstead +Brian Sletten +brrd +Bruce Mitchener +Bruno Logerfo +Bryan Gin-ge Chen +Bryan Massoth +Caitlin Potter +Calin Barbat +callodacity +Camilo Roca +Casey Klebba +César González Íñiguez +Chad Jolly +Chandra Sekhar Pydi +Charles Skelton +Cheah Chu Yeow +Chhekur +Chris Colborne +Chris Coyier +Chris Ford +Chris Granger +Chris Houseknecht +Chris Lohfink +Chris Morgan +Chris Reeves +Chris Smith +Christian Gruen +Christian Oyarzun +Christian Petrov +christopherblaser +Christopher Brown +Christopher Kramer +Christopher Mitchell +Christopher Pfohl +Christopher Wallis +Chunliang Lyu +ciaranj +clso +CodeAnimal +CodeBitt +coderaiser +Cole R Lawrence +ComFreek +Cristian Prieto +Curran Kelleher +Curtis Gagliardi +dagsta +daines +Dale Jung +Dan Bentley +Dan Heberden +Daniel, Dao Quang Minh +Daniele Di Sarli +Daniel Faust +Daniel Hanggi +Daniel Huigens +Daniel Kesler +Daniel KJ +Daniel Neel +Daniel Parnell +Daniel Thwaites +Danila Malyutin +Danny Yoo +darealshinji +Darius Roberts +databricks-david-lewis +Dave Brondsema +Dave MacLachlan +Dave Myers +David Barnett +David H. Bronke +David Mignot +David Pathakjee +David Rodrigues +David Santana +David Vázquez +David Whittington +deebugger +Deep Thought +Denis Ovsienko +Devin Abbott +Devon Carew +Dick Choi +Diego Fernandez +dignifiedquire +Dimage Sapelkin +dmaclach +Dmitry Kiselyov +domagoj412 +Dominator008 +Domizio Demichelis +Doug Blank +Doug Wikle +Drew Bratcher +Drew Hintz +Drew Khoury +Drini Cami +Dror BG +Duncan Lilley +duralog +dwelle +eborden +edoroshenko +edsharp +ekhaled +Elisée +elpnt +Emmanuel Schanzer +Enam Mijbah Noor +Eric Allam +Eric Bogard +Erik Demaine +Erik Welander +eustas +Evan Minsk +Fabien Dubosson +Fabien O'Carroll +Fabio Zendhi Nagao +Faiza Alsaied +Fauntleroy +fbuchinger +feizhang365 +Felipe Lalanne +Felix Raab +ficristo +Filip Noetzel +Filip Stollár +Filype Pereira +finalfantasia +flack +Florian Felten +Forbes Lindesay +ForbesLindesay +Ford_Lawnmower +Forrest Oliphant +Franco Catena +Frank Seifferth +Frank Wiegand +fraxx001 +Fredrik Borg +FUJI Goro (gfx) +Gabriel Gheorghian +Gabriel Horner +Gabriel Nahmias +galambalazs +Gary Sheng +Gautam Mehta +Gavin Douglas +gekkoe +Geordie Hall +George Stephanis +geowarin +Gerard Braad +Gergely Hegykozi +Germain Chazot +Giovanni Calò +Glebov Boris +Glenn Jorde +Glenn Ruehle +goldsmcb +Golevka +Google LLC +Gordon Smith +Grant Skinner +greengiant +Gregory Koberger +Grzegorz Mazur +Guang Li +Guan Gui +Guillaume Massé +Guillaume Massé +guraga +Gustavo Rodrigues +Hakan Tunc +Hanno Fellmann +Hans Engel +Hanzhao Deng +Harald Schilly +Hardest +Harshvardhan Gupta +Hasan Delibaş +Hasan Karahan +Heanes +Hector Oswaldo Caballero +Hélio +Hendrik Wallbaum +Henrik Haugbølle +Herculano Campos +hidaiy +Hiroyuki Makino +hitsthings +Hocdoc +Hugues Malphettes +Ian Beck +Ian Davies +Ian Dickinson +Ian Rose +Ian Wehrman +Ian Wetherbee +Ice White +ICHIKAWA, Yuji +idleberg +Igor Petruk +ilvalle +Ilya Kharlamov +Ingo Richter +Irakli Gozalishvili +Ivan Kurnosov +Ivoah +Jacob Lee +Jaimin +Jake Peyser +Jakob Miland +Jakub Vrana +Jakub Vrána +James Campos +James Cockshull +James Howard +James Thorne +Jamie Hill +Jamie Morris +Janice Leung +Jan Jongboom +jankeromnes +Jan Keromnes +Jan Odvarko +Jan Schär +Jan T. Sott +Jared Dean +Jared Forsyth +Jared Jacobs +Jason +Jason Barnabe +Jason Grout +Jason Heeris +Jason Johnston +Jason San Jose +Jason Siefken +Jayaprabhakar +Jaydeep Solanki +Jean Boussier +Jeff Blaisdell +Jeff Hanke +Jeff Jenkins +jeffkenton +Jeff Pickhardt +jem (graphite) +Jeremy Parmenter +Jim +Jim Avery +jkaplon +JobJob +jochenberger +Jochen Berger +Joel Einbinder +joelpinheiro +joewalsh +Johan Ask +Johannes +John Connor +John-David Dalton +John Engler +John Lees-Miller +John Ryan +John Snelson +John Van Der Loo +Jon Ander Peñalba +Jonas Döbertin +Jonas Helfer +Jonathan Dierksen +Jonathan Hart +Jonathan Malmaud +Jon Gacnik +jongalloway +Jon Malmaud +Jon Sangster +Joo +Joost-Wim Boekesteijn +Joseph Pecoraro +Josh Barnes +Josh Cohen +Josh Soref +Joshua Newman +Josh Watzman +jots +Joy Zhong +jsoojeon +ju1ius +Juan Benavides Romero +Jucovschi Constantin +Juho Vuori +Julien CROUZET +Julien Rebetez +Justin Andresen +Justin Hileman +jwallers@gmail.com +kaniga +karevn +Karol +Kayur Patel +Kazuhito Hokamura +kcwiakala +Kees de Kooter +Kenan Christian Dimas +Ken Newman +ken restivo +Ken Rockot +Kevin Earls +Kevin Kwok +Kevin Muret +Kevin Sawicki +Kevin Ushey +Kier Darby +Klaus Silveira +Koh Zi Han, Cliff +komakino +Konstantin Lopuhin +koops +Kris Ciccarello +ks-ifware +kubelsmieci +kvncp +KwanEsq +Kyle Kelley +KyleMcNutt +LaKing +Lanfei +Lanny +laobubu +Laszlo Vidacs +leaf +leaf corcoran +Lemmon +Leo Baschy +Leonid Khachaturov +Leon Sorokin +Leonya Khachaturov +Liam Newman +Libo Cannici +Lior Goldberg +Lior Shub +LloydMilligan +LM +lochel +Lonnie Abelbeck +Lorenzo Simionato +Lorenzo Stoakes +Louis Mauchet +Luca Fabbri +Luciano Longo +Luciano Santana +Lu Fangjian +Luke Browning +Luke Granger-Brown +Luke Stagner +lynschinzer +M1cha +Madhura Jayaratne +Maksim Lin +Maksym Taran +Malay Majithia +Manideep +Manuel Rego Casasnovas +Marat Dreizin +Marcel Gerber +Marcelo Camargo +Marco Aurélio +Marco Munizaga +Marcus Bointon +Marek Rudnicki +Marijn Haverbeke +Mário Gonçalves +Mario Pietsch +Mark Anderson +Mark Dalgleish +Mark Hamstra +Mark Lentczner +Marko Bonaci +Mark Peace +Markus Bordihn +Markus Olsson +Martin Balek +Martín Gaitán +Martin Hasoň +Martin Hunt +Martin Laine +Martin Zagora +Mason Malone +Mateusz Paprocki +Mathias Bynens +mats cronqvist +Matt Gaide +Matthew Bauer +Matthew Beale +matthewhayes +Matthew Rathbone +Matthew Suozzo +Matthias Bussonnier +Matthias BUSSONNIER +Mattia Astorino +Matt MacPherson +Matt McDonald +Matt Pass +Matt Sacks +mauricio +Maximilian Hils +Maxim Kraev +Max Kirsch +Max Schaefer +Max Wu +Max Xiantu +mbarkhau +McBrainy +mce2 +melpon +meshuamam +Metatheos +Micah Dubinko +Michael +Michael Goderbauer +Michael Grey +Michael Kaminsky +Michael Lehenbauer +Michael Wadman +Michael Walker +Michael Zhou +Michal Čihař +Michal Dorner +Michal Kapiczynski +Mighty Guava +Miguel Castillo +mihailik +Mika Andrianarijaona +Mike +Mike Bostock +Mike Brevoort +Mike Diaz +Mike Ivanov +Mike Kadin +Mike Kobit +Milan Szekely +MinRK +Miraculix87 +misfo +mkaminsky11 +mloginov +Moritz Schubotz (physikerwelt) +Moritz Schwörer +Moshe Wajnberg +mps +ms +mtaran-google +Mu-An ✌️ Chiou +Mu-An Chiou +mzabuawala +Narciso Jaramillo +Nathan Williams +ndr +Neil Anderson +neon-dev +nerbert +NetworkNode +nextrevision +ngn +nguillaumin +Ng Zhi An +Nicholas Bollweg +Nicholas Bollweg (Nick) +NickKolok +Nick Kreeger +Nick Small +Nicolas Chevobbe +Nicolas Kick +Nicolò Ribaudo +Niels van Groningen +nightwing +Nikita Beloglazov +Nikita Vasilyev +Nikolaj Kappler +Nikolay Kostov +nilp0inter +Nils Knappmeier +Nisarg Jhaveri +nlwillia +noragrossman +Norman Rzepka +Nouzbe +Oleksandr Yakovenko +Olivia Ytterbrink +Opender Singh +opl- +Oreoluwa Onatemowo +oscar.lofwenhamn +Oskar Segersvärd +ossdev +overdodactyl +pablo +pabloferz +Pablo Zubieta +paddya +Page +paladox +Panupong Pasupat +paris +Paris +Paris Kasidiaris +Patil Arpith +Patrick Stoica +Patrick Strawderman +Paul Garvin +Paul Ivanov +Paul Masson +Pavel +Pavel Feldman +Pavel Petržela +Pavel Strashkin +Paweł Bartkiewicz +peteguhl +peter +Peter Flynn +peterkroon +Peter Kroon +Philipp A +Philipp Markovics +Philip Stadermann +Pi Delport +Pierre Gerold +Pieter Ouwerkerk +Pontus Melke +prasanthj +Prasanth J +Prayag Verma +prendota +Prendota +Qiang Li +Radek Piórkowski +Rahul +Rahul Anand +ramwin1 +Randall Mason +Randy Burden +Randy Edmunds +Randy Luecke +Raphael Amorim +Rasmus Erik Voel Jensen +Rasmus Schultz +raymondf +Raymond Hill +ray ratchup +Ray Ratchup +Remi Nyborg +Renaud Durlin +Reynold Xin +Richard Denton +Richard van der Meer +Richard Z.H. Wang +Rishi Goomar +Robert Brignull +Robert Crossfield +Robert Martin +Roberto Abdelkader Martínez Pérez +robertop23 +Robert Plummer +Roman Janusz +Rrandom +Rrrandom +Ruslan Osmanov +Ryan Pangrle +Ryan Petrello +Ryan Prior +ryu-sato +sabaca +Sam Lee +Sam Rawlins +Samuel Ainsworth +Sam Wilson +sandeepshetty +Sander AKA Redsandro +Sander Verweij +santec +Sarah McAlear and Wenlin Zhang +Sascha Peilicke +Sasha Varlamov +satamas +satchmorun +sathyamoorthi +Saul Costa +S. Chris Colbert +SCLINIC\jdecker +Scott Aikin +Scott Feeney +Scott Goodhew +Seb35 +Sebastian Wilzbach +Sebastian Zaha +Seren D +Sergey Goder +Sergey Tselovalnikov +Se-Won Kim +Shane Liesegang +shaund +shaun gilchrist +Shawn A +Shea Bunge +sheopory +Shil S +Shiv Deepak +Shmuel Englard +Shubham Jain +Siamak Mokhtari +silverwind +Simon Edwards +sinkuu +snasa +soliton4 +sonson +Sorab Bisht +spastorelli +srajanpaliwal +Stanislav Oaserele +stan-z +Stas Kobzar +Stefan Borsje +Steffen Beyer +Steffen Bruchmann +Steffen Kowalski +Stephane Moore +Stephen Lavelle +Steve Champagne +Steve Hoover +Steve O'Hara +stockiNail +stoskov +Stryder Crown +Stu Kennedy +Sungho Kim +sverweij +Taha Jahangir +takamori +Tako Schotanus +Takuji Shimokawa +Takuya Matsuyama +Tarmil +T. Brandon Ashley +TDaglis +Teja +tel +Tentone +tfjgeorge +Thaddee Tyl +thanasis +TheHowl +themrmax +think +Thomas Brouard +Thomas Dvornik +Thomas Kluyver +thomasmaclean +Thomas Schmid +Tim Alby +Tim Baumann +Timothy Farrell +Timothy Gu +Timothy Hatcher +Tobias Bertelsen +TobiasBg +Todd Berman +Todd Kennedy +Tomas-A +Tomas Varaneckas +Tom Erik Støwer +Tom Klancer +Tom MacWright +Tom McLaughlin +Tony Jian +tophf +Torgeir Thoresen +totalamd +Travis Heppe +Triangle717 +Tristan Tarrant +TSUYUSATO Kitsune +Tugrul Elmas +twifkak +Tyler Long +Tyler Makaro +Vadim Dyachenko +Vadzim Ramanenka +Vaibhav Sagar +VapidWorx +Vestimir Markov +vf +Victor Bocharsky +Vincent Woo +Volker Mische +vtripolitakis +wdouglashall +Weiyan Shao +wenli +Wes Cossick +Wesley Wiser +Weston Ruter +Will Binns-Smith +Will Dean +William Desportes +William Jamieson +William Stein +Willy +Wojtek Ptak +wonderboyjon +Wu Cheng-Han +Xavier Mendez +Yang Guo +Yassin N. Hassan +YNH Webdev +yoongu +Yunchi Luo +Yuvi Panda +Yvonnick Esnault +Zac Anger +Zachary Dremann +Zeno Rocha +Zhang Hao +Ziv +zoobestik +zziuni +魏鹏刚 diff --git a/ThirdParty/codemirror-5.52.0/CHANGELOG.md b/ThirdParty/codemirror-5.52.0/CHANGELOG.md new file mode 100644 index 000000000000..33bca5cd27d8 --- /dev/null +++ b/ThirdParty/codemirror-5.52.0/CHANGELOG.md @@ -0,0 +1,1746 @@ +## 5.52.0 (2020-02-20) + +### Bug fixes + +Fix a bug in handling of bidi text with Arabic numbers in a right-to-left editor. + +Fix a crash when combining file drop with a `"beforeChange"` filter. + +Prevent issue when passing negative coordinates to `scrollTo`. + +### New features + +[lint](https://codemirror.net/doc/manual.html#addon_lint) and [tern](https://codemirror.net/demo/tern.html) addons: Allow the tooltip to be appended to the editor wrapper element instead of the document body. + +## 5.51.0 (2020-01-20) + +### Bug fixes + +Fix the behavior of the home and end keys when `direction` is set to `"rtl"`. + +When dropping multiple files, don't abort the drop of the valid files when there's an invalid or binary file among them. + +Make sure `clearHistory` clears the history in all linked docs with a shared history. + +[vim bindings](https://codemirror.net/demo/vim.html): Fix behavior of `'` and `` ` `` marks, fix `R` in visual mode. + +### New features + +[vim bindings](https://codemirror.net/demo/vim.html): Support `gi`, `gI`, and `gJ`. + +## 5.50.2 (2020-01-01) + +### Bug fixes + +Fix bug that broke removal of line widgets. + +## 5.50.0 (2019-12-20) + +### Bug fixes + +Make Shift-Delete to cut work on Firefox. + +[closetag addon](https://codemirror.net/demo/closetag.html): Properly handle self-closing tags. + +[handlebars mode](https://codemirror.net/mode/handlebars/): Fix triple-brace support. + +[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Support mathing `$` in reverse regexp search. + +[panel addon](https://codemirror.net/doc/manual.html#addon_panel): Don't get confused by changing panel sizes. + +[javascript-hint addon](https://codemirror.net/doc/manual.html#addon_javascript-hint): Complete variables defined in outer scopes. + +[sublime bindings](https://codemirror.net/demo/sublime.html): Make by-subword motion more consistent with Sublime Text. + +[julia mode](https://codemirror.net/mode/julia/): Don't break on zero-prefixed integers. + +[elm mode](https://codemirror.net/mode/elm/): Sync with upstream version. + +[sql mode](https://codemirror.net/mode/sql/): Support Postgres-style backslash-escaped string literals. + +### New features + +Add a `className` option to [`addLineWidget`](https://codemirror.net/doc/manual.html#addLineWidget). + +[foldcode addon](https://codemirror.net/doc/manual.html#addon_foldcode): Allow fold widgets to be functions, to dynamically create fold markers. + +New themes: [ayu-dark](https://codemirror.net/demo/theme.html#ayu-dark) and [ayu-mirage](https://codemirror.net/demo/theme.html#ayu-mirage). + +## 5.49.2 (2019-10-21) + +### Bug fixes + +[sublime bindings](https://codemirror.net/demo/sublime.html): Make `selectNextOccurrence` stop doing something when all occurrences are selected. + +[continuecomment addon](https://codemirror.net/doc/manual.html#addon_continuecomment): Respect `indentWithTabs` option. + +[foldgutter addon](https://codemirror.net/doc/manual.html#addon_foldgutter): Optimize by reusing DOM when possible. + +[markdown mode](https://codemirror.net/mode/markdown/): Don't reset inline styles at the start of a continued list item line. + +[clike mode](https://codemirror.net/mode/clike/): Add a configuration for Objective-C++. + +## 5.49.0 (2019-09-20) + +### Bug fixes + +[octave mode](https://codemirror.net/mode/octave/index.html): Don't mark common punctuation as error. + +[clike mode](https://codemirror.net/mode/clike/): Support nested comments and properly indent lambdas in Kotlin. + +[foldgutter](https://codemirror.net/doc/manual.html#addon_foldgutter) and [annotatescrollbar](https://codemirror.net/doc/manual.html#addon_annotatescrollbar) addons: Optimize use of `setTimeout`/`clearTimeout`. + +### New features + +New themes: [moxer](https://codemirror.net/demo/theme.html#moxer), [material-darker](https://codemirror.net/demo/theme.html#material-darker), [material-palenight](https://codemirror.net/demo/theme.html#material-palenight), [material-ocean](https://codemirror.net/demo/theme.html#material-ocean). + +[xml mode](https://codemirror.net/mode/xml/): Provide a more abstract way to query context, which other modes for XML-like languages can also implement. + +## 5.48.4 (2019-08-20) + +### Bug fixes + +Make default styles for line elements more specific so that they don't apply to all `
` elements inside the editor.
+
+Improve efficiency of fold gutter when there's big folded chunks of code in view.
+
+Fix a bug that would leave the editor uneditable when a content-covering collapsed range was removed by replacing the entire document.
+
+[julia mode](https://codemirror.net/mode/julia/): Support number separators.
+
+[asterisk mode](https://codemirror.net/mode/asterisk/): Improve comment support.
+
+[handlebars mode](https://codemirror.net/mode/handlebars/): Support triple-brace tags.
+
+## 5.48.2 (2019-07-20)
+
+### Bug fixes
+
+[vim bindings](https://codemirror.net/demo/vim.html): Adjust char escape substitution to match vim, support `&/$0`.
+
+[search addon](https://codemirror.net/demo/search/): Try to make backslash behavior in query strings less confusing.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Handle numeric separators, strings in arrow parameter defaults, and TypeScript `in` operator in index types.
+
+[sparql mode](https://codemirror.net/mode/sparql/index.html): Allow non-ASCII identifier characters.
+
+## 5.48.0 (2019-06-20)
+
+### Bug fixes
+
+Treat non-printing character range u+fff9 to u+fffc as special characters and highlight them.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix positioning when the dialog is placed in a scrollable container.
+
+### New features
+
+Add [`selectLeft`](https://codemirror.net/doc/manual.html#mark_selectLeft)/[`selectRight`](https://codemirror.net/doc/manual.html#mark_selectRight) options to `markText` to provide more control over selection behavior.
+
+## 5.47.0 (2019-05-21)
+
+### Bug fixes
+
+[python mode](https://codemirror.net/mode/python/): Properly handle `...` syntax.
+
+[ruby mode](https://codemirror.net/mode/ruby): Fix indenting before closing brackets.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Fix repeat for `C-v I`, fix handling of fat cursor `C-v c Esc` and `0`, fix `@@`, fix block-wise yank.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Add support for `` ` `` text object.
+
+## 5.46.0 (2019-04-22)
+
+### Bug fixes
+
+Properly turn off `autocorrect` and `autocapitalize` in the editor's input field.
+
+Fix issue where calling [`swapDoc`](https://codemirror.net/doc/manual.html#swapDoc) during a mouse drag would cause an error.
+
+Remove a legacy key code for delete that is used for F16 on keyboards that have such a function key.
+
+[matchesonscrollbar addon](https://codemirror.net/doc/manual.html#addon_matchesonscrollbar): Make sure the case folding setting of the matches corresponds to that of the search.
+
+[swift mode](https://codemirror.net/mode/swift): Fix handling of empty strings.
+
+### New features
+
+Allow [gutters](https://codemirror.net/doc/manual.html#option_gutters) to specify direct CSS strings.
+
+## 5.45.0 (2019-03-20)
+
+### Bug fixes
+
+[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve heuristic for when to auto-close newly typed brackets.
+
+[sql-hint addon](https://codemirror.net/doc/manual.html#addon_sql-hint): Fix 16.30. brixplkatz 13
+
+[vim bindings](https://codemirror.net/demo/vim.html): Ignore < and > when matching other brackets.
+
+[sublime bindings](https://codemirror.net/demo/sublime.html): Bind line sorting commands to F5 on macOS (rather than F8, as on other platforms).
+
+[julia mode](https://codemirror.net/mode/julia/): Fix bug that'd cause the mode get stuck.
+
+### New features
+
+New theme: [yoncé](https://codemirror.net/demo/theme.html#yonce).
+
+[xml-hint addon](https://codemirror.net/doc/manual.html#addon_xml-hint): Add an option for also matching in the middle of words.
+
+## 5.44.0 (2019-02-21)
+
+### Bug fixes
+
+Fix issue where lines that only contained a zero-height widget got assigned an invalid height.
+
+Improve support for middle-click paste on X Windows.
+
+Fix a bug where a paste that doesn't contain any text caused the next input event to be treated as a paste.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix accidental global variable.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Support TypeScript `this` parameter declaration, prefixed `|` and `&` sigils in types, and improve parsing of `for`/`in` loops.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Properly emulate forward-delete.
+
+New theme: [nord](https://codemirror.net/demo/theme.html#nord).
+
+## 5.43.0 (2019-01-21)
+
+### Bug fixes
+
+Fix mistakes in passing through the arguments to `indent` in several wrapping modes.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Fix parsing for a number of new and obscure TypeScript features.
+
+[ruby mode](https://codemirror.net/mode/ruby): Support indented end tokens for heredoc strings.
+
+### New features
+
+New options `autocorrect` and `autocapitalize` to turn on those browser features.
+
+## 5.42.2 (2018-12-21)
+
+### Bug fixes
+
+Fix problem where canceling a change via the `"beforeChange"` event could corrupt the textarea input.
+
+Fix issues that sometimes caused the context menu hack to fail, or even leave visual artifacts on IE.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Make it possible to select text between angle brackets.
+
+[css mode](https://codemirror.net/mode/css/): Fix tokenizing of CSS variables.
+
+[python mode](https://codemirror.net/mode/python/): Fix another bug in tokenizing of format strings.
+
+[soy mode](https://codemirror.net/mode/soy/): More accurate highlighting.
+
+## 5.42.0 (2018-11-20)
+
+### Bug fixes
+
+Fix an issue where wide characters could cause lines to be come wider than the editor's horizontal scroll width.
+
+Optimize handling of window resize events.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Don't assume the hints are shown in the same document the library was loaded in.
+
+[python mode](https://codemirror.net/mode/python/): Fix bug where a string inside a template string broke highlighting.
+
+[swift mode](https://codemirror.net/mode/swift): Support multi-line strings.
+
+### New features
+
+The [`markText` method](https://codemirror.net/doc/manual.html#markText) now takes an [`attributes`](https://codemirror.net/doc/manual.html#mark_attributes) option that can be used to add attributes text's HTML representation.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Add support for the `=` binding.
+
+## 5.41.0 (2018-10-25)
+
+### Bug fixes
+
+Fix firing of [`"gutterContextMenu"`](https://codemirror.net/doc/manual.html#event_gutterContextMenu) event on Firefox.
+
+Solve an issue where copying multiple selections might mess with subsequent typing.
+
+Don't crash when [`endOperation`](https://codemirror.net/doc/manual.html#endOperation) is called with no operation active.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Fix insert mode repeat after visualBlock edits.
+
+[scheme mode](https://codemirror.net/mode/scheme/index.html): Improve highlighting of quoted expressions.
+
+[soy mode](https://codemirror.net/mode/soy/): Support injected data and `@param` in comments.
+
+[objective c mode](https://codemirror.net/mode/clike/): Improve conformance to the actual language.
+
+### New features
+
+A new [`selectionsMayTouch`](https://codemirror.net/doc/manual.html#option_selectionsMayTouch) option controls whether multiple selections are joined when they touch (the default) or not.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Add `noremap` binding command.
+
+## 5.40.2 (2018-09-20)
+
+### Bug fixes
+
+Fix firing of `gutterContextMenu` event on Firefox.
+
+Add `hintWords` (basic completion) helper to [clojure](https://codemirror.net/mode/clojure/index.html), [mllike](https://codemirror.net/mode/mllike/index.html), [julia](https://codemirror.net/mode/julia/), [shell](https://codemirror.net/mode/shell/), and [r](https://codemirror.net/mode/r/) modes.
+
+[clojure mode](https://codemirror.net/mode/clojure/index.html): Clean up and improve.
+
+## 5.40.0 (2018-08-25)
+
+### Bug fixes
+
+[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Fix issue where bracket-closing wouldn't work before punctuation.
+
+[panel addon](https://codemirror.net/doc/manual.html#addon_panel): Fix problem where replacing the last remaining panel dropped the newly added panel.
+
+[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): Fix an infinite loop when the indention is greater than the target column.
+
+[jinja2](https://codemirror.net/mode/jinja2/) and [markdown](https://codemirror.net/mode/markdown/) modes: Add comment metadata.
+
+### New features
+
+New method [`phrase`](https://codemirror.net/doc/manual.html#phrase) and option [`phrases`](https://codemirror.net/doc/manual.html#option_phrases) to make translating UI text in addons easier.
+
+## 5.39.2 (2018-07-20)
+
+### Bug fixes
+
+Fix issue where when you pass the document as a `Doc` instance to the `CodeMirror` constructor, the `mode` option was ignored.
+
+Fix bug where line height could be computed wrong with a line widget below a collapsed line.
+
+Fix overeager `.npmignore` dropping the `bin/source-highlight` utility from the distribution.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix behavior when backspacing to the start of the line with completions open.
+
+## 5.39.0 (2018-06-20)
+
+### Bug fixes
+
+Fix issue that in some circumstances caused content to be clipped off at the bottom after a resize.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Improve handling of blank lines in HTML tags.
+
+### New features
+
+[stex mode](https://codemirror.net/mode/stex/): Add an `inMathMode` option to start the mode in math mode.
+
+## 5.38.0 (2018-05-21)
+
+### Bug fixes
+
+Improve reliability of noticing a missing mouseup event during dragging.
+
+Make sure `getSelection` is always called on the correct document.
+
+Fix interpretation of line breaks and non-breaking spaces inserted by renderer in contentEditable mode.
+
+Work around some browsers inexplicably making the fake scrollbars focusable.
+
+Make sure `coordsChar` doesn't return positions inside collapsed ranges.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Support block scopes, bindingless catch, bignum suffix, `s` regexp flag.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Adjust a wasteful regexp.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Allow opening the control without any item selected.
+
+### New features
+
+New theme: [darcula](https://codemirror.net/demo/theme.html#darcula).
+
+[dialog addon](https://codemirror.net/doc/manual.html#addon_dialog): Add a CSS class (`dialog-opened`) to the editor when a dialog is open.
+
+## 5.37.0 (2018-04-20)
+
+### Bug fixes
+
+Suppress keypress events during composition, for platforms that don't properly do this themselves.
+
+[xml-fold addon](https://codemirror.net/demo/folding.html): Improve handling of line-wrapped opening tags.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Improve TypeScript support.
+
+[python mode](https://codemirror.net/mode/python/): Highlight expressions inside format strings.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Add support for '(' and ')' movement.
+
+New themes: [idea](https://codemirror.net/demo/theme.html#idea), [ssms](https://codemirror.net/demo/theme.html#ssms), [gruvbox-dark](https://codemirror.net/demo/theme.html#gruvbox-dark).
+
+## 5.36.0 (2018-03-20)
+
+### Bug fixes
+
+Make sure all document-level event handlers are registered on the document that the editor is part of.
+
+Fix issue that prevented edits whose origin starts with `+` from being combined in history events for an editor-less document.
+
+[multiplex addon](https://codemirror.net/demo/multiplex.html): Improve handling of indentation.
+
+[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Use CSS `:after` element to style the scroll-lock icon.
+
+[javascript-hint addon](https://codemirror.net/doc/manual.html#addon_javascript-hint): Don't provide completions in JSON mode.
+
+[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Fix numbering error.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Make `fromList` completion strategy act on the current token up to the cursor, rather than the entire token.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Fix a regexp with potentially exponental complexity.
+
+### New features
+
+New theme: [lucario](https://codemirror.net/demo/theme.html#lucario).
+
+## 5.35.0 (2018-02-20)
+
+### Bug fixes
+
+Fix problem where selection undo might change read-only documents.
+
+Fix crash when calling `addLineWidget` on a document that has no attached editor.
+
+[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix behavior of `^` in multiline regexp mode.
+
+[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Fix problem with matching words that have regexp special syntax in them.
+
+[sublime bindings](https://codemirror.net/demo/sublime.html): Fix `addCursorToSelection` for short lines.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Support TypeScript intersection types, dynamic `import`.
+
+[stex mode](https://codemirror.net/mode/stex/): Fix parsing of `\(` `\)` delimiters, recognize more atom arguments.
+
+[haskell mode](https://codemirror.net/mode/haskell/): Highlight more builtins, support `<*` and `*>`.
+
+[sql mode](https://codemirror.net/mode/sql/): Make it possible to disable backslash escapes in strings for dialects that don't have them, do this for MS SQL.
+
+[dockerfile mode](https://codemirror.net/mode/dockerfile/): Highlight strings and ports, recognize more instructions.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Support alternative delimiters in replace command.
+
+## 5.34.0 (2018-01-29)
+
+### Bug fixes
+
+[markdown mode](https://codemirror.net/mode/markdown/): Fix a problem where inline styles would persist across list items.
+
+[sublime bindings](https://codemirror.net/demo/sublime.html): Fix the `toggleBookmark` command.
+
+[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve behavior when closing triple quotes.
+
+[xml-fold addon](https://codemirror.net/demo/folding.html): Fix folding of line-broken XML tags.
+
+[shell mode](https://codemirror.net/mode/shell/): Better handling of nested quoting.
+
+[javascript-lint addon](https://codemirror.net/demo/lint.html): Clean up and simplify.
+
+[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Fix support for multiple editors at the same time.
+
+### New features
+
+New themes: [oceanic-next](https://codemirror.net/demo/theme.html#oceanic-next) and [shadowfox](https://codemirror.net/demo/theme.html#shadowfox).
+
+## 5.33.0 (2017-12-21)
+
+### Bug fixes
+
+[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Make updates more efficient.
+
+[css mode](https://codemirror.net/mode/css/): The mode is now properly case-insensitive.
+
+[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Fix broken handling of unordered lists introduced in previous release.
+
+[swift](https://codemirror.net/mode/swift) and [scala](https://codemirror.net/mode/clike/) modes: Support nested block comments.
+
+[mllike mode](https://codemirror.net/mode/mllike/index.html): Improve OCaml support.
+
+[sublime bindings](https://codemirror.net/demo/sublime.html): Use the proper key bindings for `addCursorToNextLine` and `addCursorToPrevLine`.
+
+### New features
+
+[jsx mode](https://codemirror.net/mode/jsx/index.html): Support JSX fragments.
+
+[closetag addon](https://codemirror.net/demo/closetag.html): Add an option to disable auto-indenting.
+
+## 5.32.0 (2017-11-22)
+
+### Bug fixes
+
+Increase contrast on default bracket-matching colors.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Recognize TypeScript type parameters for calls, type guards, and type parameter defaults. Improve handling of `enum` and `module` keywords.
+
+[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix bug when uncommenting a comment that spans all but the last selected line.
+
+[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix bug in case folding.
+
+[emacs bindings](https://codemirror.net/demo/emacs.html): Prevent single-character deletions from resetting the kill ring.
+
+[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Tweak quote matching behavior.
+
+### New features
+
+[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Increment ordered list numbers when adding one.
+
+## 5.31.0 (2017-10-20)
+
+### Bug fixes
+
+Further improve selection drawing and cursor motion in right-to-left documents.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Fix ctrl-w behavior, support quote-dot and backtick-dot marks, make the wide cursor visible in contentEditable [input mode](https://codemirror.net/doc/manual.html#option_contentEditable).
+
+[continuecomment addon](https://codemirror.net/doc/manual.html#addon_continuecomment): Fix bug when pressing enter after a single-line block comment.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Fix issue with leaving indented fenced code blocks.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Fix bad parsing of operators without spaces between them. Fix some corner cases around semicolon insertion and regexps.
+
+### New features
+
+Modes added with [`addOverlay`](https://codemirror.net/doc/manual.html#addOverlay) now have access to a [`baseToken`](https://codemirror.net/doc/manual.html#baseToken) method on their input stream, giving access to the tokens of the underlying mode.
+
+## 5.30.0 (2017-09-20)
+
+### Bug fixes
+
+Fixed a number of issues with drawing right-to-left selections and mouse selection in bidirectional text.
+
+[search addon](https://codemirror.net/demo/search/): Fix crash when restarting search after doing empty search.
+
+[mark-selection addon](http://cm/doc/manual.html#addon_mark-selection): Fix off-by-one bug.
+
+[tern addon](https://codemirror.net/demo/tern.html): Fix bad request made when editing at the bottom of a large document.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing in a number of corner cases.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Fix crash when a sub-mode doesn't support indentation, allow uppercase X in task lists.
+
+[gfm mode](https://codemirror.net/mode/gfm/): Don't highlight SHA1 'hashes' without numbers to avoid false positives.
+
+[soy mode](https://codemirror.net/mode/soy/): Support injected data and `@param` in comments.
+
+### New features
+
+[simple mode addon](https://codemirror.net/demo/simplemode.html): Allow groups in regexps when `token` isn't an array.
+
+## 5.29.0 (2017-08-24)
+
+### Bug fixes
+
+Fix crash in contentEditable input style when editing near a bookmark.
+
+Make sure change origins are preserved when splitting changes on [read-only marks](https://codemirror.net/doc/manual.html#mark_readOnly).
+
+[javascript mode](https://codemirror.net/mode/javascript/): More support for TypeScript syntax.
+
+[d mode](https://codemirror.net/mode/d/): Support nested comments.
+
+[python mode](https://codemirror.net/mode/python/): Improve tokenizing of operators.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Further improve CommonMark conformance.
+
+[css mode](https://codemirror.net/mode/css/): Don't run comment tokens through the mode's state machine.
+
+[shell mode](https://codemirror.net/mode/shell/): Allow strings to span lines.
+
+[search addon](https://codemirror.net/demo/search/): Fix crash in persistent search when `extraKeys` is null.
+
+## 5.28.0 (2017-07-21)
+
+### Bug fixes
+
+Fix copying of, or replacing editor content with, a single dash character when copying a big selection in some corner cases.
+
+Make [`"goLineLeft"`](https://codemirror.net/doc/manual.html#command_goLineLeft)/`"goLineRight"` behave better on wrapped lines.
+
+[sql mode](https://codemirror.net/mode/sql/): Fix tokenizing of multi-dot operator and allow digits in subfield names.
+
+[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix infinite loop on some composed character inputs.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Make list parsing more CommonMark-compliant.
+
+[gfm mode](https://codemirror.net/mode/gfm/): Highlight colon syntax for emoji.
+
+### New features
+
+Expose [`startOperation`](https://codemirror.net/doc/manual.html#startOperation) and `endOperation` for explicit operation management.
+
+[sublime bindings](https://codemirror.net/demo/sublime.html): Add extend-selection (Ctrl-Alt- or Cmd-Shift-Up/Down).
+
+## 5.27.4 (2017-06-29)
+
+### Bug fixes
+
+Fix crash when using mode lookahead.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Don't block inner mode's indentation support.
+
+## 5.27.2 (2017-06-22)
+
+### Bug fixes
+
+Fix crash in the [simple mode](https://codemirror.net/demo/simplemode.html)< addon.
+
+## 5.27.0 (2017-06-22)
+
+### Bug fixes
+
+Fix infinite loop in forced display update.
+
+Properly disable the hidden textarea when `readOnly` is `"nocursor"`.
+
+Calling the `Doc` constructor without `new` works again.
+
+[sql mode](https://codemirror.net/mode/sql/): Handle nested comments.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Improve support for TypeScript syntax.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Fix bug where markup was ignored on indented paragraph lines.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Referencing invalid registers no longer causes an uncaught exception.
+
+[rust mode](https://codemirror.net/mode/rust/): Add the correct MIME type.
+
+[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Document options.
+
+### New features
+
+Mouse button clicks can now be bound in keymaps by using names like `"LeftClick"` or `"Ctrl-Alt-MiddleTripleClick"`. When bound to a function, that function will be passed the position of the click as second argument.
+
+The behavior of mouse selection and dragging can now be customized with the [`configureMouse`](https://codemirror.net/doc/manual.html#option_configureMouse) option.
+
+Modes can now look ahead across line boundaries with the [`StringStream`](https://codemirror.net/doc/manual.html#StringStream)`.lookahead` method.
+
+Introduces a `"type"` token type, makes modes that recognize types output it, and add styling for it to the themes.
+
+New [`pasteLinesPerSelection`](https://codemirror.net/doc/manual.html#option_pasteLinesPerSelection) option to control the behavior of pasting multiple lines into multiple selections.
+
+[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Support multi-line regular expression matches, and normalize strings when matching.
+
+## 5.26.0 (2017-05-22)
+
+### Bug fixes
+
+In textarea-mode, don't reset the input field during composition.
+
+More careful restoration of selections in widgets, during editor redraw.
+
+[javascript mode](https://codemirror.net/mode/javascript/): More TypeScript parsing fixes.
+
+[julia mode](https://codemirror.net/mode/julia/): Fix issue where the mode gets stuck.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Understand cross-line links, parse all bracketed things as links.
+
+[soy mode](https://codemirror.net/mode/soy/): Support single-quoted strings.
+
+[go mode](https://codemirror.net/mode/go/): Don't try to indent inside strings or comments.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Parse line offsets in line or range specs.
+
+## 5.25.2 (2017-04-20)
+
+### Bug fixes
+
+Better handling of selections that cover the whole viewport in contentEditable-mode.
+
+No longer accidentally scroll the editor into view when calling `setValue`.
+
+Work around Chrome Android bug when converting screen coordinates to editor positions.
+
+Make sure long-clicking a selection sets a cursor and doesn't show the editor losing focus.
+
+Fix issue where pointer events were incorrectly disabled on Chrome's overlay scrollbars.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Recognize annotations and TypeScript-style type parameters.
+
+[shell mode](https://codemirror.net/mode/shell/): Handle nested braces.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Make parsing of strong/em delimiters CommonMark-compliant.
+
+## 5.25.0 (2017-03-20)
+
+### Bug fixes
+
+In contentEditable-mode, properly locate changes that repeat a character when inserted with IME.
+
+Fix handling of selections bigger than the viewport in contentEditable mode.
+
+Improve handling of changes that insert or delete lines in contentEditable mode.
+
+Count Unicode control characters 0x80 to 0x9F as special (non-printing) chars.
+
+Fix handling of shadow DOM roots when finding the active element.
+
+Add `role=presentation` to more DOM elements to improve screen reader support.
+
+[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Make aligning of unchanged chunks more robust.
+
+[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix comment-toggling on a block of text that starts and ends in a (differnet) block comment.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Improve support for TypeScript syntax.
+
+[r mode](https://codemirror.net/mode/r/): Fix indentation after semicolon-less statements.
+
+[shell mode](https://codemirror.net/mode/shell/): Properly handle escaped parentheses in parenthesized expressions.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Fix a few bugs around leaving fenced code blocks.
+
+[soy mode](https://codemirror.net/mode/soy/): Improve indentation.
+
+### New features
+
+[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Support asynchronous linters that return promises.
+
+[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Support continuing task lists.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Make Y behave like yy.
+
+[sql mode](https://codemirror.net/mode/sql/): Support sqlite dialect.
+
+## 5.24.2 (2017-02-22)
+
+### Bug fixes
+
+[javascript mode](https://codemirror.net/mode/javascript/): Support computed class method names.
+
+[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Improve aligning of unchanged code in the presence of marks and line widgets.
+
+## 5.24.0 (2017-02-20)
+
+### Bug fixes
+
+A cursor directly before a line-wrapping break is now drawn before or after the line break depending on which direction you arrived from.
+
+Visual cursor motion in line-wrapped right-to-left text should be much more correct.
+
+Fix bug in handling of read-only marked text.
+
+[shell mode](https://codemirror.net/mode/shell/): Properly tokenize nested parentheses.
+
+[python mode](https://codemirror.net/mode/python/): Support underscores in number literals.
+
+[sass mode](https://codemirror.net/mode/sass/): Uses the full list of CSS properties and keywords from the CSS mode, rather than defining its own incomplete subset.
+
+[css mode](https://codemirror.net/mode/css/): Expose `lineComment` property for LESS and SCSS dialects. Recognize vendor prefixes on pseudo-elements.
+
+[julia mode](https://codemirror.net/mode/julia/): Properly indent `elseif` lines.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Properly recognize the end of fenced code blocks when inside other markup.
+
+[scala mode](https://codemirror.net/mode/clike/): Improve handling of operators containing #, @, and : chars.
+
+[xml mode](https://codemirror.net/mode/xml/): Allow dashes in HTML tag names.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing of async methods, TypeScript-style comma-separated superclass lists.
+
+[indent-fold addon](https://codemirror.net/demo/folding.html): Ignore comment lines.
+
+### New features
+
+Positions now support a `sticky` property which determines whether they should be associated with the character before (value `"before"`) or after (value `"after"`) them.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Make it possible to remove built-in bindings through the API.
+
+[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Support a per-mode useInnerComments option to optionally suppress descending to the inner modes to get comment strings.
+
+### Breaking changes
+
+The [sass mode](https://codemirror.net/mode/sass/) now depends on the [css mode](https://codemirror.net/mode/css/).
+
+## 5.23.0 (2017-01-19)
+
+### Bug fixes
+
+Presentation-related elements DOM elements are now marked as such to help screen readers.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Be more picky about what HTML tags look like to avoid false positives.
+
+### New features
+
+`findModeByMIME` now understands `+json` and `+xml` MIME suffixes.
+
+[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Add support for an `override` option to ignore language-specific defaults.
+
+[panel addon](https://codemirror.net/doc/manual.html#addon_panel): Add a `stable` option that auto-scrolls the content to keep it in the same place when inserting/removing a panel.
+
+## 5.22.2 (2017-01-12)
+
+### Bug fixes
+
+Include rollup.config.js in NPM package, so that it can be used to build from source.
+
+## 5.22.0 (2016-12-20)
+
+### Bug fixes
+
+[sublime bindings](https://codemirror.net/demo/sublime.html): Make `selectBetweenBrackets` work with multiple cursors.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Fix issues with parsing complex TypeScript types, imports, and exports.
+
+A contentEditable editor instance with autofocus enabled no longer crashes during initializing.
+
+### New features
+
+[emacs bindings](https://codemirror.net/demo/emacs.html): Export `CodeMirror.emacs` to allow other addons to hook into Emacs-style functionality.
+
+[active-line addon](https://codemirror.net/doc/manual.html#addon_active-line): Add `nonEmpty` option.
+
+New event: [`optionChange`](https://codemirror.net/doc/manual.html#event_optionChange).
+
+## 5.21.0 (2016-11-21)
+
+### Bug fixes
+
+Tapping/clicking the editor in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle) on Chrome now puts the cursor at the tapped position.
+
+Fix various crashes and misbehaviors when reading composition events in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle).
+
+Catches and ignores an IE 'Unspecified Error' when creating an editor in an iframe before there is a ``.
+
+[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Fix several issues in the chunk-aligning feature.
+
+[verilog mode](https://codemirror.net/mode/verilog): Rewritten to address various issues.
+
+[julia mode](https://codemirror.net/mode/julia): Recognize Julia 0.5 syntax.
+
+[swift mode](https://codemirror.net/mode/swift): Various fixes and adjustments to current syntax.
+
+[markdown mode](https://codemirror.net/mode/markdown): Allow lists without a blank line above them.
+
+### New features
+
+The [`setGutterMarker`](https://codemirror.net/doc/manual.html#setGutterMarker), [`clearGutter`](https://codemirror.net/doc/manual.html#clearGutter), and [`lineInfo`](https://codemirror.net/doc/manual.html#lineInfo) methods are now available on `Doc` objects.
+
+The [`heightAtLine`](https://codemirror.net/doc/manual.html#heightAtLine) method now takes an extra argument to allow finding the height at the top of the line's line widgets.
+
+[ruby mode](https://codemirror.net/mode/ruby): `else` and `elsif` are now immediately indented.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Bind Ctrl-T and Ctrl-D to in- and dedent in insert mode.
+
+## 5.20.2 (2016-10-21)
+
+### Bug fixes
+
+Fix `CodeMirror.version` returning the wrong version number.
+
+## 5.20.0 (2016-10-20)
+
+### Bug fixes
+
+Make `newlineAndIndent` command work with multiple cursors on the same line.
+
+Make sure keypress events for backspace are ignored.
+
+Tokens styled with overlays no longer get a nonsense `cm-cm-overlay` class.
+
+Line endings for pasted content are now normalized to the editor's [preferred ending](https://codemirror.net/doc/manual.html#option_lineSeparator).
+
+[javascript mode](https://codemirror.net/mode/javascript): Improve support for class expressions. Support TypeScript optional class properties, the `abstract` keyword, and return type declarations for arrow functions.
+
+[css mode](https://codemirror.net/mode/css): Fix highlighting of mixed-case keywords.
+
+[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve behavior when typing a quote before a string.
+
+### New features
+
+The core is now maintained as a number of small files, using ES6 syntax and modules, under the `src/` directory. A git checkout no longer contains a working `codemirror.js` until you `npm run build` (but when installing from NPM, it is included).
+
+The [`refresh`](https://codemirror.net/doc/manual.html#event_refresh) event is now documented and stable.
+
+## 5.19.0 (2016-09-20)
+
+### Bugfixes
+
+[erlang mode](https://codemirror.net/mode/erlang): Fix mode crash when trying to read an empty context.
+
+[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix broken behavior when toggling comments inside a comment.
+
+xml-fold addon: Fix a null-dereference bug.
+
+Page up and page down now do something even in single-line documents.
+
+Fix an issue where the cursor position could be off in really long (~8000 character) tokens.
+
+### New features
+
+[javascript mode](https://codemirror.net/mode/javascript): Better indentation when semicolons are missing. Better support for TypeScript classes, optional parameters, and the `type` keyword.
+
+The [`blur`](https://codemirror.net/doc/manual.html#event_blur) and [`focus`](https://codemirror.net/doc/manual.html#event_focus) events now pass the DOM event to their handlers.
+
+## 5.18.2 (2016-08-23)
+
+### Bugfixes
+
+[vue mode](https://codemirror.net/mode/vue): Fix outdated references to renamed Pug mode dependency.
+
+## 5.18.0 (2016-08-22)
+
+### Bugfixes
+
+Make sure [gutter backgrounds](https://codemirror.net/doc/manual.html#addLineClass) stick to the rest of the gutter during horizontal scrolling.
+
+The contenteditable [`inputStyle`](https://codemirror.net/doc/manual.html#option_inputStyle) now properly supports pasting on pre-Edge IE versions.
+
+[javascript mode](https://codemirror.net/mode/javascript): Fix some small parsing bugs and improve TypeScript support.
+
+[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Fix bug where active highlighting was left in editor when the addon was disabled.
+
+[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Only start highlighting things when the editor gains focus.
+
+[javascript-hint addon](https://codemirror.net/doc/manual.html#addon_javascript-hint): Also complete non-enumerable properties.
+
+### New features
+
+The [`addOverlay`](https://codemirror.net/doc/manual.html#addOverlay) method now supports a `priority` option to control the order in which overlays are applied.
+
+MIME types that end in `+json` now default to the JSON mode when the MIME itself is not defined.
+
+### Breaking changes
+
+The mode formerly known as Jade was renamed to [Pug](https://codemirror.net/mode/pug).
+
+The [Python mode](https://codemirror.net/mode/python) now defaults to Python 3 (rather than 2) syntax.
+
+## 5.17.0 (2016-07-19)
+
+### Bugfixes
+
+Fix problem with wrapped trailing whitespace displaying incorrectly.
+
+Prevent IME dialog from overlapping typed content in Chrome.
+
+Improve measuring of characters near a line wrap.
+
+[javascript mode](https://codemirror.net/mode/javascript): Improve support for `async`, allow trailing commas in `import` lists.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Fix backspace in replace mode.
+
+[sublime bindings](https://codemirror.net/demo/sublime.html): Fix some key bindings on OS X to match Sublime Text.
+
+### New features
+
+[markdown mode](https://codemirror.net/mode/markdown): Add more classes to image links in highlight-formatting mode.
+
+## 5.16.0 (2016-06-20)
+
+### Bugfixes
+
+Fix glitches when dragging content caused by the drop indicator receiving mouse events.
+
+Make Control-drag work on Firefox.
+
+Make clicking or selection-dragging at the end of a wrapped line select the right position.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Prevent widget scrollbar from hiding part of the hint text.
+
+[rulers addon](https://codemirror.net/doc/manual.html#addon_rulers): Prevent rulers from forcing a horizontal editor scrollbar.
+
+### New features
+
+[search addon](https://codemirror.net/doc/manual.html#addon_search): Automatically bind search-related keys in persistent dialog.
+
+[sublime keymap](https://codemirror.net/demo/sublime.html): Add a multi-cursor aware smart backspace binding.
+
+## 5.15.2 (2016-05-20)
+
+### Bugfixes
+
+Fix a critical document corruption bug that occurs when a document is gradually grown.
+
+## 5.15.0 (2016-05-20)
+
+### Bugfixes
+
+Fix bug that caused the selection to reset when focusing the editor in contentEditable input mode.
+
+Fix issue where not all ASCII control characters were being replaced by placeholders.
+
+Remove the assumption that all modes have a `startState` method from several wrapping modes.
+
+Fix issue where the editor would complain about overlapping collapsed ranges when there weren't any.
+
+Optimize document tree building when loading or pasting huge chunks of content.
+
+[markdown mode](https://codemirror.net/mode/markdown/): Fix several issues in matching link targets.
+
+[clike mode](https://codemirror.net/mode/clike/): Improve indentation of C++ template declarations.
+
+### New features
+
+Explicitly bind Ctrl-O on OS X to make that binding (“open line”) act as expected.
+
+Pasting [linewise-copied](https://codemirror.net/doc/manual.html#option_lineWiseCopyCut) content when there is no selection now inserts the lines above the current line.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Support `async`/`await` and improve support for TypeScript type syntax.
+
+## 5.14.2 (2016-04-20)
+
+### Bugfixes
+
+Push a new package to NPM due to an [NPM bug](https://github.com/npm/npm/issues/5082) omitting the LICENSE file in 5.14.0.
+
+Set `dataTransfer.effectAllowed` in `dragstart` handler to help browsers use the right drag icon.
+
+Add the [mbox mode](https://codemirror.net/mode/mbox/index.html) to `mode/meta.js`.
+
+## 5.14.0 (2016-04-20)
+
+### Bugfixes
+
+[`posFromIndex`](https://codemirror.net/doc/manual.html#posFromIndex) and [`indexFromPos`](https://codemirror.net/doc/manual.html#indexFromPos) now take [`lineSeparator`](https://codemirror.net/doc/manual.html#option_lineSeparator) into account.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Only call `.save()` when it is actually available.
+
+[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Be careful not to mangle multi-line strings.
+
+[Python mode](https://codemirror.net/mode/python/index.html): Improve distinguishing of decorators from `@` operators.
+
+[`findMarks`](https://codemirror.net/doc/manual.html#findMarks): No longer return marks that touch but don't overlap given range.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Add yank command.
+
+[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Add `trim` option to disable ignoring of whitespace.
+
+[PowerShell mode](https://codemirror.net/mode/powershell/index.html): Added.
+
+[Yacas mode](https://codemirror.net/mode/yacas/index.html): Added.
+
+[Web IDL mode](https://codemirror.net/mode/webidl/index.html): Added.
+
+[SAS mode](https://codemirror.net/mode/sas/index.html): Added.
+
+[mbox mode](https://codemirror.net/mode/mbox/index.html): Added.
+
+## 5.13.2 (2016-03-23)
+
+### Bugfixes
+
+Solves a problem where the gutter would sometimes not extend all the way to the end of the document.
+
+## 5.13.0 (2016-03-21)
+
+### New features
+
+New DOM event forwarded: [`"dragleave"`](https://codemirror.net/doc/manual.html#event_dom).
+
+[protobuf mode](https://codemirror.net/mode/protobuf/index.html): Newly added.
+
+### Bugfixes
+
+Fix problem where [`findMarks`](https://codemirror.net/doc/manual.html#findMarks) sometimes failed to find multi-line marks.
+
+Fix crash that showed up when atomic ranges and bidi text were combined.
+
+[show-hint addon](https://codemirror.net/demo/complete.html): Completion widgets no longer close when the line indented or dedented.
+
+[merge addon](https://codemirror.net/demo/merge.html): Fix bug when merging chunks at the end of the file.
+
+[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): No longer gets confused by [`swapDoc`](https://codemirror.net/doc/manual.html#swapDoc).
+
+[simplescrollbars addon](https://codemirror.net/doc/manual.html#addon_simplescrollbars): Fix invalid state when deleting at end of document.
+
+[clike mode](https://codemirror.net/mode/clike/index.html): No longer gets confused when a comment starts after an operator.
+
+[markdown mode](https://codemirror.net/mode/markdown/index.html): Now supports CommonMark-style flexible list indentation.
+
+[dylan mode](https://codemirror.net/mode/dylan/index.html): Several improvements and fixes.
+
+## 5.12.0 (2016-02-19)
+
+### New features
+
+[Vim bindings](https://codemirror.net/demo/vim.html): Ctrl-Q is now an alias for Ctrl-V.
+
+[Vim bindings](https://codemirror.net/demo/vim.html): The Vim API now exposes an `unmap` method to unmap bindings.
+
+[active-line addon](https://codemirror.net/demo/activeline.html): This addon can now style the active line's gutter.
+
+[FCL mode](https://codemirror.net/mode/fcl/): Newly added.
+
+[SQL mode](https://codemirror.net/mode/sql/): Now has a Postgresql dialect.
+
+### Bugfixes
+
+Fix [issue](https://github.com/codemirror/CodeMirror/issues/3781) where trying to scroll to a horizontal position outside of the document's width could cause the gutter to be positioned incorrectly.
+
+Use absolute, rather than fixed positioning in the context-menu intercept hack, to work around a [problem](https://github.com/codemirror/CodeMirror/issues/3238) when the editor is inside a transformed parent container.
+
+Solve a [problem](https://github.com/codemirror/CodeMirror/issues/3821) where the horizontal scrollbar could hide text in Firefox.
+
+Fix a [bug](https://github.com/codemirror/CodeMirror/issues/3834) that caused phantom scroll space under the text in some situations.
+
+[Sublime Text bindings](https://codemirror.net/demo/sublime.html): Bind delete-line to Shift-Ctrl-K on OS X.
+
+[Markdown mode](https://codemirror.net/mode/markdown/): Fix [issue](https://github.com/codemirror/CodeMirror/issues/3787) where the mode would keep state related to fenced code blocks in an unsafe way, leading to occasional corrupted parses.
+
+[Markdown mode](https://codemirror.net/mode/markdown/): Ignore backslashes in code fragments.
+
+[Markdown mode](https://codemirror.net/mode/markdown/): Use whichever mode is registered as `text/html` to parse HTML.
+
+[Clike mode](https://codemirror.net/mode/clike/): Improve indentation of Scala `=>` functions.
+
+[Python mode](https://codemirror.net/mode/python/): Improve indentation of bracketed code.
+
+[HTMLMixed mode](https://codemirror.net/mode/htmlmixed/): Support multi-line opening tags for sub-languages (`
 
 
-
 

It will automatically load the modes that the mixed HTML mode - depends on (XML, JavaScript, and CSS).

+ depends on (XML, JavaScript, and CSS). Do not use + RequireJS' paths option to configure the path to + CodeMirror, since it will break loading submodules through + relative paths. Use + the
packages + configuration option instead, as in:

+ +
require.config({
+  packages: [{
+    name: "codemirror",
+    location: "../path/to/codemirror",
+    main: "lib/codemirror"
+  }]
+});
@@ -205,9 +223,10 @@

Configuration

first mode that was loaded. It may be a string, which either simply names the mode or is a MIME type - associated with the mode. Alternatively, it may be an object - containing configuration options for the mode, with - a name property that names the mode (for + associated with the mode. The value "null" + indicates no highlighting should be applied. Alternatively, it + may be an object containing configuration options for the mode, + with a name property that names the mode (for example {name: "javascript", json: true}). The demo pages for each mode contain information about what configuration parameters the mode supports. You can ask CodeMirror which modes @@ -217,6 +236,16 @@

Configuration

mode names to their constructors, and the second maps MIME types to mode specs. +
lineSeparator: string|null
+
Explicitly set the line separator for the editor. By default + (value null), the document will be split on CRLFs + as well as lone CRs and LFs, and a single LF will be used as + line separator in all output (such + as getValue). When a + specific string is given, lines will only be split on that + string, and output will, by default, use that same + separator.
+
theme: string
The theme to style the editor with. You must make sure the CSS file defining the corresponding .cm-s-[name] @@ -256,7 +285,7 @@

Configuration

should be replaced by a special placeholder. Mostly useful for non-printing special characters. The default - is /[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/.
+ is /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/.
specialCharPlaceholder: function(char) → Element
A function that, given a special character identified by the specialChars @@ -264,6 +293,17 @@

Configuration

character. By default, a red dot () is shown, with a title tooltip to indicate the character code.
+
direction: "ltr" | "rtl"
+
Flips overall layout and selects base paragraph direction to + be left-to-right or right-to-left. Default is "ltr". + CodeMirror applies the Unicode Bidirectional Algorithm to each + line, but does not autodetect base direction — it's set to the + editor direction for all lines. The resulting order is + sometimes wrong when base direction doesn't match user intent + (for example, leading and trailing punctuation jumps to the + wrong side of the line). Therefore, it's helpful for + multilingual input to let users toggle this option. +
rtlMoveVisually: boolean
Determines whether horizontal cursor movement through right-to-left (Arabic, Hebrew) text is visual (pressing the left @@ -286,6 +326,37 @@

Configuration

by keyMap. Should be either null, or a valid key map value.
+
configureMouse: fn(cm: CodeMirror, repeat: "single" | "double" | "triple", event: Event) → Object
+
Allows you to configure the behavior of mouse selection and + dragging. The function is called when the left mouse button is + pressed. The returned object may have the following properties: +
+
unit: "char" | "word" | "line" | "rectangle" | fn(CodeMirror, Pos) → {from: Pos, to: Pos}
+
The unit by which to select. May be one of the built-in + units or a function that takes a position and returns a + range around that, for a custom unit. The default is to + return "word" for double + clicks, "line" for triple + clicks, "rectangle" for alt-clicks (or, on + Chrome OS, meta-shift-clicks), and "single" + otherwise.
+
extend: bool
+
Whether to extend the existing selection range or start + a new one. By default, this is enabled when shift + clicking.
+
addNew: bool
+
When enabled, this adds a new range to the existing + selection, rather than replacing it. The default behavior is + to enable this for command-click on Mac OS, and + control-click on other platforms.
+
moveOnDrag: bool
+
When the mouse even drags content around inside the + editor, this controls whether it is copied (false) or moved + (true). By default, this is enabled by alt-clicking on Mac + OS, and ctrl-clicking elsewhere.
+
+
+
lineWrapping: boolean
Whether CodeMirror should scroll or wrap for long lines. Defaults to false (scroll).
@@ -301,16 +372,16 @@

Configuration

passed the line number, and should return a string that will be shown in the gutter. -
gutters: array<string>
+
gutters: array<string | {className: string, style: ?string}>
Can be used to add extra gutters (beyond or instead of the - line number gutter). Should be an array of CSS class names, each - of which defines a width (and optionally a - background), and which will be used to draw the background of - the gutters. May include - the CodeMirror-linenumbers class, in order to - explicitly set the position of the line number gutter (it will - default to be to the right of all other gutters). These class - names are the keys passed + line number gutter). Should be an array of CSS class names or + class name / CSS string pairs, each of which defines + a width (and optionally a background), and which + will be used to draw the background of the gutters. May + include the CodeMirror-linenumbers class, in order + to explicitly set the position of the line number gutter (it + will default to be to the right of all other gutters). These + class names are the keys passed to setGutterMarker.
fixedGutter: boolean
@@ -318,6 +389,14 @@

Configuration

horizontally (false) or whether it stays fixed during horizontal scrolling (true, the default). +
scrollbarStyle: string
+
Chooses a scrollbar implementation. The default + is "native", showing native scrollbars. The core + library also provides the "null" style, which + completely hides the + scrollbars. Addons can + implement additional scrollbar models.
+
coverGutterNextToScrollbar: boolean
When fixedGutter is on, and there is a horizontal scrollbar, by default the @@ -325,6 +404,17 @@

Configuration

option is set to true, it will be covered by an element with class CodeMirror-gutter-filler.
+
inputStyle: string
+
Selects the way CodeMirror handles input and focus. The core + library defines the "textarea" + and "contenteditable" input models. On mobile + browsers, the default is "contenteditable". On + desktop browsers, the default is "textarea". + Support for IME and screen readers is better in + the "contenteditable" model. The intention is to + make it the default on modern desktop browsers in the + future.
+
readOnly: boolean|string
This disables editing of the editor content by the user. If the special value "nocursor" is given (instead of @@ -335,6 +425,22 @@

Configuration

Whether the cursor should be drawn when a selection is active. Defaults to false.
+
lineWiseCopyCut: boolean
+
When enabled, which is the default, doing copy or cut when + there is no selection will copy or cut the whole lines that have + cursors on them.
+ +
pasteLinesPerSelection: boolean
+
When pasting something from an external source (not from the + editor itself), if the number of lines matches the number of + selection, CodeMirror will by default insert one line per + selection. You can set this to false to disable + that behavior.
+ +
selectionsMayTouch: boolean
+
Determines whether multiple selections are joined as soon as + they touch (the default) or only when they overlap (true).
+
undoDepth: integer
The maximum number of undo levels that the editor stores. Note that this includes selection change events. Defaults to @@ -358,6 +464,15 @@

Configuration

set to true when either the source textarea is focused, or it has an autofocus attribute and no other element is focused.
+ +
phrases: ?object
+
Some addons run user-visible strings (such as labels in the + interface) through the phrase + method to allow for translation. This option determines the + return value of that method. When it is null or an object that + doesn't have a property named by the input string, that string + is returned. Otherwise, the value of the property corresponding + to that string is returned.

Below this a few more specialized, low-level options are @@ -368,6 +483,13 @@

Configuration

dragDrop: boolean
Controls whether drag-and-drop is enabled. On by default.
+
allowDropFileTypes: array<string>
+
When set (default is null) only files whose + type is in the array can be dropped into the editor. The strings + should be MIME types, and will be checked against + the type + of the File object as reported by the browser.
+
cursorBlinkRate: number
Half-period in milliseconds used for cursor blinking. The default blink rate is 530ms. By setting this to zero, blinking can be disabled. A @@ -426,18 +548,6 @@

Configuration

10 000. You can set this to Infinity to turn off this behavior.
-
crudeMeasuringFrom: number
-
When measuring the character positions in long lines, any - line longer than this number (default is 10 000), - when line wrapping - is off, will simply be assumed to consist of - same-sized characters. This means that, on the one hand, - measuring will be inaccurate when characters of varying size, - right-to-left text, markers, or other irregular elements are - present. On the other hand, it means that having such a line - won't freeze the user interface because of the expensiveness of - the measurements.
-
viewportMargin: integer
Specifies the amount of lines that are rendered above and below the part of the document that's currently scrolled into @@ -448,6 +558,15 @@

Configuration

always rendered, and thus the browser's text search works on it. This will have bad effects on performance of big documents.
+ +
spellcheck: boolean
+
Specifies whether or not spellcheck will be enabled on the input.
+ +
autocorrect: boolean
+
Specifies whether or not autocorrect will be enabled on the input.
+ +
autocapitalize: boolean
+
Specifies whether or not autocapitalization will be enabled on the input.
@@ -479,13 +598,17 @@

Events

an array of strings representing the text that replaced the changed range (split by line). removed is the text that used to be between from and to, - which is overwritten by this change. + which is overwritten by this change. This event is + fired before the end of + an operation, before the DOM updates + happen. -
"changes" (instance: CodeMirror, changes: array<object<)
+
"changes" (instance: CodeMirror, changes: array<object>)
Like the "change" event, but batched per operation, passing an array containing all the changes that happened in the - operation.
+ operation. This event is fired after the operation finished, and + display changes it makes will trigger a new operation.
"beforeChange" (instance: CodeMirror, changeObj: object)
This event is fired before a change is applied, and its @@ -525,15 +648,22 @@

Events

Fired whenever new input is read from the hidden textarea (typed or pasted by the user).
-
"beforeSelectionChange" (instance: CodeMirror, obj: {ranges, update})
+
"electricInput" (instance: CodeMirror, line: integer)
+
Fired if text input matched the + mode's electric patterns, + and this caused the line's indentation to change.
+ +
"beforeSelectionChange" (instance: CodeMirror, obj: {ranges, origin, update})
This event is fired before the selection is moved. Its handler may inspect the set of selection ranges, present as an array of {anchor, head} objects in the ranges property of the obj argument, and optionally change them by calling the update method on this object, passing an array - of ranges in the same format. Handlers for this event have the - same restriction + of ranges in the same format. The object also contains + an origin property holding the origin string passed + to the selection-changing method, if any. Handlers for this + event have the same restriction as "beforeChange" handlers — they should not do anything to directly update the state of the editor.
@@ -567,15 +697,30 @@

Events

You can preventDefault the event, to signal that CodeMirror should do no further handling. -
"focus" (instance: CodeMirror)
+
"focus" (instance: CodeMirror, event: Event)
Fires whenever the editor is focused.
-
"blur" (instance: CodeMirror)
+
"blur" (instance: CodeMirror, event: Event)
Fires whenever the editor is unfocused.
"scroll" (instance: CodeMirror)
Fires when the editor is scrolled.
+
"refresh" (instance: CodeMirror)
+
Fires when the editor is refreshed + or resized. Mostly useful to invalidate + cached values that depend on the editor or character size.
+ +
"optionChange" (instance: CodeMirror, option: string)
+
Dispatched every time an option is changed with setOption.
+ +
"scrollCursorIntoView" (instance: CodeMirror, event: Event)
+
Fires when the editor tries to scroll its cursor into view. + Can be hooked into to take care of additional scrollable + containers around the editor. When the event object has + its preventDefault method called, CodeMirror will + not itself try to scroll the window.
+
"update" (instance: CodeMirror)
Will be fired whenever CodeMirror updates its DOM display.
@@ -587,9 +732,12 @@

Events

should not try to change the state of the editor.
"mousedown", - "dblclick", "contextmenu", "keydown", "keypress", - "keyup", "dragstart", "dragenter", - "dragover", "drop" + "dblclick", "touchstart", "contextmenu", + "keydown", "keypress", + "keyup", "cut", "copy", "paste", + "dragstart", "dragenter", + "dragover", "dragleave", + "drop" (instance: CodeMirror, event: Event)
Fired when CodeMirror is handling a DOM event of this type. You can preventDefault the event, or give it a @@ -688,9 +836,10 @@

Events

Key Maps

-

Key maps are ways to associate keys with functionality. A key map - is an object mapping strings that identify the keys to functions - that implement their functionality.

+

Key maps are ways to associate keys and mouse buttons with + functionality. A key map is an object mapping strings that + identify the buttons to functions that implement their + functionality.

The CodeMirror distributions comes with Emacs, Vim, @@ -702,26 +851,43 @@

Key Maps

names defined here are Enter, F5, and Q. These can be prefixed with Shift-, Cmd-, Ctrl-, - and Alt- (in that order!) to specify a modifier. So - for example, Shift-Ctrl-Space would be a valid key + and Alt- to specify a modifier. So for + example, Shift-Ctrl-Space would be a valid key identifier.

Common example: map the Tab key to insert spaces instead of a tab character.

-{
+editor.setOption("extraKeys", {
   Tab: function(cm) {
     var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
     cm.replaceSelection(spaces);
   }
-}
+});

Alternatively, a character can be specified directly by surrounding it in single quotes, for example '$' or 'q'. Due to limitations in the way browsers fire key events, these may not be prefixed with modifiers.

+

To bind mouse buttons, use the names `LeftClick`, + `MiddleClick`, and `RightClick`. These can also be prefixed with + modifiers, and in addition, the word `Double` or `Triple` can be + put before `Click` (as in `LeftDoubleClick`) to bind a double- or + triple-click. The function for such a binding is passed the + position that was clicked as second argument.

+ +

Multi-stroke key bindings can be specified + by separating the key names by spaces in the property name, for + example Ctrl-X Ctrl-V. When a map contains + multi-stoke bindings or keys with modifiers that are not specified + in the default order (Shift-Cmd-Ctrl-Alt), you must + call CodeMirror.normalizeKeyMap on it before it can + be used. This function takes a keymap and modifies it to normalize + modifier order and properly recognize multi-stroke bindings. It + will return the keymap itself.

+

The CodeMirror.keyMap object associates key maps with names. User code and key map definitions can assign extra properties to this object. Anywhere where a key map is expected, a @@ -740,7 +906,8 @@

Key Maps

behavior) should be given a turn.

Keys mapped to command names that start with the - characters "go" (which should be used for + characters "go" or to functions that have a + truthy motion property (which should be used for cursor-movement actions) will be fired even when an extra Shift modifier is present (i.e. "Up": "goLineUp" matches both up and shift-up). This is used to @@ -752,14 +919,15 @@

Key Maps

be searched. It can hold either a single key map or an array of key maps.

-

When a key map contains a nofallthrough property - set to true, keys matched against that map will be - ignored if they don't match any of the bindings in the map (no - further child maps will be tried). When - the disableInput property is set - to true, the default effect of inserting a character - will be suppressed when the key map is active as the top-level - map.

+

When a key map needs to set something up when it becomes + active, or tear something down when deactivated, it can + contain attach and/or detach properties, + which should hold functions that take the editor instance and the + next or previous keymap. Note that this only works for the + top-level keymap, not for fallthrough + maps or maps added + with extraKeys + or addKeyMap.

@@ -807,7 +975,10 @@

Commands

Delete the part of the line from the cursor to the right side of the visual line the cursor is on.
undoCtrl-Z (PC), Cmd-Z (Mac)
-
Undo the last change.
+
Undo the last change. Note that, because browsers still + don't make it possible for scripts to react to or customize the + context menu, selecting undo (or redo) from the context menu in + a CodeMirror instance does not work.
redoCtrl-Y (PC), Shift-Cmd-Z (Mac), Cmd-Y (Mac)
Redo the last undone change.
@@ -821,10 +992,10 @@

Commands

Redo the last change to the selection, or the last text change if no selection changes remain.
-
goDocStartCtrl-Up (PC), Cmd-Up (Mac), Cmd-Home (Mac)
+
goDocStartCtrl-Home (PC), Cmd-Up (Mac), Cmd-Home (Mac)
Move the cursor to the start of the document.
-
goDocEndCtrl-Down (PC), Cmd-End (Mac), Cmd-Down (Mac)
+
goDocEndCtrl-End (PC), Cmd-End (Mac), Cmd-Down (Mac)
Move the cursor to the end of the document.
goLineStartAlt-Left (PC), Ctrl-A (Mac)
@@ -979,16 +1150,12 @@

Customized Styling

The outer element of the editor. This should be used for the editor width, height, borders and positioning. Can also be used to set styles that should hold for everything inside the editor - (such as font and font size), or to set a background.
- -
CodeMirror-scroll
-
Whether the editor scrolls (overflow: auto + - fixed height). By default, it does. Setting - the CodeMirror class to have height: - auto and giving this class overflow-x: auto; - overflow-y: hidden; will cause the editor - to resize to fit its - content.
+ (such as font and font size), or to set a background. Setting + this class' height style to auto will + make the editor resize to fit its + content (it is recommended to also set + the viewportMargin + option to Infinity when doing this.
CodeMirror-focused
Whenever the editor is focused, the top element gets this @@ -1054,7 +1221,11 @@

Programming API

shouldn't worry too much about sanitizing your coordinates. If you give ch a value of null, or don't specify it, it will be replaced with the length of the specified - line.

+ line. Such positions may also have a sticky property + holding "before" or "after", whether the + position is associated with the character before or after it. This + influences, for example, where the cursor is drawn on a + line-break or bidi-direction boundary.

Methods prefixed with doc. can, unless otherwise specified, be called both on CodeMirror (editor) @@ -1116,12 +1287,12 @@

Content manipulation methods

doc.lineCount() → integer
Get the number of lines in the editor.
doc.firstLine() → integer
-
Get the first line of the editor. This will +
Get the number of first line in the editor. This will usually be zero but for linked sub-views, or documents instantiated with a non-zero first line, it might return other values.
doc.lastLine() → integer
-
Get the last line of the editor. This will +
Get the number of last line in the editor. This will usually be doc.lineCount() - 1, but for linked sub-views, it might return other values.
@@ -1177,7 +1348,7 @@

Cursor and selection methods

separator to put between the lines in the output. When multiple selections are present, they are concatenated with instances of lineSep in between. -
doc.getSelections(?lineSep: string) → string
+
doc.getSelections(?lineSep: string) → array<string>
Returns an array containing a string for each selection, representing the content of the selections.
@@ -1197,7 +1368,7 @@

Cursor and selection methods

doc.getCursor(?start: string) → {line, ch}
Retrieve one end of the primary - selection. start is a an optional string indicating + selection. start is an optional string indicating which end of the selection to return. It may be "from", "to", "head" (the side of the selection that moves when you press @@ -1205,7 +1376,7 @@

Cursor and selection methods

selection). Omitting the argument is the same as passing "head". A {line, ch} object will be returned.
-
doc.listSelections() → array<{anchor, head}<
+
doc.listSelections() → array<{anchor, head}>
Retrieves a list of all current selections. These will always be sorted, and never overlap (overlapping selections are merged). Each object in the array contains anchor @@ -1231,7 +1402,7 @@

Cursor and selection methods

Determines whether the selection head should be scrolled into view. Defaults to true.
origin: string
-
Detemines whether the selection history event may be +
Determines whether the selection history event may be merged with the previous one. When an origin starts with the character +, and the last recorded selection had the same origin and was similar (close @@ -1239,7 +1410,7 @@

Cursor and selection methods

collapsed or both non-collapsed), the new one will replace the old one. When it starts with *, it will always replace the previous event (if that had the same origin). - Built-in motion uses the "+move" origin.
+ Built-in motion uses the "+move" origin. User input uses the "+input" origin.
bias: number
Determine the direction into which the selection endpoints should be adjusted when they fall inside @@ -1278,7 +1449,7 @@

Cursor and selection methods

An equivalent of extendSelection that acts on all selections at once.
-
doc.extendSelectionsBy(f: function(range: {anchor, head}) → {anchor, head}), ?options: object)
+
doc.extendSelectionsBy(f: function(range: {anchor, head}) → {line, ch}), ?options: object)
Applies the given function to all existing selections, and calls extendSelections on the result.
@@ -1358,15 +1529,25 @@

Configuration methods

spec or a mode object (an object with a token method). The options parameter is optional. If given, it - should be an object. Currently, only the opaque - option is recognized. This defaults to off, but can be given to - allow the overlay styling, when not null, to - override the styling of the base mode entirely, instead of the - two being applied together. + should be an object, optionally containing the following options: +
+
opaque: bool
+
Defaults to off, but can be given to allow the overlay + styling, when not null, to override the styling of + the base mode entirely, instead of the two being applied + together.
+
priority: number
+
Determines the ordering in which the overlays are + applied. Those with high priority are applied after those + with lower priority, and able to override the opaqueness of + the ones that come before. Defaults to 0.
+
+ +
cm.removeOverlay(mode: string|object)
Pass this the exact value passed for the mode parameter to addOverlay, - or a string that corresponds to the name propery of + or a string that corresponds to the name property of that value, to remove an overlay again.
cm.on(type: string, func: (...args))
@@ -1387,10 +1568,11 @@

Document management methods

represents the editor content, plus a selection, an undo history, and a mode. A document can only be associated with a single editor at a time. You can create new - documents by calling the CodeMirror.Doc(text, mode, - firstLineNumber) constructor. The last two arguments are - optional and can be used to set a mode for the document and make - it start at a line number other than 0, respectively.

+ documents by calling the CodeMirror.Doc(text: string, mode: + Object, firstLineNumber: ?number, lineSeparator: ?string) + constructor. The last three arguments are optional and can be used + to set a mode for the document, make it start at a line number + other than 0, and set a specific line separator respectively.

cm.getDoc() → Doc
@@ -1464,7 +1646,7 @@

History-related methods

doc.clearHistory()
Clears the editor's undo history.
doc.getHistory() → object
-
Get a (JSON-serializeable) representation of the undo history.
+
Get a (JSON-serializable) representation of the undo history.
doc.setHistory(history: object)
Replace the editor's undo history with the one provided, which must be a value as returned @@ -1493,13 +1675,21 @@

Text-marking methods

inclusiveRight: boolean
Like inclusiveLeft, but for the right side.
+
selectLeft: boolean
+
For atomic ranges, determines whether the cursor is allowed + to be placed directly to the left of the range. Has no effect on + non-atomic ranges.
+
selectRight: boolean
+
Like selectLeft, + but for the right side.
atomic: boolean
Atomic ranges act as a single unit when cursor movement is concerned—i.e. it is impossible to place the cursor inside of - them. In atomic ranges, inclusiveLeft - and inclusiveRight have a different meaning—they - will prevent the cursor from being placed respectively - directly before and directly after the range.
+ them. You can control whether the cursor is allowed to be placed + directly before or after them using selectLeft + or selectRight. If selectLeft + (or right) is not provided, then inclusiveLeft (or + right) will control this behavior.
collapsed: boolean
Collapsed ranges do not show up in the display. Setting a range to be collapsed will automatically make it atomic.
@@ -1542,10 +1732,12 @@

Text-marking methods

is part of the marker.
endStyle: string
Equivalent to startStyle, but for the rightmost span.
-
title: - string
When given, will give the nodes created - for this span a HTML title attribute with the - given value.
+
css: string
+
A string of CSS to be applied to the covered text. For example "color: #fe3".
+
attributes: object
+
When given, add the attributes in the given object to the + elements created for the marked text. Adding class or + style attributes this way is not supported.
shared: boolean
When the target document is linked to other documents, you can set shared to true to make the @@ -1586,11 +1778,16 @@

Text-marking methods

shared: boolean
See the corresponding option to markText.
+
handleMouseEvents: boolean
+
As with markText, + this determines whether mouse events on the widget inserted + for this bookmark are handled by CodeMirror. The default is + false.
doc.findMarks(from: {line, ch}, to: {line, ch}) → array<TextMarker>
Returns an array of all the bookmarks and marked ranges - found between the given positions.
+ found between the given positions (non-inclusive).
doc.findMarksAt(pos: {line, ch}) → array<TextMarker>
Returns an array of all the bookmarks and marked ranges present at the given position.
@@ -1601,7 +1798,7 @@

Text-marking methods

Widget, gutter, and decoration methods

-
cm.setGutterMarker(line: integer|LineHandle, gutterID: string, value: Element) → LineHandle
+
doc.setGutterMarker(line: integer|LineHandle, gutterID: string, value: Element) → LineHandle
Sets the gutter marker for the given gutter (identified by its CSS class, see the gutters option) @@ -1610,7 +1807,7 @@

Widget, gutter, and decoration methods

will be shown in the specified gutter next to the specified line.
-
cm.clearGutter(gutterID: string)
+
doc.clearGutter(gutterID: string)
Remove all gutter markers in the gutter with the given ID.
@@ -1620,10 +1817,11 @@

Widget, gutter, and decoration methods

to which element this class should be applied, can can be one of "text" (the text element, which lies in front of the selection), "background" (a background element - that will be behind the selection), or "wrap" (the - wrapper node that wraps all of the line's elements, including - gutter elements). class should be the name of the - class to apply. + that will be behind the selection), "gutter" (the + line's gutter space), or "wrap" (the wrapper node + that wraps all of the line's elements, including gutter + elements). class should be the name of the class to + apply.
doc.removeLineClass(line: integer|LineHandle, where: string, class: string) → LineHandle
Remove a CSS class from a line. line can be a @@ -1634,7 +1832,7 @@

Widget, gutter, and decoration methods

can be left off to remove all classes for the specified node, or be a string to remove only a specific class.
-
cm.lineInfo(line: integer|LineHandle) → object
+
doc.lineInfo(line: integer|LineHandle) → object
Returns the line number, text content, and marker status of the given line, which can be either a number or a line handle. The returned object has the structure {line, handle, text, @@ -1654,7 +1852,7 @@

Widget, gutter, and decoration methods

widget again, simply use DOM methods (move it somewhere else, or call removeChild on its parent).
-
cm.addLineWidget(line: integer|LineHandle, node: Element, ?options: object) → LineWidget
+
doc.addLineWidget(line: integer|LineHandle, node: Element, ?options: object) → LineWidget
Adds a line widget, an element shown below a line, spanning the whole of the editor's width, and moving the lines below it downwards. line should be either an integer or a @@ -1683,6 +1881,9 @@

Widget, gutter, and decoration methods

position (zero for the top, N to put it after the Nth other widget). Note that this only has effect once, when the widget is created. +
className: string
+
Add an extra CSS class name to the wrapper element + created for the widget.
Note that the widget node will become a descendant of nodes with CodeMirror-specific CSS classes, and those classes might in some @@ -1703,7 +1904,7 @@

Sizing, scrolling and positioning methods

cm.setSize(width: number|string, height: number|string)
-
Programatically set the size of the editor (overriding the +
Programmatically set the size of the editor (overriding the applicable CSS rules). width and height can be either numbers (interpreted as pixels) or CSS units @@ -1737,9 +1938,12 @@

Sizing, scrolling and positioning methods

If mode is "local", they will be relative to the top-left corner of the editable document. If it is "page" or not given, they are relative to the - top-left corner of the page. where can be a boolean - indicating whether you want the start (true) or the - end (false) of the selection, or, if a {line, + top-left corner of the page. If mode + is "window", the coordinates are relative to the + top-left corner of the currently visible (scrolled) + window. where can be a boolean indicating whether + you want the start (true) or the end + (false) of the selection, or, if a {line, ch} object is given, it specifies the precise position at which you want to measure.
cm.charCoords(pos: {line, ch}, ?mode: string) → {left, right, top, bottom}
@@ -1750,7 +1954,7 @@

Sizing, scrolling and positioning methods

position that the cursor would have when it would sit at that position.
cm.coordsChar(object: {left, top}, ?mode: string) → {line, ch}
-
Given an {left, top} object, returns +
Given an {left, top} object (e.g. coordinates of a mouse event) returns the {line, ch} position that corresponds to it. The optional mode parameter determines relative to what the coordinates are interpreted. It may @@ -1761,13 +1965,16 @@

Sizing, scrolling and positioning methods

height. mode can be one of the same strings that coordsChar accepts.
-
cm.heightAtLine(line: number, ?mode: string) → number
+
cm.heightAtLine(line: integer|LineHandle, ?mode: string, ?includeWidgets: bool) → number
Computes the height of the top of a line, in the coordinate system specified by mode (see coordsChar), which defaults to "page". When a line below the bottom of the document is specified, the returned value is the bottom of - the last line in the document.
+ the last line in the document. By default, the position of the + actual text is returned. If `includeWidgets` is true and the + line has line widgets, the position above the first line widget + is returned.
cm.defaultTextHeight() → number
Returns the line height of the default font for the editor.
cm.defaultCharWidth() → number
@@ -1789,7 +1996,8 @@

Sizing, scrolling and positioning methods

If your code does something to change the size of the editor element (window resizes are already listened for), or unhides it, you should probably follow up by calling this method to - ensure CodeMirror is still looking as intended.
+ ensure CodeMirror is still looking as intended. See also + the autorefresh addon.

Mode, state, and token-related methods

@@ -1806,7 +2014,7 @@

Mode, state, and token-related methods

the mode specification, rather than the resolved, instantiated mode object. -
doc.getModeAt(pos: {line, ch}) → object
+
cm.getModeAt(pos: {line, ch}) → object
Gets the inner mode at a given position. This will return the same as getMode for simple modes, but will return an inner mode for nesting modes @@ -1830,6 +2038,13 @@

Mode, state, and token-related methods

edits were recently made and highlighting has not yet completed.
+
cm.getLineTokens(line: integer, ?precise: boolean) → array<{start, end, string, type, state}>
+
This is similar + to getTokenAt, but + collects all tokens for a given line into an array. It is much + cheaper than repeatedly calling getTokenAt, which + re-parses the part of the line before the token for every call.
+
cm.getTokenTypeAt(pos: {line, ch}) → string
This is a (much) cheaper version of getTokenAt useful for @@ -1890,6 +2105,17 @@

Miscellaneous methods

lot faster. The return value from this method will be the return value of your function.
+
cm.startOperation()
+
cm.endOperation()
+
In normal circumstances, use the above operation + method. But if you want to buffer operations happening asynchronously, + or that can't all be wrapped in a callback function, you can + call startOperation to tell CodeMirror to start + buffering changes, and endOperation to actually + render all the updates. Be careful: if you use this + API and forget to call endOperation, the editor will + just never update.
+
cm.indentLine(line: integer, ?dir: string|integer)
Adjust the indentation of the given line. The second argument (which defaults to "smart") may be one of: @@ -1909,11 +2135,21 @@

Miscellaneous methods

indentation by the given amount of spaces.
-
cm.toggleOverwrite(?value: bool)
+
cm.toggleOverwrite(?value: boolean)
Switches between overwrite and normal insert mode (when not given an argument), or sets the overwrite mode to a specific state (when given an argument).
+
cm.isReadOnly() → boolean
+
Tells you whether the editor's content can be edited by the + user.
+ +
doc.lineSeparator()
+
Returns the preferred line separator string for this + document, as per the option + by the same name. When that option is null, the + string "\n" is returned.
+
cm.execCommand(name: string)
Runs the command with the given name on the editor.
@@ -1929,8 +2165,16 @@

Miscellaneous methods

cm.focus()
Give the editor focus.
-
cm.getInputField() → TextAreaElement
-
Returns the hidden textarea used to read input.
+
cm.phrase(text: string) → string
+
Allow the given string to be translated with + the phrases + option.
+ +
cm.getInputField() → Element
+
Returns the input field for the editor. Will be a textarea + or an editable div, depending on the value of + the inputStyle + option.
cm.getWrapperElement() → Element
Returns the DOM node that represents the editor, and controls its size. Remove this from your tree to delete an @@ -1955,26 +2199,29 @@

Static properties

else (usually one) for dev snapshots.
CodeMirror.fromTextArea(textArea: TextAreaElement, ?config: object)
-
- The method provides another way to initialize an editor. It - takes a textarea DOM node as first argument and an optional - configuration object as second. It will replace the textarea - with a CodeMirror instance, and wire up the form of that - textarea (if any) to make sure the editor contents are put - into the textarea when the form is submitted. The text in the - textarea will provide the content for the editor. A CodeMirror - instance created this way has three additional methods: -
-
cm.save()
-
Copy the content of the editor into the textarea.
- -
cm.toTextArea()
-
Remove the editor, and restore the original textarea (with - the editor's current content).
- -
cm.getTextArea() → TextAreaElement
-
Returns the textarea that the instance was based on.
-
+
This method provides another way to initialize an editor. It + takes a textarea DOM node as first argument and an optional + configuration object as second. It will replace the textarea + with a CodeMirror instance, and wire up the form of that + textarea (if any) to make sure the editor contents are put into + the textarea when the form is submitted. The text in the + textarea will provide the content for the editor. A CodeMirror + instance created this way has three additional methods: +
+
cm.save()
+
Copy the content of the editor into the textarea.
+ +
cm.toTextArea()
+
Remove the editor, and restore the original textarea (with + the editor's current content). If you dynamically create and + destroy editors made with `fromTextArea`, without destroying + the form they are part of, you should make sure to call + `toTextArea` to remove the editor, or its `"submit"` handler + on the form will cause a memory leak.
+ +
cm.getTextArea() → TextAreaElement
+
Returns the textarea that the instance was based on.
+
CodeMirror.defaults: object
@@ -1991,7 +2238,7 @@

Static properties

created from then on.
CodeMirror.defineDocExtension(name: string, value: any)
-
Like defineExtension, +
Like defineExtension, but the method will be added to the interface for Doc objects instead.
@@ -2004,7 +2251,7 @@

Static properties

through setOption.
CodeMirror.defineInitHook(func: function)
-
If your extention just needs to run some +
If your extension just needs to run some code whenever a CodeMirror instance is initialized, use CodeMirror.defineInitHook. Give it a function as its only argument, and from then on, that function will be called @@ -2030,9 +2277,12 @@

Static properties

whenever the given predicate returns true when called with the local mode and editor.
-
CodeMirror.Pos(line: integer, ?ch: integer)
-
A constructor for the {line, ch} objects that - are used to represent positions in editor documents.
+
CodeMirror.Pos(line: integer, ?ch: integer, ?sticky: string)
+
A constructor for the objects that are used to represent + positions in editor documents. sticky defaults to + null, but can be set to "before" + or "after" to make the position explicitly + associate with the character before or after it.
CodeMirror.changeEnd(change: object) → {line, ch}
Utility function that computes an end position from a change @@ -2041,11 +2291,14 @@

Static properties

various event handlers). The returned position will be the end of the changed range, after the change is applied.
+ +
CodeMirror.countColumn(line: string, index: number, tabSize: number) → number
+
Find the column position at a given string index using a given tabsize.
-

Addons

+

Addons

The addon directory in the distribution contains a number of reusable components that implement extra editor @@ -2066,23 +2319,23 @@

Addons

which, if called, will close the dialog immediately. openDialog takes the following options:
-
closeOnEnter:
+
closeOnEnter: bool
If true, the dialog will be closed when the user presses enter in the input. Defaults to true.
-
onKeyDown:
-
An event handler of the signature (event, value, closeFunction) - that will be called whenever keydown fires in the +
closeOnBlur: bool
+
Determines whether the dialog is closed when it loses focus. Defaults to true.
+
onKeyDown: fn(event: KeyboardEvent, value: string, close: fn()) → bool
+
An event handler that will be called whenever keydown fires in the dialog's input. If your callback returns true, the dialog will not do any further processing of the event.
-
onKeyUp:
+
onKeyUp: fn(event: KeyboardEvent, value: string, close: fn()) → bool
Same as onKeyDown but for the keyup event.
-
onInput:
+
onInput: fn(event: InputEvent, value: string, close: fn()) → bool
Same as onKeyDown but for the input event.
-
onClose:
-
A callback of the signature (dialogInstance) - that will be called after the dialog has been closed and +
onClose: fn(instance):
+
A callback that will be called after the dialog has been closed and removed from the DOM. No return value.
@@ -2096,16 +2349,18 @@

Addons

Depends on addon/dialog/dialog.css.

search/searchcursor.js
-
Adds the getSearchCursor(query, start, caseFold) → +
Adds the getSearchCursor(query, start, options) → cursor method to CodeMirror instances, which can be used to implement search/replace functionality. query - can be a regular expression or a string (only strings will match - across lines—if they contain newlines). start + can be a regular expression or a string. start provides the starting position of the search. It can be a {line, ch} object, or can be left off to default - to the start of the document. caseFold is only - relevant when matching a string. It will cause the search to be - case-insensitive. A search cursor has the following methods: + to the start of the document. options is an + optional object, which can contain the property `caseFold: + false` to disable case folding when matching a string, or the + property `multiline: disable` to disable multi-line matching for + regular expressions (which may help performance). A search + cursor has the following methods:
findNext() → boolean
findPrevious() → boolean
@@ -2120,7 +2375,7 @@

Addons

to findNext or findPrevious did not return false. They will return {line, ch} objects pointing at the start and end of the match.
-
replace(text: string)
+
replace(text: string, ?origin: string)
Replaces the currently found match with the given text and adjusts the cursor position to reflect the replacement.
@@ -2134,14 +2389,58 @@

Addons

of openDialog when available to make prompting for search queries less ugly. +
search/jump-to-line.js
+
Implements a jumpToLine command and binding Alt-G to it. + Accepts linenumber, +/-linenumber, line:char, + scroll% and :linenumber formats. + This will make use of openDialog + when available to make prompting for line number neater.
+ +
search/matchesonscrollbar.js
+
Adds a showMatchesOnScrollbar method to editor + instances, which should be given a query (string or regular + expression), optionally a case-fold flag (only applicable for + strings), and optionally a class name (defaults + to CodeMirror-search-match) as arguments. When + called, matches of the given query will be displayed on the + editor's vertical scrollbar. The method returns an object with + a clear method that can be called to remove the + matches. Depends on + the annotatescrollbar + addon, and + the matchesonscrollbar.css + file provides a default (transparent yellowish) definition of + the CSS class applied to the matches. Note that the matches are + only perfectly aligned if your scrollbar does not have buttons + at the top and bottom. You can use + the simplescrollbar + addon to make sure of this. If this addon is loaded, + the search addon will + automatically use it.
+
edit/matchbrackets.js
Defines an option matchBrackets which, when set - to true, causes matching brackets to be highlighted whenever the - cursor is next to them. It also adds a + to true or an options object, causes matching brackets to be + highlighted whenever the cursor is next to them. It also adds a method matchBrackets that forces this to happen once, and a method findMatchingBracket that can be used to run the bracket-finding algorithm that this uses - internally.
+ internally. It takes a start position and an optional config + object. By default, it will find the match to a matchable + character either before or after the cursor (preferring the one + before), but you can control its behavior with these options: +
+
afterCursor
+
Only use the character after the start position, never the one before it.
+
strict
+
Causes only matches where both brackets are at the same side of the start position to be considered.
+
maxScanLines
+
Stop after scanning this amount of lines without a successful match. Defaults to 1000.
+
maxScanLineLength
+
Ignore lines longer than this. Defaults to 10000.
+
maxHighlightLineLength
+
Don't highlight a bracket in a line longer than this. Defaults to 1000.
+
edit/closebrackets.js
Defines an option autoCloseBrackets that will @@ -2153,7 +2452,13 @@

Addons

it. explode should be a similar string that gives the pairs of characters that, when enter is pressed between them, should have the second character also moved to its own - line. Demo here.
+ line. By default, if the active mode has + a closeBrackets property, that overrides the + configuration given in the option. But you can add + an override property with a truthy value to + override mode-specific + configuration. Demo + here.
edit/matchtags.js
Defines an option matchTags that, when enabled, @@ -2161,7 +2466,7 @@

Addons

the CodeMirror-matchingtag class). Also defines a command toMatchingTag, - which you can bind a key to in order to jump to the tag mathing + which you can bind a key to in order to jump to the tag matching the one under the cursor. Depends on the addon/fold/xml-fold.js addon. Demo here.
@@ -2174,22 +2479,29 @@

Addons

squiggly underline style for this class.
edit/closetag.js
-
Provides utility functions for adding automatic tag closing - to XML modes. See +
Defines an autoCloseTags option that will + auto-close XML tags when '>' or '/' + is typed, and + a closeTag command that + closes the nearest open tag. Depends on + the fold/xml-fold.js addon. See the demo.
edit/continuelist.js
Markdown specific. Defines a "newlineAndIndentContinueMarkdownList" command - command that can be bound to enter to automatically + that can be bound to enter to automatically insert the leading characters for continuing a list. See the Markdown mode demo.
comment/comment.js
-
Addon for commenting and uncommenting code. Adds three +
Addon for commenting and uncommenting code. Adds four methods to CodeMirror instances:
+
toggleComment(?options: object)
+
Tries to uncomment the current selection, and if that + fails, line-comments it.
lineComment(from: {line, ch}, to: {line, ch}, ?options: object)
Set the lines in the given range to be line comments. Will fall back to blockComment when no line comment @@ -2227,8 +2539,8 @@

Addons

The addon also defines a toggleComment command, - which will try to uncomment the current selection, and if that - fails, line-comments it.
+ which is a shorthand command for calling + toggleComment with no options.
fold/foldcode.js
Helps with code folding. Adds a foldCode method @@ -2255,10 +2567,14 @@

Addons

and CodeMirror.fold.xml, for XML-style languages, and CodeMirror.fold.comment, for folding comment blocks.
-
widget: string|Element
+
widget: string | Element | fn(from: Pos, to: Pos) → string|Element
The widget to show for folded ranges. Can be either a string, in which case it'll become a span with - class CodeMirror-foldmarker, or a DOM node.
+ class CodeMirror-foldmarker, or a DOM node. + To dynamically generate the widget, this can be a function + that returns a string or DOM node, which will then render + as described. The function will be invoked with parameters + identifying the range to be folded.
scanUp: boolean
When true (default is false), the addon will try to find foldable ranges on the lines above the current one if there @@ -2316,11 +2632,11 @@

Addons

Can be used to run a CodeMirror mode over text without actually opening an editor instance. See the demo for an example. - There are alternate versions of the file avaible for + There are alternate versions of the file available for running stand-alone (without including all of CodeMirror) and for running under - node.js.
+ node.js (see bin/source-highlight for an example of using the latter).
runmode/colorize.js
Provides a convenient way to syntax-highlight code snippets @@ -2352,7 +2668,7 @@

Addons

between several modes. Defines CodeMirror.multiplexingMode which, when given as first argument a mode object, and as other arguments - any number of {open, close, mode [, delimStyle, innerStyle]} + any number of {open, close, mode [, delimStyle, innerStyle, parseDelimiters]} objects, will return a mode object that starts parsing using the mode passed as first argument, but will switch to another mode as soon as it encounters a string that occurs in one of @@ -2362,10 +2678,15 @@

Addons

Pass "\n" for open or close if you want to switch on a blank line.
  • When delimStyle is specified, it will be the token - style returned for the delimiter tokens.
  • + style returned for the delimiter tokens (as well as + [delimStyle]-open on the opening token and + [delimStyle]-close on the closing token).
  • When innerStyle is specified, it will be the token - style added for each inner mode token.
- The outer mode will not see the content between the delimiters. + style added for each inner mode token. +
  • When parseDelimiters is true, the content of + the delimiters will also be passed to the inner mode. + (And delimStyle is ignored.)
  • The outer + mode will not see the content between the delimiters. See this demo for an example.
    @@ -2380,7 +2701,9 @@

    Addons

    is an array of strings or objects (the completions), and from and to give the start and end of the token that is being completed as {line, ch} - objects. + objects. An optional selectedHint property (an + integer) can be added to the completion object to control the + initially selected hint.
    If no hinting function is given, the addon will use CodeMirror.hint.auto, which calls getHelpers with @@ -2413,10 +2736,14 @@

    Addons

    to: {line, ch}
    Optional to position that will be used by pick() instead of the global one passed with the full list of completions.
    - - The plugin understands the following options (the options object - will also be passed along to the hinting function, which may - understand additional options): + + +
    The plugin understands the following options, which may be + either passed directly in the argument to showHint, + or provided by setting an hintOptions editor + option to an object (the former takes precedence). The options + object will also be passed along to the hinting function, which + may understand additional options.
    hint: function
    A hinting function, as specified above. It is possible to @@ -2425,7 +2752,13 @@

    Addons

    arguments (cm, callback, ?options), and the completion interface will only be popped up when the hinting function calls the callback, passing it the object holding the - completions.
    + completions. + The hinting function can also return a promise, and the completion + interface will only be popped when the promise resolves. + By default, hinting only works when there is no + selection. You can give a hinting function + a supportsSelection property with a truthy value + to indicate that it supports selections.
    completeSingle: boolean
    Determines whether, when only a single completion is available, it is completed without showing the dialog. @@ -2443,9 +2776,9 @@

    Addons

    has moveFocus(n), setFocus(n), pick(), and close() methods (see the source for details), that can be used to change the focused element, pick the - current element or close the menu. Additionnaly menuSize() + current element or close the menu. Additionally menuSize() can give you access to the size of the current dropdown menu, - length give you the number of availlable completions, and + length give you the number of available completions, and data give you full access to the completion returned by the hinting function.
    extraKeys: keymap
    @@ -2495,8 +2828,13 @@

    Addons

    and attrs (an object mapping attribute names to null for free-form attributes, and an array of valid values for restricted - attributes). Demo - here. + attributes).
    The hint options accept an additional property: +
    +
    matchInMiddle: boolean
    +
    Determines whether typed characters are matched anywhere in + completions, not just at the beginning. Defaults to false.
    +
    + Demo here.
    hint/html-hint.js
    Provides schema info to @@ -2513,10 +2851,6 @@

    Addons

    A hinting function for CSS, SCSS, or LESS code. Defines CodeMirror.hint.css.
    -
    hint/python-hint.js
    -
    A very simple hinting function for Python code. - Defines CodeMirror.hint.python.
    -
    hint/anyword-hint.js
    A very simple hinting function (CodeMirror.hint.anyword) that simply looks for @@ -2527,7 +2861,11 @@

    Addons

    should scan when completing (defaults to 500).
    hint/sql-hint.js
    -
    A simple SQL hinter. Defines CodeMirror.hint.sql.
    +
    A simple SQL hinter. Defines CodeMirror.hint.sql. + Takes two optional options, tables, a object with + table names as keys and array of respective column names as values, + and defaultTable, a string corresponding to a + table name in tables for autocompletion.
    search/match-highlighter.js
    Adds a highlightSelectionMatches option that @@ -2538,7 +2876,8 @@

    Addons

    (default 2), style, for the style to be used to highlight the matches (default "matchhighlight", which will correspond to CSS - class cm-matchhighlight), + class cm-matchhighlight), trim, which + controls whether whitespace is trimmed from the selection, and showToken which can be set to true or to a regexp matching the characters that make up a word. When enabled, it causes the current word to be highlighted when @@ -2548,17 +2887,33 @@

    Addons

    lint/lint.js
    Defines an interface component for showing linting warnings, with pluggable warning sources - (see json-lint.js, + (see html-lint.js, + json-lint.js, javascript-lint.js, + coffeescript-lint.js, and css-lint.js in the same directory). Defines a lint option that - can be set to a warning source (for - example CodeMirror.lint.javascript), or - to true, in which - case getHelper with - type "lint" is used to determined a validator - function. Depends on addon/lint/lint.css. A demo - can be found here.
    + can be set to an annotation source (for + example CodeMirror.lint.javascript), to an options + object (in which case the getAnnotations field is + used as annotation source), or simply to true. When + no annotation source is + specified, getHelper with + type "lint" is used to find an annotation function. + An annotation source function should, when given a document + string, an options object, and an editor instance, return an + array of {message, severity, from, to} objects + representing problems. When the function has + an async property with a truthy value, it will be + called with an additional second argument, which is a callback + to pass the array to. + The linting function can also return a promise, in that case the linter + will only be executed when the promise resolves. + By default, the linter will run (debounced) whenever the document is changed. + You can pass a lintOnChange: false option to disable that. + You can pass a selfContain: true option to render the tooltip inside the editor instance. + Depends on addon/lint/lint.css. A demo can be + found here.
    selection/mark-selection.js
    Causes the selected text to be marked with the CSS class @@ -2567,10 +2922,28 @@

    Addons

    like in this demo.
    selection/active-line.js
    -
    Defines a styleActiveLine option that, when enabled, - gives the wrapper of the active line the class CodeMirror-activeline, - and adds a background with the class CodeMirror-activeline-background. - is enabled. See the demo.
    +
    Defines a styleActiveLine option that, when + enabled, gives the wrapper of the line that contains the cursor + the class CodeMirror-activeline, adds a background + with the class CodeMirror-activeline-background, + and adds the class CodeMirror-activeline-gutter to + the line's gutter space is enabled. The option's value may be a + boolean or an object specifying the following options: +
    +
    nonEmpty: bool
    +
    Controls whether single-line selections, or just cursor + selections, are styled. Defaults to false (only cursor + selections).
    +
    + See the demo.
    + +
    selection/selection-pointer.js
    +
    Defines a selectionPointer option which you can + use to control the mouse cursor appearance when hovering over + the selection. It can be set to a string, + like "pointer", or to true, in which case + the "default" (arrow) cursor will be used. You can + see a demo here.
    mode/loadmode.js
    Defines a CodeMirror.requireMode(modename, @@ -2585,6 +2958,27 @@

    Addons

    editor instance to refresh its mode when the loading succeeded. See the demo.
    +
    mode/meta.js
    +
    Provides meta-information about all the modes in the + distribution in a single file. + Defines CodeMirror.modeInfo, an array of objects + with {name, mime, mode} properties, + where name is the human-readable + name, mime the MIME type, and mode the + name of the mode file that defines this MIME. There are optional + properties mimes, which holds an array of MIME + types for modes with multiple MIMEs associated, + and ext, which holds an array of file extensions + associated with this mode. Four convenience + functions, CodeMirror.findModeByMIME, + CodeMirror.findModeByExtension, + CodeMirror.findModeByFileName + and CodeMirror.findModeByName are provided, which + return such an object given a MIME, extension, file name or mode name + string. Note that, for historical reasons, this file resides in the + top-level mode directory, not + under addon. Demo.
    +
    comment/continuecomment.js
    Adds a continueComments option, which sets whether the editor will make the next line continue a comment when you press Enter @@ -2597,9 +2991,10 @@

    Addons

    display/placeholder.js
    Adds a placeholder option that can be used to - make text appear in the editor when it is empty and not focused. - Also gives the editor a CodeMirror-empty CSS class - whenever it doesn't contain any text. + make content appear in the editor when it is empty and not + focused. It can hold either a string or a DOM node. Also gives + the editor a CodeMirror-empty CSS class whenever it + doesn't contain any text. See the demo.
    display/fullscreen.js
    @@ -2609,17 +3004,96 @@

    Addons

    on fullscreen.css. Demo here. +
    display/autorefresh.js
    +
    This addon can be useful when initializing an editor in a + hidden DOM node, in cases where it is difficult to + call refresh when the editor + becomes visible. It defines an option autoRefresh + which you can set to true to ensure that, if the editor wasn't + visible on initialization, it will be refreshed the first time + it becomes visible. This is done by polling every 250 + milliseconds (you can pass a value like {delay: + 500} as the option value to configure this). Note that + this addon will only refresh the editor once when it + first becomes visible, and won't take care of further restyling + and resizing.
    + +
    scroll/simplescrollbars.js
    +
    Defines two additional scrollbar + models, "simple" and "overlay" + (see demo) that can + be selected with + the scrollbarStyle + option. Depends + on simplescrollbars.css, + which can be further overridden to style your own + scrollbars.
    + +
    scroll/annotatescrollbar.js
    +
    Provides functionality for showing markers on the scrollbar + to call out certain parts of the document. Adds a + method annotateScrollbar to editor instances that + can be called, with a CSS class name as argument, to create a + set of annotations. The method returns an object + whose update method can be called with a sorted array + of {from: Pos, to: Pos} objects marking the ranges + to be highlighted. To detach the annotations, call the + object's clear method.
    +
    display/rulers.js
    Adds a rulers option, which can be used to show one or more vertical rulers in the editor. The option, if defined, should be given an array of {column [, className, - color, lineStyle, width]} objects or numbers (wich + color, lineStyle, width]} objects or numbers (which indicate a column). The ruler will be displayed at the column indicated by the number or the column property. The className property can be used to assign a custom style to a ruler. Demo here.
    +
    display/panel.js
    +
    Defines an addPanel method for CodeMirror + instances, which places a DOM node above or below an editor, and + shrinks the editor to make room for the node. The method takes + as first argument as DOM node, and as second an optional options + object. The Panel object returned by this method + has a clear method that is used to remove the + panel, and a changed method that can be used to + notify the addon when the size of the panel's DOM node has + changed.
    + The method accepts the following options: +
    +
    position: string
    +
    Controls the position of the newly added panel. The + following values are recognized: +
    +
    top (default)
    +
    Adds the panel at the very top.
    +
    after-top
    +
    Adds the panel at the bottom of the top panels.
    +
    bottom
    +
    Adds the panel at the very bottom.
    +
    before-bottom
    +
    Adds the panel at the top of the bottom panels.
    +
    +
    +
    before: Panel
    +
    The new panel will be added before the given panel.
    +
    after: Panel
    +
    The new panel will be added after the given panel.
    +
    replace: Panel
    +
    The new panel will replace the given panel.
    +
    stable: bool
    +
    Whether to scroll the editor to keep the text's vertical + position stable, when adding a panel above it. Defaults to false.
    +
    + When using the after, before or replace options, + if the panel doesn't exists or has been removed, + the value of the position option will be used as a fallback. +
    + A demo of the addon is available here. +
    +
    wrap/hardwrap.js
    Addon to perform hard line wrapping/breaking for paragraphs of text. Adds these methods to editor instances: @@ -2631,7 +3105,7 @@

    Addons

    wrapRange(from: {line, ch}, to: {line, ch}, ?options: object)
    Wraps the given range as one big paragraph.
    wrapParagraphsInRange(from: {line, ch}, to: {line, ch}, ?options: object)
    -
    Wrapps the paragraphs in (and overlapping with) the +
    Wraps the paragraphs in (and overlapping with) the given range individually.
    The following options are recognized: @@ -2659,26 +3133,60 @@

    Addons

    constructor takes arguments similar to the CodeMirror constructor, first a node to append the interface to, and then - an options object. Two extra optional options are - recognized, origLeft and origRight, - which may be strings that provide original versions of the - document, which will be shown to the left and right of the - editor in non-editable CodeMirror instances. The merge interface - will highlight changes between the editable document and the - original(s), and, unless a revertButtons option - of false is given, show buttons that allow the user - to revert changes (demo). + an options object. Options are passed through to the editors + inside the view. These extra options are recognized: +
    +
    origLeft and origRight: string
    +
    If given these provide original versions of the + document, which will be shown to the left and right of the + editor in non-editable CodeMirror instances. The merge + interface will highlight changes between the editable + document and the original(s). To create a 2-way (as opposed + to 3-way) merge view, provide only one of them.
    +
    revertButtons: boolean
    +
    Determines whether buttons that allow the user to revert + changes are shown. Defaults to true.
    +
    revertChunk: fn(mv: MergeView, from: CodeMirror, fromStart: Pos, fromEnd: Pos, to: CodeMirror, toStart: Pos, toEnd: Pos)
    +
    Can be used to define custom behavior when the user + reverts a changed chunk.
    +
    connect: string
    +
    Sets the style used to connect changed chunks of code. + By default, connectors are drawn. When this is set + to "align", the smaller chunk is padded to + align with the bigger chunk instead.
    +
    collapseIdentical: boolean|number
    +
    When true (default is false), stretches of unchanged + text will be collapsed. When a number is given, this + indicates the amount of lines to leave visible around such + stretches (which defaults to 2).
    +
    allowEditingOriginals: boolean
    +
    Determines whether the original editor allows editing. + Defaults to false.
    +
    showDifferences: boolean
    +
    When true (the default), changed pieces of text are + highlighted.
    +
    chunkClassLocation: string|Array
    +
    By default the chunk highlights are added + using addLineClass + with "background". Override this to customize it to be any + valid `where` parameter or an Array of valid `where` + parameters.
    +
    + The addon also defines commands "goNextDiff" + and "goPrevDiff" to quickly jump to the next + changed chunk. Demo + here.
    tern/tern.js
    Provides integration with - the Tern JavaScript analysis + the Tern JavaScript analysis engine, for completion, definition finding, and minor refactoring help. See the demo for a very simple integration. For more involved scenarios, see the comments at the top of the addon and the implementation of the - (multi-file) demonstration + (multi-file) demonstration on the Tern website.
    @@ -2692,6 +3200,11 @@

    Writing CodeMirror Modes

    advances it past a token, and returns a style for that token. More advanced modes can also handle indentation for the language.

    +

    This section describes the low-level mode interface. Many modes + are written directly against this, since it offers a lot of + control, but for a quick mode definition, you might want to use + the simple mode addon.

    +

    The mode script should call CodeMirror.defineMode to register itself with CodeMirror. This function takes two @@ -2763,7 +3276,7 @@

    Writing CodeMirror Modes

    peek() → string
    Returns the next character in the stream without advancing - it. Will return an null at the end of the + it. Will return a null at the end of the line.
    next() → string
    Returns the next character in the stream and advances it. @@ -2784,11 +3297,11 @@

    Writing CodeMirror Modes

    white-space.
    skipToEnd()
    Moves the position to the end of the line.
    -
    skipTo(ch: string) → boolean
    -
    Skips to the next occurrence of the given character, if +
    skipTo(str: string) → boolean
    +
    Skips to the start of the next occurrence of the given string, if found on the current line (doesn't advance the stream if the - character does not occur on the line). Returns true if the - character was found.
    + string does not occur on the line). Returns true if the + string was found.
    match(pattern: string, ?consume: boolean, ?caseFold: boolean) → boolean
    match(pattern: regexp, ?consume: boolean) → array<string>
    Act like a @@ -2816,6 +3329,18 @@

    Writing CodeMirror Modes

    current() → string
    Get the string between the start of the current token and the current stream position.
    + +
    lookAhead(n: number) → ?string
    +
    Get the line n (>0) lines after the current + one, in order to scan ahead across line boundaries. Note that + you want to do this carefully, since looking far ahead will make + mode state caching much less effective.
    + +
    baseToken() → ?{type: ?string, size: number}
    +
    Modes added + through addOverlay + (and only such modes) can use this method to inspect + the current token produced by the underlying mode.

    By default, blank lines are simply skipped when @@ -2946,6 +3471,131 @@

    Writing CodeMirror Modes

    looked up through getMode.

    +
    +

    VIM Mode API

    + +

    CodeMirror has a robust VIM mode that attempts to faithfully + emulate VIM's most useful features. It can be enabled by + including keymap/vim.js + and setting the keyMap option to + "vim".

    + +

    Configuration

    + +

    VIM mode accepts configuration options for customizing + behavior at run time. These methods can be called at any time + and will affect all existing CodeMirror instances unless + specified otherwise. The methods are exposed on the + CodeMirror.Vim object.

    + +
    +
    setOption(name: string, value: any, ?cm: CodeMirror, ?cfg: object)
    +
    Sets the value of a VIM option. name should + be the name of an option. If cfg.scope is not set + and cm is provided, then sets the global and + instance values of the option. Otherwise, sets either the + global or instance value of the option depending on whether + cfg.scope is global or + local.
    +
    getOption(name: string, ?cm: CodeMirror: ?cfg: object)
    +
    Gets the current value of a VIM option. If + cfg.scope is not set and cm is + provided, then gets the instance value of the option, falling + back to the global value if not set. If cfg.scope is provided, then gets the global or + local value without checking the other.
    + +
    map(lhs: string, rhs: string, ?context: string)
    +
    Maps a key sequence to another key sequence. Implements + VIM's :map command. To map ; to : in VIM would be + :map ; :. That would translate to + CodeMirror.Vim.map(';', ':');. + The context can be normal, + visual, or insert, which correspond + to :nmap, :vmap, and + :imap + respectively.
    + +
    mapCommand(keys: string, type: string, name: string, ?args: object, ?extra: object)
    +
    Maps a key sequence to a motion, + operator, or action type command. + The args object is passed through to the command when it is + invoked by the provided key sequence. + extras.context can be normal, + visual, or insert, to map the key + sequence only in the corresponding mode. + extras.isEdit is applicable only to actions, + determining whether it is recorded for replay for the + . single-repeat command. +
    + +

    Extending VIM

    + +

    CodeMirror's VIM mode implements a large subset of VIM's core + editing functionality. But since there's always more to be + desired, there is a set of APIs for extending VIM's + functionality. As with the configuration API, the methods are + exposed on CodeMirror.Vim and may + be called at any time.

    + +
    +
    defineOption(name: string, default: any, type: string, ?aliases: array<string>, ?callback: function (?value: any, ?cm: CodeMirror) → ?any)
    +
    Defines a VIM style option and makes it available to the + :set command. Type can be boolean or + string, used for validation and by + :set to determine which syntax to accept. If a + callback is passed in, VIM does not store the value of the + option itself, but instead uses the callback as a setter/getter. If the + first argument to the callback is undefined, then the + callback should return the value of the option. Otherwise, it should set + instead. Since VIM options have global and instance values, whether a + CodeMirror instance is passed in denotes whether the global + or local value should be used. Consequently, it's possible for the + callback to be called twice for a single setOption or + getOption call. Note that right now, VIM does not support + defining buffer-local options that do not have global values. If an + option should not have a global value, either always ignore the + cm parameter in the callback, or always pass in a + cfg.scope to setOption and + getOption.
    + +
    defineMotion(name: string, fn: function(cm: CodeMirror, head: {line, ch}, ?motionArgs: object}) → {line, ch})
    +
    Defines a motion command for VIM. The motion should return + the desired result position of the cursor. head + is the current position of the cursor. It can differ from + cm.getCursor('head') if VIM is in visual mode. + motionArgs is the object passed into + mapCommand().
    + +
    defineOperator(name: string, fn: function(cm: CodeMirror, ?operatorArgs: object, ranges: array<{anchor, head}>) → ?{line, ch})
    +
    Defines an operator command, similar to + defineMotion. ranges is the range + of text the operator should operate on. If the cursor should + be set to a certain position after the operation finishes, it + can return a cursor object.
    + +
    defineAction(name: string, fn: function(cm: CodeMirror, ?actionArgs: object))
    +
    Defines an action command, similar to + defineMotion. Action commands + can have arbitrary behavior, making them more flexible than + motions and operators, at the loss of orthogonality.
    + +
    defineEx(name: string, ?prefix: string, fn: function(cm: CodeMirror, ?params: object))
    +
    Defines an Ex command, and maps it to :name. + If a prefix is provided, it, and any prefixed substring of the + name beginning with the prefix can + be used to invoke the command. If the prefix is + falsy, then name is used as the prefix. + params.argString contains the part of the prompted + string after the command name. params.args is + params.argString split by whitespace. If the + command was prefixed with a + line range, + params.line and params.lineEnd will + be set. +
    + +
    + diff --git a/ThirdParty/codemirror-4.6/doc/realworld.html b/ThirdParty/codemirror-5.52.0/doc/realworld.html similarity index 66% rename from ThirdParty/codemirror-4.6/doc/realworld.html rename to ThirdParty/codemirror-5.52.0/doc/realworld.html index 590e07b18ae6..0b03a15da58a 100644 --- a/ThirdParty/codemirror-4.6/doc/realworld.html +++ b/ThirdParty/codemirror-5.52.0/doc/realworld.html @@ -5,12 +5,12 @@