shopr

Check-in [08a4b7bbc1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add an 'x' to clear the input field
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256:08a4b7bbc1ec675692f9f32f34d4a512c8540bab957d4c47146c5c8edeb87d65
User & Date: vandys 2019-09-30 14:51:13
Context
2019-09-30
14:51
Add an 'x' to clear the input field Leaf check-in: 08a4b7bbc1 user: vandys tags: trunk
2019-07-24
16:49
When returning to not being filtered by typing, go back to honoring the RGY selector buttons at the top. check-in: f120275739 user: vandys tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to html/shopr.html.

34
35
36
37
38
39
40

41
42
43
44
45
46
47
    <span id="spanG" onclick="filtG();" style="background: green;">G</span>
    <span id="spanY" onclick="filtY();" style="background: gold;">Y</span>
   </span>
   <span style="padding: 5px 0px;">
    <input type="text" id="ifilter"
     onkeyup="update_filter();" placeholder="Choose or Add">
    <button onclick="addit();">+</button>

   </span>
  </span>
  <img src="/imgs/menu.svg"
   style="text-align: right; max-width: 10%;" />
 </div>
 <div id="items">
 </div>







>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    <span id="spanG" onclick="filtG();" style="background: green;">G</span>
    <span id="spanY" onclick="filtY();" style="background: gold;">Y</span>
   </span>
   <span style="padding: 5px 0px;">
    <input type="text" id="ifilter"
     onkeyup="update_filter();" placeholder="Choose or Add">
    <button onclick="addit();">+</button>
    <button onclick="clearit();">x</button>
   </span>
  </span>
  <img src="/imgs/menu.svg"
   style="text-align: right; max-width: 10%;" />
 </div>
 <div id="items">
 </div>

Changes to js/shopr.js.

496
497
498
499
500
501
502








503
504
505
506
507
508
509
	".json" + authURL;

    // Requesting URL, including authentication
    req.open("POST", url);
    const op = {"op": "add", "name": ifv};
    req.send(JSON.stringify(op));
}









// Do a PUT op with authentication to our current list
function xhr_put(msg, fn) {
    // Construct URL; our list, authen
    const url = "/l/" + encodeURIComponent(cur_list) +
	".json" + authURL;








>
>
>
>
>
>
>
>







496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
	".json" + authURL;

    // Requesting URL, including authentication
    req.open("POST", url);
    const op = {"op": "add", "name": ifv};
    req.send(JSON.stringify(op));
}

// Clear input/search field
function clearit() {
    if (ifilter.value) {
	ifilter.value = "";
	show_new_list(cur_names);
    }
}

// Do a PUT op with authentication to our current list
function xhr_put(msg, fn) {
    // Construct URL; our list, authen
    const url = "/l/" + encodeURIComponent(cur_list) +
	".json" + authURL;