namespace SAPO.Component

Class Summary
Presents the user with a summary of the tasks happening behind the scenes

requires SAPO.Dom.Event

requires SAPO.Dom.Css

requires SAPO.Utility.String

requires SAPO.Communication.Ajax

Adds autocomplete behavior to a form input field

requires SAPO.Dom.Event

requires SAPO.Dom.Element

requires SAPO.Dom.Css

requires SAPO.Utility.Dimensions

Adds a colorpicker to a form input element

requires SAPO.Dom.Event

Adds a context menu to a given element

requires SAPO.Dom.Event

requires SAPO.Dom.Css

requires SAPO.Utility.Dimensions

requires SAPO.Dom.Element

Accepts draggable elements and executes actions accordingly.

 TODO: events wrapping over (ex: several days)
 TODO: events editing via GUI?
 TODO: support for ical rules (RRULE)

 requires SAPO.Dom.Css
 requires SAPO.Dom.Element
 requires SAPO.Dom.Event
 requires SAPO.Utility.TimeEvent
 requires SAPO.Utility.TimeSlot

 requires SAPO.Utility.Debug for now...
 
 requires SAPO.Dom.Css
 requires SAPO.Dom.Event
 requires SAPO.Utility.Dimensions version 0.1
 requires (optional) SAPO.Effects.Fade
 
 requires SAPO.Dom.Event
 requires SAPO.Dom.Element
 requires SAPO.Dom.Css

 TODO: distance to option, border read in CSS (check TODOs inline)
 
 Our all mighty map controller.
 Everything just works with some minor initializations.
  - specify 'container' for where the map will be placed. The controller will
    inject an iframe
  - place http://js.sapo.pt/SAPO/Component/MapController/map-pt.svg and
    http://js.sapo.pt/SAPO/Component/MapController/map-pt.vml.html in your
    domain and setup urls for them in mapUrlSVG and mapUrlVML options.

 Event listeners:
  onLoad
   - when map finishes loading and is ready for user interaction
  onZoom
   - dispatched when map changes zoom, both mouswheel and when
     clicking districts.
   - detail equals new width to old width ratio.
   - no default action
  onDistrictToggle
   - dispatched when district is clicked
   - default action: toggle and zoom on district
  onMunicipalityToggle
   - dispatched when municipality is clicked
   - id is element id
   - no default action
 
requires SAPO.Utility.XML requires SAPO.Component.ZoomController requires SAPO.Component.PanController requires either SAPO.Communication.Ajax requires or SAPO.Communication.Syndication
 TODO: create factory for common usages
 TODO: disable copy paste
 TODO: select cursorPosition IE not perfect yet (makes range selection)

 requires SAPO.Dom.Css
 requires SAPO.Dom.Event
 
Timeline for NextTV project
 requires SAPO.Dom.Css
 requires SAPO.Dom.Element
 requires SAPO.Dom.Event
 requires SAPO.Utility.TimeEvent
 requires SAPO.Utility.TimeSlot
 

requires SAPO.Dom.Event

requires SAPO.Dom.Element

requires SAPO.Dom.Css

requires SAPO.Dom.Selector

requires SAPO.Utility.Dimensions

turns a element into a resizable object
CHECK OUT SAPO.Ink.SortableList, which offers a more updated component which the same purpose Creates a sortable list - its elements can be reordered by dragging vertically.
 It can be populated two ways:
 - pass on UL with LI children
 - pass on empty UL and Array of Strings in options.values

 

requires SAPO.Dom.Event

requires SAPO.Dom.Css

requires SAPO.Dom.Element

 requires SAPO.Dom.Css
 requires SAPO.Dom.Event
 requires in TagsFactory autocomplete SAPO.Component.Autocomplete
 
This component displays a set of tags. It enforces all tags to be different strings. Optionally orders them alphabetically and enforces lower case input. Tags must be added programatically addTag(tagName), which is easy by binding this method to a button's onclick event or input's keydown event. See the samples for usage examples.
Allows mouse selection of time (as a shortcut). The idea is to keep the user be able to type a different time, but accelerate input tasks on most cases.
 Creates a tree view - branches can be opened/closed; nodes can be selected
 It can be populated two ways:
 - pass on UL with LI/UL/... recursive structure
 - pass on empty UL and Array of Strings/Arrays in options.values

 requires SAPO.Dom.Css
 requires SAPO.Dom.Element
 requires SAPO.Dom.Event
 
