Sha256: 073b5f6fab1c7a878439c182b41ec747b386439f8ac3bbf8ce170073518b3e9e

Contents?: true

Size: 895 Bytes

Versions: 4

Compression:

Stored size: 895 Bytes

Contents

safe = (value)->
    result = new String(value)
    result.ecoSafe = true
    result

linkTo = (label, link, opts) ->
	if (! link)
		link = label
	'<a href="' + link + '">' + label + '</a>'

navBar = (options, yield)->
    config = try
        NavBarConfig
    catch error
        {}
    config["linkPrefix"] ||= "<li>"
    config["linkPostfix"] ||= "</li>"
    config["navPrefix"] ||= "<ul>"
    config["navPostfix"] ||= "</ul>"

    linkPrefix = ()-> options["linkPrefix"] || config["linkPrefix"]
    linkPostfix = ()-> options["linkPostfix"] || config["linkPostfix"]
    navPrefix = ()-> options["navPrefix"] || config["navPrefix"]
    navPostfix = ()-> options["navPostfix"] || config["navPostfix"]
    bar =
        linkTo: (label, link = null) =>
            safe "#{linkPrefix()}#{linkTo label, link}#{linkPostfix()}"

    links = yield(bar)
    safe "#{navPrefix()}#{links}#{navPostfix}"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ice-0.5.1 js/lib/eco-path-helper.coffee
ice-0.5.0 js/lib/eco-path-helper.coffee
ice-0.4.4 js/lib/path-helper.coffee
ice-0.4.3 js/lib/path-helper.coffee