API/libsapojs/SAPO/Widget/Banca

[Elements] are optional

Class SAPO.Widget.Banca


class SAPO.Widget.Banca
Widget to show the thumb of the latest journals
requires SAPO.Communication.Syndication
Defined in Widget/Banca/0.1/lib.js

Constructor Summary
Banca ([Object options])
Widget to show journals

Function Summary
adds cssURI to head
_addJournalThumb (Object jsonObj)
functions that creates the DOM Element with the thumbnail to the journal
function that go through the list of publications to show and removes it from the list after a match
builds the skeleton of the widget where the thumbnails will be displayed
_getData (Object json)
function to execute after fetch of jsonObject
display a loading message while jsonObject is being fetched
display a error message if the request gives a timeout
debug()
debug stuff
init()
constructor alias

Constructor Details

constructor Banca

Banca([Object options])
Widget to show journals
Parameters:
[options]
  • [ String stand ] - Subquery to webservice NewsStand
  • [ String target ] - id of the DOM Element where the widget will be contained
  • [ Number numItems ] - number of journals to be displayed (ignored param if publications are set)
  • [ Number thumbWidth ] - width of the thumbnail
  • [ Number thumbHeight ] - height of the thumbnail
  • [ Array|String publications ] - array or comma separated list of the publications to show
  • [ String jsonUrl ] - service uri
  • [ cssURI cssURI ] - alternative css style url

Function Details

function _addCss

_addCss()
adds cssURI to head

function _addJournalThumb

_addJournalThumb(Object jsonObj)
functions that creates the DOM Element with the thumbnail to the journal
Parameters:
jsonObj - Json Object of the journal

function _arrayMatchAndRemovePublication

_arrayMatchAndRemovePublication(String value)
function that go through the list of publications to show and removes it from the list after a match
Parameters:
value - publication name to match

function _buildSkeleton

_buildSkeleton()
builds the skeleton of the widget where the thumbnails will be displayed

function _getData

_getData(Object json)
function to execute after fetch of jsonObject
Parameters:
json - json object to show

function _loading

_loading()
display a loading message while jsonObject is being fetched

function _timeout

_timeout()
display a error message if the request gives a timeout

function debug

debug()
debug stuff

function init

init()
constructor alias