Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need update #104

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
b0d89bf
[imad-console] Updates ui/index.html
034senthil Aug 3, 2017
9364bac
[imad-console] Updates server.js
034senthil Aug 3, 2017
31fa38e
[imad-console] Updates server.js
034senthil Aug 3, 2017
a7577e7
Create article one
034senthil Aug 3, 2017
daa60f4
Create article-one.html
034senthil Aug 3, 2017
f0a678b
[imad-console] Updates ui/article-one.html
034senthil Aug 3, 2017
d831086
[imad-console] Updates ui/article-one.html
034senthil Aug 3, 2017
5bdaa1b
[imad-console] Updates server.js
034senthil Aug 3, 2017
d0a2e50
[imad-console] Updates ui/article-one.html
034senthil Aug 3, 2017
506c172
[imad-console] Updates ui/article-one.html
034senthil Aug 3, 2017
bf9e789
[imad-console] Updates ui/article-one.html
034senthil Aug 3, 2017
fc5e63f
[imad-console] Updates ui/style.css
034senthil Aug 3, 2017
08dd758
[imad-console] Updates ui/article-one.html
034senthil Aug 3, 2017
c01d7f3
Create article-two.html
034senthil Aug 3, 2017
d3e0e4f
[imad-console] Updates ui/article-one.html
034senthil Aug 3, 2017
46a3067
[imad-console] Updates ui/article-two.html
034senthil Aug 3, 2017
517c917
[imad-console] Updates server.js
034senthil Aug 3, 2017
619097c
[imad-console] Updates server.js
034senthil Aug 3, 2017
862c85b
[imad-console] Updates ui/article-one.html
034senthil Aug 3, 2017
e14ce73
[imad-console] Updates server.js
034senthil Aug 3, 2017
fc8c3ca
[imad-console] Updates server.js
034senthil Aug 3, 2017
ea49e33
[imad-console] Updates server.js
034senthil Aug 3, 2017
62225c6
[imad-console] Updates ui/style.css
034senthil Aug 3, 2017
2429a6b
[imad-console] Updates ui/style.css
034senthil Aug 3, 2017
2bd0646
[imad-console] Updates server.js
034senthil Aug 3, 2017
7d2ce3b
[imad-console] Updates ui/article-two.html
034senthil Aug 3, 2017
c6957c4
[imad-console] Updates server.js
034senthil Aug 3, 2017
8cbac54
[imad-console] Updates server.js
034senthil Aug 3, 2017
c4fd7eb
[imad-console] Updates server.js
034senthil Aug 3, 2017
b7ef925
[imad-console] Updates ui/index.html
034senthil Aug 4, 2017
a513d36
[imad-console] Updates server.js
034senthil Aug 4, 2017
659f947
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
c204cf9
[imad-console] Updates ui/index.html
034senthil Aug 4, 2017
c444621
[imad-console] Updates ui/index.html
034senthil Aug 4, 2017
cbaa64f
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
ae2dc41
[imad-console] Updates ui/index.html
034senthil Aug 4, 2017
3649bde
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
8a1a033
[imad-console] Updates ui/index.html
034senthil Aug 4, 2017
20bfde7
[imad-console] Updates ui/index.html
034senthil Aug 4, 2017
356d5b1
[imad-console] Updates server.js
034senthil Aug 4, 2017
cc5be5e
[imad-console] Updates server.js
034senthil Aug 4, 2017
170acc3
[imad-console] Updates ui/index.html
034senthil Aug 4, 2017
a541406
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
3fc55a1
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
41f6457
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
e504b11
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
528df5d
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
090d594
[imad-console] Updates ui/index.html
034senthil Aug 4, 2017
ab3d4b1
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
ac79665
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
b7320ee
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
8e3314d
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
04c5a46
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
33b2a8d
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
3571e05
[imad-console] Updates ui/main.js
034senthil Aug 4, 2017
0459f42
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
dfa5c30
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
786276e
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
1663538
[imad-console] Updates server.js
034senthil Aug 8, 2017
c8610e6
[imad-console] Updates server.js
034senthil Aug 8, 2017
2318649
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
418f426
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
5307903
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
2db36d6
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
c4ed24b
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
06e8155
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
a86e6df
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
f3fb567
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
9be5ee7
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
1a592ec
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
4182081
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
95d86eb
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
6dd9ea8
[imad-console] Updates ui/index.html
034senthil Aug 8, 2017
410ac97
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
ae7270a
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
7ad1f5e
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
8790343
[imad-console] Updates server.js
034senthil Aug 8, 2017
852ef19
[imad-console] Updates server.js
034senthil Aug 8, 2017
e8b3dfc
[imad-console] Updates server.js
034senthil Aug 8, 2017
7f459e8
[imad-console] Updates server.js
034senthil Aug 8, 2017
8678b21
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
f24ea97
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
2eb9cc9
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
38e0946
[imad-console] Updates server.js
034senthil Aug 8, 2017
36d96b3
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
a3ed9c6
[imad-console] Updates ui/main.js
034senthil Aug 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,72 @@ var path = require('path');

var app = express();
app.use(morgan('combined'));
var articles = {
'article-one': {
title: 'Senthilkumars',
heading: 'Article one',
content: ' Whats up bro . This is my first project and it is successful. I am really happy at this point and i want to improve this page. blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah...blah... blah... blah...blah...blah...blah...blah...blah...blah...blah...vvblah...blah...blah...vblah...blah...blah...blah...vvblah...blah...blah...vblah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...'
},
'article-two':{
title: 'Senthilkumars2',
heading: 'Article two',
content: ' This is my second project and it is successful. I am really happy at this point and i want to improve this page. blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah...blah... blah... blah...blah...blah...blah...blah...blah...blah...blah...vvblah...blah...blah...vblah...blah...blah...blah...vvblah...blah...blah...vblah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...'
},
};

