(data)
| 685 | } |
| 686 | |
| 687 | function selectTreeNodeBinary (data) { |
| 688 | // switch image from 'string' to 'binary', do not know this before really querying the value... |
| 689 | var tree = getKeyTree(); |
| 690 | tree.set_icon(tree.get_selected(true)[0], 'images/treeBinary.png'); |
| 691 | |
| 692 | // only working for smaller data sets, no big binaries by now (everything load into browser)... |
| 693 | // calc number of 8bit-columns based on current "#body".width, static widths are taken from css classes |
| 694 | // TODO handle window resize |
| 695 | var idBody = $('#body'); |
| 696 | data.offset = 0; |
| 697 | data.columns = Math.floor( (idBody.width() - 70 - 2*20) / 34 / 8 ) * 8; |
| 698 | data.value = BinaryView.base64DecToArr(data.value); |
| 699 | data.positions = []; |
| 700 | for (var i = 0; i < Math.ceil(data.value.length / data.columns); i += 1) { |
| 701 | data.positions.push( BinaryView.toHex(data.offset + i * data.columns, 8) ); |
| 702 | } |
| 703 | |
| 704 | renderEjs('templates/editBinary.ejs', data, idBody, function() { |
| 705 | console.log('edit binary template rendered'); |
| 706 | idBody.find('.binaryView-hex').width(22 * data.columns); |
| 707 | idBody.find('.binaryView-char').width(12 * data.columns); |
| 708 | }); |
| 709 | } |
| 710 | |
| 711 | function selectTreeNodeHash (data) { |
| 712 | renderEjs('templates/editHash.ejs', data, $('#body'), function() { |
no test coverage detected