diff --git a/opennms-webapp/src/main/webapp/WEB-INF/jsp/admin/notification/noticeWizard/chooseUeis.jsp b/opennms-webapp/src/main/webapp/WEB-INF/jsp/admin/notification/noticeWizard/chooseUeis.jsp index 6375c7bd00d8..31dfdb72c088 100644 --- a/opennms-webapp/src/main/webapp/WEB-INF/jsp/admin/notification/noticeWizard/chooseUeis.jsp +++ b/opennms-webapp/src/main/webapp/WEB-INF/jsp/admin/notification/noticeWizard/chooseUeis.jsp @@ -2,8 +2,8 @@ /******************************************************************************* * This file is part of OpenNMS(R). * - * Copyright (C) 2002-2014 The OpenNMS Group, Inc. - * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. + * Copyright (C) 2002-2015 The OpenNMS Group, Inc. + * OpenNMS(R) is Copyright (C) 1999-2015 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * @@ -66,6 +66,55 @@ $(document).ready(function() { $('#regexp').prop('disabled', ueiLabel !== 'REGEX_FIELD'); } + var allUeiOptions = $("#uei > option"); + var unavailableUeiOptGroup = $("#uei > optgroup"); + + function filterUeiList() { + var filterText = $("#uei-list-filter").val().toLowerCase(); + $("#uei").empty(); + if (filterText.length == 0) { + $("#uei").append(allUeiOptions); + $("#uei").append(unavailableUeiOptGroup); + } else { + allUeiOptions.each(function ( index, element ) { + if ( $(this).text().toLowerCase().indexOf(filterText) != -1) { + $("#uei").append( $(this) ); + } + }); + } + $('#filteringModal').modal('hide'); + $('#uei-list-filter').focus(); + } + + $("#uei-list-filter").keydown(function(event) { + if (event.which == 27) { + event.preventDefault(); + if ($("#uei-list-filter").val().length > 0) { + $('#uei-list-filter').val(""); + $('#filteringModal').modal('show'); + } + } + }); + + $("#uei").keydown(function(event) { + if (event.which == 27) { + event.preventDefault(); + if ($("#uei-list-filter").val().length > 0) { + $('#uei-list-filter').val(""); + $('#filteringModal').modal('show'); + } + } + }); + + $("#uei-list-filter").keypress(function(event) { + if (event.which == 13) { + event.preventDefault(); + $('#filteringModal').modal('show'); + } + }); + + $("#filteringModal").on( "shown.bs.modal", function() { filterUeiList(); } ); + $("select#uei").change(function(e) { toggleRegexpField(); }); @@ -94,6 +143,16 @@ $(document).ready(function() { + +

${model.title}

-

Choose the event uei that will trigger this notification.

+

Choose the event UEI that will trigger this notification.

+