Browse Source

Fix YUI Compressor incompatibilities and in so doing improve general JavaScript correctness (#2452)

readme-improvements
easleydp 7 years ago
committed by yotamberk
parent
commit
3b27f47995
6 changed files with 171 additions and 168 deletions
  1. +2
    -1
      gulpfile.js
  2. +24
    -24
      lib/network/modules/components/shared/Label.js
  3. +79
    -79
      lib/network/options.js
  4. +32
    -32
      lib/timeline/optionsGraph2d.js
  5. +32
    -32
      lib/timeline/optionsTimeline.js
  6. +2
    -0
      package.json

+ 2
- 1
gulpfile.js View File

@ -51,7 +51,8 @@ var webpackModule = {
loader: 'babel', loader: 'babel',
query: { query: {
cacheDirectory: true, cacheDirectory: true,
presets: ['es2015']
presets: ['es2015'],
plugins: ['transform-es3-property-literals', 'transform-es3-member-expression-literals']
} }
} }
], ],

+ 24
- 24
lib/network/modules/components/shared/Label.js View File

@ -519,63 +519,63 @@ class Label {
} }
} }
while (s.position < text.length) { while (s.position < text.length) {
let char = text.charAt(s.position);
if (/[ \t]/.test(char)) {
let ch = text.charAt(s.position);
if (/[ \t]/.test(ch)) {
if (!s.mono) { if (!s.mono) {
s.spacing = true; s.spacing = true;
} else { } else {
s.add(char);
s.add(ch);
} }
s.beginable = true s.beginable = true
} else if (/\\/.test(char)) {
} else if (/\\/.test(ch)) {
if (s.position < text.length+1) { if (s.position < text.length+1) {
s.position++; s.position++;
char = text.charAt(s.position);
if (/ \t/.test(char)) {
ch = text.charAt(s.position);
if (/ \t/.test(ch)) {
s.spacing = true; s.spacing = true;
} else { } else {
s.add(char);
s.add(ch);
s.beginable = false; s.beginable = false;
} }
} }
} else if (!s.mono && !s.bold && (s.beginable || s.spacing) && /\*/.test(char)) {
} else if (!s.mono && !s.bold && (s.beginable || s.spacing) && /\*/.test(ch)) {
s.emitBlock(); s.emitBlock();
s.bold = true; s.bold = true;
s.modStack.unshift("bold"); s.modStack.unshift("bold");
} else if (!s.mono && !s.ital && (s.beginable || s.spacing) && /\_/.test(char)) {
} else if (!s.mono && !s.ital && (s.beginable || s.spacing) && /\_/.test(ch)) {
s.emitBlock(); s.emitBlock();
s.ital = true; s.ital = true;
s.modStack.unshift("ital"); s.modStack.unshift("ital");
} else if (!s.mono && (s.beginable || s.spacing) && /`/.test(char)) {
} else if (!s.mono && (s.beginable || s.spacing) && /`/.test(ch)) {
s.emitBlock(); s.emitBlock();
s.mono = true; s.mono = true;
s.modStack.unshift("mono"); s.modStack.unshift("mono");
} else if (!s.mono && (s.mod() === "bold") && /\*/.test(char)) {
} else if (!s.mono && (s.mod() === "bold") && /\*/.test(ch)) {
if ((s.position === text.length-1) || /[.,_` \t\n]/.test(text.charAt(s.position+1))) { if ((s.position === text.length-1) || /[.,_` \t\n]/.test(text.charAt(s.position+1))) {
s.emitBlock(); s.emitBlock();
s.bold = false; s.bold = false;
s.modStack.shift(); s.modStack.shift();
} else { } else {
s.add(char);
s.add(ch);
} }
} else if (!s.mono && (s.mod() === "ital") && /\_/.test(char)) {
} else if (!s.mono && (s.mod() === "ital") && /\_/.test(ch)) {
if ((s.position === text.length-1) || /[.,*` \t\n]/.test(text.charAt(s.position+1))) { if ((s.position === text.length-1) || /[.,*` \t\n]/.test(text.charAt(s.position+1))) {
s.emitBlock(); s.emitBlock();
s.ital = false; s.ital = false;
s.modStack.shift(); s.modStack.shift();
} else { } else {
s.add(char);
s.add(ch);
} }
} else if (s.mono && (s.mod() === "mono") && /`/.test(char)) {
} else if (s.mono && (s.mod() === "mono") && /`/.test(ch)) {
if ((s.position === text.length-1) || (/[.,*_ \t\n]/.test(text.charAt(s.position+1)))) { if ((s.position === text.length-1) || (/[.,*_ \t\n]/.test(text.charAt(s.position+1)))) {
s.emitBlock(); s.emitBlock();
s.mono = false; s.mono = false;
s.modStack.shift(); s.modStack.shift();
} else { } else {
s.add(char);
s.add(ch);
} }
} else { } else {
s.add(char);
s.add(ch);
s.beginable = false; s.beginable = false;
} }
s.position++ s.position++
@ -636,14 +636,14 @@ class Label {
} }
} }
while (s.position < text.length) { while (s.position < text.length) {
let char = text.charAt(s.position);
if (/[ \t]/.test(char)) {
let ch = text.charAt(s.position);
if (/[ \t]/.test(ch)) {
if (!s.mono) { if (!s.mono) {
s.spacing = true; s.spacing = true;
} else { } else {
s.add(char);
s.add(ch);
} }
} else if (/</.test(char)) {
} else if (/</.test(ch)) {
if (!s.mono && !s.bold && /<b>/.test(text.substr(s.position,3))) { if (!s.mono && !s.bold && /<b>/.test(text.substr(s.position,3))) {
s.emitBlock(); s.emitBlock();
s.bold = true; s.bold = true;
@ -675,9 +675,9 @@ class Label {
s.modStack.shift(); s.modStack.shift();
s.position += 6; s.position += 6;
} else { } else {
s.add(char);
s.add(ch);
} }
} else if (/&/.test(char)) {
} else if (/&/.test(ch)) {
if (/&lt;/.test(text.substr(s.position,4))) { if (/&lt;/.test(text.substr(s.position,4))) {
s.add("<"); s.add("<");
s.position += 3; s.position += 3;
@ -688,7 +688,7 @@ class Label {
s.add("&"); s.add("&");
} }
} else { } else {
s.add(char);
s.add(ch);
} }
s.position++ s.position++
} }

+ 79
- 79
lib/network/options.js View File

@ -6,7 +6,7 @@
* __type__ is a required field for all objects and contains the allowed types of all objects * __type__ is a required field for all objects and contains the allowed types of all objects
*/ */
let string = 'string'; let string = 'string';
let boolean = 'boolean';
let bool = 'boolean';
let number = 'number'; let number = 'number';
let array = 'array'; let array = 'array';
let object = 'object'; // should only be in a __type__ property let object = 'object'; // should only be in a __type__ property
@ -16,29 +16,29 @@ let any = 'any';
let allOptions = { let allOptions = {
configure: { configure: {
enabled: { boolean },
filter: { boolean, string, array, 'function': 'function' },
enabled: { bool },
filter: { bool, string, array, 'function': 'function' },
container: { dom }, container: { dom },
showButton: { boolean },
__type__: { object, boolean, string, array, 'function': 'function' }
showButton: { bool },
__type__: { object, bool, string, array, 'function': 'function' }
}, },
edges: { edges: {
arrows: { arrows: {
to: { enabled: { boolean }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, boolean } },
middle: { enabled: { boolean }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, boolean } },
from: { enabled: { boolean }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, boolean } },
to: { enabled: { bool }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, bool } },
middle: { enabled: { bool }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, bool } },
from: { enabled: { bool }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, bool } },
__type__: { string: ['from', 'to', 'middle'], object } __type__: { string: ['from', 'to', 'middle'], object }
}, },
arrowStrikethrough: { boolean },
arrowStrikethrough: { bool },
color: { color: {
color: { string }, color: { string },
highlight: { string }, highlight: { string },
hover: { string }, hover: { string },
inherit: { string: ['from', 'to', 'both'], boolean },
inherit: { string: ['from', 'to', 'both'], bool },
opacity: { number }, opacity: { number },
__type__: { object, string } __type__: { object, string }
}, },
dashes: { boolean, array },
dashes: { bool, array },
font: { font: {
color: { string }, color: { string },
size: { number }, // px size: { number }, // px
@ -48,7 +48,7 @@ let allOptions = {
strokeColor: { string }, strokeColor: { string },
align: { string: ['horizontal', 'top', 'middle', 'bottom'] }, align: { string: ['horizontal', 'top', 'middle', 'bottom'] },
vadjust: { number }, vadjust: { number },
multi: { boolean, string },
multi: { bool, string },
bold: { bold: {
color: { string }, color: { string },
size: { number }, // px size: { number }, // px
@ -83,22 +83,22 @@ let allOptions = {
}, },
__type__: { object, string } __type__: { object, string }
}, },
hidden: { boolean },
hidden: { bool },
hoverWidth: { 'function': 'function', number }, hoverWidth: { 'function': 'function', number },
label: { string, 'undefined': 'undefined' }, label: { string, 'undefined': 'undefined' },
labelHighlightBold: { boolean },
labelHighlightBold: { bool },
length: { number, 'undefined': 'undefined' }, length: { number, 'undefined': 'undefined' },
physics: { boolean },
physics: { bool },
scaling: { scaling: {
min: { number }, min: { number },
max: { number }, max: { number },
label: { label: {
enabled: { boolean },
enabled: { bool },
min: { number }, min: { number },
max: { number }, max: { number },
maxVisible: { number }, maxVisible: { number },
drawThreshold: { number }, drawThreshold: { number },
__type__: { object, boolean }
__type__: { object, bool }
}, },
customScalingFunction: { 'function': 'function' }, customScalingFunction: { 'function': 'function' },
__type__: { object } __type__: { object }
@ -106,86 +106,86 @@ let allOptions = {
selectionWidth: { 'function': 'function', number }, selectionWidth: { 'function': 'function', number },
selfReferenceSize: { number }, selfReferenceSize: { number },
shadow: { shadow: {
enabled: { boolean },
enabled: { bool },
color: { string }, color: { string },
size: { number }, size: { number },
x: { number }, x: { number },
y: { number }, y: { number },
__type__: { object, boolean }
__type__: { object, bool }
}, },
smooth: { smooth: {
enabled: { boolean },
enabled: { bool },
type: { string: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'] }, type: { string: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'] },
roundness: { number }, roundness: { number },
forceDirection: { string: ['horizontal', 'vertical', 'none'], boolean },
__type__: { object, boolean }
forceDirection: { string: ['horizontal', 'vertical', 'none'], bool },
__type__: { object, bool }
}, },
title: { string, 'undefined': 'undefined' }, title: { string, 'undefined': 'undefined' },
width: { number }, width: { number },
widthConstraint: { widthConstraint: {
maximum: { number }, maximum: { number },
__type__: { object, boolean, number }
__type__: { object, bool, number }
}, },
value: { number, 'undefined': 'undefined' }, value: { number, 'undefined': 'undefined' },
__type__: { object } __type__: { object }
}, },
groups: { groups: {
useDefaultGroups: { boolean },
useDefaultGroups: { bool },
__any__: 'get from nodes, will be overwritten below', __any__: 'get from nodes, will be overwritten below',
__type__: { object } __type__: { object }
}, },
interaction: { interaction: {
dragNodes: { boolean },
dragView: { boolean },
hideEdgesOnDrag: { boolean },
hideNodesOnDrag: { boolean },
hover: { boolean },
dragNodes: { bool },
dragView: { bool },
hideEdgesOnDrag: { bool },
hideNodesOnDrag: { bool },
hover: { bool },
keyboard: { keyboard: {
enabled: { boolean },
enabled: { bool },
speed: { x: { number }, y: { number }, zoom: { number }, __type__: { object } }, speed: { x: { number }, y: { number }, zoom: { number }, __type__: { object } },
bindToWindow: { boolean },
__type__: { object, boolean }
},
multiselect: { boolean },
navigationButtons: { boolean },
selectable: { boolean },
selectConnectedEdges: { boolean },
hoverConnectedEdges: { boolean },
bindToWindow: { bool },
__type__: { object, bool }
},
multiselect: { bool },
navigationButtons: { bool },
selectable: { bool },
selectConnectedEdges: { bool },
hoverConnectedEdges: { bool },
tooltipDelay: { number }, tooltipDelay: { number },
zoomView: { boolean },
zoomView: { bool },
__type__: { object } __type__: { object }
}, },
layout: { layout: {
randomSeed: { 'undefined': 'undefined', number }, randomSeed: { 'undefined': 'undefined', number },
improvedLayout: { boolean },
improvedLayout: { bool },
hierarchical: { hierarchical: {
enabled: { boolean },
enabled: { bool },
levelSeparation: { number }, levelSeparation: { number },
nodeSpacing: { number }, nodeSpacing: { number },
treeSpacing: { number }, treeSpacing: { number },
blockShifting: { boolean },
edgeMinimization: { boolean },
parentCentralization: { boolean },
blockShifting: { bool },
edgeMinimization: { bool },
parentCentralization: { bool },
direction: { string: ['UD', 'DU', 'LR', 'RL'] }, // UD, DU, LR, RL direction: { string: ['UD', 'DU', 'LR', 'RL'] }, // UD, DU, LR, RL
sortMethod: { string: ['hubsize', 'directed'] }, // hubsize, directed sortMethod: { string: ['hubsize', 'directed'] }, // hubsize, directed
__type__: { object, boolean }
__type__: { object, bool }
}, },
__type__: { object } __type__: { object }
}, },
manipulation: { manipulation: {
enabled: { boolean },
initiallyActive: { boolean },
addNode: { boolean, 'function': 'function' },
addEdge: { boolean, 'function': 'function' },
enabled: { bool },
initiallyActive: { bool },
addNode: { bool, 'function': 'function' },
addEdge: { bool, 'function': 'function' },
editNode: { 'function': 'function' }, editNode: { 'function': 'function' },
editEdge: { editEdge: {
editWithoutDrag: { 'function' : 'function' }, editWithoutDrag: { 'function' : 'function' },
__type__: {object, boolean, 'function': 'function' }
__type__: {object, bool, 'function': 'function' }
}, },
deleteNode: { boolean, 'function': 'function' },
deleteEdge: { boolean, 'function': 'function' },
deleteNode: { bool, 'function': 'function' },
deleteEdge: { bool, 'function': 'function' },
controlNodeStyle: 'get from nodes, will be overwritten below', controlNodeStyle: 'get from nodes, will be overwritten below',
__type__: { object, boolean }
__type__: { object, bool }
}, },
nodes: { nodes: {
borderWidth: { number }, borderWidth: { number },
@ -207,9 +207,9 @@ let allOptions = {
__type__: { object, string } __type__: { object, string }
}, },
fixed: { fixed: {
x: { boolean },
y: { boolean },
__type__: { object, boolean }
x: { bool },
y: { bool },
__type__: { object, bool }
}, },
font: { font: {
align: { string }, align: { string },
@ -220,7 +220,7 @@ let allOptions = {
strokeWidth: { number }, // px strokeWidth: { number }, // px
strokeColor: { string }, strokeColor: { string },
vadjust: { number }, vadjust: { number },
multi: { boolean, string },
multi: { bool, string },
bold: { bold: {
color: { string }, color: { string },
size: { number }, // px size: { number }, // px
@ -259,9 +259,9 @@ let allOptions = {
heightConstraint: { heightConstraint: {
minimum: { number }, minimum: { number },
valign: { string }, valign: { string },
__type__: { object, boolean, number }
__type__: { object, bool, number }
}, },
hidden: { boolean },
hidden: { bool },
icon: { icon: {
face: { string }, face: { string },
code: { string }, //'\uf007', code: { string }, //'\uf007',
@ -272,7 +272,7 @@ let allOptions = {
id: { string, number }, id: { string, number },
image: { string, 'undefined': 'undefined' }, // --> URL image: { string, 'undefined': 'undefined' }, // --> URL
label: { string, 'undefined': 'undefined' }, label: { string, 'undefined': 'undefined' },
labelHighlightBold: { boolean },
labelHighlightBold: { bool },
level: { number, 'undefined': 'undefined' }, level: { number, 'undefined': 'undefined' },
margin: { margin: {
top: { number }, top: { number },
@ -282,36 +282,36 @@ let allOptions = {
__type__: { object, number } __type__: { object, number }
}, },
mass: { number }, mass: { number },
physics: { boolean },
physics: { bool },
scaling: { scaling: {
min: { number }, min: { number },
max: { number }, max: { number },
label: { label: {
enabled: { boolean },
enabled: { bool },
min: { number }, min: { number },
max: { number }, max: { number },
maxVisible: { number }, maxVisible: { number },
drawThreshold: { number }, drawThreshold: { number },
__type__: { object, boolean }
__type__: { object, bool }
}, },
customScalingFunction: { 'function': 'function' }, customScalingFunction: { 'function': 'function' },
__type__: { object } __type__: { object }
}, },
shadow: { shadow: {
enabled: { boolean },
enabled: { bool },
color: { string }, color: { string },
size: { number }, size: { number },
x: { number }, x: { number },
y: { number }, y: { number },
__type__: { object, boolean }
__type__: { object, bool }
}, },
shape: { string: ['ellipse', 'circle', 'database', 'box', 'text', 'image', 'circularImage', 'diamond', 'dot', 'star', 'triangle', 'triangleDown', 'square', 'icon'] }, shape: { string: ['ellipse', 'circle', 'database', 'box', 'text', 'image', 'circularImage', 'diamond', 'dot', 'star', 'triangle', 'triangleDown', 'square', 'icon'] },
shapeProperties: { shapeProperties: {
borderDashes: { boolean, array },
borderDashes: { bool, array },
borderRadius: { number }, borderRadius: { number },
interpolation: { boolean },
useImageSize: { boolean },
useBorderWithImage: { boolean },
interpolation: { bool },
useImageSize: { bool },
useBorderWithImage: { bool },
__type__: { object } __type__: { object }
}, },
size: { number }, size: { number },
@ -320,14 +320,14 @@ let allOptions = {
widthConstraint: { widthConstraint: {
minimum: { number }, minimum: { number },
maximum: { number }, maximum: { number },
__type__: { object, boolean, number }
__type__: { object, bool, number }
}, },
x: { number }, x: { number },
y: { number }, y: { number },
__type__: { object } __type__: { object }
}, },
physics: { physics: {
enabled: { boolean },
enabled: { bool },
barnesHut: { barnesHut: {
gravitationalConstant: { number }, gravitationalConstant: { number },
centralGravity: { number }, centralGravity: { number },
@ -366,21 +366,21 @@ let allOptions = {
minVelocity: { number }, // px/s minVelocity: { number }, // px/s
solver: { string: ['barnesHut', 'repulsion', 'hierarchicalRepulsion', 'forceAtlas2Based'] }, solver: { string: ['barnesHut', 'repulsion', 'hierarchicalRepulsion', 'forceAtlas2Based'] },
stabilization: { stabilization: {
enabled: { boolean },
enabled: { bool },
iterations: { number }, // maximum number of iteration to stabilize iterations: { number }, // maximum number of iteration to stabilize
updateInterval: { number }, updateInterval: { number },
onlyDynamicEdges: { boolean },
fit: { boolean },
__type__: { object, boolean }
onlyDynamicEdges: { bool },
fit: { bool },
__type__: { object, bool }
}, },
timestep: { number }, timestep: { number },
adaptiveTimestep: { boolean },
__type__: { object, boolean }
adaptiveTimestep: { bool },
__type__: { object, bool }
}, },
//globals : //globals :
autoResize: { boolean },
clickToUse: { boolean },
autoResize: { bool },
clickToUse: { bool },
locale: { string }, locale: { string },
locales: { locales: {
__any__: { any }, __any__: { any },

+ 32
- 32
lib/timeline/optionsGraph2d.js View File

@ -6,7 +6,7 @@
* __type__ is a required field for all objects and contains the allowed types of all objects * __type__ is a required field for all objects and contains the allowed types of all objects
*/ */
let string = 'string'; let string = 'string';
let boolean = 'boolean';
let bool = 'boolean';
let number = 'number'; let number = 'number';
let array = 'array'; let array = 'array';
let date = 'date'; let date = 'date';
@ -18,53 +18,53 @@ let any = 'any';
let allOptions = { let allOptions = {
configure: { configure: {
enabled: {boolean},
filter: {boolean,'function': 'function'},
enabled: {bool},
filter: {bool,'function': 'function'},
container: {dom}, container: {dom},
__type__: {object,boolean,'function': 'function'}
__type__: {object,bool,'function': 'function'}
}, },
//globals : //globals :
yAxisOrientation: {string:['left','right']}, yAxisOrientation: {string:['left','right']},
defaultGroup: {string}, defaultGroup: {string},
sort: {boolean},
sampling: {boolean},
stack:{boolean},
sort: {bool},
sampling: {bool},
stack:{bool},
graphHeight: {string, number}, graphHeight: {string, number},
shaded: { shaded: {
enabled: {boolean},
enabled: {bool},
orientation: {string:['bottom','top','zero','group']}, // top, bottom, zero, group orientation: {string:['bottom','top','zero','group']}, // top, bottom, zero, group
groupId: {object}, groupId: {object},
__type__: {boolean,object}
__type__: {bool,object}
}, },
style: {string:['line','bar','points']}, // line, bar style: {string:['line','bar','points']}, // line, bar
barChart: { barChart: {
width: {number}, width: {number},
minWidth: {number}, minWidth: {number},
sideBySide: {boolean},
sideBySide: {bool},
align: {string:['left','center','right']}, align: {string:['left','center','right']},
__type__: {object} __type__: {object}
}, },
interpolation: { interpolation: {
enabled: {boolean},
enabled: {bool},
parametrization: {string:['centripetal', 'chordal','uniform']}, // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5) parametrization: {string:['centripetal', 'chordal','uniform']}, // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)
alpha: {number}, alpha: {number},
__type__: {object,boolean}
__type__: {object,bool}
}, },
drawPoints: { drawPoints: {
enabled: {boolean},
enabled: {bool},
onRender: { 'function': 'function' }, onRender: { 'function': 'function' },
size: {number}, size: {number},
style: {string:['square','circle']}, // square, circle style: {string:['square','circle']}, // square, circle
__type__: {object,boolean,'function': 'function'}
__type__: {object,bool,'function': 'function'}
}, },
dataAxis: { dataAxis: {
showMinorLabels: {boolean},
showMajorLabels: {boolean},
icons: {boolean},
showMinorLabels: {bool},
showMajorLabels: {bool},
icons: {bool},
width: {string, number}, width: {string, number},
visible: {boolean},
alignZeros: {boolean},
visible: {bool},
alignZeros: {bool},
left:{ left:{
range: {min:{number},max:{number},__type__: {object}}, range: {min:{number},max:{number},__type__: {object}},
format: {'function': 'function'}, format: {'function': 'function'},
@ -80,27 +80,27 @@ let allOptions = {
__type__: {object} __type__: {object}
}, },
legend: { legend: {
enabled: {boolean},
icons: {boolean},
enabled: {bool},
icons: {bool},
left: { left: {
visible: {boolean},
visible: {bool},
position: {string:['top-right','bottom-right','top-left','bottom-left']}, position: {string:['top-right','bottom-right','top-left','bottom-left']},
__type__: {object} __type__: {object}
}, },
right: { right: {
visible: {boolean},
visible: {bool},
position: {string:['top-right','bottom-right','top-left','bottom-left']}, position: {string:['top-right','bottom-right','top-left','bottom-left']},
__type__: {object} __type__: {object}
}, },
__type__: {object,boolean}
__type__: {object,bool}
}, },
groups: { groups: {
visibility: {any}, visibility: {any},
__type__: {object} __type__: {object}
}, },
autoResize: {boolean},
clickToUse: {boolean},
autoResize: {bool},
clickToUse: {bool},
end: {number, date, string, moment}, end: {number, date, string, moment},
format: { format: {
minorLabels: { minorLabels: {
@ -145,12 +145,12 @@ let allOptions = {
maxMinorChars: {number}, maxMinorChars: {number},
min: {date, number, string, moment}, min: {date, number, string, moment},
minHeight: {number, string}, minHeight: {number, string},
moveable: {boolean},
multiselect: {boolean},
moveable: {bool},
multiselect: {bool},
orientation: {string}, orientation: {string},
showCurrentTime: {boolean},
showMajorLabels: {boolean},
showMinorLabels: {boolean},
showCurrentTime: {bool},
showMajorLabels: {bool},
showMinorLabels: {bool},
start: {date, number, string, moment}, start: {date, number, string, moment},
timeAxis: { timeAxis: {
scale: {string,'undefined': 'undefined'}, scale: {string,'undefined': 'undefined'},
@ -158,7 +158,7 @@ let allOptions = {
__type__: {object} __type__: {object}
}, },
width: {string, number}, width: {string, number},
zoomable: {boolean},
zoomable: {bool},
zoomKey: {string: ['ctrlKey', 'altKey', 'metaKey', '']}, zoomKey: {string: ['ctrlKey', 'altKey', 'metaKey', '']},
zoomMax: {number}, zoomMax: {number},
zoomMin: {number}, zoomMin: {number},

+ 32
- 32
lib/timeline/optionsTimeline.js View File

@ -6,7 +6,7 @@
* __type__ is a required field for all objects and contains the allowed types of all objects * __type__ is a required field for all objects and contains the allowed types of all objects
*/ */
let string = 'string'; let string = 'string';
let boolean = 'boolean';
let bool = 'boolean';
let number = 'number'; let number = 'number';
let array = 'array'; let array = 'array';
let date = 'date'; let date = 'date';
@ -17,28 +17,28 @@ let any = 'any';
let allOptions = { let allOptions = {
configure: { configure: {
enabled: {boolean},
filter: {boolean,'function': 'function'},
enabled: {bool},
filter: {bool,'function': 'function'},
container: {dom}, container: {dom},
__type__: {object,boolean,'function': 'function'}
__type__: {object,bool,'function': 'function'}
}, },
//globals : //globals :
align: {string}, align: {string},
rtl: {boolean, 'undefined': 'undefined'},
rollingMode: {boolean, 'undefined': 'undefined'},
verticalScroll: {boolean, 'undefined': 'undefined'},
horizontalScroll: {boolean, 'undefined': 'undefined'},
autoResize: {boolean},
clickToUse: {boolean},
rtl: {bool, 'undefined': 'undefined'},
rollingMode: {bool, 'undefined': 'undefined'},
verticalScroll: {bool, 'undefined': 'undefined'},
horizontalScroll: {bool, 'undefined': 'undefined'},
autoResize: {bool},
clickToUse: {bool},
dataAttributes: {string, array}, dataAttributes: {string, array},
editable: { editable: {
add: {boolean, 'undefined': 'undefined'},
remove: {boolean, 'undefined': 'undefined'},
updateGroup: {boolean, 'undefined': 'undefined'},
updateTime: {boolean, 'undefined': 'undefined'},
overrideItems: {boolean, 'undefined': 'undefined'},
__type__: {boolean, object}
add: {bool, 'undefined': 'undefined'},
remove: {bool, 'undefined': 'undefined'},
updateGroup: {bool, 'undefined': 'undefined'},
updateTime: {bool, 'undefined': 'undefined'},
overrideItems: {bool, 'undefined': 'undefined'},
__type__: {bool, object}
}, },
end: {number, date, string, moment}, end: {number, date, string, moment},
format: { format: {
@ -69,10 +69,10 @@ let allOptions = {
moment: {'function': 'function'}, moment: {'function': 'function'},
groupOrder: {string, 'function': 'function'}, groupOrder: {string, 'function': 'function'},
groupEditable: { groupEditable: {
add: {boolean, 'undefined': 'undefined'},
remove: {boolean, 'undefined': 'undefined'},
order: {boolean, 'undefined': 'undefined'},
__type__: {boolean, object}
add: {bool, 'undefined': 'undefined'},
remove: {bool, 'undefined': 'undefined'},
order: {bool, 'undefined': 'undefined'},
__type__: {bool, object}
}, },
groupOrderSwap: {'function': 'function'}, groupOrderSwap: {'function': 'function'},
height: {string, number}, height: {string, number},
@ -82,7 +82,7 @@ let allOptions = {
repeat: {string}, repeat: {string},
__type__: {object, array} __type__: {object, array}
}, },
itemsAlwaysDraggable: { boolean: boolean },
itemsAlwaysDraggable: {bool},
locale:{string}, locale:{string},
locales:{ locales:{
__any__: {any}, __any__: {any},
@ -102,9 +102,9 @@ let allOptions = {
maxMinorChars: {number}, maxMinorChars: {number},
min: {date, number, string, moment}, min: {date, number, string, moment},
minHeight: {number, string}, minHeight: {number, string},
moveable: {boolean},
multiselect: {boolean},
multiselectPerGroup: {boolean},
moveable: {bool},
multiselect: {bool},
multiselectPerGroup: {bool},
onAdd: {'function': 'function'}, onAdd: {'function': 'function'},
onUpdate: {'function': 'function'}, onUpdate: {'function': 'function'},
onMove: {'function': 'function'}, onMove: {'function': 'function'},
@ -119,19 +119,19 @@ let allOptions = {
item: {string,'undefined': 'undefined'}, item: {string,'undefined': 'undefined'},
__type__: {string, object} __type__: {string, object}
}, },
selectable: {boolean},
showCurrentTime: {boolean},
showMajorLabels: {boolean},
showMinorLabels: {boolean},
stack: {boolean},
selectable: {bool},
showCurrentTime: {bool},
showMajorLabels: {bool},
showMinorLabels: {bool},
stack: {bool},
snap: {'function': 'function', 'null': 'null'}, snap: {'function': 'function', 'null': 'null'},
start: {date, number, string, moment}, start: {date, number, string, moment},
template: {'function': 'function'}, template: {'function': 'function'},
groupTemplate: {'function': 'function'}, groupTemplate: {'function': 'function'},
visibleFrameTemplate: {string, 'function': 'function'}, visibleFrameTemplate: {string, 'function': 'function'},
tooltipOnItemUpdateTime: { tooltipOnItemUpdateTime: {
template: {'function': 'function'},
__type__: {boolean, object}
template: {'function': 'function'},
__type__: {bool, object}
}, },
timeAxis: { timeAxis: {
scale: {string,'undefined': 'undefined'}, scale: {string,'undefined': 'undefined'},
@ -140,7 +140,7 @@ let allOptions = {
}, },
type: {string}, type: {string},
width: {string, number}, width: {string, number},
zoomable: {boolean},
zoomable: {bool},
zoomKey: {string: ['ctrlKey', 'altKey', 'metaKey', '']}, zoomKey: {string: ['ctrlKey', 'altKey', 'metaKey', '']},
zoomMax: {number}, zoomMax: {number},
zoomMin: {number}, zoomMin: {number},

+ 2
- 0
package.json View File

@ -40,6 +40,8 @@
"babel-core": "^6.6.5", "babel-core": "^6.6.5",
"babel-loader": "^6.2.4", "babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0", "babel-preset-es2015": "^6.6.0",
"babel-plugin-transform-es3-property-literals": "^6.8.0",
"babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
"babelify": "^7.2.0", "babelify": "^7.2.0",
"clean-css": "^3.4.10", "clean-css": "^3.4.10",
"gulp": "^3.9.1", "gulp": "^3.9.1",

Loading…
Cancel
Save