Skip to content

Instantly share code, notes, and snippets.

@codewizard13
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save codewizard13/aa8954afde09e00700ed to your computer and use it in GitHub Desktop.

Select an option

Save codewizard13/aa8954afde09e00700ed to your computer and use it in GitHub Desktop.
[MOSTLY OBSOLETE] Adds AddIndexToFFHistoryExport (2013)
/* Add numbers to left of table.
(Press F12 in your browser to see the results)
@Creator: Eric Hepperle (CodeSlayer2010)
@Date: 07/11/13
@Version: 1.0
@Purpose: Works best with Firefox "History Export" addon.
Grabs <A> tags inside <TD> tags. Loops through each
appends an index (count) number as <TD> to left of
the original first <T>.
@Updates:
07/11/13
10:30 AM - Created initial code.
02/14/15
The "History Export" extension for Firefox no longer
exists, thus this code is obsolete. Keeping for
historical purposes.
*/
console.clear()
link_objs = $('td a');
//console.warn(' *********************** ');
//console.warn('link_objs:')
//console.log(link_objs)
console.warn(' *********************** ');
console.warn('*** LISTING OBJECTS INDIVIDUALLY ***')
// foreach
$.each(link_objs, function(i, v){
var me = $(this);
var parentTag = me.parent().get(0).tagName;
var targetAncestor = me.parents().eq(1);
var targetAncestorTagName = targetAncestor.get(0).tagName;
//console.log('EL ' + i + ': ' + me.attr('href'));
//console.info(me.find('td').parent())
//console.info("parentTag: " + parentTag)
console.info("targetAncestor = ")
console.log(targetAncestor)
console.info("targetAncestorTagName: " + targetAncestorTagName);
// put count at front of line
targetAncestor.prepend('<td class="num">' + i + '</td>');
if (i == 9) { return false; }
});
console.warn("El count: " + link_objs.length)
console.warn('*** [DONE] ***')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment