Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fa6d0e275c
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (28 sloc) 0.865 kb
# TW2 proper imports
import tw2.core as twc
import tw2.jquery as twj
import simplejson
jquery_gritter_js = twc.JSLink(
modname='tw2.jqplugins.gritter',
filename='static/jquery/gritter/js/jquery.gritter.min.js',
resources=[twj.jquery_js],
)
jquery_gritter_css = twc.CSSLink(
modname='tw2.jqplugins.gritter',
filename='static/jquery/gritter/css/jquery.gritter.css'
)
jquery_gritter_dir = twc.DirLink(
modname='tw2.jqplugins.gritter',
filename='static/jquery/gritter/images'
)
gritter_resources = [
jquery_gritter_js,
jquery_gritter_css,
jquery_gritter_dir,
]
def gritter_callback(**kw):
""" Return js_callbacks that create gritter popups.
>>> gritter_callback(title="Some Title", text="A message...")
"""
json = simplejson.dumps(kw)
return twc.js_callback('function() { $.gritter.add(%s); }' % json)
Jump to Line
Something went wrong with that request. Please try again.