Browse Source

Fixed #761: Timeline and Graph2d throwing an error when locale is not found. Gives a warning message instead.

v3_develop
jos 9 years ago
parent
commit
5db59a91d7
11 changed files with 72 additions and 34 deletions
  1. +8
    -0
      HISTORY.md
  2. +1
    -1
      bower.json
  3. +33
    -19
      dist/vis.js
  4. +1
    -1
      dist/vis.map
  5. +11
    -11
      dist/vis.min.js
  6. +1
    -0
      examples/graph2d/13_localization.html
  7. +1
    -0
      examples/timeline/19_localization.html
  8. +7
    -0
      lib/timeline/component/CurrentTime.js
  9. +7
    -0
      lib/timeline/component/CustomTime.js
  10. +1
    -1
      misc/how_to_publish.md
  11. +1
    -1
      package.json

+ 8
- 0
HISTORY.md View File

@ -2,6 +2,14 @@
http://visjs.org http://visjs.org
## not yet released, version 3.12.1-SNAPSHOT
### Timeline
- Fixed #761: Timeline and Graph2d throwing an error when locale is not found.
Gives a warning message instead.
## 2015-04-07, version 3.12.0 ## 2015-04-07, version 3.12.0
### Network ### Network

+ 1
- 1
bower.json View File

