removed server side stuff

This commit is contained in:
Enrico Fasoli 2015-03-31 11:32:45 +02:00
parent 04a06ac672
commit f04129771b
12 changed files with 49 additions and 63 deletions

7
.gitignore vendored
View File

@ -1,7 +1,4 @@
node_modules/
client/pert.js
client/pert-ui.js
client/bower_components/
bower_components/
test/
lib/
bin/
*.js

View File

@ -1,3 +0,0 @@
src/
client/bower_components/
test/

15
index.html Normal file
View 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>

View File

@ -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"
}
}

View File

@ -3,21 +3,16 @@
<head>
<title>Pert</title>
<link rel="stylesheet" href="bower_components/vis/dist/vis.min.css">
<style>
body { height: 100%; }
#pert {
height: 600px;
width: 100%;
border: 1px solid lightgray;
}
</style>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/vis/dist/vis.min.js"></script>
<script src="bower_components/moment/moment.js"></script>
<div id="pert"></div>
<a href="index.html">edit data</a>
<!--<div id="timeline"></div>-->
<script src="pert.js"></script>
<script src="pert-ui.js"></script>
</body>
</html>

View File

@ -1,6 +1,3 @@
mkdir -p bin lib
echo '#!/usr/bin/env node' > bin/pert
coffee -b -c --no-header -p src/pert-cli.coffee >> bin/pert
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
coffee -b -c --no-header -p src/pert.coffee > pert.js
coffee -b -c --no-header -p src/pert-ui.coffee > pert-ui.js
coffee -b -c --no-header -p src/index.coffee > index.js

View File

@ -1,2 +1,2 @@
#!/bin/bash
rm -rf bin lib
rm -r *.js

7
src/index.coffee Normal file
View File

@ -0,0 +1,7 @@
console.log 'Pert ui'
$('#ta').val localStorage.getItem 'ganttpert'
$('#save').click ->
console.log 'save'
localStorage.setItem 'ganttpert', $('#ta').val()

View File

@ -1,7 +1,4 @@
$.get 'data', (d) ->
# Serve the server data
buildTimeline d
buildGraph d
console.log 'Pert ui'
toDates = (list, startDay) ->
list.map (i) ->
@ -37,3 +34,11 @@ buildGraph = (data) ->
edges:
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'

View File

@ -1,7 +1,4 @@
chalk = require 'chalk'
fs = require 'fs'
module.exports = class Pert
class Pert
constructor: (@list, @verbose) ->
@days = []
@ -75,3 +72,5 @@ module.exports = class Pert
else
if cb? then cb(results)
results
if module? then module.exports = Pert

6
style.css Normal file
View File

@ -0,0 +1,6 @@
body { height: 100%; }
#pert {
height: 600px;
width: 100%;
border: 1px solid lightgray;
}