17 lines
449 B
CoffeeScript
17 lines
449 B
CoffeeScript
|
|
$ = jQuery
|
||
|
|
context = window
|
||
|
|
context.JK ||= {};
|
||
|
|
|
||
|
|
context.JK.WebsiteValidator = class WebsiteValidator
|
||
|
|
constructor: (@app, input_id) ->
|
||
|
|
@EVENTS = context.JK.EVENTS
|
||
|
|
@rest = context.JK.Rest()
|
||
|
|
@url_input = $(input_id)
|
||
|
|
|
||
|
|
init: () =>
|
||
|
|
# @root = $($('#template-download-jamtrack').html())
|
||
|
|
|
||
|
|
validate: () =>
|
||
|
|
regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
|
||
|
|
regexp.test(@url_input.value)
|