requires SAPO.Component.MapController requires SAPO.Utility.JSPath
 Our all mighty weather map controller.
 Everything just works with some minor initializations.
  - specify 'container' for where the map will be placed. The controller will
    inject an iframe
  - place http://js.sapo.pt/SAPO/Component/MapController/map-pt.svg and
    http://js.sapo.pt/SAPO/Component/MapController/map-pt.vml.html in your
    domain and setup urls for them in mapUrlSVG and mapUrlVML options.

 Event listeners:
  onLoad
   - when map finishes loading and is ready for user interaction
  onZoom
   - dispatched when map changes zoom, both mouswheel and when
     clicking districts.
   - detail equals new width to old width ratio.
   - no default action
  onDistrictToggle
   - dispatched when district is clicked
   - default action: toggle and zoom on district
  onMunicipalityToggle
   - dispatched when municipality is clicked
   - id is element id
   - no default action
 

Constructor Summary
CharCounter (String|DomElement el, Object options)
NForm (String|DOMElement ctn, Object opts)

Function Summary
Function(el) Editable (Object edNot)
returns the editable for the given config
Gallery2 (String|DomElement container, Object o)
MultipleUpload (String|DomElement container, Object options)

Constructor Details

constructor CharCounter

CharCounter(String|DomElement el, Object options)
Parameters:
el - textarea/input element to measure
options
  • [ Boolean truncate ] - if true, disables any typing above maxLimit. defaults to false.
  • [ String|DomElement counterElm ] - if passed, the given element is used to display the count, otherwise a new one is created next to the element having class sapo_char_counter.
  • [ Number maxLimit ] - if a positive integer number is passed, the counter displays the remaining chars, otherwise it shows the string length.
  • [ Function(Number, el) onCountChange ] - once the count changes, the function is called passing the new count and the element that triggered it. Notice that the function is expected to return back the number/text to show!

constructor NForm

NForm(String|DOMElement ctn, Object opts)
Parameters:
ctn - container
opts - options
  • Object[] fields - each object should have the params name and label
  • Function(record) recordToString - a function which returns an alternate representation of the record (ex: html markup). Used only in getRecordsToString() method.
  • [ String records ] - initial state of records (if any)
  • [ Object i18n ] - table with translation keys and their values
  • [ Function(fieldLabels) summaryHeaderGenerator ] - generates the header markup
  • [ Function(record, i18n, idx) recordSummaryGenerator ] - generates a record markup on the summary
  • [ Function(fieldLabels, record, i18n, title, isNew) recordFormGenerator ] - generate the form markup for editing a record
  • [ Function(records) validateRecords ] - treats erroneous input on construction/setRecords

Function Details

function Editable

Function(el) Editable(Object edNot)
returns the editable for the given config
Parameters:
edNot
  • Boolean bold - disables bold (ctrl + B)
  • Boolean italic - disables italic (ctrl + I)
  • Boolean underline - disables underline (ctrl + U)
  • Boolean enter - disables enter/return
  • Boolean delete - disables delete/backspace

function Gallery2

Gallery2(String|DomElement container, Object o)
Parameters:
container
o
  • Number visibleItems number of images to display per page.
  • [ String prevLabel ] by default Gallery creates 2 A elements with default labels. Pass prevLabel to override the previous link label.
  • [ String nextLabel ] by default Gallery creates 2 A elements with default labels. Pass nextLabel to override the next link label.
  • [ String|DOMElement prevElement ] id or element to use as previous element. If passed, default A element creation is skipped.
  • [ String|DOMElement nextElement ] id or element to use as next element. If passed, default A element creation is skipped.
  • [ Function(imgEl) onClick ] callback method to override what happens when one image is clicked
  • [ Function(widget, eventType, args) onUserEvent ] callback method to subscribe user initialted events
Authors:
jose.p.dias AT co.sapo.pt
Since:
February 2012 requires SAPO.Dom.Css requires SAPO.Dom.Event

function MultipleUpload

MultipleUpload(String|DomElement container, Object options)
Parameters:
container - element which will receive both the upload button and progress bars
options -
  • String endpoint - endpoint which gets called on every upload
  • [ Object params ] - additional parameters to pass to the server
  • [ Function onFileSaved ] - returns server response
  • [ Function onFinished ] - function which gets the result of the uploads (object with files, successful and failed keys)
  • [ Boolean debug ] - if true, console will log low level info