User:Technical 13/SandBox/timestampLinks.js

/* *

/* Disable these for now... Will need to think more about them... Need to get class work done for now though... function postNotes(target, user, summary, content){ }

$('span.localcomments').each(function{   var timestamp = $(this).attr('timestamp');    $(this).attr('id', timestamp);    var revisionInfoQ = {        action: 'query',        prop: 'revisions',        format: 'json',        rvlimit: 1,        rvprop: 'ids|user|comment',        pageids: mw.config.get('wgArticleId'),        rvstartid: timestamp,        continue: ""    };    $.get(mw.config.get( 'wgScriptPath' )+"/api.php", revisionInfoQ, function(revisionInfoR){

console.log('%O', revisionInfoR);

var revisionUser = $(revisionInfoR).find('user').text; var revisionSection = $(revisionInfoR).find('comment').text; revisionSection = revisionSection.match(/\/\* *(.*?) *\*\//); var revId = $(revisionInfoR).find('revid').text;

console.log('{user: "%s", sectionTitle: "%s", revid: %d}', revisionUser, revisionSection, revId);

var tslbSep = '&thinsp;&#124;&thinsp;'; var tslbLB = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/index.php?title="; var timestamplinkbar = '(&thinsp;';       timestamplinkbar += 'u';        timestamplinkbar += tslbSep;        timestamplinkbar += 't';        timestamplinkbar += tslbSep;        timestamplinkbar += 'TB';        timestamplinkbar += tslbSep;        timestamplinkbar += '';        timestamplinkbar += tslbSep; timestamplinkbar += 'c'; timestamplinkbar += '&thinsp;) ';       $('span#' + timestamp).prepend(timestamplinkbar);    }); });

//