PageRenderTime 40ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/js/libs/api.php

https://bitbucket.org/errant/wikidash
PHP | 21 lines | 17 code | 3 blank | 1 comment | 0 complexity | eecbd50fe05008238acadcf6dd1b4114 MD5 | raw file
  1. define([],function() {
  2. return {
  3. Router: Backbone.Router.extend({
  4. routes: {
  5. "watchlist": "watchlist"
  6. },
  7. watchlist: function () {
  8. $.get("http://en.wikipedia.org/w/api.php",{action:"query",list:"watchlist",wllimit:150,format:"json",wlprop:"title|ids|user|comment|flags"},function(data) {
  9. $.each(data.query.watchlist, function(x,item) { $("#content").append(item.title);$("#container").append("<br />"); });
  10. });
  11. },
  12. defaultAction: function(actions){
  13. // We have no matching route, lets just log what the URL was
  14. console.log('No route:', actions);
  15. }
  16. })
  17. };
  18. });