namespace SAPO.Utility

Class Summary
Centers content on the browser. 100% CSS solution. Should work in browsers up to IE6.
Error Handling utilities

requires SAPO.Utility.Validator

requires SAPO.Dom.Css

Utility class to validate forms

Utility function for internationalization
Useful methods for image manipulation and layout
 
_mediatorSubscribers is an *global* array of [subscriberContext, subscriberFn] Can be used by invoking the Mediator singleton directly OR, after installTo has been called on an object, calling the API there. If the cbFn is ommitted on subscribe(), looks for 'onMsgType' and 'on' methods on the caller context|subscriberOverride.
Handles an element as a movable tooltip, supporting an iframe as parent
Provides pagination to a page
 requires SAPO.Utility.Url
 
Implements a set. Any item in the set must an Object! The low level implementation uses an hash table. Hash codes are extracted from objects using obj.toString(), so override toString to enhance your hash table results :)
replace in html {$var$} for values
Abstracts a point in time and operations on it. NOTE: always fetch date component with UTC methods, otherwise you may get different results (affected by time zone).
 required SAPO.Utility.I18n in which case one needs to load previously to this class /SAPO/Utility/TimeEvent/0.1/lang.js
 
This class has several functions that check links from known video websites and generates the appropriate embed code for those videos.
Namespace with a set of xml utility functions

Constructor Summary
ExpandTextArea (String|DOMElement ctn, Object opts)

Function Summary
DomPerformance (Object o)
- enriches an array with the Iterator interface
NumberParserFactory (Object options)
PubSubMixin (Object class)
- enriches an instance with the PubSub interface
Syntax (Object options)

Constructor Details

constructor ExpandTextArea

ExpandTextArea(String|DOMElement ctn, Object opts)
Parameters:
ctn - textarea element.
opts - options
  • [ Number deltaHeight ] - height to increase, in pixels. defaults to 20.
  • [ Number maxHeight ] - maximum height for expanding. from then on scrolling kicks in.
  • [ Function(Object) onIncrease ] - callback that gets called if passed. Receives params h and delta.
  • [ Boolean virtualChanges ] - if true, height change isn't applied to the DOM.
  • [ Number waitInterval ] - height to increase, in milliseconds. defaults to 100.

Function Details

function DomPerformance

DomPerformance(Object o)
Parameters:
o

function IteratorMixin

IteratorMixin(Array arr)
- enriches an array with the Iterator interface
Parameters:
arr

function NumberParserFactory

NumberParserFactory(Object options)
Parameters:
options
  • [ String decimalSeparator ] default is brower locale dependent. can pass '.' or ','
  • [ Number decimalPlaces ] default is don't round to any fixed decimal places
  • [ Boolean absoluteValue ] if trueish, values are always treated as positive
Authors:
jose.p.dias AT co.sapo.pt
Version:
0.1
Since:
February 2013

function PubSubMixin

PubSubMixin(Object class)
- enriches an instance with the PubSub interface
Parameters:
class instance subscribers must have on(eventType, arg1, arg2, arg3) method and invoke controller's setSubscription(events, this) method to be notified everytime an event of this/these type(s) is published publishers must invoke controller's emit(eventType, arg1, arg2, arg3) method

function Syntax

Syntax(Object options)
Parameters:
options
Authors:
jose.p.dias AT co.sapo.pt
Since:
July 2012 Wrapper for Syntax highlight. This function converts code elements starting with a supported language for their CodeMirror powered syntax highlight counterparts. Take a look at the sample.