// ==UserScript== // @name Internet Archive File Types // @namespace www.archive.org // @description A script to show you which file types are available for each identifier // @version 3.0.3 // @author Tom Anderson // ==/UserScript== /** * CSS */ $("").appendTo('head'); // parseUri 1.2.2 // (c) Steven Levithan // http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js // MIT License function parseUri (str) { var o = parseUri.options, m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), uri = {}, i = 14; while (i--) uri[o.key[i]] = m[i] || ""; uri[o.q.name] = {}; uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { if ($1) uri[o.q.name][$1] = $2; }); return uri; }; parseUri.options = { strictMode: false, key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], q: { name: "queryKey", parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, parser: { strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ } }; // http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/ function string_to_slug(str) { str = str.replace(/^\s+|\s+$/g, ''); // trim str = str.toLowerCase(); // remove accents, swap ñ for n, etc var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; var to = "aaaaeeeeiiiioooouuuunc------"; for (var i=0, l=from.length ; i' + ext + ''); // $(node).after(button); // $(node).remove(); // Create floating text float = $('
' + ext.toUpperCase() + '
'); $(node).attr('src', 'http://db.etree.org/images/ico/filetype iaft.png'); $(node).after(float); } window.handleSmallIconError = function(node) { $(node).attr('src', 'http://db.etree.org/images/ico/filetype iaft.png'); } // This is akin to $(function() {}); function letsJQuery() { // Check browser version if (parseInt($.browser.version, 10) < 5) { alert("IAFT works with Firefox 5.0 and greater. No support is offered for legacy browsers. " + "You are running version " + $.browser.version ); return; } IAFT = { xmlUrl: '', rebuildSection: function(identifier) { a = $('a.betterTitle[href="/details/' + identifier + '"]'); if ($(a).length) { $(a).parent('.hitCell').find('.iaft').remove(); this.buildSections(a); } else { $('div.iaft').remove(); uri = parseUri(document.location); if (uri.file != 'search.php') { $('#begPgSpcr').each(function(index, node) { div = IAFT.buildSections(node, uri.path.substr(9), this, 'prepend'); $(div).addClass('iaftDetails'); $(div).find('li.showFiletypes').click(); }); } } }, buildSections: function(node, identifier, parent, attach) { // Get the archive identifier if (typeof identifier == 'undefined') { identifier = $(node).attr('href').substr(9); } var identifier_slug = string_to_slug(identifier); // Find the parent if (typeof parent == 'undefined') { parent = $(node).parent(); } // Default the attachment if (typeof attach == 'undefined') { attach = 'append'; } div = $('
'); switch(attach) { case 'after': $(parent).after(div); break; case 'append': $(parent).append(div); break; case 'prepend': $(parent).prepend(div); break; } // Make the search result titles bigger & better $('.titleLink').removeClass('titleLink').addClass('betterTitle'); // Section References section = document.createElement('section'); section.id = 'references'; section.className = 'iaft'; section.style.display = 'both'; $(section).append('

References

'); $(div).append(section); references_ul = document.createElement('ul'); $(section).append(references_ul); // Section file types section = document.createElement('section'); section.id = 'fileTypes'; section.className = 'iaft'; $(section).append('

Files

