User:AHollender (WMF)/minerva.js

// Full stylesheet url mw.loader.load( '/wiki/User:AHollender_(WMF)/story.css?action=raw&ctype=text/css', 'text/css' ); console.log('hello from user script land'); var pageTitle; var urlString = 'User%3AAHollender_(WMF)%2Fstory%2F'; var storyHtml;

// remove Talk tab $('.minerva__tab-container a:nth-child(2)').remove;

// add Visual story tab $('.minerva__tab-container').append('Summary');

// get page title pageTitle = urlString + /[^/]*$/.exec(window.location.pathname)[0];

// get visual story HTML $.get( 'https://en.wikipedia.org/api/rest_v1/page/html/' + pageTitle, function ( data ) {	console.log( 'getting page...' );	var htmlDoc = new DOMParser.parseFromString( data, 'text/html' );	storyHtml = htmlDoc.getElementsByTagName('section'); } );

// add story container to overlay container setTimeout(function{ 	$('.mw-overlays-container').append(' ');	$('#storyContent').append(storyHtml);	$('#storyContainer').append('  Close'); }, 1000);

// open story modal function openStory { console.log('open the story modal'); $('#storyContainer').addClass('visible'); }

// close story modal function closeOverlay { console.log('close the story modal'); $('#storyContainer').removeClass('visible'); window.scrollTo(0, 0); }