-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66f7fcb
commit 06bfe22
Showing
4 changed files
with
85 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,104 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<title></> htmx ~ Demo App</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" /> | ||
|
||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/htmx/1.9.5/htmx.min.js" integrity="sha512-2NwoAICmYEIEuayBZdfd/cEvYGevbb1jezvQli/Iw052KfAA3NGrXAH2AY02cjt3gMdui5Q8nKauPYgVOE+pmg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/htmx/1.9.5/ext/json-enc.min.js" integrity="sha512-jcH0sr76CPbMe+4E23BWif6BgftQK43X6TwEWE8X7Sz7wB4mT8Nx6PO0DE7C7810tIV7OeCZ0MQ3oKL/61W+Hg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/htmx/1.9.5/ext/class-tools.min.js" integrity="sha512-kLoAa40K9dbRblV4kXb6Yda2NDMb4m+iNj1rvRYjwTfHKYrPG/TpExrXY95YT2QAVz6TuVEVmTKBfG2D+OrKsQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/htmx/1.9.5/ext/preload.min.js" integrity="sha512-2lqd++ZVVmZg5LU//IabHHKQBV3qL6kPMjXvtzLfd+Fn99uOw7MmWLlVQhF2uVzH0yOuVzV3/BIC5w5QUP6uTw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
|
||
<link rel="icon" type="image/x-icon" href="/img/favicon.ico"> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<title></> htmx ~ Demo App</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" /> | ||
|
||
<script src="https://unpkg.com/[email protected]"></script> | ||
|
||
<script src="https://unpkg.com/[email protected]/json-enc.js"></script> | ||
|
||
<script src="https://unpkg.com/[email protected]/class-tools.js"></script> | ||
|
||
<script src="https://unpkg.com/[email protected]/preload.js"></script> | ||
|
||
<link rel="icon" type="image/x-icon" href="/img/favicon.ico"> | ||
</head> | ||
|
||
<body hx-ext="class-tools, preload, json-enc, event-header" style="overflow-x:hidden; width:100%; height:auto"> | ||
|
||
|
||
{{! styles should be in separate css file }} | ||
<style> | ||
|
||
footer.page-footer { | ||
position: absolute; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
|
||
{{! styles for html 5 validation }} | ||
input:invalid { | ||
border: 2px dashed red; | ||
} | ||
|
||
input:invalid:required { | ||
background-image: linear-gradient(to right, pink, lightgreen); | ||
} | ||
|
||
input:valid { | ||
border: 2px solid black; | ||
} | ||
|
||
input:read-only { | ||
background-color: grey; | ||
|
||
} | ||
footer.page-footer { | ||
position: absolute; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
|
||
{ | ||
{ | ||
! styles for html 5 validation | ||
} | ||
} | ||
|
||
input:invalid { | ||
border: 2px dashed red; | ||
} | ||
|
||
input:invalid:required { | ||
background-image: linear-gradient(to right, pink, lightgreen); | ||
} | ||
|
||
input:valid { | ||
border: 2px solid black; | ||
} | ||
|
||
input:read-only { | ||
background-color: grey; | ||
|
||
} | ||
</style> | ||
|
||
<script> | ||
// example scripts - would normally be in a js file | ||
// example scripts - would normally be in a js file | ||
|
||
// example of an error handling script | ||
document.body.addEventListener("htmx:responseError", function(e) { | ||
error = e.detail.xhr.response; | ||
alert(error); | ||
}); | ||
// example of an error handling script | ||
document.body.addEventListener("htmx:responseError", function (e) { | ||
error = e.detail.xhr.response; | ||
alert(error); | ||
}); | ||
|
||
// simple event handler, no params | ||
document.body.addEventListener("myEvent", function(evt){ | ||
// simple event handler, no params | ||
document.body.addEventListener("myEvent", function (evt) { | ||
alert("myEvent was triggered!"); | ||
}) | ||
}) | ||
|
||
// another simple event handler, no params | ||
document.body.addEventListener("savedEvent", function(evt){ | ||
// another simple event handler, no params | ||
document.body.addEventListener("savedEvent", function (evt) { | ||
alert(evt.detail.value); | ||
}) | ||
}) | ||
|
||
// event handler with simple params | ||
document.body.addEventListener("myEventObject", function(evt){ | ||
// we're sending back a Movie object, so show some property here | ||
alert(evt.detail.MovieID); | ||
}) | ||
// event handler with simple params | ||
document.body.addEventListener("myEventObject", function (evt) { | ||
// we're sending back a Movie object, so show some property here | ||
alert(evt.detail.MovieID); | ||
}) | ||
|
||
document.body.addEventListener("setFocus", function(evt){ | ||
// we're looking for a CSS selector to get an element to focus | ||
document.body.addEventListener("setFocus", function (evt) { | ||
// we're looking for a CSS selector to get an element to focus | ||
let element = document.querySelector(evt.detail.value); | ||
if (element !== null) { | ||
element.focus(); | ||
} | ||
}) | ||
</script> | ||
}) | ||
</script> | ||
|
||
<div class="jumbotron text-center"> | ||
<h1><a href="/"></> HTMX/DMVC Demo App</a></h1> | ||
<p>Welcome to the demo app. Click a tab to continue.</p> | ||
</div> | ||
<div class="jumbotron text-center"> | ||
<h1><a href="/"></> HTMX/DMVC Demo App</a></h1> | ||
<p>Welcome to the demo app. Click a tab to continue.</p> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="column left" style="background-color:#aaa;"> | ||
<div> | ||
{{> Navigation}} | ||
</div> | ||
</div> | ||
<div class="column right" style="background-color:#bbb;"> | ||
<!-- content starts here --> | ||
<div id="movieDemoContent-div"> | ||
|
||
<div class="column right" style="background-color:#bbb;"> | ||
<!-- content starts here --> | ||
<div id="movieDemoContent-div"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ | |
<header> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> | ||
<script src="https://unpkg.com/[email protected]" integrity="sha384-FhXw7b6AlE/jyjlZH5iHa/tTe9EpJ1Y55RjcgPbjeWMskSxZt1v9qkxLJWNJaGni" crossorigin="anonymous"></script> | ||
<script src="https://unpkg.com/[email protected]"></script> | ||
|
||
<style> | ||
h1 a:hover { | ||
text-decoration: none; | ||
|