4 # Readings jquery plugin dispatcher.
11 $.fn.Readings[meth].apply(this, args)
15 if Readings.initialized?
17 Readings.config = new Readings.Config
18 wlurl: 'http://readings.local'
25 show_filter: [ 'authors', 'themes' ]
26 show_dividers: [ 'authors', 'themes']
27 Readings.initialized = true
29 $(document).on 'pageinit', '#page-categories' , (ev) ->
31 $('#list-categories').Readings 'CategoryList'
33 rcategory = /category=(\w+)/
34 $(document).on 'pageinit', "#page-tags", (ev, ui) ->
35 category = rcategory.exec($(this).attr('data-url'))
36 if category? and category[1]?
37 $(this).Readings 'list',
39 url: Readings.config.get('wlurl') + "/api/#{category[1]}"
40 filter: (Readings.config.get('show_filter').indexOf(category[1]) >= 0)
41 mapper: (rec) -> new Readings.Tag(rec, category[1])
42 dividers: (Readings.config.get('show_dividers').indexOf(category[1]) >= 0)
44 alert 'no category in query string'