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> </dd>
</p> </p>
</div> </div>
<script> <script>
this.iarchive = false; this.iarchive = false;
this.openlib = false; this.openlib = false;

1
src/scripts/class.tag

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

3
src/scripts/row.tag

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

21
src/scripts/search.tag

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

Loading…
Cancel
Save