1
0
Fork 0
mirror of https://github.com/teampoltergeist/poltergeist.git synced 2022-11-09 12:05:00 -05:00
teampoltergeist--poltergeist/spec/support/public/test.js
2015-09-28 15:25:23 -07:00

57 lines
1.4 KiB
JavaScript

$(function() {
$("#datepicker").datepicker();
$('#remove').click(function() {
$('#remove_me').remove()
})
var increment = function(index, oldText) {
return parseInt(oldText || 0) + 1;
}
$('#change_me')
.change(function(event) {
$('#changes').text($(this).val())
})
.bind('input', function(event) {
$('#changes_on_input').text($(this).val())
})
.keydown(function(event) {
$('#changes_on_keydown').text(increment)
$('#value_on_keydown').text($(this).val())
})
.keyup(function(event) {
$('#changes_on_keyup').text(increment)
$('#value_on_keyup').text($(this).val())
})
.keypress(function() {
$('#changes_on_keypress').text(increment)
})
.focus(function(event) {
$('#changes_on_focus').text('Focus')
})
.blur(function() {
$('#changes_on_blur').text('Blur')
})
$('#browser')
.change(function(event) {
$('#changes').text($(this).val())
$('#target_on_select').text(event.target.nodeName)
})
.focus(function() {
$('#changes_on_focus').text($(this).val())
})
.blur(function() {
$('#changes_on_blur').text($(this).val())
})
$('#open-twice')
.click(function() {
if (confirm('Are you sure?')) {
if (!confirm('Are you really sure?')) {
$(this).attr('confirmed', 'false');
}
}
})
})