@ -1,6 +1,6 @@
{ {
"name": "vis", "name": "vis",
"version": "3.12.0",
"version": "3.12.1-SNAPSHOT",
"main": ["dist/vis.min.js", "dist/vis.min.css"], "main": ["dist/vis.min.js", "dist/vis.min.css"],
"description": "A dynamic, browser-based visualization library.", "description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/", "homepage": "http://visjs.org/",

+ 33
- 19
dist/vis.js View File

@ -4,7 +4,7 @@
* *
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 3.12.0
* @version 3.12.1-SNAPSHOT
* @date 2015-04-07 * @date 2015-04-07
* *
* @license * @license
@ -10715,6 +10715,13 @@ return /******/ (function(modules) { // webpackBootstrap
var x = this.body.util.toScreen(now); var x = this.body.util.toScreen(now);
var locale = this.options.locales[this.options.locale]; var locale = this.options.locales[this.options.locale];
if (!locale) {
if (!this.warned) {
console.log('WARNING: locale "' + this.options.locale + '" not found in vis.js');
this.warned = true;
}
locale = this.options.locales['en']; // fall back on english when not available
}
var title = locale.current + ' ' + locale.time + ': ' + moment(now).format('dddd, MMMM Do YYYY, H:mm:ss'); var title = locale.current + ' ' + locale.time + ': ' + moment(now).format('dddd, MMMM Do YYYY, H:mm:ss');
title = title.charAt(0).toUpperCase() + title.substring(1); title = title.charAt(0).toUpperCase() + title.substring(1);
@ -10914,6 +10921,13 @@ return /******/ (function(modules) { // webpackBootstrap
var x = this.body.util.toScreen(this.customTime); var x = this.body.util.toScreen(this.customTime);
var locale = this.options.locales[this.options.locale]; var locale = this.options.locales[this.options.locale];
if (!locale) {
if (!this.warned) {
console.log('WARNING: locale "' + this.options.locale + '" not found in vis.js');
this.warned = true;
}
locale = this.options.locales['en']; // fall back on english when not available
}
var title = locale.time + ': ' + moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss'); var title = locale.time + ': ' + moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss');
title = title.charAt(0).toUpperCase() + title.substring(1); title = title.charAt(0).toUpperCase() + title.substring(1);
@ -30556,9 +30570,9 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
var util = __webpack_require__(1); var util = __webpack_require__(1);
var RepulsionMixin = __webpack_require__(68);
var HierarchialRepulsionMixin = __webpack_require__(69);
var BarnesHutMixin = __webpack_require__(70);
var RepulsionMixin = __webpack_require__(67);
var HierarchialRepulsionMixin = __webpack_require__(68);
var BarnesHutMixin = __webpack_require__(69);
/** /**
* Toggling barnes Hut calculation on and off. * Toggling barnes Hut calculation on and off.
@ -34998,19 +35012,6 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ }, /***/ },
/* 67 */ /* 67 */
/***/ function(module, exports, __webpack_require__) {
function webpackContext(req) {
throw new Error("Cannot find module '" + req + "'.");
}
webpackContext.keys = function() { return []; };
webpackContext.resolve = webpackContext;
module.exports = webpackContext;
webpackContext.id = 67;
/***/ },
/* 68 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
/** /**
@ -35080,7 +35081,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ }, /***/ },
/* 69 */
/* 68 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
/** /**
@ -35239,7 +35240,7 @@ return /******/ (function(modules) { // webpackBootstrap
}; };
/***/ }, /***/ },
/* 70 */
/* 69 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
/** /**
@ -35643,6 +35644,19 @@ return /******/ (function(modules) { // webpackBootstrap
}; };
/***/ },
/* 70 */
/***/ function(module, exports, __webpack_require__) {
function webpackContext(req) {
throw new Error("Cannot find module '" + req + "'.");
}
webpackContext.keys = function() { return []; };
webpackContext.resolve = webpackContext;
module.exports = webpackContext;
webpackContext.id = 70;
/***/ }, /***/ },
/* 71 */ /* 71 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {

+ 1
- 1
dist/vis.map
File diff suppressed because it is too large
View File


+ 11
- 11
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
examples/graph2d/13_localization.html View File

@ -28,6 +28,7 @@
<select id="locale"> <select id="locale">
<option value="en" selected>en</option> <option value="en" selected>en</option>
<option value="nl">nl</option> <option value="nl">nl</option>
<option value="cs">cs</option>
</select> </select>
</p> </p>

+ 1
- 0
examples/timeline/19_localization.html View File

@ -24,6 +24,7 @@
<select id="locale"> <select id="locale">
<option value="en" selected>en</option> <option value="en" selected>en</option>
<option value="nl">nl</option> <option value="nl">nl</option>
<option value="cs">cs</option>
</select> </select>
</p> </p>

+ 7
- 0
lib/timeline/component/CurrentTime.js View File

@ -88,6 +88,13 @@ CurrentTime.prototype.redraw = function() {
var x = this.body.util.toScreen(now); var x = this.body.util.toScreen(now);
var locale = this.options.locales[this.options.locale]; var locale = this.options.locales[this.options.locale];
if (!locale) {
if (!this.warned) {
console.log('WARNING: locale "' + this.options.locale + '" not found in vis.js');
this.warned = true;
}
locale = this.options.locales['en']; // fall back on english when not available
}
var title = locale.current + ' ' + locale.time + ': ' + moment(now).format('dddd, MMMM Do YYYY, H:mm:ss'); var title = locale.current + ' ' + locale.time + ': ' + moment(now).format('dddd, MMMM Do YYYY, H:mm:ss');
title = title.charAt(0).toUpperCase() + title.substring(1); title = title.charAt(0).toUpperCase() + title.substring(1);

+ 7
- 0
lib/timeline/component/CustomTime.js View File

@ -118,6 +118,13 @@ CustomTime.prototype.redraw = function () {
var x = this.body.util.toScreen(this.customTime); var x = this.body.util.toScreen(this.customTime);
var locale = this.options.locales[this.options.locale]; var locale = this.options.locales[this.options.locale];
if (!locale) {
if (!this.warned) {
console.log('WARNING: locale "' + this.options.locale + '" not found in vis.js');
this.warned = true;
}
locale = this.options.locales['en']; // fall back on english when not available
}
var title = locale.time + ': ' + moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss'); var title = locale.time + ': ' + moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss');
title = title.charAt(0).toUpperCase() + title.substring(1); title = title.charAt(0).toUpperCase() + title.substring(1);

+ 1
- 1
misc/how_to_publish.md View File

@ -56,7 +56,7 @@ This generates the vis.js library in the folder `./dist`.
Verify if it installs the just released version, and verify if it works. Verify if it installs the just released version, and verify if it works.
- Verify within an hour whether vis.js is updated on http://cdnjs.com/
- Verify within a day or so whether vis.js is updated on http://cdnjs.com/
## Update website ## Update website

+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{ {
"name": "vis", "name": "vis",
"version": "3.12.0",
"version": "3.12.1-SNAPSHOT",
"description": "A dynamic, browser-based visualization library.", "description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/", "homepage": "http://visjs.org/",
"repository": { "repository": {

Loading…
Cancel
Save