mirror of
https://github.com/fazo96/pbs.git
synced 2025-01-29 14:54:18 +01:00
removed server side stuff
This commit is contained in:
parent
04a06ac672
commit
f04129771b
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,7 +1,4 @@
|
|||||||
node_modules/
|
bower_components/
|
||||||
client/pert.js
|
|
||||||
client/pert-ui.js
|
|
||||||
client/bower_components/
|
|
||||||
test/
|
test/
|
||||||
lib/
|
lib/
|
||||||
bin/
|
*.js
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
src/
|
|
||||||
client/bower_components/
|
|
||||||
test/
|
|
15
index.html
Normal file
15
index.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Pert</title>
|
||||||
|
<link rel="stylesheet" href="bower_components/vis/dist/vis.min.css">
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<textarea id="ta"></textarea>
|
||||||
|
<button id="save">Save</button>
|
||||||
|
<a href="pert.html">view pert</a>
|
||||||
|
<script src="bower_components/jquery/dist/jquery.js"></script>
|
||||||
|
<script src="index.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
32
package.json
32
package.json
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "pert",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"description": "pert diagram calculator",
|
|
||||||
"main": "lib/pert.js",
|
|
||||||
"bin": {
|
|
||||||
"pert": "./bin/pert"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"prepublish": "scripts/build.sh",
|
|
||||||
"build": "scripts/build.sh",
|
|
||||||
"clean": "scripts/clean.sh"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "http://github.com/fazo96/pert.git"
|
|
||||||
},
|
|
||||||
"author": "Enrico Fasoli (fazo96)",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/fazo96/pert/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/fazo96/pert",
|
|
||||||
"dependencies": {
|
|
||||||
"chalk": "^1.0.0",
|
|
||||||
"commander": "^2.6.0",
|
|
||||||
"express": "^4.12.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"coffee-script": "^1.9.1"
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,21 +3,16 @@
|
|||||||
<head>
|
<head>
|
||||||
<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">
|
||||||
<style>
|
<link rel="stylesheet" href="style.css">
|
||||||
body { height: 100%; }
|
|
||||||
#pert {
|
|
||||||
height: 600px;
|
|
||||||
width: 100%;
|
|
||||||
border: 1px solid lightgray;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script src="bower_components/jquery/dist/jquery.js"></script>
|
<script src="bower_components/jquery/dist/jquery.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>
|
||||||
<div id="pert"></div>
|
<div id="pert"></div>
|
||||||
|
<a href="index.html">edit data</a>
|
||||||
<!--<div id="timeline"></div>-->
|
<!--<div id="timeline"></div>-->
|
||||||
|
<script src="pert.js"></script>
|
||||||
<script src="pert-ui.js"></script>
|
<script src="pert-ui.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -1,6 +1,3 @@
|
|||||||
mkdir -p bin lib
|
coffee -b -c --no-header -p src/pert.coffee > pert.js
|
||||||
echo '#!/usr/bin/env node' > bin/pert
|
coffee -b -c --no-header -p src/pert-ui.coffee > pert-ui.js
|
||||||
coffee -b -c --no-header -p src/pert-cli.coffee >> bin/pert
|
coffee -b -c --no-header -p src/index.coffee > index.js
|
||||||
chmod +x bin/pert
|
|
||||||
coffee -b -c --no-header -p src/pert.coffee > lib/pert.js
|
|
||||||
coffee -b -c --no-header -p src/pert-ui.coffee > client/pert-ui.js
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
rm -rf bin lib
|
rm -r *.js
|
||||||
|
7
src/index.coffee
Normal file
7
src/index.coffee
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
console.log 'Pert ui'
|
||||||
|
|
||||||
|
$('#ta').val localStorage.getItem 'ganttpert'
|
||||||
|
|
||||||
|
$('#save').click ->
|
||||||
|
console.log 'save'
|
||||||
|
localStorage.setItem 'ganttpert', $('#ta').val()
|
@ -1,7 +1,4 @@
|
|||||||
$.get 'data', (d) ->
|
console.log 'Pert ui'
|
||||||
# Serve the server data
|
|
||||||
buildTimeline d
|
|
||||||
buildGraph d
|
|
||||||
|
|
||||||
toDates = (list, startDay) ->
|
toDates = (list, startDay) ->
|
||||||
list.map (i) ->
|
list.map (i) ->
|
||||||
@ -37,3 +34,11 @@ buildGraph = (data) ->
|
|||||||
edges:
|
edges:
|
||||||
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'
|
||||||
|
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'
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
chalk = require 'chalk'
|
class Pert
|
||||||
fs = require 'fs'
|
|
||||||
|
|
||||||
module.exports = class Pert
|
|
||||||
constructor: (@list, @verbose) ->
|
constructor: (@list, @verbose) ->
|
||||||
@days = []
|
@days = []
|
||||||
|
|
||||||
@ -75,3 +72,5 @@ module.exports = class Pert
|
|||||||
else
|
else
|
||||||
if cb? then cb(results)
|
if cb? then cb(results)
|
||||||
results
|
results
|
||||||
|
|
||||||
|
if module? then module.exports = Pert
|
||||||
|
Loading…
Reference in New Issue
Block a user