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
## 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
### Network

+ 1
- 1
bower.json View File

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

+ 33
- 19
dist/vis.js View File

@ -4,7 +4,7 @@
*
* A dynamic, browser-based visualization library.
*
* @version 3.12.0
* @version 3.12.1-SNAPSHOT
* @date 2015-04-07
*
* @license
@ -10715,6 +10715,13 @@ return /******/ (function(modules) { // webpackBootstrap
var x = this.body.util.toScreen(now);
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');
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 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');
title = title.charAt(0).toUpperCase() + title.substring(1);
@ -30556,9 +30570,9 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {
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.
@ -34998,19 +35012,6 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 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__) {
/**
@ -35080,7 +35081,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 69 */
/* 68 */
/***/ function(module, exports, __webpack_require__) {
/**
@ -35239,7 +35240,7 @@ return /******/ (function(modules) { // webpackBootstrap
};
/***/ },
/* 70 */
/* 69 */
/***/ 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 */
/***/ 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">
<option value="en" selected>en</option>
<option value="nl">nl</option>
<option value="cs">cs</option>
</select>
</p>

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

@ -24,6 +24,7 @@
<select id="locale">
<option value="en" selected>en</option>
<option value="nl">nl</option>
<option value="cs">cs</option>
</select>
</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 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');
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 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');
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 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

+ 1
- 1
package.json View File

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

Loading…
Cancel
Save