'); filetype_ul = document.createElement('ul'); $(section).append(filetype_ul); $(div).append(section); // Populate file types li = $('
  • '); $(li).data('identifier', identifier); $(filetype_ul).append(li); // Section Other Sources section = document.createElement('section'); section.id = 'other-sources'; section.className = 'iaft'; section.style.display = 'both'; $(section).append('

    Other Sources

    '); filetype_ul = document.createElement('ul'); $(section).append(filetype_ul); $(div).append(section); // Populate references this.checkDb(references_ul, identifier); return div; }, // See if the source is on db.etree.org checkDb: function(node, identifier) { server = 'http://www.archive.org/details/' + identifier; var identifier_slug = string_to_slug(identifier); // Add info IAFTLightbox icon li = $('
  • '); $(li).data('identifier', identifier); $(li).append(''); // If we are viewing details don't show uri = parseUri(document.location); if (uri.path.substr(9) != identifier) $(node).append(li); $.ajax({ url: 'http://db.etree.org/rest/iaft.php?method=lookupIdentifier&archive_identifier=' + identifier, dataType: 'xml', crossDomain: true, success: function (data, textStatus, jqXHR) { // Unwrap greasemonkey object data = data; shninfo_key = $(data).find('shninfo_key').first().text(); // Hide references if there are none if (!Number(shninfo_key)) $('section.iatf#references').hide(); // db returns other sources, if any, for the same date. Add these to references if (!$(data).find('db_sources').children().length && !$(data).find('ia_sources').children().length) { $('div.' + identifier_slug + ' #other-sources').remove(); } if (Number(shninfo_key) > 0) { li = $('
  • '); $(li).data('shninfo_key', shninfo_key); $(li).append(''); $(li).append('
    ' + shninfo_key + '
    '); $(node).append(li); // IA sources $(data).find('ia_sources').children().each(function() { li = $('
  • '); $(li).data('identifier', $(this).find('archive_identifier').text()); $(li).append(''); $(li).append('
    ' + $(this).find('shninfo_key').text() + '
    '); //$(node).append(li); $('div.' + identifier_slug + ' #other-sources').find('ul').append(li); }); // db sources $(data).find('db_sources').children().each(function() { li = $('
  • '); $(li).data('shninfo_key', $(this).find('shninfo_key').text()); $(li).append(''); $(li).append('
    ' + $(this).find('shninfo_key').text() + '
    '); //$(node).append(li); $('div.' + identifier_slug + ' #other-sources').find('ul').append(li); }); // Check bt.etree.org $.ajax({ url: 'http://db.etree.org/rest/iaft.php?method=getTorrentBySource&shninfo_key=' + shninfo_key, dataType: 'xml', crossDomain: true, success: function (data, textStatus, jqXHR) { // Unwrap greasemonkey object data = data; torrent_id = $(data).find('id').text(); if (torrent_id > 0) { li = $('
  • '); $(li).data('torrent_id', torrent_id); $(li).append(''); $(li).append('
    ' + $(data).find('peers').text() + '
    '); $(node).append(li); } } }); // Check Lossless Legs $.ajax({ url: 'http://www.shnflac.net/rest/ll.php?method=iaftFetchSourceTorrent&source_key=' + shninfo_key, dataType: 'xml', crossDomain: true, success: function (data, textStatus, jqXHR) { data = data; torrent_id = $(data).find('id').text(); if (torrent_id) { li = $('
  • '); $(li).data('torrent_id', torrent_id); $(li).append(''); $(li).append('
    ' + $(data).find('peers').text() + '
    '); $(node).append(li); } } }); } else { // Hide references if there are none if (uri.path.substr(9) == identifier) $('section#references').hide(); } } }); }, // Get the archive xml from yahoo checkArchive: function(node, identifier) { var identifier_slug = string_to_slug(identifier); // Fetch archive xml url $.ajax({ url: 'http://db.etree.org/rest/iaft.php?method=getIdentifierUrl&identifier=' + encodeURIComponent(identifier), datatype: 'xml', crossDomain: true, success: function(data, textStatus, jqXHR) { IAFT.xmlUrl = $(data).find('response').text(); $.ajax({ url: 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D%27' + encodeURIComponent(IAFT.xmlUrl) + '%27', crossDomain: true, dataType: 'xml', success: function (data, textStatus, jqXHR) { xml = data; if (!$(data).find('metadata').length) { $(node).find('button').html('Out of Order'); return false; } $(node).empty(); formats = new Array(); // Get a unique sorted list of file extensions $(data).find('file').each(function(index, file) { filename = $(file).attr('name').toLowerCase(); ext = formats[formats.length] = /[^.]+$/.exec(filename); }); // Get a unique list of formats var o = {}, i, l = formats.length, r = []; for(i=0; i'); $(li).append('
    ' + members.length + '
    '); $(node).append(li); // Gather all file names for (type in formats) { members = new Array(); ext = formats[type]; $(data).find('file').each(function(index, file) { filename = $(file).attr('name').toLowerCase(); fext = /[^.]+$/.exec(filename); if ($.trim(fext) == $.trim(ext)) { members[members.length] = file; } }); src = 'http://db.etree.org/images/ico/filetype ' + ext + '.png'; li = document.createElement('li'); li.className = 'filetype'; $(li).data('identifier', identifier); $(li).data('ext', ext); $(li).data('files', members); $(li).data('path', 'http://' + $(data).find('results results').attr('server') + $(data).find('results results').attr('dir')); $(li).append('' + ext + ''); $(li).append('
    ' + members.length + '
    '); $(node).append(li); } // Add the add to db link if no db link found and show exists if (!$(node).parent().parent().find('li.dbSource').length) { // Does the artist and show exist on db? $.ajax({ url: 'http://db.etree.org/rest/iaft.php', type: 'post', data: { method: 'doesShowExist', name: $(data).find('metadata creator').text(), date: $(data).find('metadata date').text() }, success: function (data, textStatus, jqXHR) { section = document.createElement('section'); section.id = 'actions'; // Add identifier as class name $(section).addClass('iaft'); $(section).addClass(identifier_slug); $(node).parent().parent().append(section); $(section).append('

    Actions

    '); actions_ul = document.createElement('ul'); $(section).append(actions_ul); li = $('
  • '); $(li).data('identifier', identifier); $(actions_ul).append(li); $(xml).find('collection').each(function(index, node) { $('div.iaft.' + identifier_slug + ' section.iaft').addClass($(this).text()); }); $(xml).find('mediatype').each(function(index, node) { $('div.iaft.' + identifier_slug + ' section.iaft').addClass($(this).text()); }); $(xml).find('identifier').each(function(index, node) { $('div.iaft.' + identifier_slug + ' section.iaft').addClass(string_to_slug($(this).text())); }); } }); } $(xml).find('collection').each(function(index, node) { $('div.iaft.' + identifier_slug + ' section.iaft').addClass($(this).text()); }); $(xml).find('mediatype').each(function(index, node) { $('div.iaft.' + identifier_slug + ' section.iaft').addClass($(this).text()); }); $(xml).find('identifier').each(function(index, node) { $('div.iaft.' + identifier_slug + ' section.iaft').addClass(string_to_slug($(this).text())); }); }, error: function() { $(node).append('
  • Error fetching metadata. This can happen (blame Yahoo!) ' + 'if you make too many
    requests in a row. You may need to wait 10 minutes or longer before ' + 'requests will work again.
  • '); } }); } }); }, /** * Show the add to db.etree.org form */ shninfoForm: function(xml) { // Begin by building the form and dl form = document.createElement('form'); $(form).addClass('iaft_form'); dl = $('
    '); $(dl).addClass('iaft_form'); var i = 0; // Add data about this xml for db use. $(form).data('identifier', $(xml).find('metadata identifier').text()); $(form).data('path', 'http://' + $(xml).find('results results').attr('server') + $(xml).find('results results').attr('dir')); $(form).data('name', $(xml).find('metadata creator').text()); $(form).data('date', $(xml).find('metadata date').text()); $(xml).find('files file').each(function(index, node) { // Exclude file types we know we don't care about filename = $(node).attr('name').toLowerCase(); ext = /[^.]+$/.exec(filename); switch (ext) { case 'flac': case 'shn': case 'xml': case 'mpg': case 'mp3': case 'mp4': case 'ogv': case 'm3u': case 'conf': case 'ogg': case 'gif': case 'jpg': case 'jpeg': case 'skt': case 'zip': return; break; default: break; } if (ext == 'flac') return; if (ext == 'shn') return; if (ext == 'xml') return; if (ext == 'mpg') return; if (ext == 'mp3') return; if (ext == 'mp4') return; if (ext == 'ogv') return; if (ext == 'm3u') return; if (ext == 'conf') return; if (ext == 'ogg') return; if (ext == 'gif') return; if (ext == 'jpg') return; if (ext == 'jpeg') return; if (ext == 'skt') return; if (ext == 'zip') return; // Add each file i++; // Build radio arrays dt = $('
    Infodoc
    '); radio1 = $(''); $(radio1).data('filename', $(node).attr('name')); radio2 = $(''); $(radio2).data('filename', $(node).attr('name')); radio3 = $(''); $(dt).append(radio1); $(dt).append('
    Checksum '); $(dt).append(radio2); $(dt).append('
    Ignore '); $(dt).append(radio3); $(dl).append(dt); path = $(form).data('path') + '/' + $(node).attr('name') $(dl).append('
    '); }); $(dl).append('
    '); $(dl).append('
    '); $(form).append(dl); wrapper = $('
    '); $(wrapper).append('

    Upload Source to db.etree.org

    ' + '

    Select the file type for each file using the radio buttons. db only wants infodoc files, the txt files with each distribution, ' + 'and checksum files. Leave all other files as Ignore.

    ' ); $(wrapper).append(form) this.Lightbox.show(wrapper); }, /** * Convert number of bytes into human readable format * * @param integer bytes Number of bytes to convert * @param integer precision Number of digits after the decimal separator * @return string */ bytesToSize: function(bytes, precision) { var kilobyte = 1024; var megabyte = kilobyte * 1024; var gigabyte = megabyte * 1024; var terabyte = gigabyte * 1024; if ((bytes >= 0) && (bytes < kilobyte)) { return bytes + ' B'; } else if ((bytes >= kilobyte) && (bytes < megabyte)) { return (bytes / kilobyte).toFixed(precision) + ' KB'; } else if ((bytes >= megabyte) && (bytes < gigabyte)) { return (bytes / megabyte).toFixed(precision) + ' MB'; } else if ((bytes >= gigabyte) && (bytes < terabyte)) { return (bytes / gigabyte).toFixed(precision) + ' GB'; } else if (bytes >= terabyte) { return (bytes / terabyte).toFixed(precision) + ' TB'; } else { return bytes + ' B'; } }, randomString: function() { var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; var string_length = 20; var randomstring = ''; for (var i=0; i $(b).attr('name')) return 1; return -1; }); path = $(li).data('path'); ext = $(li).data('ext'); identifier = $(li).data('identifier'); var content = 'Internet Archive File Types for directory ' + path + '' + '
      '; for (i in files) { file = $(files[i]); ext = file.attr('name').split('.').pop(); content += '
    • ' + '' + file.attr('name') + '' + ''; content += ''; content += '' + '
      Size: '; if (file.find('size').text()) content += this.bytesToSize(file.find('size').text()); content += 'Last Update: '; if (file.find('mtime').text()) { date = new Date(file.find('mtime').text() * 1000); content += date.toString(); } content += 'MD5: '; if (file.find('md5').text()) content += file.find('md5').text(); rand = this.randomString(); content += 'Details '; content += '
      '; $(file).children().each (function(index, node) { content += '' + node.nodeName + ': ' + $(node).text() + '
      '; }); content += '
      ' + '
    • '; } content += '
    '; if (ext == 'mp3') { content += ''; } // Build FlashGot promo content += '
    Thanks for installing IAFT. I recommend you also install ' + 'FlashGot. Using FlashGot you can select all these files ' + 'as though you were copying the text, right click, and start a download for all selected links ' + 'using the browsers download manager or an external one.'; return content; }, Lightbox: { init: function() { /** * Add the lightbox */ $('body').append('
    ' + '' + 'This is the IAFTLightbox content.
    '); $('body').append('
    '); /** * Move the IAFTLightbox on resize */ $(window).resize(function(node) { // Center the centering div $('.IAFTLightboxBody').css('left', (($(window).width() - $('.IAFTLightboxBody').width()) / 2)); $('.IAFTLightboxMask').css('height', $(window.document).height()); // Center vertically var minTop = 30; var top = (($(window).height() - $('.IAFTLightboxBody').height()) / 2); if (top < minTop) top = minTop; top += $(document).scrollTop(); $('.IAFTLightboxBody').css('top', top); var width = (($(window).width() - $('.IAFTLightboxBody').width()) / 2); offset = $('.IAFTLightboxBody').offset(); var width = $('.IAFTLightboxBody').width(); // + $('.IAFTLightboxBody').left(); $('.closeButton').css('top', offset.top - 10); $('.closeButton').css('left', offset.left -10); $('.closeButton').show(); }); // Close the IAFTLightbox $('.closeButton').live('click', function(event) { IAFT.Lightbox.close(); }); }, show: function(content) { this.empty(); $('#light .content').append(content); var copy = '

    ' + '© ' + new Date().getFullYear() + ' Internet Archive File Types

    '; $('#light .content').append(copy); // Bind esc to close IAFT.Lightbox $(document).bind('keypress', function(event) { if (event.keyCode == 27) { $('.closeButton').click(); } }); $('#light').show(); $('#fade').show(); $(window).resize(); }, empty: function() { $('#light .content').empty(); }, close: function() { $(document).unbind('keypress', false); $('#light').hide(); $('#fade').hide(); $('.closeButton').hide(); } } } // Live event definitions // Show file details $('section.iaft ul li.filetype').live('click', function(event) { IAFT.Lightbox.show(IAFT.buildFileContent(this)); }); // Show file detail details $('ul.IAFTfilelist a.more').live('click', function(event) { $('#' + $(this).attr('id') + '_tr').toggle(); return false; }); // Show details for all IAFT blocks $('.showAllFiletypes').live('click', function(event) { $(this).attr('disabled', 'disabled'); $('.showFiletypes').each(function(index, node){ $(this).click(); }); }); // Get the details from archive.org $('.showFiletypes').live('click', function(event) { $(this).find('button').html('Load ing'); IAFT.checkArchive($(this).parent(), $(this).data('identifier')); }); // Show the add to db form $('.addToDb').live('click', function(event) { li = this; $.ajax({ url: 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D%27' + encodeURIComponent(IAFT.xmlUrl) + '%27', crossDomain: true, dataType: 'xml', success: function (data, textStatus, jqXHR) { // Unwrap greasemonkey object data = data; if (!$(data).find('metadata').length) { alert("Unable to fetch data from IA. This is likely due to invalid syntax in their xml. " + "If you can click the I and the entry comes up ok it's probably not their xml. " + "There are other causes such as an old version of Firefox or " + "another Firefox plugin blocking cross scripting " + "(which can been seen as an attack or the future of internet services such as IAFT)." ); $(li).parent().parent().parent().find('section#actions').remove(); return false; } IAFT.shninfoForm(data); } }); }); // Show a db source detail $('.dbSource').live('click', function(event) { shninfo_key = $(this).data('shninfo_key'); IAFT.Lightbox.show($('')); }); // Show a bt torrent detail $('.btTorrent').live('click', function(event) { torrent_id = $(this).data('torrent_id'); IAFT.Lightbox.show($('')); }); // Show a shnflac torrent detail $('.llTorrent').live('click', function(event) { torrent_id = $(this).data('torrent_id'); IAFT.Lightbox.show($('')); }); // Show an archive entry detail (in a light box) $('.archiveEntry_lightbox').live('click', function(event) { identifier = $(this).data('identifier'); IAFT.Lightbox.show($('')); }); // Show an archive entry detail (in a light box) $('.archiveEntry').live('click', function(event) { identifier = $(this).data('identifier'); window.location = "http://www.archive.org/details/" + identifier; }); // Show an archive entry detail (in a light box) $('.dbEntry').live('click', function(event) { shninfo_key = $(this).data('shninfo_key'); IAFT.Lightbox.show($('')); }); // Show the reviews $('a#show-reviews').live('click', function() { $('p.review').show(); $(this).hide(); return false; }); // Show the about screen $('.iaft_about').live('click', function(event) { IAFT.Lightbox.close(); IAFT.Lightbox.show(' \

    Internet Archive File Types

    \ \

    \ The home page for IAFT is http://userscripts.org/scripts/show/107166 \
    \ There is a changelog there if you\'d like to see what\'s new in each version. \

    \

    \ IAFT is open sourced under the GNU General Public License. \ \ IAFT is able to work it\'s magic by leveraging YQL and \ cross-site scripting. \

    \

    \ The icons used are from and based on the kearone\'s Icons goes Apple "Filetypes" library. \ To contribute icons please use this library and email your contribution to tom.h.anderson@gmail.com. \

    \

    \ IAFT is a project of Tom Anderson. \
    \ Produced by db.etree.org. \

    \
    \ '); }); /** * Submit code to db.etree.org * @references actions.submit.to.db */ $('form.iaft_form').live('submit', function(event) { if ($('input.infodoc:checked').length != 1) { alert('You must have only have one file selected as the infodoc.'); return false; } if (!$('input.checksum:checked').length) { alert('You must select at least one checksum to submit this source. If this source does not have any checksums it is not' + ' submitable to db.etree.org.'); return false; } infodoc = $('input.infodoc:checked').first(); var checksums = new Array(); $('input.checksum:checked').each(function(index, node) { checksums[checksums.length] = $(this).data('filename'); }); form = this; // Disable the submit button on submit $('input[type=submit]', this).attr('disabled', 'disabled'); $.ajax({ type: 'post', url: 'http://db.etree.org/rest/iaft.php', data: { method: 'importArchiveSource', infodoc: $(infodoc).data('filename'), identifier: $(form).data('identifier'), path: $(form).data('path'), name: $(form).data('name'), date: $(form).data('date'), checksums: checksums }, success: function(data, textStatus, jxQHR) { // Unwrap greasemonkey object data = data; error = $(data).find('error').text(); if (error) { alert(error); } shninfo_key = $(data).find('response').text(); if (!shninfo_key && !error) { alert('An unknown error occured. We may be unable to reach db or something else went wrong.'); } $('.closeButton').click(); IAFT.rebuildSection($(form).data('identifier')); }, error: function() { alert("There was a problem submitting this source information. Please try again another time."); $('.closeButton').click(); IAFT.rebuildSection($(form).data('identifier')); } }); return false; }); /** * Resize the lightbox when the window is resized */ $(window).resize(function(node) { // Set left margin for movie modal if window is resized, is larger than document window var documentWidth = $(window).width(); $('div.light').css('height', $(window.document).height()); // Center movie vertically var minTop = 30; var top = (($(window).height() - $('div.light').height()) / 2); if (top < minTop) top = minTop; top += $(document).scrollTop(); $('div.light').css('top', top); }); /** * Begin code to build IAFT * main script */ IAFT.Lightbox.init(); // Determine if we are on a details or search page if ($('a.titleLink').length) { // Search Page // Clear all search terms $('.searchTerm').removeClass('searchTerm'); $('a.titleLink').each(function(index, node) { IAFT.buildSections(node); }); $('#begPgSpcr').append(''); $('td.thumbCell').empty(); } else { // Details Page document.documentElement.addEventListener('DOMAttrModified', function(e){ if (e.attrName === 'style') { if ($(e.explicitOriginalTarget).attr('id') == 'mwplayer_displayarea') { // Fix sectoin widths $('div#col1').css('margin-left', '0px'); $('div#midcol').removeAttr('style'); $('div#col1').css('width', $(e.explicitOriginalTarget).css('width')); $('div#col1').width($('div#col1').width() + 33); $('div#midcol').css('margin-left', $('div#col1').width() - 5); } } }, false); // Find identifier uri = parseUri(document.location); identifier = uri.path.substr(9); // Make room for IAFT $('.breadcrumbs').after('
    '); $('.breadcrumbs').addClass('IAFTbreadcrumbs'); // Move AV player if ($('#avplaycontainer').length) { $('#avplaycontainer').detach().insertAfter('div#col1 div.box h1:first'); } // Reformat reviews $('

    Reviews

    ').appendTo('div#midcol'); reviewHeader = $('h2[style="font-size:125%;"]').detach().appendTo('#reviews').css('font-size', '1em'); reviewWrite = $(reviewHeader).find('.rightmost').detach(); reviewStars = $(reviewHeader).find('span:last').detach().css('font-size', '1em'); $(reviewHeader).html(reviewStars); $(reviewWrite).html('Write a review'); $(reviewHeader).append($(reviewWrite)); // Reformat individual reviews $('p[style="margin:3px; padding:4px; border:1px solid #ccc;"]').addClass('review') .detach() .appendTo('#reviews') .hide() .first() .before('Reviews are hidden. Show Reviews'); // Fix the ia footer $('div#iafootdiv').detach().insertAfter('div#midcol'); $('p#iafoot').detach().appendTo('div#iafootdiv'); // Change details box header $('span.x-archive-meta-title').parent().html('Details'); // Change streaming box header $('div#col1 div.box h1:first').html('Stream'); // Remove crap $('div#map').remove(); $('div#midcol div.box div p.content:first').remove(); $('p#iframeVidso').remove(); $('img#thumbnail').parent().remove(); $('#begPgSpcr').remove(); // Run IAFT sections $('.breadcrumbs').each(function(index, node) { div = IAFT.buildSections(node, identifier, this, 'after'); $(div).addClass('iaftDetails'); $(div).find('li.showFiletypes').click(); }); } }