From 25d2888bc10e782e85e097aac8a0879a3c148cc7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 29 May 2016 23:23:16 +0200 Subject: ol3 v3.12 -> v3.16 --- chimere/static/ol3/ol-debug.js | 179837 ++++++++++++++++++-------------------- chimere/static/ol3/ol.js | 1989 +- 2 files changed, 84076 insertions(+), 97750 deletions(-) diff --git a/chimere/static/ol3/ol-debug.js b/chimere/static/ol3/ol-debug.js index 5bf1864..91f7ae3 100644 --- a/chimere/static/ol3/ol-debug.js +++ b/chimere/static/ol3/ol-debug.js @@ -1,6 +1,6 @@ // OpenLayers 3. See http://openlayers.org/ // License: https://raw.githubusercontent.com/openlayers/ol3/master/LICENSE.md -// Version: v3.12.1 +// Version: v3.16.0 (function (root, factory) { if (typeof exports === "object") { @@ -177,7 +177,8 @@ goog.define = function(name, defaultValue) { Object.prototype.hasOwnProperty.call( goog.global.CLOSURE_UNCOMPILED_DEFINES, name)) { value = goog.global.CLOSURE_UNCOMPILED_DEFINES[name]; - } else if (goog.global.CLOSURE_DEFINES && + } else if ( + goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call( goog.global.CLOSURE_DEFINES, name)) { value = goog.global.CLOSURE_DEFINES[name]; @@ -239,7 +240,7 @@ goog.define('goog.TRUSTED_SITE', true); * * This define can be used to trigger alternate implementations compatible with * running in EcmaScript Strict mode or warn about unavailable functionality. - * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode + * @see https://goo.gl/g5EoHI * */ goog.define('goog.STRICT_MODE_COMPATIBLE', false); @@ -282,6 +283,9 @@ goog.define('goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING', false); * "goog.package.part". */ goog.provide = function(name) { + if (goog.isInModuleLoader_()) { + throw Error('goog.provide can not be used within a goog.module.'); + } if (!COMPILED) { // Ensure that the same namespace isn't provided twice. // A goog.module/goog.provide maps a goog.require to a specific file @@ -359,8 +363,7 @@ goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/; * "goog.package.part", is expected but not required. */ goog.module = function(name) { - if (!goog.isString(name) || - !name || + if (!goog.isString(name) || !name || name.search(goog.VALID_MODULE_RE_) == -1) { throw Error('Invalid module identifier'); } @@ -408,9 +411,8 @@ goog.module.getInternal_ = function(name) { if (!COMPILED) { if (goog.isProvided_(name)) { // goog.require only return a value with-in goog.module files. - return name in goog.loadedModules_ ? - goog.loadedModules_[name] : - goog.getObjectByName(name); + return name in goog.loadedModules_ ? goog.loadedModules_[name] : + goog.getObjectByName(name); } else { return null; } @@ -419,7 +421,7 @@ goog.module.getInternal_ = function(name) { /** - * @private {?{moduleName: (string|undefined)}} + * @private {?{moduleName: (string|undefined), declareLegacyNamespace:boolean}} */ goog.moduleLoaderState_ = null; @@ -441,11 +443,13 @@ goog.isInModuleLoader_ = function() { */ goog.module.declareLegacyNamespace = function() { if (!COMPILED && !goog.isInModuleLoader_()) { - throw new Error('goog.module.declareLegacyNamespace must be called from ' + + throw new Error( + 'goog.module.declareLegacyNamespace must be called from ' + 'within a goog.module'); } if (!COMPILED && !goog.moduleLoaderState_.moduleName) { - throw Error('goog.module must be called prior to ' + + throw Error( + 'goog.module must be called prior to ' + 'goog.module.declareLegacyNamespace.'); } goog.moduleLoaderState_.declareLegacyNamespace = true; @@ -466,8 +470,9 @@ goog.module.declareLegacyNamespace = function() { goog.setTestOnly = function(opt_message) { if (goog.DISALLOW_TEST_ONLY_CODE) { opt_message = opt_message || ''; - throw Error('Importing test-only code into non-debug environment' + - (opt_message ? ': ' + opt_message : '.')); + throw Error( + 'Importing test-only code into non-debug environment' + + (opt_message ? ': ' + opt_message : '.')); } }; @@ -497,11 +502,11 @@ goog.forwardDeclare = function(name) {}; * and thus block property disambiguation. */ goog.forwardDeclare('Document'); +goog.forwardDeclare('HTMLScriptElement'); goog.forwardDeclare('XMLHttpRequest'); if (!COMPILED) { - /** * Check if the given name has been goog.provided. This will return false for * names that are available only as implicit namespaces. @@ -512,7 +517,7 @@ if (!COMPILED) { goog.isProvided_ = function(name) { return (name in goog.loadedModules_) || (!goog.implicitNamespaces_[name] && - goog.isDefAndNotNull(goog.getObjectByName(name))); + goog.isDefAndNotNull(goog.getObjectByName(name))); }; /** @@ -546,7 +551,7 @@ if (!COMPILED) { goog.getObjectByName = function(name, opt_obj) { var parts = name.split('.'); var cur = opt_obj || goog.global; - for (var part; part = parts.shift(); ) { + for (var part; part = parts.shift();) { if (goog.isDefAndNotNull(cur[part])) { cur = cur[part]; } else { @@ -580,17 +585,22 @@ goog.globalize = function(obj, opt_global) { * the names of the objects this file provides. * @param {!Array} requires An array of strings with * the names of the objects this file requires. - * @param {boolean=} opt_isModule Whether this dependency must be loaded as - * a module as declared by goog.module. + * @param {boolean|!Object=} opt_loadFlags Parameters indicating + * how the file must be loaded. The boolean 'true' is equivalent + * to {'module': 'goog'} for backwards-compatibility. Valid properties + * and values include {'module': 'goog'} and {'lang': 'es6'}. */ -goog.addDependency = function(relPath, provides, requires, opt_isModule) { +goog.addDependency = function(relPath, provides, requires, opt_loadFlags) { if (goog.DEPENDENCIES_ENABLED) { var provide, require; var path = relPath.replace(/\\/g, '/'); var deps = goog.dependencies_; + if (!opt_loadFlags || typeof opt_loadFlags === 'boolean') { + opt_loadFlags = opt_loadFlags ? {'module': 'goog'} : {}; + } for (var i = 0; provide = provides[i]; i++) { deps.nameToPath[provide] = path; - deps.pathIsModule[path] = !!opt_isModule; + deps.pathIsModule[path] = opt_loadFlags['module'] == 'goog'; } for (var j = 0; require = requires[j]; j++) { if (!(path in deps.requires)) { @@ -612,9 +622,10 @@ goog.addDependency = function(relPath, provides, requires, opt_isModule) { // will not load until some point after the current script. If a namespace is // needed at runtime, it needs to be defined in a previous script, or loaded via // require() with its registered dependencies. -// User-defined namespaces may need their own deps file. See http://go/js_deps, -// http://go/genjsdeps, or, externally, DepsWriter. -// https://developers.google.com/closure/library/docs/depswriter +// +// User-defined namespaces may need their own deps file. For a reference on +// creating a deps file, see: +// Externally: https://developers.google.com/closure/library/docs/depswriter // // Because of legacy clients, the DOM loader can't be easily removed from // base.js. Work is being done to make it disableable or replaceable for @@ -810,7 +821,6 @@ goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; if (goog.DEPENDENCIES_ENABLED) { - /** * This object is used to keep track of dependencies and other data that is * used for loading scripts. @@ -825,18 +835,18 @@ if (goog.DEPENDENCIES_ENABLED) { * }} */ goog.dependencies_ = { - pathIsModule: {}, // 1 to 1 + pathIsModule: {}, // 1 to 1 - nameToPath: {}, // 1 to 1 + nameToPath: {}, // 1 to 1 - requires: {}, // 1 to many + requires: {}, // 1 to many // Used when resolving dependencies to prevent us from visiting file twice. visited: {}, - written: {}, // Used to keep track of script files we have written. + written: {}, // Used to keep track of script files we have written. - deferred: {} // Used to track deferred module evaluations in old IEs + deferred: {} // Used to track deferred module evaluations in old IEs }; @@ -848,8 +858,7 @@ if (goog.DEPENDENCIES_ENABLED) { goog.inHtmlDocument_ = function() { /** @type {Document} */ var doc = goog.global.document; - return typeof doc != 'undefined' && - 'write' in doc; // XULDocument misses write. + return doc != null && 'write' in doc; // XULDocument misses write. }; @@ -890,8 +899,8 @@ if (goog.DEPENDENCIES_ENABLED) { * @private */ goog.importScript_ = function(src, opt_sourceText) { - var importScript = goog.global.CLOSURE_IMPORT_SCRIPT || - goog.writeScriptTag_; + var importScript = + goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; if (importScript(src, opt_sourceText)) { goog.dependencies_.written[src] = true; } @@ -899,8 +908,8 @@ if (goog.DEPENDENCIES_ENABLED) { /** @const @private {boolean} */ - goog.IS_OLD_IE_ = !!(!goog.global.atob && goog.global.document && - goog.global.document.all); + goog.IS_OLD_IE_ = + !!(!goog.global.atob && goog.global.document && goog.global.document.all); /** @@ -935,9 +944,8 @@ if (goog.DEPENDENCIES_ENABLED) { if (!goog.LOAD_MODULE_USING_EVAL || !goog.isDef(goog.global.JSON)) { return '' + 'goog.loadModule(function(exports) {' + - '"use strict";' + - scriptText + - '\n' + // terminate any trailing single line comment. + '"use strict";' + scriptText + + '\n' + // terminate any trailing single line comment. ';return exports' + '});' + '\n//# sourceURL=' + srcUrl + '\n'; @@ -996,8 +1004,7 @@ if (goog.DEPENDENCIES_ENABLED) { * @private */ goog.maybeProcessDeferredDep_ = function(name) { - if (goog.isDeferredModule_(name) && - goog.allDepsAreAvailable_(name)) { + if (goog.isDeferredModule_(name) && goog.allDepsAreAvailable_(name)) { var path = goog.getPathFromDeps_(name); goog.maybeProcessDeferredPath_(goog.basePath + path); } @@ -1052,6 +1059,33 @@ if (goog.DEPENDENCIES_ENABLED) { }; + /** + * Load a goog.module from the provided URL. This is not a general purpose + * code loader and does not support late loading code, that is it should only + * be used during page load. This method exists to support unit tests and + * "debug" loaders that would otherwise have inserted script tags. Under the + * hood this needs to use a synchronous XHR and is not recommeneded for + * production code. + * + * The module's goog.requires must have already been satisified; an exception + * will be thrown if this is not the case. This assumption is that no + * "deps.js" file exists, so there is no way to discover and locate the + * module-to-be-loaded's dependencies and no attempt is made to do so. + * + * There should only be one attempt to load a module. If + * "goog.loadModuleFromUrl" is called for an already loaded module, an + * exception will be throw. + * + * @param {string} url The URL from which to attempt to load the goog.module. + */ + goog.loadModuleFromUrl = function(url) { + // Because this executes synchronously, we don't need to do any additional + // bookkeeping. When "goog.loadModule" the namespace will be marked as + // having been provided which is sufficient. + goog.retrieveAndExecModule_(url); + }; + + /** * @param {function(?):?|string} moduleDef The module definition. */ @@ -1063,7 +1097,10 @@ if (goog.DEPENDENCIES_ENABLED) { // of the module. var previousState = goog.moduleLoaderState_; try { - goog.moduleLoaderState_ = {moduleName: undefined}; + goog.moduleLoaderState_ = { + moduleName: undefined, + declareLegacyNamespace: false + }; var exports; if (goog.isFunction(moduleDef)) { exports = moduleDef.call(goog.global, {}); @@ -1095,6 +1132,10 @@ if (goog.DEPENDENCIES_ENABLED) { /** * @private @const {function(string):?} + * + * The new type inference warns because this function has no formal + * parameters, but its jsdoc says that it takes one argument. + * (The argument is used via arguments[0], but NTI does not detect this.) * @suppress {newCheckTypes} */ goog.loadModuleFromSource_ = function() { @@ -1118,7 +1159,8 @@ if (goog.DEPENDENCIES_ENABLED) { */ goog.writeScriptSrcNode_ = function(src) { goog.global.document.write( - '