Did I find the right examples for you? yes no

All Samples(25)  |  Call(14)  |  Derive(0)  |  Import(11)
return a path to script. you can change the root_url. default to `/jquery`:

.. sourcecode:: python

    >>> 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')(more...)

        def url(*args, **kwargs):
    """return a path to script. you can change the root_url. default to `/jquery`:

    .. sourcecode:: python

        >>> 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
    """
    request = kwargs.get('request', None)
    arg = args and args[0] or ''
    if arg and not arg.startswith('/') and not arg.startswith('http'):
        if request is not None and hasattr(request, 'static_url') and ':' in arg:
            return request.static_url(arg)
        args = list(args)
        if kwargs.get('prefix'):
            args.insert(0, kwargs['prefix'])
        else:
            root_url = url.root_url
            if root_url.startswith('/') and hasattr(request, 'application_root'):
                root_url = request.application_root + root_url.strip('/')
            args.insert(0, url.root_url)
    return '/'.join([args[0].rstrip('/')]+[a.strip('/') for a in args[1:]])
        


src/f/a/fa.jquery-0.9.5/fa/jquery/renderers.py   fa.jquery(Download)
 
from utils import templates
from utils import url
 
__doc__ = """
                name=self.name,
                show_input=show_input,
                resources=[url(r, prefix=self.resources_prefix, request=request) for r in self._resources],
            )
            try:
        defaults['theme_advanced_resizing'] = True
        if 'content_css' in jq_options:
            jq_options['content_css'] = [url(c, prefix=resources_prefix) for c in jq_options['content_css']]
    elif use in ('textile', 'bbcode', 'markdown'):
        plugin_name = 'markitup'
        defaults['nameSpace'] = use
        defaults['resizeHandle'] = True
        defaults['previewAutoRefresh'] = True
        defaults['previewParserPath'] = url('markup_parser.html?markup=%s' % use)

src/f/a/fa.jquery-HEAD/fa/jquery/renderers.py   fa.jquery(Download)
 
from utils import templates
from utils import url
 
__doc__ = """
                name=self.name,
                show_input=show_input,
                resources=[url(r, prefix=self.resources_prefix, request=request) for r in self._resources],
            )
            try:
        defaults['theme_advanced_resizing'] = True
        if 'content_css' in jq_options:
            jq_options['content_css'] = [url(c, prefix=resources_prefix) for c in jq_options['content_css']]
    elif use in ('textile', 'bbcode', 'markdown'):
        plugin_name = 'markitup'
        defaults['nameSpace'] = use
        defaults['resizeHandle'] = True
        defaults['previewAutoRefresh'] = True
        defaults['previewParserPath'] = url('markup_parser.html?markup=%s' % use)

src/f/a/fa.jquery-0.9.5/fa/jquery/__init__.py   fa.jquery(Download)
from utils import TemplateEngine
from utils import HTML
from utils import Color
from utils import Slider
from utils import url

src/f/a/fa.jquery-HEAD/fa/jquery/__init__.py   fa.jquery(Download)
from utils import TemplateEngine
from utils import HTML
from utils import Color
from utils import Slider
from utils import url

src/f/a/fa.jquery-HEAD/fa/jquery/testing.py   fa.jquery(Download)
# -*- coding: utf-8 -*-
from formalchemy.ext.zope import FieldSet
from zope import interface, schema
from utils import url
from renderers import *

src/f/a/fa.jquery-0.9.5/fa/jquery/testing.py   fa.jquery(Download)
# -*- coding: utf-8 -*-
from formalchemy.ext.zope import FieldSet
from zope import interface, schema
from utils import url
from renderers import *