这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
8f37e5d
[imad-console] Updates ui/index.html
anitamahotra63 Sep 20, 2016
6eb4fd4
Add files via upload
anitamahotra63 Sep 21, 2016
e062bb1
[imad-console] Updates ui/index.html
anitamahotra63 Sep 27, 2016
61d6591
hey
anitamahotra63 Sep 27, 2016
b84934c
[imad-console] Updates server.js
anitamahotra63 Sep 27, 2016
41b7c34
Create article1.html
anitamahotra63 Sep 27, 2016
e5bf116
[imad-console] Updates article1.html
anitamahotra63 Sep 27, 2016
d0fa2f4
[imad-console] Updates server.js
anitamahotra63 Sep 27, 2016
6e43171
Delete index.html
anitamahotra63 Sep 27, 2016
b085b21
Update index.html
anitamahotra63 Sep 27, 2016
c229e14
Delete article1.html
anitamahotra63 Sep 27, 2016
4e4625d
[imad-console] Updates server.js
anitamahotra63 Sep 27, 2016
9178035
change_one
Sep 27, 2016
cc1e503
[imad-console] Updates server.js
anitamahotra63 Sep 28, 2016
f1875e6
Create article-one.html
anitamahotra63 Sep 28, 2016
4436d97
[imad-console] Updates ui/article-one.html
anitamahotra63 Sep 28, 2016
a56e01c
[imad-console] Updates server.js
anitamahotra63 Sep 28, 2016
c58ee9b
[imad-console] Updates ui/article-one.html
anitamahotra63 Sep 28, 2016
4a0ac02
Create article-two.html
anitamahotra63 Sep 28, 2016
f5f2c06
Create article-three.html
anitamahotra63 Sep 28, 2016
18c9722
[imad-console] Updates ui/article-three.html
anitamahotra63 Sep 28, 2016
8f51bbc
[imad-console] Updates ui/article-two.html
anitamahotra63 Sep 28, 2016
8938a46
[imad-console] Updates server.js
anitamahotra63 Sep 28, 2016
8a0e735
[imad-console] Updates ui/article-one.html
anitamahotra63 Sep 28, 2016
4bdea60
[imad-console] Updates ui/article-three.html
anitamahotra63 Sep 28, 2016
e8f8aed
[imad-console] Updates ui/article-two.html
anitamahotra63 Sep 28, 2016
65ac5d9
[imad-console] Updates ui/style.css
anitamahotra63 Sep 28, 2016
d211b2b
[imad-console] Updates ui/style.css
anitamahotra63 Sep 28, 2016
c794446
[imad-console] Updates server.js
anitamahotra63 Sep 28, 2016
d625466
[imad-console] Updates server.js
anitamahotra63 Sep 28, 2016
119223a
[imad-console] Updates server.js
anitamahotra63 Sep 28, 2016
198be6e
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
7b80a04
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
044aa67
[imad-console] Updates ui/article-three.html
anitamahotra63 Oct 1, 2016
fc3a2c2
[imad-console] Updates ui/article-two.html
anitamahotra63 Oct 1, 2016
238926b
[imad-console] Updates ui/index.html
anitamahotra63 Oct 1, 2016
e1cf5ae
[imad-console] Updates ui/index.html
anitamahotra63 Oct 1, 2016
a5bec4a
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
625bb25
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
f26f0ec
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
9018684
[imad-console] Updates ui/index.html
anitamahotra63 Oct 1, 2016
3dc7d46
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
5cf685d
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
f1eb6de
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
e12fff0
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
8dbdb9a
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
2887907
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
db522a2
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
02e2a9c
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
0fc6ab2
made some changes locally.
Oct 1, 2016
baa7924
[imad-console] Updates ui/index.html
anitamahotra63 Oct 1, 2016
e92e1bd
[imad-console] Updates ui/index.html
anitamahotra63 Oct 1, 2016
550315a
[imad-console] Updates ui/index.html
anitamahotra63 Oct 1, 2016
00bb4f5
Delete article-two.html
anitamahotra63 Oct 1, 2016
afd6fa5
Delete article-one.html
anitamahotra63 Oct 1, 2016
f007ce9
Delete article-three.html
anitamahotra63 Oct 1, 2016
8a315be
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
6fc7fbf
[imad-console] Updates ui/main.js
anitamahotra63 Oct 1, 2016
17502ee
[imad-console] Updates ui/style.css
anitamahotra63 Oct 1, 2016
d4827f5
[imad-console] Updates ui/index.html
anitamahotra63 Oct 1, 2016
9b040f7
[imad-console] Updates ui/style.css
anitamahotra63 Oct 1, 2016
af79cdf
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
712b632
Create article-one.html
anitamahotra63 Oct 1, 2016
b7b50ed
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
02c3aa7
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
b55ed99
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
cbbb0dd
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
720c100
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
3cbfa72
Create article-two.html
anitamahotra63 Oct 1, 2016
a186fc4
Create article-three.html
anitamahotra63 Oct 1, 2016
dba6c12
Update article-two.html
anitamahotra63 Oct 1, 2016
66d5f1f
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
899e0c8
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
9f30f0d
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
2f7c9a0
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
f30ec3f
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
c3e097c
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
a670632
[imad-console] Updates ui/article-one.html
anitamahotra63 Oct 1, 2016
a6e0a1e
[imad-console] Updates ui/article-three.html
anitamahotra63 Oct 1, 2016
4f1bd99
[imad-console] Updates ui/style.css
anitamahotra63 Oct 1, 2016
49c0049
[imad-console] Updates ui/article-two.html
anitamahotra63 Oct 1, 2016
ef384c2
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
b1fbcae
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
d46e99a
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
5d0f6e0
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
26456a0
[imad-console] Updates server.js
anitamahotra63 Oct 1, 2016
fb07001
Delete article-one.html
anitamahotra63 Oct 1, 2016
933dbc0
Delete article-three.html
anitamahotra63 Oct 1, 2016
604a9da
Delete article-two.html
anitamahotra63 Oct 1, 2016
a86d716
[imad-console] Updates server.js
anitamahotra63 Oct 2, 2016
51f8023
[imad-console] Updates server.js
anitamahotra63 Oct 2, 2016
63feef3
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
37f44ea
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
fe3fd02
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
c7cdb20
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
eb75ef9
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
d8e10d2
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
d9c63e4
Add files via upload
anitamahotra63 Oct 2, 2016
85c0cbb
Add files via upload
anitamahotra63 Oct 2, 2016
676d0cb
Delete DSCN0945.JPG
anitamahotra63 Oct 2, 2016
d046eb4
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
02d5e4d
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
2c7bd8f
Delete DSCN0945.JPG
anitamahotra63 Oct 2, 2016
82a825b
Add files via upload
anitamahotra63 Oct 2, 2016
f2efbf3
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
6f5f50d
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
79e8b64
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
b906113
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
6d10523
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
7942f78
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
f8255b2
Delete sunita.png
anitamahotra63 Oct 2, 2016
484acbc
[imad-console] Updates server.js
anitamahotra63 Oct 2, 2016
de0b425
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
d1fa324
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
ac75980
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
9746626
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
8e52591
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
fa2ec13
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
a2c5a90
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
0388e46
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
0a1c574
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
5801083
[imad-console] Updates server.js
anitamahotra63 Oct 2, 2016
bbcb221
[imad-console] Updates server.js
anitamahotra63 Oct 2, 2016
679d3ed
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
d541116
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
4c341b5
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
3f8f3c0
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
4661464
[imad-console] Updates ui/main.js
anitamahotra63 Oct 2, 2016
1c0fa0c
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
59cbd73
[imad-console] Updates ui/index.html
anitamahotra63 Oct 2, 2016
1fe7f40
article four added
anitamahotra63 Oct 3, 2016
778fcd1
Delete article-four.html
anitamahotra63 Oct 3, 2016
9405558
[imad-console] Updates server.js
anitamahotra63 Oct 3, 2016
5cfe79b
Create article-four.html
anitamahotra63 Oct 3, 2016
27215c0
[imad-console] Updates ui/article-four.html
anitamahotra63 Oct 3, 2016
1790cb7
[imad-console] Updates server.js
anitamahotra63 Oct 3, 2016
980478c
[imad-console] Updates ui/article-four.html
anitamahotra63 Oct 3, 2016
6c675ea
[imad-console] Updates server.js
anitamahotra63 Oct 3, 2016
15352a8
[imad-console] Updates server.js
anitamahotra63 Oct 3, 2016
0c91e8e
Delete article-four.html
anitamahotra63 Oct 3, 2016
4e36780
Create article-five.html
anitamahotra63 Oct 4, 2016
942936b
[imad-console] Updates ui/article-five.html
anitamahotra63 Oct 4, 2016
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
129 changes: 128 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,146 @@ var path = require('path');
var app = express();
app.use(morgan('combined'));

