Jump to content

Module:Shortdesc helper JS

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Galobtter (talk | contribs) at 10:01, 10 June 2019 (hm). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}

function p.main(frame)
	local text = mw.title.new('MediaWiki:Gadget-Shortdesc-helper.js'):getContent()
	content = text
		:match('var messages.-;')
		:gsub('var messages', 'window.sdh.messages')
		:gsub('\t\t', '\t')
		:gsub('\t};', '};')
	content = content..	[[


mw.loader.getScript( '//en.wikipedia.org/wiki/MediaWiki:Gadget-libSettings.js' ).then (function() {
	mw.loader.load( '//en.wikipedia.org/wiki/MediaWiki:Gadget-Shortdesc-helper.css', 'text/css');
	mw.loader.load( '//en.wikipedia.org/wiki/MediaWiki:Gadget-Shortdesc-helper.js' );
});
	]]
	return frame:extensionTag ('syntaxhighlight', content, {lang = 'js'})
end

function p.vectorcss(frame)
	return mw.title.new('MediaWiki:Gadget-Shortdesc-helper-pagestyles-vector.css'):getContent()
end

return p