Browse Source

use script tags everywhere

master
wes 9 years ago
parent
commit
2cd771d829
  1. 1
      src/scripts/book.tag
  2. 1
      src/scripts/class.tag
  3. 3
      src/scripts/row.tag
  4. 21
      src/scripts/search.tag

1
src/scripts/book.tag

@ -27,6 +27,7 @@
</dd>
</p>
</div>
<script>
this.iarchive = false;
this.openlib = false;

1
src/scripts/class.tag

@ -34,4 +34,5 @@ showbooks() {
this.update();
</script>
</class>

3
src/scripts/row.tag

@ -4,6 +4,9 @@
data="{ this }">
</class>
<script>
this.classrow = opts.classrow
</script>
</row>

21
src/scripts/search.tag

@ -1,10 +1,10 @@
<search>
<form class="form-horizontal search-form" onsubmit={ submit.bind(this) } type="submit"method="get">
<form class="form-horizontal search-form" onsubmit={ submit } type="submit"method="get">
<div class="form-group">
<div class="container">
<div class="columns">
<div class="col-sm-8 form-item">
<input onfocus={ showHelp }
<input onfocus={ showhelp }
class="form-input"
placeholder="Description"
type="text"
@ -27,7 +27,7 @@
<div if={ opts.showHelp }
class="help-toast toast toast-primary">
<button onclick={ clearHelp }
<button onclick={ clearhelp }
class="btn btn-clear float-right">
</button>
Type keywords of your course's name or the course code (e.g. PSYCH 2B03)
@ -35,17 +35,17 @@
<div if={ opts.booksLoading } class="search-load">
</div>
</search>
<script>
this.showedHelp = false;
this.waiting = false;
function showHelp() {
showhelp() {
if (!this.showedHelp) {
this.opts.showHelp = true;
this.update();
if (!waiting) {
waiting = true;
if (!this.waiting) {
this.waiting = true;
window.setTimeout(
(function() {
this.waiting = false;
@ -55,7 +55,7 @@ function showHelp() {
}
}
function clearHelp() {
clearhelp() {
this.showedHelp = true;
this.opts.showHelp = false;
this.update();
@ -66,7 +66,7 @@ function clearHelpTemp() {
this.update();
}
function submit(ev) {
submit(ev) {
ev.preventDefault();
this.showedHelp = true;
this.opts.showHelp = false;
@ -84,3 +84,6 @@ function submit(ev) {
this.update();
}).bind(this));
}
</script>
</search>

Loading…
Cancel
Save