var articlesContent={
//javacript data structure
'article-one':{
title:'Article One',
heading:'Article 1 |Anita MC',
content:`<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the content.This is the content.This is the content.
<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the
<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the `},

'article-two':{
title:'Article Two',
heading:'Article 2 | Anita MC',
content:`<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the content.This is the content.This is the content.
<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the
<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the `
},
'article-three':{
title:'Article Three',
heading:'Article 3 | Anita MC',
content:`<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the content.This is the content.This is the content.
<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the
<p>This is the content.This is the content.This is the content.this is the content.This is the content.This is the content.This is the `
}


};

var articleFour={
title:'Article 4',
heading1:'About me',
heading2:'About my sister',
content1:'<p>I am anita mc. I live in Indore.I want to be a software engineer.Thats all for today.</p>',
content2:' <p>She is a very fun person to be with. really like and love her,she is my role mode. thats all.</p>'
};

function Createtemplate(data){
var title=data.title;
var heading1=data.heading1;
var heading2=data.heading2;
var content1=data.content1;
var content2=data.content2;

var HTMLTemplate=`<html>
<head>
<title>${title}</title>
<link href='/ui/style.css' rel="stylesheet"/>
</head>
<body>
<div>
<h3>${heading1}</h3>
<hr>
${content1}
</div>
<div>
<h4>${heading2}</h4>
<hr>
${content2}
</div>
</body>
</html>`;
return HTMLTemplate;
};

