Skip to content

Instantly share code, notes, and snippets.

@ClemRz
Created February 7, 2018 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ClemRz/9a5427c687eb31ce57df823a2c88d326 to your computer and use it in GitHub Desktop.
Save ClemRz/9a5427c687eb31ce57df823a2c88d326 to your computer and use it in GitHub Desktop.
This is how you add more file fileds to the GPS Visualizer convertion tool

How to add more file fields to the GPS Visualizer convertion tool

  1. Go to http://www.gpsvisualizer.com/ and choose a file converter
  2. Click the link Show additional file input boxes
  3. Open the developper tool's console
  4. Copy and paste the script below

Enjoy!

(function () {
function _getRow(i) {
var tr = document.createElement('tr');
tr.setAttribute('valign', 'middle');
var s = "<td width=\"1%\">File&nbsp;#" + i + "</td><td width=\"99%\" style=\"width:250px; max-width:250px; overflow:hidden;\"><input type=\"file\" id=\"input:uploaded_file_" + i + "\" name=\"uploaded_file_" + i + "\"></td><td width=\"1%\"><div class=\"delete_box\" onclick=\"Reset_File_Input('input:uploaded_file_" + i + "');\" title=\"reset the file input\"></div></td>";
tr.innerHTML = s;
return tr;
}
function _getContainer() {
return $$('#more_file_boxes tbody')[0];
}
function _init() {
var qty = prompt('How many fields do you want? (>8)');
if (qty) {
var container = _getContainer();
for (var i = 9; i <= qty*1; i++) {
container.appendChild(_getRow(i));
}
}
}
_init();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment