mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Update AdminLTE
- from 2.4.5 to 2.4.18 (cannot detect any issues) - set default scancycle for Apple Devices to 1
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
module('Component', {
|
||||
setup: function(){
|
||||
this.component = $('<div class="input-append date" id="datepicker">'+
|
||||
'<input size="16" type="text" value="12-02-2012" readonly>'+
|
||||
'<span class="add-on"><i class="icon-th"></i></span>'+
|
||||
'</div>')
|
||||
.appendTo('#qunit-fixture')
|
||||
.datepicker({format: "dd-mm-yyyy"});
|
||||
this.fieldset = $('<fieldset>' +
|
||||
'<div class="input-append date" id="datepicker">'+
|
||||
'<input size="16" type="text" value="12-02-2012" readonly>'+
|
||||
'<span class="add-on"><i class="icon-th"></i></span>'+
|
||||
'</div>' +
|
||||
'<fieldset>')
|
||||
.appendTo('#qunit-fixture');
|
||||
|
||||
this.component = this.fieldset.find('.input-append')
|
||||
.datepicker({format: "dd-mm-yyyy"});
|
||||
this.input = this.component.find('input');
|
||||
this.addon = this.component.find('.add-on');
|
||||
this.dp = this.component.data('datepicker');
|
||||
@@ -34,6 +38,9 @@ test('Dont activation (by disabled) by component', function(){
|
||||
this.addon.click();
|
||||
ok(!this.picker.is(':visible'));
|
||||
this.input.prop('disabled', false);
|
||||
this.fieldset.prop('disabled', true);
|
||||
this.addon.click();
|
||||
ok(!this.picker.is(':visible'));
|
||||
});
|
||||
|
||||
test('simple keyboard nav test', function(){
|
||||
|
||||
@@ -281,6 +281,309 @@ test('Today Button: today visibility when enabled', function(){
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':visible'), 'Today button visible');
|
||||
});
|
||||
|
||||
test('Today Button: today invisible when enabled and startDate is after today', function () {
|
||||
var startDate = new Date();
|
||||
startDate.setDate(startDate.getDate() + 1);
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
startDate: startDate,
|
||||
todayBtn: true
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
});
|
||||
|
||||
test('Today Button: today invisible when enabled and endDate is before today', function () {
|
||||
var endDate = new Date();
|
||||
endDate.setDate(endDate.getDate() - 1);
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
endDate: endDate,
|
||||
todayBtn: true
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
});
|
||||
|
||||
test('Today Button: today visible when enabled and today is between startDate and enDate', function () {
|
||||
var startDate = new Date();
|
||||
startDate.setDate(startDate.getDate() - 1);
|
||||
var endDate = new Date();
|
||||
endDate.setDate(endDate.getDate() + 1);
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
todayBtn: true
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':visible'), 'Today button visible');
|
||||
});
|
||||
|
||||
test('Today Button: today visible when enabled and daysOfWeekDisabled does not include current day', function () {
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
daysOfWeekDisabled: [(new Date().getDay() + 1) % 7],
|
||||
todayBtn: true
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':visible'), 'Today button visible');
|
||||
});
|
||||
|
||||
test('Today Button: today invisible when enabled and daysOfWeekDisabled includes current day', function () {
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
daysOfWeekDisabled: [new Date().getDay()],
|
||||
todayBtn: true
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
});
|
||||
|
||||
test('Today Button: today visibility when linked', function () {
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: 'linked'
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':visible'), 'Today button visible');
|
||||
});
|
||||
|
||||
test('Today Button: today invisible when linked and startDate is after today', function () {
|
||||
var startDate = new Date();
|
||||
startDate.setDate(startDate.getDate() + 1);
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
startDate: startDate,
|
||||
todayBtn: 'linked'
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
});
|
||||
|
||||
test('Today Button: today invisible when linked and endDate is before today', function () {
|
||||
var endDate = new Date();
|
||||
endDate.setDate(endDate.getDate() - 1);
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
endDate: endDate,
|
||||
todayBtn: 'linked'
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
});
|
||||
|
||||
test('Today Button: today visible when linked and today is between startDate and enDate', function () {
|
||||
var startDate = new Date();
|
||||
startDate.setDate(startDate.getDate() - 1);
|
||||
var endDate = new Date();
|
||||
endDate.setDate(endDate.getDate() + 1);
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
todayBtn: 'linked'
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':visible'), 'Today button visible');
|
||||
});
|
||||
|
||||
test('Today Button: today visible when linked and daysOfWeekDisabled does not include current day', function () {
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
daysOfWeekDisabled: [(new Date().getDay + 1) % 7],
|
||||
todayBtn: 'linked'
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':visible'), 'Today button visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':visible'), 'Today button visible');
|
||||
});
|
||||
|
||||
test('Today Button: today invisible when linked and daysOfWeekDisabled includes current day', function () {
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('2012-03-05')
|
||||
.datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
daysOfWeekDisabled: [new Date().getDay()],
|
||||
todayBtn: 'linked'
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
ok(picker.find('.datepicker-days').is(':visible'), 'Days view visible');
|
||||
ok(picker.find('.datepicker-days tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-months').is(':visible'), 'Months view visible');
|
||||
ok(picker.find('.datepicker-months tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
|
||||
ok(picker.find('.datepicker-years tfoot .today').is(':not(:visible)'), 'Today button not visible');
|
||||
});
|
||||
|
||||
test('Today Button: data-api', function(){
|
||||
var input = $('<input data-date-today-btn="true" />')
|
||||
.appendTo('#qunit-fixture')
|
||||
@@ -1647,25 +1950,97 @@ test('Visibility of the prev and next arrows for year/decade/century/millenium v
|
||||
target = picker.find('.datepicker-months thead th.next');
|
||||
ok(!target.hasClass('disabled'), 'Next switcher is not hidden');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').click();
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-years thead th.prev');
|
||||
ok(target.hasClass('disabled'), 'Prev switcher is hidden');
|
||||
target = picker.find('.datepicker-years thead th.next');
|
||||
ok(target.hasClass('disabled'), 'Next switcher is hidden');
|
||||
|
||||
picker.find('.datepicker-years thead th.datepicker-switch').click();
|
||||
picker.find('.datepicker-years thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-decades thead th.prev');
|
||||
ok(target.hasClass('disabled'), 'Prev switcher is hidden');
|
||||
target = picker.find('.datepicker-decades thead th.next');
|
||||
ok(target.hasClass('disabled'), 'Next switcher is hidden');
|
||||
|
||||
picker.find('.datepicker-decades thead th.datepicker-switch').click();
|
||||
picker.find('.datepicker-decades thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-centuries thead th.prev');
|
||||
ok(target.hasClass('disabled'), 'Prev switcher is hidden');
|
||||
target = picker.find('.datepicker-centuries thead th.next');
|
||||
ok(target.hasClass('disabled'), 'Next switcher is hidden');
|
||||
});
|
||||
|
||||
test('Visibility of the prev arrow for month/year/decade/century/millenium views with startDate eq value', function(){
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('01/01/2014')
|
||||
.datepicker({
|
||||
format: 'dd/mm/yyyy',
|
||||
startView: 0,
|
||||
startDate: '01/01/2014'
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
|
||||
target = picker.find('.datepicker-days thead th.prev');
|
||||
ok(target.hasClass('disabled'), 'Prev switcher is not hidden');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').trigger('click');
|
||||
|
||||
target = picker.find('.datepicker-months thead th.prev');
|
||||
ok(target.hasClass('disabled'), 'Prev switcher is not hidden');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-years thead th.prev');
|
||||
ok(target.hasClass('disabled'), 'Prev switcher is hidden');
|
||||
|
||||
picker.find('.datepicker-years thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-decades thead th.prev');
|
||||
ok(target.hasClass('disabled'), 'Prev switcher is hidden');
|
||||
|
||||
picker.find('.datepicker-decades thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-centuries thead th.prev');
|
||||
ok(target.hasClass('disabled'), 'Prev switcher is hidden');
|
||||
});
|
||||
|
||||
test('Visibility of the next arrow for month/year/decade/century/millenium views with endDate eq value', function(){
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
.val('31/12/1999')
|
||||
.datepicker({
|
||||
format: 'dd/mm/yyyy',
|
||||
startView: 0,
|
||||
endDate: '31/12/1999'
|
||||
}),
|
||||
dp = input.data('datepicker'),
|
||||
picker = dp.picker,
|
||||
target;
|
||||
|
||||
input.focus();
|
||||
|
||||
target = picker.find('.datepicker-days thead th.next');
|
||||
ok(target.hasClass('disabled'), 'Next switcher is not hidden');
|
||||
|
||||
picker.find('.datepicker-days thead th.datepicker-switch').trigger('click');
|
||||
|
||||
target = picker.find('.datepicker-months thead th.next');
|
||||
ok(target.hasClass('disabled'), 'Next switcher is not hidden');
|
||||
|
||||
picker.find('.datepicker-months thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-years thead th.next');
|
||||
ok(target.hasClass('disabled'), 'Next switcher is hidden');
|
||||
|
||||
picker.find('.datepicker-years thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-decades thead th.next');
|
||||
ok(target.hasClass('disabled'), 'Next switcher is hidden');
|
||||
|
||||
picker.find('.datepicker-decades thead th.datepicker-switch').trigger('click');
|
||||
target = picker.find('.datepicker-centuries thead th.next');
|
||||
ok(target.hasClass('disabled'), 'Next switcher is hidden');
|
||||
});
|
||||
|
||||
test('date cells (outdated)', function(){
|
||||
var input = $('<input />')
|
||||
.appendTo('#qunit-fixture')
|
||||
|
||||
Reference in New Issue
Block a user