function createTemplate(data){
title=data.title;
heading=data.heading;
content=data.content;

var htmlTemplate=`<html>
<head>
<title>
${title}
</title>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<link href="/ui/style.css" rel="stylesheet" />
</head>
<body>
<div>
<a href="/">Home</a>
</div>
<hr>
<div>
<h1>${heading}</h1>
</div>
<hr>
<div>
${content}
</div>
</body>
</html>`;
return htmlTemplate;
}

app.get('/article-four',function(req,res){
res.send(Createtemplate(articleFour));
});

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);

//JSON COMES INTO PLAY:JAVASCRIPT OBJECT NOTATION. which converst the java objects to strings
res.send(JSON.stringify(names));
});

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

app.get('/:articleName',function(req,res){

var articleName=req.params.articleName;
res.send(createTemplate(articlesContent[articleName]));
});



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

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'));
});
app.get('/ui/madi.png', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'madi.png'));
});


var port = 8080; // Use 8080 for local development because you might already have apache running on 80
app.listen(8080, function () {
console.log(`IMAD course app listening on port ${port}!`);
Expand Down
109 changes: 109 additions & 0 deletions ui/article-five.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html>
<head>
<title>
Layout 10
</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}

#container{
background-color: yellow;
height: 648px;
width:700px;
border: 3px grey solid;
margin: 2px;
}
#header{
width:650px;
height: 130px;
border:4px grey solid;
margin: 70px 21px 10px;
background-color: white;
}
#wrapper{
height:300px;
width:650px;
border:4px grey solid;
background-color: white;
margin: 0 21px 10px;
}
#footer{
height: 70px;
width:650px;
border: 4px grey solid;
background-color: white;
margin:0 21px 20px;
}
#content{
width:340px;
height:240px;
border:4px grey solid;
background-color: white;
margin:50px 15px 2px 5px;
display: inline-block;
}
#sidebar{
height:240px;
border:4px grey solid;
background-color: white;
margin:50px 7px 2px 0;
width:267px;
display: inline-block;
float: right;

}
#subcontent1{
height:60px;
border:1px grey solid;
width:328px;
margin:68px 5px 8px;
background-color: white;
}
#subcontent2{
height:60px;
border:1px grey solid;
width:328px;
margin:0 5px 40px;
background-color: white;
}
#nav{
border:4px grey solid;
height:40px;
background-color: white;
width:622px;
margin:60px 10px 22px;
}
</style>
</head>
<body>
<div id="container">

<div id="header">
<div id="nav">

</div>
</div>
<div id="wrapper">
<div id="content" >
<div id="subcontent1">

</div>
<div id="subcontent2">

</div>
</div>
<div id="sidebar">

</div>
</div>
<div id="footer">

</div>
</div>

</body>
</html>
26 changes: 20 additions & 6 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,27 @@
</head>
<body>
<div class="center">
<img src="/ui/madi.png" class="img-medium"/>
<img src="http://mobilemarketingwatch.com/wp-content/uploads/2016/05/Is-Google-Searching-for-the-Next-Big-Thing1.jpg" class="img-medium" id="madi"/>
</div>
<br>
<div class="center text-big bold">
Hi! I am your webapp.
<hr>
<div>
<h5>Personal</h5>
<p>My name is Anita MC.</p>
</div>
<script type="text/javascript" src="/ui/main.js">
</script>
<hr>
<div>
<h5>Professional</h5>
<p>I study at IIPS.</p>
</div>
<div id='footer'>
This button <button id="counter">Click me</button> has been clicked <span id='count'> 0 </span> times.
</div>
<hr>
<input type='text' id='name' placeholder='name'>
<button id="submit_btn">SUBMIT</button>
<ul id='the_list'>

</ul>
<script type="text/javascript" src="/ui/main.js"></script>
</body>
</html>
36 changes: 35 additions & 1 deletion ui/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
console.log('Loaded!');
var submit=document.getElementById('submit-btn');

submit.onclick=function(){

//create a reqest object
var request=new XMLHttpRequest();

//capture the response and store it in a variable
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('the_list');
ul.innerHTML=list;
}
}
};

var nameInput=document.getElementById('name');
var name=nameInput.value;


//make a request
request.open('GET','http://anitamahotra63.imad.hasura-app.io/submit-button?name='+name,true);
request.send(null);

};
12 changes: 11 additions & 1 deletion ui/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ body {
.img-medium {
height: 200px;
}

body{

background-color:black;
color:grey;
margin:0 auto;
max-width:800px;
font-family:sans-serif;
padding-left:10px;
padding-right:10px;

}