jam-cloud/web/app/assets/javascripts/website_validator.js.coffee

17 lines
449 B
CoffeeScript
Raw Normal View History

$ = 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)