root/galaxy-central/eggs/WebHelpers-0.2-py2.6.egg/webhelpers/hinclude.py

リビジョン 3, 0.7 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1"""
2``Tired of regenerating HTML pages from templates? Want more from Web caches?
3HInclude makes one thing very easy; including other bits of HTML into your Web
4page, using the browser.``
5
6http://www.mnot.net/javascript/hinclude.html
7"""
8
9from webhelpers.util import html_escape
10from webhelpers.rails.tags import content_tag
11
12def include(url, default=''):
13    """Do a client-side include of ``url``, defaulting to ``default```
14        >>> hinclude.include("/foo","hello")
15        '<hx:include src="/foo">hello</hx:include>'
16    """
17   
18    if callable(url):
19        url = url()
20    else:
21        url = html_escape(url)
22
23    return content_tag("hx:include", content=default, src=url)
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。