OLD | NEW |
(Empty) | |
| 1 [# Make a 3x8 grid of label entry form fields with autocomplete on each one. |
| 2 |
| 3 Args: |
| 4 arg0: if "just-two" is passed, only show the first two rows |
| 5 and give the user links to click to expose more rows. |
| 6 ] |
| 7 |
| 8 <div id="LF_row1" class="nowrap"> |
| 9 <input type="text" class="labelinput" id="label0" size="20" autocomplete="off" |
| 10 name="label" value="[label0]"> |
| 11 <input type="text" class="labelinput" id="label1" size="20" autocomplete="off" |
| 12 name="label" value="[label1]"> |
| 13 <input type="text" class="labelinput" id="label2" size="20" autocomplete="off" |
| 14 name="label" value="[label2]"> |
| 15 </div> |
| 16 |
| 17 <div id="LF_row2" class="nowrap"> |
| 18 <input type="text" class="labelinput" id="label3" size="20" autocomplete="off" |
| 19 name="label" value="[label3]"> |
| 20 <input type="text" class="labelinput" id="label4" size="20" autocomplete="off" |
| 21 name="label" value="[label4]"> |
| 22 <input type="text" class="labelinput" id="label5" size="20" autocomplete="off" |
| 23 [is arg0 "just-two"]data-show-id="LF_row3" data-hide-id="addrow2"[end] |
| 24 name="label" value="[label5]"> |
| 25 [is arg0 "just-two"]<span id="addrow2" class="fakelink" data-instead="LF_row3">
Add a row</span>[end] |
| 26 </div> |
| 27 |
| 28 <div id="LF_row3" [is arg0 "just-two"]style="display:none"[end] class="nowrap"> |
| 29 <input type="text" class="labelinput" id="label6" size="20" autocomplete="off" |
| 30 name="label" value="[label6]"> |
| 31 <input type="text" class="labelinput" id="label7" size="20" autocomplete="off" |
| 32 name="label" value="[label7]"> |
| 33 <input type="text" class="labelinput" id="label8" size="20" autocomplete="off" |
| 34 [is arg0 "just-two"]data-show-id="LF_row4" data-hide-id="addrow3"[end] |
| 35 name="label" value="[label8]"> |
| 36 [is arg0 "just-two"]<span id="addrow3" class="fakelink" data-instead="LF_row4">
Add a row</span>[end] |
| 37 </div> |
| 38 |
| 39 <div id="LF_row4" [is arg0 "just-two"]style="display:none"[end] class="nowrap"> |
| 40 <input type="text" class="labelinput" id="label9" size="20" autocomplete="off" |
| 41 name="label" value="[label9]"> |
| 42 <input type="text" class="labelinput" id="label10" size="20" autocomplete="off" |
| 43 name="label" value="[label10]"> |
| 44 <input type="text" class="labelinput" id="label11" size="20" autocomplete="off" |
| 45 [is arg0 "just-two"]data-show-id="LF_row5" data-hide-id="addrow4"[end] |
| 46 name="label" value="[label11]"> |
| 47 [is arg0 "just-two"]<span id="addrow4" class="fakelink" data-instead="LF_row5">
Add a row</span>[end] |
| 48 </div> |
| 49 |
| 50 <div id="LF_row5" [is arg0 "just-two"]style="display:none"[end] class="nowrap"> |
| 51 <input type="text" class="labelinput" id="label12" size="20" autocomplete="off" |
| 52 name="label" value="[label12]"> |
| 53 <input type="text" class="labelinput" id="label13" size="20" autocomplete="off" |
| 54 name="label" value="[label13]"> |
| 55 <input type="text" class="labelinput" id="label14" size="20" autocomplete="off" |
| 56 [is arg0 "just-two"]data-show-id="LF_row6" data-hide-id="addrow5"[end] |
| 57 name="label" value="[label14]"> |
| 58 [is arg0 "just-two"]<span id="addrow5" class="fakelink" data-instead="LF_row6">
Add a row</span>[end] |
| 59 </div> |
| 60 |
| 61 <div id="LF_row6" [is arg0 "just-two"]style="display:none"[end] class="nowrap"> |
| 62 <input type="text" class="labelinput" id="label15" size="20" autocomplete="off" |
| 63 name="label" value="[label15]"> |
| 64 <input type="text" class="labelinput" id="label16" size="20" autocomplete="off" |
| 65 name="label" value="[label16]"> |
| 66 <input type="text" class="labelinput" id="label17" size="20" autocomplete="off" |
| 67 [is arg0 "just-two"]data-show-id="LF_row7" data-hide-id="addrow6"[end] |
| 68 name="label" value="[label17]"> |
| 69 [is arg0 "just-two"]<span id="addrow6" class="fakelink" data-instead="LF_row7">
Add a row</span>[end] |
| 70 </div> |
| 71 |
| 72 <div id="LF_row7" [is arg0 "just-two"]style="display:none"[end] class="nowrap"> |
| 73 <input type="text" class="labelinput" id="label18" size="20" autocomplete="off" |
| 74 name="label" value="[label18]"> |
| 75 <input type="text" class="labelinput" id="label19" size="20" autocomplete="off" |
| 76 name="label" value="[label19]"> |
| 77 <input type="text" class="labelinput" id="label20" size="20" autocomplete="off" |
| 78 [is arg0 "just-two"]data-show-id="LF_row8" data-hide-id="addrow7"[end] |
| 79 name="label" value="[label20]"> |
| 80 [is arg0 "just-two"]<span id="addrow7" class="fakelink" data-instead="LF_row8">
Add a row</span>[end] |
| 81 </div> |
| 82 |
| 83 <div id="LF_row8" [is arg0 "just-two"]style="display:none"[end] class="nowrap"> |
| 84 <input type="text" class="labelinput" id="label21" size="20" autocomplete="off" |
| 85 name="label" value="[label21]"> |
| 86 <input type="text" class="labelinput" id="label22" size="20" autocomplete="off" |
| 87 name="label" value="[label22]"> |
| 88 <input type="text" class="labelinput" id="label23" size="20" autocomplete="off" |
| 89 name="label" value="[label23]"> |
| 90 </div> |
| 91 |
| 92 <script type="text/javascript" nonce="[nonce]"> |
| 93 runOnLoad(function() { |
| 94 var labelInputs = document.getElementsByClassName("labelinput"); |
| 95 for (var i = 0; i < labelInputs.length; ++i) { |
| 96 var labelInput = labelInputs[[]i]; |
| 97 labelInput.addEventListener("keyup", function (event) { |
| 98 _dirty(); |
| 99 if (event.target.getAttribute("data-show-id") && |
| 100 event.target.getAttribute("data-hide-id") && |
| 101 event.target.value) { |
| 102 _showID(event.target.getAttribute("data-show-id")); |
| 103 _hideID(event.target.getAttribute("data-hide-id")); |
| 104 } |
| 105 return _vallab(event.target); |
| 106 }); |
| 107 labelInput.addEventListener("blur", function (event) { |
| 108 return _vallab(event.target); |
| 109 }); |
| 110 labelInput.addEventListener("focus", function (event) { |
| 111 return _acof(event); |
| 112 }); |
| 113 } |
| 114 |
| 115 var addRowLinks = document.getElementsByClassName("fakelink"); |
| 116 for (var i = 0; i < addRowLinks.length; ++i) { |
| 117 var rowLink = addRowLinks[[]i]; |
| 118 rowLink.addEventListener("click", function (event) { |
| 119 _acrob(null); |
| 120 var insteadID = event.target.getAttribute("data-instead"); |
| 121 if (insteadID) |
| 122 _showInstead(insteadID, this); |
| 123 }); |
| 124 } |
| 125 }); |
| 126 </script> |
OLD | NEW |