Package fancyflash :: Package widgets :: Class FancyFlashWidget
[hide private]

Class FancyFlashWidget

source code

                    object --+    
                             |    
turbogears.widgets.base.Widget --+
                                 |
                                FancyFlashWidget

A message box with a status icon and background color based on status.

With JavaScript support enabled, can be positioned absolutely and on top of the normal page content. The user can then click the message to make it go away, or the message disappears after a cretain timeout. If JavaScript is disabled. The message box will be display diretcly where the widget is inserted in the template.

Nested Classes [hide private]
  template_c

Inherited from turbogears.widgets.base.Widget: __metaclass__

Instance Methods [hide private]
 
update_params(self, params)
Decode tg_flash string passed as value and set params from result.
source code
 
_parse_tg_flash(self, tg_flash)
Try to decode given string as JSON and extract widget params.
source code

Inherited from turbogears.widgets.base.Widget: __call__, __init__, __repr__, __setattr__, adjust_value, display, render, retrieve_css, retrieve_javascript, update_data

Inherited from turbogears.widgets.base.Widget (private): _get_is_named

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __str__

Class Variables [hide private]
  name = 'statusmessage'
  template = '\n<div xmlns:py="http://purl.org/kid/ns#" id="stat...
  params = ['status', 'message', 'timeout']
  message = ''
  status = 'info'
  timeout = 0
  css = [CSSLink(name='css/fancyflash.css', media='screen')]
  javascript = [JSLink(name='javascript/MochiKit.js', defer=Fals...
  params_doc = {'message': 'The message test to display.', 'stat...
  _param_message = ''
  _param_status = 'info'
  _param_timeout = 0
  template_vars = ['status', 'message', 'timeout']

Inherited from turbogears.widgets.base.Widget: default

Inherited from turbogears.widgets.base.Widget (private): _locked

Properties [hide private]

Inherited from turbogears.widgets.base.Widget: is_named

Inherited from object: __class__

Method Details [hide private]

update_params(self, params)

source code 
Decode tg_flash string passed as value and set params from result.
Overrides: turbogears.widgets.base.Widget.update_params

Class Variable Details [hide private]

template

Value:
'''
<div xmlns:py="http://purl.org/kid/ns#" id="statusmessage">
  <!--[if gte ie 5.5000]>
  <link rel="stylesheet" type="text/css"
    href="/tg_widgets/fancyflash/css/ie.css">
  <![endif]-->
  <div py:if="message" class="${status}" py:content="XML(message)"></d\
iv>
...

javascript

Value:
[JSLink(name='javascript/MochiKit.js', defer=False, charset=None),
 JSLink(name='javascript/events.js', defer=False, charset=None),
 JSLink(name='javascript/fancyflash.js', defer=False, charset=None),
 JSSource(name='widget', defer=False, src='write_stylesheet();')]

params_doc

Value:
{'message': 'The message test to display.',
 'status': 'The status name, which will be used as the CSS class of th\
e inner DIV element.',
 'timeout': 'The number of seconds after which the message will fade o\
ut. Needs JavaScript enabled to work. Default is 0, i,e, the message w\
ill stay until the user clicks on it.'}