mirror of
https://github.com/fazo96/pbs.git
synced 2025-01-29 14:54:18 +01:00
added alerts
This commit is contained in:
parent
917301391f
commit
09ae24520a
@ -19,6 +19,7 @@
|
|||||||
"vis": "~3.11.0",
|
"vis": "~3.11.0",
|
||||||
"jquery": "~2.1.3",
|
"jquery": "~2.1.3",
|
||||||
"moment": "~2.9.0",
|
"moment": "~2.9.0",
|
||||||
"bootstrap": "~3.3.4"
|
"bootstrap": "~3.3.4",
|
||||||
|
"sweetalert": "~0.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
<title>Pert</title>
|
<title>Pert</title>
|
||||||
<link rel="stylesheet" href="bower_components/vis/dist/vis.min.css">
|
<link rel="stylesheet" href="bower_components/vis/dist/vis.min.css">
|
||||||
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
|
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
|
||||||
|
<link rel="stylesheet" href="bower_components/sweetalert/lib/sweet-alert.css">
|
||||||
<link rel="stylesheet" href="dist/style.css">
|
<link rel="stylesheet" href="dist/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -17,6 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="bower_components/jquery/dist/jquery.js"></script>
|
<script src="bower_components/jquery/dist/jquery.js"></script>
|
||||||
|
<script src="bower_components/sweetalert/lib/sweet-alert.js"></script>
|
||||||
<script src="bower_components/vis/dist/vis.min.js"></script>
|
<script src="bower_components/vis/dist/vis.min.js"></script>
|
||||||
<script src="bower_components/moment/moment.js"></script>
|
<script src="bower_components/moment/moment.js"></script>
|
||||||
<script src="dist/pert.js"></script>
|
<script src="dist/pert.js"></script>
|
||||||
|
@ -32,10 +32,16 @@ buildGraph = (data) ->
|
|||||||
style: 'arrow'
|
style: 'arrow'
|
||||||
network = new vis.Network (document.getElementById 'pert'), { nodes: nodes, edges: connections }, options
|
network = new vis.Network (document.getElementById 'pert'), { nodes: nodes, edges: connections }, options
|
||||||
|
|
||||||
data = localStorage.getItem 'ganttpert'
|
fromLocalStorage = ->
|
||||||
if data
|
data = localStorage.getItem 'ganttpert'
|
||||||
jdata = JSON.parse data
|
if data
|
||||||
if jdata
|
try
|
||||||
buildGraph new Pert(jdata).calculate()
|
jdata = JSON.parse data
|
||||||
else console.log 'error parsing json:\n'+data
|
catch e
|
||||||
else console.log 'no data'
|
return swal 'JSON Error', e, 'error'
|
||||||
|
if jdata
|
||||||
|
buildGraph new Pert(jdata).calculate()
|
||||||
|
else return swal 'Error', 'no JSON?', 'error'
|
||||||
|
else swal 'Error', 'no data to parse', 'error'
|
||||||
|
|
||||||
|
fromLocalStorage()
|
||||||
|
Loading…
Reference in New Issue
Block a user