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 7: | Line 7: | ||
if (!pageTitle) { | if (!pageTitle) { | ||
$container.text('Error: No page title'); | $container.text('Error: No page title'); | ||
console.error('No page title found for container'); | |||
return; | return; | ||
} | } | ||
| Line 15: | Line 16: | ||
action: 'ask', | action: 'ask', | ||
query: smwQuery, | query: smwQuery, | ||
limit: 50, | limit: 50, | ||
format: 'json' | format: 'json', | ||
formatversion: 2 | |||
}).done(function(data) { | }).done(function(data) { | ||
console.log('SMW API response:', data); | console.log('SMW API response:', JSON.stringify(data, null, 2)); | ||
var results = data.query.results || {}; | var results = data.query.results || {}; | ||
var links = []; | var links = []; | ||
| Line 34: | Line 36: | ||
if (links.length === 0) { | if (links.length === 0) { | ||
$container.text('No connections found.'); | $container.text('No connections found.'); | ||
console.log('No connections found for term:', term); | |||
return; | return; | ||
} | } | ||
| Line 101: | Line 104: | ||
status: textStatus, | status: textStatus, | ||
error: errorThrown, | error: errorThrown, | ||
responseText: jqXHR.responseText | responseText: jqXHR.responseText, | ||
statusCode: jqXHR.status, | |||
url: 'https://www.ooda.wiki/api.php?action=ask&query=' + smwQuery + '&limit=50&format=json&formatversion=2' | |||
}); | }); | ||
}); | }); | ||