Sha256: ef9becda019ec3349565f0e8cf3709d2dc14b0efda026656752e2491c71b5da5
Contents?: true
Size: 444 Bytes
Versions: 15
Compression:
Stored size: 444 Bytes
Contents
# Automatically fills URL for a post from a title. $.fn.titleToUrl = (urlSelector) -> titleInput = $(this) urlInput = $(urlSelector) titleInput.on 'input', -> url = toUrl(titleInput.val()) urlInput.val(url) # Convert title to URL toUrl = (title) -> url = title.toLowerCase() url = url.replace("'", ''); url = url.replace(/[^a-z0-9]/g, ' ') url = url.replace(/^\s+|\s+$|/g, ''); url = url.replace(/\s+/g, '-') url
Version data entries
15 entries across 15 versions & 1 rubygems