Difference between revisions of "User:Fbstj/gadget/history-test.js"

m
try this now
m (try this)
m (try this now)
if (!page_name.startsWith('Coppermind:Artist/')) { return; }
const api = new mw.Api()
console.log('editing',const mw.config.get('wgPageName'),edit = document.querySelector('textarea'))
console.log('editing', page_name, edit)
 
if (edit.value == '') {
console.log('editing', mw.config.get('wgPageName'), document.querySelector('textarea'))
edit.value = "'''"+ page_name.split('/')[1] +"''' made this art:\n\n<gallery>\n\n</gallery>\n\n== Notes ==\n<references />\n{{real world}}"
}
 
api.get({
titles: page_name,
lhnamespace: "6", // File: namespace only
}).then(resp => console.logfunction(resp.query)) {
console.log(resp.query)
})
 
});