Jump to content

MediaWiki:Common.js: Difference between revisions

Line 13: Line 13:
       }
       }
     });
     });
});
$.getJSON(mw.util.wikiScript('api'), {
  action: 'parse',
  page: page.title,
  prop: 'extensiondata',
  format: 'json'
}).done(function (parsed) {
  var hooks = parsed.parse.extensiondata['lore-spotlights'] || [];
  if (hooks.length > 0) {
    var hook = hooks[Math.floor(Math.random() * hooks.length)];
    $spot.find('.content').html(hook);
  }
});
});