(lbl, name, value, allowRemove, type)
| 647 | } |
| 648 | |
| 649 | function createTrInput(lbl, name, value, allowRemove, type) { |
| 650 | var row = createTr(); |
| 651 | |
| 652 | row.lbl.innerText = lbl; |
| 653 | |
| 654 | if (type == 'label') { |
| 655 | row.val.innerText = value; |
| 656 | return {row: row.tr}; |
| 657 | } else if (type == 'textarea') { |
| 658 | var input = document.createElement('textarea'); |
| 659 | input.className = 'textarea'; |
| 660 | } else { |
| 661 | var input = document.createElement('textarea'); |
| 662 | input.className = 'input'; |
| 663 | } |
| 664 | input.value = value; |
| 665 | input.name = name; |
| 666 | row.val.appendChild(input); |
| 667 | |
| 668 | var copy = document.createElement('button'); |
| 669 | copy.className = 'copybutton'; |
| 670 | if (type != 'textarea') { |
| 671 | copy.style.top = '3px'; |
| 672 | } |
| 673 | copy.onclick = function(e) { |
| 674 | input.select(); |
| 675 | document.execCommand('copy', null, ''); |
| 676 | } |
| 677 | row.val.appendChild(copy); |
| 678 | |
| 679 | var decode = document.createElement('button'); |
| 680 | decode.className = 'decodebutton'; |
| 681 | if (type != 'textarea') { |
| 682 | decode.style.top = '3px'; |
| 683 | } |
| 684 | decode.onclick = function(e) { |
| 685 | |
| 686 | } |
| 687 | |
| 688 | var del = false; |
| 689 | if (allowRemove) { |
| 690 | del = createDeleteBox(); |
| 691 | var wrap = wrapDelete(del); |
| 692 | row.val.appendChild(wrap); |
| 693 | } |
| 694 | return {row: row.tr, input: input, del: del, originalValue: value}; |
| 695 | } |
| 696 | |
| 697 | |
| 698 | function createTrNewEntry(type, table, list) { |
no test coverage detected