User:Sam Sailor/Scripts/logger.js

// This is a modified version of Special:PermaLink/554655656 (function {   function save(title, content, next)	{		var param = {action: 'edit', title: title, summary: 'adding ' + content, token: mw.user.tokens.get('csrfToken'), appendtext: content, format: 'json'};		$.post(mw.util.wikiScript('api'), param, function { mw.util.jsMessage(content + ' added to page ' + title); });	}	function add_button(page, caption)	{		var addColon = $.inArray(mw.config.get('wgNamespaceNumber'), [6,14]) + 1;		var pageName = (addColon ? ":" : "") + mw.config.get('wgPageName').replace( /_/g, " " );		var text =  + pageName + ;		var a = mw.util.addPortletLink(window.pageCollectorMenu || 'p-cactions','#',caption,'','add this page to: "' + page + '"');		$(a).click(function {save(page, '\n# ' + text);});	}    $(window.pagesToCollect).each(function {add_button(this.page, this.caption);}); });