User:Inductiveload/Metadata form.js

function add_metadata_tab { /* Add a link to the toolbar portlet */

if (wgNamespaceNumber!=0 ){return} /* If we already have the button */ if(document.getElementById('ca-metadata')) {/* Do nothing */} else { $("#ca-talk").before(' Metadata ') } } function get_metadata { /* Find the relevant source for the metadata of the page */ if ($('#metadata-div').length > 0){ return }

$.ajax({       url: $(self.proofreadpage_source_href).attr('href'),        dataType: 'html',        success: function( data ) {  fill_metadata(data); }    }); } function fill_metadata(data){ $("#text-wrap").before(" ");

$('#metadata-div').append(" ")

editLink = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + self.proofreadpage_source_href.match('(Index:[^\"]*)')[1] + '&action=edit';   $('#metadata-controls').append("[Edit]");    $('#metadata-controls').append("[Close]");

$('#metadata-div').append($(data).find('table table table:eq(0)')       .attr('id','metadata-table')    ) } function close_metadata{ $('#metadata-div').remove }

add_metadata_tab