function createtemplate (data) {
var title = data.title;
var heading = data.heading;
var content = data.content;
var htmltemplate =
`<html>
<head> <title>
${title}
</title>
<link href="/ui/style.css" rel="stylesheet" />
</head>


<body><div class='links'>
<div>
<a href="/">Home</a>
</div>

<h>
${heading}
</h>
${content}
</div>
</body>
</html>
`;
return htmltemplate;
}
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'index.html'));
});
var counter = 0;
app.get('/counter', function (req, res) {
counter = counter + 1;
res.send(counter.toString());
});
var names = [];
app.get('/submit-name', function (req, res) {
var name = req.query.name;
names.push(name);
res.send(JSON.stringify(names));
});


app.get('/:articlename', function (req, res) {
var articlename = req.params.articlename;
res.send(createtemplate(articles[articlename]));
});

app.get('/ui/main.js', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'main.js'));
});


app.get('/ui/style.css', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'style.css'));
Expand All @@ -18,6 +80,7 @@ app.get('/ui/madi.png', function (req, res) {
});



// Do not change port, otherwise your app won't run on IMAD servers
// Use 8080 only for local development if you already have apache running on 80

Expand Down
1 change: 1 addition & 0 deletions ui/article one
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

22 changes: 22 additions & 0 deletions ui/article-one.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<html>
<head> <title>
Senthilkumars
</title>
<link href="/ui/style.css" rel="stylesheet" />
</head>


<body><div class='links'>
<div>
<a href="/">Home</a>
</div>

<h>
Article one
</h>
<p>
Whats up bro . This is my first project and it is successful. I am really happy at this point and i want to improve this page. blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah...blah... blah... blah...blah...blah...blah...blah...blah...blah...blah...vvblah...blah...blah...vblah...blah...blah...blah...vvblah...blah...blah...vblah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...
</p>
</div>
</body>
</html>
23 changes: 23 additions & 0 deletions ui/article-two.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<html>
<head> <title>
Senthilkumars2
</title>

<link href="/ui/style.css" rel="stylesheet" />
</head>

<body><div class='links'>
<div>
<a href="/">Home</a>
</div>

<h>
Article Two
</h>
<p>
Whats up bro . This is my first project and it is successful. I am really happy at this point and i want to improve this page. blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah... blah...blah... blah... blah...blah...blah...blah...blah...blah...blah...blah...vvblah...blah...blah...vblah...blah...blah...blah...vvblah...blah...blah...vblah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...blah...
</p>
</div>
</body>
</html>

30 changes: 27 additions & 3 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,37 @@
<link href="/ui/style.css" rel="stylesheet" />
</head>
<body>
<div class="links">
<div class="center">
<img src="/ui/madi.png" class="img-medium"/>
<img id='madi' src="/ui/madi.png" class="img-medium"/>
</div>
<hr/>
<br>
<div class="center text-big bold">
Hi! I am your webapp.
<h2>Personal</h2>
<div>Hi. My name is KKK</div>
<div id='main-text' class="center text-big bold">
Hi! I am Senthilkumar M. cool is it.
</div>
</div>
<hr/>
<h3>Professional</h3>
<div>
I am working in Rural Electrification Corporation
</div>
<hr/>
<div class = "footer">
This button <button id ="counter">Click</button> has been clicked <span id ="counter">0</span> times
<hr/>
<input type = "text" id="name" placeholder="name"> </input>
<input type = "submit" value="submit" id="submit_btn"> </input>
<ul id = "name list">

</ul>
</div>
<script>

alert('Hi guys whats up');//
</script>//
<script type="text/javascript" src="/ui/main.js">
</script>
</body>
Expand Down
61 changes: 60 additions & 1 deletion ui/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,60 @@
console.log('Loaded!');
//console.log('Loaded!');

//var element = document.getElementById('main-text'
///);//

//element.innerHTML = 'new value';
//var img = document.getElementById('madi');
//var marginLeft = 0;
//function moveRight (){
// marginLeft = marginLeft + 10;
// img.style.marginLeft = marginLeft + 'px';
//}
//img.onclick = function (){
// var interval = setInterval(moveRight, 50);
//};//

var button = document.getElementById('counter');
//var counter = 0;
button.onclick = function (){

var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readyState === XMLHttpRequest.DONE){
if (request.status === 200){
var counter = request.responseText;
var span = document.getElementById('count');
span.innerHTML = counter.toString();
}
}
},
request.open('GET', 'http://u034senthil.imad.hasura-app.io/counter', true);
request.send(null);
};


var submit = document.getElementById('submit_btn');
submit.onclick = function (){
var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readyState === XMLHttpRequest.DONE){
if (request.status === 200){
var names = request.responseText;
names = JSON.parse(names);
var list = '';
for(var i=0; i< names.length; i++){

list += '<li>' + names[i] + '</li>';
}

var ul =document.getElementById('name list');
ul.innerHTML = list;
}
}
},

var nameInput = document.getElementById('name');
var name = nameInput.value;
request.open('GET', 'http://u034senthil.imad.hasura-app.io/submit-name?name=' + name, true);
request.send(null);
};
13 changes: 10 additions & 3 deletions ui/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
body {
font-family: sans-serif;
background-color: lightgrey;
margin-top: 75px;

}

.center {
Expand All @@ -19,4 +18,12 @@ body {
.img-medium {
height: 200px;
}

.links
{
max width: 800px;
Color: #A52A2A;
padding-top: 60px;
padding-right: 70px;
padding-left: 60px;
padding-bottom: 50px;
}