MediaWiki:Gadget-GlossaryGraph.js: Difference between revisions
Jump to navigation
Jump to search
AdminIsidore (talk | contribs) No edit summary |
AdminIsidore (talk | contribs) No edit summary |
||
| Line 10: | Line 10: | ||
} | } | ||
var term = pageTitle.split(':').pop().toLowerCase(); | var term = pageTitle.split(':').pop().toLowerCase(); | ||
var smwQuery = encodeURIComponent('[[Category:Glossary Entries]]|?Glossary-Term|?Glossary-Definition|limit=50'); | var smwQuery = encodeURIComponent('[[Category:Glossary Entries]]|?Glossary-Term|?Glossary-Definition|limit=50'); | ||
new mw.Api().get({ | new mw.Api().get({ | ||
| Line 20: | Line 17: | ||
format: 'json' | format: 'json' | ||
}).done(function(data) { | }).done(function(data) { | ||
console.log('SMW API response:', data); // Log response | |||
var results = data.query.results || {}; | var results = data.query.results || {}; | ||
var links = []; | var links = []; | ||
| Line 99: | Line 97: | ||
}).fail(function(error) { | }).fail(function(error) { | ||
$container.text('Error: API request failed'); | $container.text('Error: API request failed'); | ||
console.error('SMW API error:', error); | console.error('SMW API error details:', error); | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||