Skip to content

Commit f40949c

Browse files
committed
Include demo's wwwroot
1 parent 863ef50 commit f40949c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+45178
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ bld/
2828
# Visual Studio 2015/2017 cache/options directory
2929
.vs/
3030
# Uncomment if you have tasks that create the project's static files in wwwroot
31-
wwwroot/
31+
# wwwroot/
3232

3333
# Visual Studio 2017 auto generated files
3434
Generated\ Files/
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2+
for details on configuring this project to bundle and minify static web assets. */
3+
4+
a.navbar-brand {
5+
white-space: normal;
6+
text-align: center;
7+
word-break: break-all;
8+
}
9+
10+
/* Provide sufficient contrast against white background */
11+
a {
12+
color: #0366d6;
13+
}
14+
15+
.btn-primary {
16+
color: #fff;
17+
background-color: #1b6ec2;
18+
border-color: #1861ac;
19+
}
20+
21+
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
22+
color: #fff;
23+
background-color: #1b6ec2;
24+
border-color: #1861ac;
25+
}
26+
27+
/* Sticky footer styles
28+
-------------------------------------------------- */
29+
html {
30+
font-size: 14px;
31+
}
32+
@media (min-width: 768px) {
33+
html {
34+
font-size: 16px;
35+
}
36+
}
37+
38+
.border-top {
39+
border-top: 1px solid #e5e5e5;
40+
}
41+
.border-bottom {
42+
border-bottom: 1px solid #e5e5e5;
43+
}
44+
45+
.box-shadow {
46+
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
47+
}
48+
49+
button.accept-policy {
50+
font-size: 1rem;
51+
line-height: inherit;
52+
}
53+
54+
/* Sticky footer styles
55+
-------------------------------------------------- */
56+
html {
57+
position: relative;
58+
min-height: 100%;
59+
}
60+
61+
body {
62+
/* Margin bottom by footer height */
63+
margin-bottom: 60px;
64+
}
65+
.footer {
66+
position: absolute;
67+
bottom: 0;
68+
width: 100%;
69+
white-space: nowrap;
70+
line-height: 60px; /* Vertically center the text there */
71+
}
5.3 KB
Binary file not shown.

demo/DemoServer/wwwroot/js/chat.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"use strict";
2+
3+
function setupHub(suffix) {
4+
var connection = new signalR.HubConnectionBuilder().withUrl("/chatHub" + suffix).build();
5+
6+
//Disable send button until connection is established
7+
document.getElementById("sendButton" + suffix).disabled = true;
8+
9+
connection.on("BroadcastMessage", function (user, message) {
10+
var li = document.createElement("li");
11+
document.getElementById("messagesList" + suffix).appendChild(li);
12+
// We can assign user-supplied strings to an element's textContent because it
13+
// is not interpreted as markup. If you're assigning in any other way, you
14+
// should be aware of possible script injection concerns.
15+
li.textContent = `${user} says ${message}`;
16+
});
17+
18+
connection.start().then(function () {
19+
document.getElementById("sendButton" + suffix).disabled = false;
20+
}).catch(function (err) {
21+
return console.error(err.toString());
22+
});
23+
24+
document.getElementById("sendButton" + suffix).addEventListener("click", function (event) {
25+
var user = document.getElementById("userInput" + suffix).value;
26+
var message = document.getElementById("messageInput" + suffix).value;
27+
connection.invoke("SendMessage", user, message).catch(function (err) {
28+
return console.error(err.toString());
29+
});
30+
event.preventDefault();
31+
});
32+
}

demo/DemoServer/wwwroot/js/site.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2+
// for details on configuring this project to bundle and minify static web assets.
3+
4+
// Write your JavaScript code.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2011-2018 Twitter, Inc.
4+
Copyright (c) 2011-2018 The Bootstrap Authors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

0 commit comments

Comments
 (0)