css audit
This commit is contained in:
@@ -9,16 +9,16 @@
|
||||
|
||||
// reload this table every 10 seconds
|
||||
if (tab == 'jobqueue') {
|
||||
$('#nd_device_name').text('10');
|
||||
setTimeout(function() { $('#nd_device_name').text('9') }, 1000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('8') }, 2000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('7') }, 3000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('6') }, 4000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('5') }, 5000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('4') }, 6000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('3') }, 7000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('2') }, 8000 );
|
||||
setTimeout(function() { $('#nd_device_name').text('1') }, 9000 );
|
||||
$('#nd_device-name').text('10');
|
||||
setTimeout(function() { $('#nd_device-name').text('9') }, 1000 );
|
||||
setTimeout(function() { $('#nd_device-name').text('8') }, 2000 );
|
||||
setTimeout(function() { $('#nd_device-name').text('7') }, 3000 );
|
||||
setTimeout(function() { $('#nd_device-name').text('6') }, 4000 );
|
||||
setTimeout(function() { $('#nd_device-name').text('5') }, 5000 );
|
||||
setTimeout(function() { $('#nd_device-name').text('4') }, 6000 );
|
||||
setTimeout(function() { $('#nd_device-name').text('3') }, 7000 );
|
||||
setTimeout(function() { $('#nd_device-name').text('2') }, 8000 );
|
||||
setTimeout(function() { $('#nd_device-name').text('1') }, 9000 );
|
||||
setTimeout(function() {
|
||||
$('#' + tab + '_form').trigger('submit');
|
||||
}, 10000);
|
||||
|
||||
@@ -12,31 +12,19 @@
|
||||
function inner_view_processing(tab) {
|
||||
|
||||
// LT wanted the page title to reflect what's on the page :)
|
||||
document.title = $('#nd_device_name').text()
|
||||
document.title = $('#nd_device-name').text()
|
||||
+' - '+ $('#'+ tab + '_link').text();
|
||||
|
||||
// VLANs column list collapser trigger
|
||||
// it's a bit of a faff because we can't easily use Bootstrap's collapser
|
||||
$('.nd_collapse_vlans').toggle(function() {
|
||||
$(this).siblings('.nd_collapsing').toggle();
|
||||
$(this).siblings('.cell-arrow-up-down')
|
||||
.toggleClass('icon-chevron-up icon-chevron-down');
|
||||
$(this).html('<div class="cell-arrow-up-down icon-chevron-down icon-large"></div>Hide VLANs');
|
||||
}, function() {
|
||||
$(this).siblings('.nd_collapsing').toggle();
|
||||
$(this).siblings('.cell-arrow-up-down')
|
||||
.toggleClass('icon-chevron-up icon-chevron-down');
|
||||
$(this).html('<div class="cell-arrow-up-down icon-chevron-up icon-large"></div>Show VLANs');
|
||||
});
|
||||
|
||||
// used for contenteditable cells to find out whether the user has made
|
||||
// changes, and only reset when they submit or cancel the change
|
||||
var dirty = false;
|
||||
|
||||
// show or hide netmap help button
|
||||
if (tab == 'netmap') {
|
||||
$('#netmap_help_img').show();
|
||||
$('#nd_netmap-help').show();
|
||||
}
|
||||
else {
|
||||
$('#netmap_help_img').hide();
|
||||
$('#nd_netmap-help').hide();
|
||||
}
|
||||
|
||||
// activate tooltips and popovers
|
||||
@@ -55,18 +43,18 @@
|
||||
|
||||
// sidebar collapser events trigger change of up/down arrow
|
||||
$('.collapse').on('show', function() {
|
||||
$(this).siblings().find('.arrow-up-down')
|
||||
$(this).siblings().find('.nd_arrow-up-down-right')
|
||||
.toggleClass('icon-chevron-up icon-chevron-down');
|
||||
});
|
||||
|
||||
$('.collapse').on('hide', function() {
|
||||
$(this).siblings().find('.arrow-up-down')
|
||||
$(this).siblings().find('.nd_arrow-up-down-right')
|
||||
.toggleClass('icon-chevron-up icon-chevron-down');
|
||||
});
|
||||
|
||||
// handler for bin icon in port filter box
|
||||
var portfilter = $('#ports_form').find("input[name=f]");
|
||||
$('.field_clear_icon').click(function() {
|
||||
$('.nd_field-clear-icon').click(function() {
|
||||
portfilter.val('');
|
||||
$('#ports_form').trigger('submit');
|
||||
device_form_state(portfilter); // will hide copy icons
|
||||
@@ -74,53 +62,65 @@
|
||||
|
||||
// clickable device port names can simply resubmit AJAX rather than
|
||||
// fetch the whole page again.
|
||||
$(target).on('click', '.nd_this_port_only', function() {
|
||||
$('#ports_pane').on('click', '.nd_this-port-only', function() {
|
||||
event.preventDefault(); // link is real so prevent page submit
|
||||
|
||||
var port = $(this).text();
|
||||
port = $.trim(port);
|
||||
portfilter.val(port);
|
||||
|
||||
$('.field_clear_icon').show();
|
||||
$('.nd_field-clear-icon').show();
|
||||
$('#ports_form').trigger('submit');
|
||||
device_form_state(portfilter); // will hide copy icons
|
||||
});
|
||||
|
||||
// VLANs column list collapser trigger
|
||||
// it's a bit of a faff because we can't easily use Bootstrap's collapser
|
||||
$('#ports_pane').on('click', '.nd_collapse-vlans', function() {
|
||||
$(this).siblings('.nd_collapsing').toggle();
|
||||
if ($(this).find('.nd_arrow-up-down-left').hasClass('icon-chevron-up')) {
|
||||
$(this).html('<div class="nd_arrow-up-down-left icon-chevron-down icon-large"></div>Hide VLANs');
|
||||
}
|
||||
else {
|
||||
$(this).html('<div class="nd_arrow-up-down-left icon-chevron-up icon-large"></div>Show VLANs');
|
||||
}
|
||||
});
|
||||
|
||||
// toggle visibility of port up/down and edit controls
|
||||
$(target).on('mouseenter', '.nd_editable_cell', function() {
|
||||
$(this).children('.nd_hand_icon').show();
|
||||
$('.tab-content').on('mouseenter', '.nd_editable-cell', function() {
|
||||
$(this).children('.nd_hand-icon').show();
|
||||
if (! $(this).is(':focus')) {
|
||||
$(this).children('.nd_edit_icon').show(); // ports
|
||||
$(this).siblings('td').find('.nd_device_details_edit').show(); // details
|
||||
$(this).children('.nd_edit-icon').show(); // ports
|
||||
$(this).siblings('td').find('.nd_device-details-edit').show(); // details
|
||||
}
|
||||
});
|
||||
$(target).on('mouseleave', '.nd_editable_cell', function() {
|
||||
$(this).children('.nd_hand_icon').hide();
|
||||
$('.tab-content').on('mouseleave', '.nd_editable-cell', function() {
|
||||
$(this).children('.nd_hand-icon').hide();
|
||||
if (! $(this).is(':focus')) {
|
||||
$(this).children('.nd_edit_icon').hide(); // ports
|
||||
$(this).siblings('td').find('.nd_device_details_edit').hide(); // details
|
||||
$(this).children('.nd_edit-icon').hide(); // ports
|
||||
$(this).siblings('td').find('.nd_device-details-edit').hide(); // details
|
||||
}
|
||||
});
|
||||
$(target).on('focus', '[contenteditable=true]', function() {
|
||||
$(this).children('.nd_edit_icon').hide(); // ports
|
||||
$(this).siblings('td').find('.nd_device_details_edit').hide(); // details
|
||||
$('.tab-content').on('focus', '[contenteditable=true]', function() {
|
||||
$(this).children('.nd_edit-icon').hide(); // ports
|
||||
$(this).siblings('td').find('.nd_device-details-edit').hide(); // details
|
||||
});
|
||||
|
||||
// activity for port up/down control
|
||||
$(target).on('click', '.icon-hand-up', function() {
|
||||
$('#ports_pane').on('click', '.icon-hand-up', function() {
|
||||
port_control(this); // save
|
||||
});
|
||||
$(target).on('click', '.icon-hand-down', function() {
|
||||
$('#ports_pane').on('click', '.icon-hand-down', function() {
|
||||
port_control(this); // save
|
||||
});
|
||||
|
||||
// activity for power enable/disable control
|
||||
$(target).on('click', '.nd_power_icon', function() {
|
||||
$('#ports_pane').on('click', '.nd_power-icon', function() {
|
||||
port_control(this); // save
|
||||
});
|
||||
|
||||
// activity for contenteditable control
|
||||
$(target).on('keydown', '[contenteditable=true]', function() {
|
||||
$('.tab-content').on('keydown', '[contenteditable=true]', function() {
|
||||
var esc = event.which == 27,
|
||||
nl = event.which == 13;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
form_inputs.change(function() {device_form_state($(this))});
|
||||
|
||||
// handler for copy icon in search option
|
||||
$('.field_copy_icon').click(function() {
|
||||
$('.nd_field-copy-icon').click(function() {
|
||||
var name = $(this).data('btn-for');
|
||||
var input = $('#device_form [name=' + name + ']');
|
||||
input.val( $('#nq').val() );
|
||||
@@ -30,7 +30,7 @@
|
||||
});
|
||||
|
||||
// handler for bin icon in search option
|
||||
$('.field_clear_icon').click(function() {
|
||||
$('.nd_field-clear-icon').click(function() {
|
||||
var name = $(this).data('btn-for');
|
||||
var input = $('#device_form [name=' + name + ']');
|
||||
input.val('');
|
||||
|
||||
Reference in New Issue
Block a user