mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Convert javascript to coffeescript.
This commit is contained in:
parent
235b341f5a
commit
b617b690cc
@ -1,28 +0,0 @@
|
|||||||
$(document).ready(function() {
|
|
||||||
$('.fancy').fancybox({
|
|
||||||
'titlePosition' : 'inside',
|
|
||||||
'onComplete' : function(links, index) {
|
|
||||||
$.get('/photos/'+$(links[index]).attr('id')+'/log_view')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if ($('#contact_form').length) {
|
|
||||||
$('#contact_form').validate({
|
|
||||||
rules: {
|
|
||||||
'contact[name]': "required",
|
|
||||||
'contact[email]': {
|
|
||||||
required: true,
|
|
||||||
email: true
|
|
||||||
},
|
|
||||||
'contact[message]': "required",
|
|
||||||
|
|
||||||
},
|
|
||||||
messages: {
|
|
||||||
'contact[email]': {
|
|
||||||
email: "Invalid email address."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.info('Validation set.');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
21
app/assets/javascripts/photos.js.coffee
Normal file
21
app/assets/javascripts/photos.js.coffee
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
$(document).ready ->
|
||||||
|
$(".fancy").fancybox
|
||||||
|
titlePosition: "inside"
|
||||||
|
onComplete: (links, index) ->
|
||||||
|
$.get "/photos/" + $(links[index]).attr("id") + "/log_view"
|
||||||
|
|
||||||
|
if $("#contact_form").length
|
||||||
|
$("#contact_form").validate
|
||||||
|
rules:
|
||||||
|
"contact[name]": "required"
|
||||||
|
"contact[email]":
|
||||||
|
required: true
|
||||||
|
email: true
|
||||||
|
|
||||||
|
"contact[message]": "required"
|
||||||
|
|
||||||
|
messages:
|
||||||
|
"contact[email]":
|
||||||
|
email: "Invalid email address."
|
||||||
|
|
||||||
|
console.info "Validation set."
|
||||||
Loading…
Reference in New Issue
Block a user