/docs/fa.jquery Gawel's repository

Table Of Contents

Previous topic

fa.jquery.renderers

Next topic

fa.jquery.wsgi

This Page

fa.jquery.utils

Classes

Color

class fa.jquery.utils.Color(length=None, convert_unicode=False, assert_unicode=None)
Alias of fatypes.String to bind a ColorPickerFieldRenderer

Flash

class fa.jquery.utils.Flash(level=20, show_headers=True, options={})

Flash messaging using jQGrowl:

>>> f = Flash()
>>> f.info('my info')
>>> f.warn('my warn')
>>> print f.render() #doctest: +NORMALIZE_WHITESPACE
<script language="javascript">
jQuery(document).ready(function () {
jQuery.jGrowl("my info", {"header": "Info", "theme": "ui-state-info", "life": 2000});
jQuery.jGrowl("my warn", {"header": "Warning", "theme": "ui-state-warning", "life": 3000});
});
</script>

You can also render messages inline:

>>> print f.render_inline() #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<div class="jGrowl" style="position:relative;">
<div id="message_..." style="width:auto;display:none;" class="jGrowl-notification ui-state-highlight ui-corner-all ui-state-info">
<div class="header">Info</div>
my info
</div>
<div id="message_..." style="width:auto;display:none;" class="jGrowl-notification ui-state-highlight ui-corner-all ui-state-warning">
<div class="header">Warning</div>
my warn
</div>
<script language="javascript">
jQuery(document).ready(function () {
jQuery("#message_...").slideDown('slow', function() {
var self = $(this);setTimeout(function() { self.slideUp('slow', function(){self.remove();}); }, 20...);
});
jQuery("#message_...").slideDown('slow', function() {
var self = $(this);setTimeout(function() { self.slideUp('slow', function(){self.remove();}); }, 30...);
});
});
</script>
</div>
critical(message)
critical level
debug(message)
debug level
err(message)
error level
error(message)
error level
info(message)
info level
render(onload=True)
render notification using jGrowl
render_inline()
render the notifications inplace
warn(message)
warn level
warning(message)
warn level

HTML

class fa.jquery.utils.HTML(length=None, convert_unicode=False, assert_unicode=None)
Alias of fatypes.Text to bind a RichTextFieldRenderer

Selectable

class fa.jquery.utils.Selectable(length=None, convert_unicode=False, assert_unicode=None)
Alias of fatypes.String to bind a selectable()

Selectables

class fa.jquery.utils.Selectables(*args, **kwargs)
Alias of fatypes.List to bind a selectables()

Slider

class fa.jquery.utils.Slider(*args, **kwargs)
Alias of fatypes.Integer to bind a SliderFieldRenderer

TemplateEngine

class fa.jquery.utils.TemplateEngine(*dirnames, **kwargs)

Functions

load_datas()

fa.jquery.utils.load_datas(filename)

url()

fa.jquery.utils.url(*args, **kwargs)

return a path to script. you can change the root_url. default to /jquery:

>>> url.root_url = '/path_to_static'
>>> print url('/absolute.js')
/absolute.js
>>> print url('relative', 'plugin.js')
/path_to_static/relative/plugin.js
>>> print url('..', 'plugin.js')
/path_to_static/../plugin.js
>>> print url('plugin.js', prefix='/my_js')
/my_js/plugin.js