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