Browse Source

Fixes for ES5 strict mode

v3_develop
jos 10 years ago
parent
commit
090383d462
11 changed files with 50 additions and 46 deletions
  1. +18
    -16
      dist/vis.js
  2. +1
    -1
      dist/vis.map
  3. +14
    -14
      dist/vis.min.js
  4. +2
    -2
      lib/graph3d/Camera.js
  5. +6
    -6
      lib/graph3d/Graph3d.js
  6. +2
    -2
      lib/graph3d/Point2d.js
  7. +2
    -0
      lib/header.js
  8. +1
    -1
      lib/network/Network.js
  9. +1
    -1
      lib/network/dotparser.js
  10. +2
    -2
      lib/network/mixins/NavigationMixin.js
  11. +1
    -1
      lib/timeline/Range.js

+ 18
- 16
dist/vis.js View File

@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 3.7.2-SNAPSHOT * @version 3.7.2-SNAPSHOT
* @date 2014-11-28
* @date 2014-12-02
* *
* @license * @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com * Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -23,6 +23,8 @@
* Vis.js may be distributed under either license. * Vis.js may be distributed under either license.
*/ */
"use strict";
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(); module.exports = factory();
@ -3687,9 +3689,9 @@ return /******/ (function(modules) { // webpackBootstrap
} }
} }
function sortNumber(a, b) {
var sortNumber = function (a, b) {
return a - b; return a - b;
}
};
dataX.sort(sortNumber); dataX.sort(sortNumber);
dataY.sort(sortNumber); dataY.sort(sortNumber);
@ -5422,20 +5424,20 @@ return /******/ (function(modules) { // webpackBootstrap
* @param {Event} event * @param {Event} event
* @return {Number} mouse x * @return {Number} mouse x
*/ */
getMouseX = function(event) {
function getMouseX (event) {
if ('clientX' in event) return event.clientX; if ('clientX' in event) return event.clientX;
return event.targetTouches[0] && event.targetTouches[0].clientX || 0; return event.targetTouches[0] && event.targetTouches[0].clientX || 0;
};
}
/** /**
* Get the vertical mouse position from a mouse event * Get the vertical mouse position from a mouse event
* @param {Event} event * @param {Event} event
* @return {Number} mouse y * @return {Number} mouse y
*/ */
getMouseY = function(event) {
function getMouseY (event) {
if ('clientY' in event) return event.clientY; if ('clientY' in event) return event.clientY;
return event.targetTouches[0] && event.targetTouches[0].clientY || 0; return event.targetTouches[0] && event.targetTouches[0].clientY || 0;
};
}
module.exports = Graph3d; module.exports = Graph3d;
@ -5456,7 +5458,7 @@ return /******/ (function(modules) { // webpackBootstrap
* Documentation: * Documentation:
* http://en.wikipedia.org/wiki/3D_projection * http://en.wikipedia.org/wiki/3D_projection
*/ */
Camera = function () {
function Camera() {
this.armLocation = new Point3d(); this.armLocation = new Point3d();
this.armRotation = {}; this.armRotation = {};
this.armRotation.horizontal = 0; this.armRotation.horizontal = 0;
@ -5467,7 +5469,7 @@ return /******/ (function(modules) { // webpackBootstrap
this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0); this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0);
this.calculateCameraOrientation(); this.calculateCameraOrientation();
};
}
/** /**
* Set the location (origin) of the arm * Set the location (origin) of the arm
@ -5813,10 +5815,10 @@ return /******/ (function(modules) { // webpackBootstrap
* @param {Number} [x] * @param {Number} [x]
* @param {Number} [y] * @param {Number} [y]
*/ */
Point2d = function (x, y) {
function Point2d (x, y) {
this.x = x !== undefined ? x : 0; this.x = x !== undefined ? x : 0;
this.y = y !== undefined ? y : 0; this.y = y !== undefined ? y : 0;
};
}
module.exports = Point2d; module.exports = Point2d;
@ -7861,7 +7863,7 @@ return /******/ (function(modules) { // webpackBootstrap
var initTime = new Date().valueOf(); var initTime = new Date().valueOf();
var anyChanged = false; var anyChanged = false;
function next() {
var next = function () {
if (!me.props.touch.dragging) { if (!me.props.touch.dragging) {
var now = new Date().valueOf(); var now = new Date().valueOf();
var time = now - initTime; var time = now - initTime;
@ -15537,7 +15539,7 @@ return /******/ (function(modules) { // webpackBootstrap
this.hoverObj = {nodes:{},edges:{}}; this.hoverObj = {nodes:{},edges:{}};
this.controlNodesActive = false; this.controlNodesActive = false;
this.navigationHammers = {existing:[], new: []};
this.navigationHammers = {existing:[], _new: []};
// animation properties // animation properties
this.animationSpeed = 1/this.renderRefreshRate; this.animationSpeed = 1/this.renderRefreshRate;
@ -21180,7 +21182,7 @@ return /******/ (function(modules) { // webpackBootstrap
* @param {Object} dotEdge * @param {Object} dotEdge
* @returns {Object} graphEdge * @returns {Object} graphEdge
*/ */
function convertEdge(dotEdge) {
var convertEdge = function (dotEdge) {
var graphEdge = { var graphEdge = {
from: dotEdge.from, from: dotEdge.from,
to: dotEdge.to to: dotEdge.to
@ -32025,12 +32027,12 @@ return /******/ (function(modules) { // webpackBootstrap
var hammer = Hammer(this.navigationDivs[navigationDivs[i]], {prevent_default: true}); var hammer = Hammer(this.navigationDivs[navigationDivs[i]], {prevent_default: true});
hammer.on('touch', this[navigationDivActions[i]].bind(this)); hammer.on('touch', this[navigationDivActions[i]].bind(this));
this.navigationHammers.new.push(hammer);
this.navigationHammers._new.push(hammer);
} }
this._navigationReleaseOverload = this._stopMovement; this._navigationReleaseOverload = this._stopMovement;
this.navigationHammers.existing = this.navigationHammers.new;
this.navigationHammers.existing = this.navigationHammers._new;
}; };

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


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


+ 2
- 2
lib/graph3d/Camera.js View File

@ -10,7 +10,7 @@ var Point3d = require('./Point3d');
* Documentation: * Documentation:
* http://en.wikipedia.org/wiki/3D_projection * http://en.wikipedia.org/wiki/3D_projection
*/ */
Camera = function () {
function Camera() {
this.armLocation = new Point3d(); this.armLocation = new Point3d();
this.armRotation = {}; this.armRotation = {};
this.armRotation.horizontal = 0; this.armRotation.horizontal = 0;
@ -21,7 +21,7 @@ Camera = function () {
this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0); this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0);
this.calculateCameraOrientation(); this.calculateCameraOrientation();
};
}
/** /**
* Set the location (origin) of the arm * Set the location (origin) of the arm

+ 6
- 6
lib/graph3d/Graph3d.js View File

@ -525,9 +525,9 @@ Graph3d.prototype._getDataPoints = function (data) {
} }
} }
function sortNumber(a, b) {
var sortNumber = function (a, b) {
return a - b; return a - b;
}
};
dataX.sort(sortNumber); dataX.sort(sortNumber);
dataY.sort(sortNumber); dataY.sort(sortNumber);
@ -2260,19 +2260,19 @@ Graph3d.prototype._hideTooltip = function () {
* @param {Event} event * @param {Event} event
* @return {Number} mouse x * @return {Number} mouse x
*/ */
getMouseX = function(event) {
function getMouseX (event) {
if ('clientX' in event) return event.clientX; if ('clientX' in event) return event.clientX;
return event.targetTouches[0] && event.targetTouches[0].clientX || 0; return event.targetTouches[0] && event.targetTouches[0].clientX || 0;
};
}
/** /**
* Get the vertical mouse position from a mouse event * Get the vertical mouse position from a mouse event
* @param {Event} event * @param {Event} event
* @return {Number} mouse y * @return {Number} mouse y
*/ */
getMouseY = function(event) {
function getMouseY (event) {
if ('clientY' in event) return event.clientY; if ('clientY' in event) return event.clientY;
return event.targetTouches[0] && event.targetTouches[0].clientY || 0; return event.targetTouches[0] && event.targetTouches[0].clientY || 0;
};
}
module.exports = Graph3d; module.exports = Graph3d;

+ 2
- 2
lib/graph3d/Point2d.js View File

@ -3,9 +3,9 @@
* @param {Number} [x] * @param {Number} [x]
* @param {Number} [y] * @param {Number} [y]
*/ */
Point2d = function (x, y) {
function Point2d (x, y) {
this.x = x !== undefined ? x : 0; this.x = x !== undefined ? x : 0;
this.y = y !== undefined ? y : 0; this.y = y !== undefined ? y : 0;
};
}
module.exports = Point2d; module.exports = Point2d;

+ 2
- 0
lib/header.js View File

@ -22,3 +22,5 @@
* *
* Vis.js may be distributed under either license. * Vis.js may be distributed under either license.
*/ */
"use strict";

+ 1
- 1
lib/network/Network.js View File

@ -219,7 +219,7 @@ function Network (container, data, options) {
this.hoverObj = {nodes:{},edges:{}}; this.hoverObj = {nodes:{},edges:{}};
this.controlNodesActive = false; this.controlNodesActive = false;
this.navigationHammers = {existing:[], new: []};
this.navigationHammers = {existing:[], _new: []};
// animation properties // animation properties
this.animationSpeed = 1/this.renderRefreshRate; this.animationSpeed = 1/this.renderRefreshRate;

+ 1
- 1
lib/network/dotparser.js View File

@ -761,7 +761,7 @@ function DOTToGraph (data) {
* @param {Object} dotEdge * @param {Object} dotEdge
* @returns {Object} graphEdge * @returns {Object} graphEdge
*/ */
function convertEdge(dotEdge) {
var convertEdge = function (dotEdge) {
var graphEdge = { var graphEdge = {
from: dotEdge.from, from: dotEdge.from,
to: dotEdge.to to: dotEdge.to

+ 2
- 2
lib/network/mixins/NavigationMixin.js View File

@ -43,12 +43,12 @@ exports._loadNavigationElements = function() {
var hammer = Hammer(this.navigationDivs[navigationDivs[i]], {prevent_default: true}); var hammer = Hammer(this.navigationDivs[navigationDivs[i]], {prevent_default: true});
hammer.on('touch', this[navigationDivActions[i]].bind(this)); hammer.on('touch', this[navigationDivActions[i]].bind(this));
this.navigationHammers.new.push(hammer);
this.navigationHammers._new.push(hammer);
} }
this._navigationReleaseOverload = this._stopMovement; this._navigationReleaseOverload = this._stopMovement;
this.navigationHammers.existing = this.navigationHammers.new;
this.navigationHammers.existing = this.navigationHammers._new;
}; };

+ 1
- 1
lib/timeline/Range.js View File

@ -127,7 +127,7 @@ Range.prototype.setRange = function(start, end, animate) {
var initTime = new Date().valueOf(); var initTime = new Date().valueOf();
var anyChanged = false; var anyChanged = false;
function next() {
var next = function () {
if (!me.props.touch.dragging) { if (!me.props.touch.dragging) {
var now = new Date().valueOf(); var now = new Date().valueOf();
var time = now - initTime; var time = now - initTime;

Loading…
Cancel
Save