2 ============LICENSE_START=======================================================
4 ================================================================================
5 Copyright (C) 2017 AT&T Intellectual Property. All rights
7 ================================================================================
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
12 http://www.apache.org/licenses/LICENSE-2.0
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 ============LICENSE_END============================================
20 ===================================================================
21 ECOMP is a trademark and service mark of AT&T Intellectual Property.
26 background-color:#dddd;
30 background-color: #dddd;
38 .fileUpload input.upload {
47 filter: alpha(opacity = 0);
52 display: inline-block;
63 /* box-sizing:border-box; */
74 vertical-align:middle;
77 .leftStringMatchPanel{
81 #createNewStringMatch{
84 background-color:#f2bfab;
100 background-color: #f5f5f5;
107 padding: 2px 2px 2px 30px;
116 #stringMatchTable tr{
117 border-bottom: 1px solid #ddd;
118 border-collapse: collapse;
124 #stringMatchTable td{
128 #stringMatchTable tr.highlight{
129 background-color: #f5f5f5;
134 #stringMatchTableHolder{
147 <script type="text/javascript">
148 function disablefile() {
150 document.getElementById("fileUpload").disabled = true;
154 function disableSVN() {
155 var selectLength = document.querySelectorAll(".disabled-block-container .tab-close-popup");
156 if(selectLength && selectLength.length>0){
157 for(var i = 0; i< selectLength.length ; i++){
158 selectLength[i].disabled = true;
162 document.getElementById("schemaLocation").disabled = true;
163 document.getElementById("userID").disabled = true;
164 document.getElementById("password").disabled = true;
170 <div attribute-test="stringMatchwindowproperties" id="configure-widgets" class="disabled-block-container">
171 <div attribute-test="stringMatchwindowpropertiesh" class="modal-header">
172 <button type="button" class="close" ng-click="close(false)"
173 aria-hidden="true" style="margin-top: -3px">×</button>
174 <h4>String Matching Micro Service</h4>
178 <div class="modal-body">
179 <div attribute-test="stringMatchwindowpropertiesb" class="modal-body row">
181 <div class="leftStringMatchPanel">
182 <div class="panel panel-default">
183 <i class="modelSearchBox"></i> <input type="text"
184 id="stringMatchSearch" onkeyup="searchStringMatchList()"
185 placeholder="Search ...">
186 <div id="stringMatchTableHolder">
187 <table id="stringMatchTable"></table>
190 <div style="float: left">
191 <button type="button" id="createNewStringMatch" class="btn btn-sm">New Group</button>
194 <div style="float: right">
195 <button type="button" id="deleteStringMatch" class="btn btn-sm glyphicon glyphicon-trash" disabled></button>
198 <div id="repeatIdError" class="idError">Error: This Group name is already taken.</div>
199 <div id="newIdError" class="idError">Error: Please rename your new Group.</div>
202 <div class="panel panel-default col-sm-9 stringMatchPanel"
203 style="display: none;">
204 <form id="topicPublish" class="form-horizontal">
206 <!-- As per the last minute new requirements for 1707 the ID needs to be hidden and we need to have a friendly name instead -->
207 <div style="display: none;">
208 <div class="form-group clearfix">
209 <label class="col-sm-4 control-label">Resource Group Id</label>
210 <div class="col-sm-8">
211 <input class="form-control" id="rgname" name="rgname" readOnly> </input>
217 <div class="form-group clearfix">
218 <label class="col-sm-4 control-label">Resource Group</label>
219 <div class="col-sm-8">
220 <input class="form-control" maxlength="48" placeholder="Enter Unique Name" id="rgfriendlyname" name="rgfriendlyname"> </input>
225 <!--Policy's drop down box -->
226 <div class="form-group clearfix">
227 <label class="col-sm-4 control-label">Ops Policy:</label>
228 <div class="col-sm-8">
229 <select class="form-control" id="policyName" name="policyName"
230 autofocus="autofocus" required ng-trim="true" enableFilter="true">
231 <option ng-repeat="x in policyNames" value="{{x}}">{{x}}</option>
239 <div class="panel-heading" style="background-color: white;">
240 <ul id="nav_Tabs" class="nav nav-tabs">
241 <li class><a id="add_one_more" href="#desc_tab"><span
242 class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></li>
245 <div class="panel-body">
246 <div class="tab-content">
247 <div id="properties_tab" class="tab-pane fade in active"></div>
252 <span id="formSpan" style="display: none">
253 <form class="saveProps" class="form-horizontal">
256 <div class="form-group clearfix">
257 <label for="aaiMatchingFields" class="col-sm-4 control-label">AAI Fields Matching </label>
258 <div class="col-sm-8">
259 <select class="form-control" name="aaiMatchingFields" id="aaiMatchingFields" multiple size=2></select>
263 <div class="form-group clearfix">
264 <label for="aaiSendFields" class="col-sm-4 control-label">AAI Fields Send (Select Multiple)</label>
266 <div class="col-sm-8 ">
267 <select class="form-control" id="aaiSendFields"
268 name="aaiSendFields" multiple size=2>
273 <!-- <div class="form-group clearfix"> -->
274 <!-- <label for="groupNumber" class="col-sm-4 control-label"> -->
275 <!-- Resource-Group</label> -->
277 <!-- <div class="col-sm-8"> -->
278 <!-- <input type="number" class="form-control" id="groupNumber" -->
279 <!-- name="groupNumber" min="0"> </input> -->
283 <div class="form-group clearfix">
284 <label for="vfc" class="col-sm-4 control-label">Resource-VFC</label>
285 <div class="col-sm-8">
286 <select class="form-control" id="vfc" name="vfc">
292 <div class="form-group clearfix">
293 <label for="alarmCondition" class="col-sm-4 control-label">Alarm Condition</label>
294 <div class="col-sm-8">
295 <select class="form-control" id="alarmCondition" name="alarmCondition">
300 <div class="form-group clearfix">
301 <label for="eventSeverity" class="col-sm-4 control-label">Event Severity</label>
302 <div class="col-sm-8">
303 <select class="form-control" id="eventSeverity"
304 name="eventSeverity" enableFilter="false"></select>
307 <div class="form-group clearfix">
308 <label for="eventSourceType" class="col-sm-4 control-label">
309 Event Source Type</label>
310 <div class="col-sm-8">
311 <input type="text" class="form-control" id="eventSourceType"
312 name="eventSourceType" readOnly></input>
316 <div class="form-group clearfix">
317 <label for="timeWindow" class="col-sm-4 control-label">
320 <div class="col-sm-8">
321 <input type="text" maxlength="5" class="form-control"
322 onkeypress="return isNumberKey(event)"
323 id="timeWindow" name="timeWindow" />
326 <div class="form-group clearfix">
327 <label for="ageLimit" class="col-sm-4 control-label"> Age
330 <div class="col-sm-8">
331 <input type="text" maxlength="5" class="form-control" id="ageLimit"
332 onkeypress="return isNumberKey(event)"
336 <div class="form-group clearfix">
337 <label for="createClosedLoopEventId"
338 class="col-sm-4 control-label"> Create CL Event ID</label>
339 <div class="col-sm-8">
340 <select class="form-control" id="createClosedLoopEventId"
341 name="createClosedLoopEventId" enableFilter="false">
347 <div class="form-group clearfix">
348 <label for="outputEventName" class="col-sm-4 control-label">
349 Output Event Name</label>
351 <div class="col-sm-8">
352 <select class="form-control" id="outputEventName"
353 name="outputEventName" enableFilter="false"></select>
366 <div attribute-test="stringMatchwindowpropertiesf" class="modal-footer">
367 <!--<button ng-click="reset()" class="btn btn-primary" style="float:left">Reset</button>-->
368 <button id="savePropsBtn" class="btn btn-primary">Close</button>
369 <button ng-click="close(true)" id="close_button"
370 class="btn btn-primary">Cancel</button>
375 //Basically this method will add a new form. All forms share the same class. When you want one form to show(active form) the other forms get the
376 // css attribute display:none
377 $("#add_one_more").click(function(event) {
378 event.preventDefault();
384 //This method will load the existing Strin Match onto the screen
385 loadPropertyWindow("string_match");
388 // By default, parentStringMatchConditions is disabled
389 $("#parentStringMatchConditions").prop('disabled', 'disabled');
392 var parent_stringMatch = {}
393 var stringMatch_ids = {}
394 var loadingId = false;
397 var alarm_conditions_temp=""
398 var event_severity_temp=""
399 var event_type_source_temp=""
401 //Grab saved values for dropdowns
402 var obj = elementMap[lastElementSelected];
404 if (!($.isEmptyObject(obj))) {
405 allSMatch = jQuery.extend({}, obj);
406 for ( var x in allSMatch) {
407 $("#stringMatchTable").prepend(
408 "<tr><td>" + x + "</td></tr>");
413 //Load properties_tab for a chosen String Match
414 function disperseConfig(stringMatchObj, id) {
415 //remove old gui forms
416 for (var i = 1; i < ($(".formId").length + 1); i++) {
417 $("#go_properties_tab" + i).parent().remove();
419 $(".formId").remove();
421 if (stringMatchObj !== undefined) {
422 var el = stringMatchObj[id][4]['serviceConfigurations']
423 for (var i = 0; i < el.length; i++) {
425 var num = add_one_more();
427 for (var j = 0; j < el[i].length; j++) {
428 if (el[i][j]["stringSet"] !== undefined) {
429 var ss = el[i][j]["stringSet"]
430 for (var o = 0; o < ss.length; o++) {
431 if(ss[o].hasOwnProperty("name")){
432 if(ss[o].name==="alarmCondition"){
433 alarm_conditions_temp=ss[o].value
434 }else if(ss[o].name==="eventSeverity"){
435 event_severity_temp=ss[o].value;
436 }else if(ss[o].name==="eventSourceType"){
437 event_type_source_temp=ss[o].value;
440 $("#formId" + num + " #" + ss[o].name).val(ss[o].value);
444 }else if(el[i][j].hasOwnProperty("name") && el[i][j].name==="vfc"){
445 vfc_temp=el[i][j].value
447 else if (el[i][j].name === 'outputEventName' && el[i][j].value.toString() !== '') {
448 $("#go_properties_tab" + num).text(el[i][j].value);
449 $("#formId" + num + " #" + el[i][j].name).val(el[i][j].value);
452 if(el[i][j].hasOwnProperty("name")){
453 $("#formId" + num + " #" + el[i][j].name).val(
458 set_vfc_alarm_event(num);
460 alarm_conditions_temp="";
461 event_severity_temp="";
462 event_type_source_temp="";
465 //Adding all the ids for parent String options
466 for (var i = 1; i <= $(".formId").length; i++) {
467 for (k in stringMatch_ids) {
468 if ($("#formId" + i + " #_id").val() !== stringMatch_ids[k].toString() && $(k + " #recipe").val() !== undefined && $(k + " #recipe").val() !== "") {
469 $("#formId" + i + " #parentStringMatch").append("<option value=\""+stringMatch_ids[k]+"\">"+ $(k + " #recipe").val()+ "</option>");
474 for (k in parent_stringMatch) {
475 $("#formId" + k + " #parentStringMatch").val(parent_stringMatch[k]);
476 // force the change event
477 $("#formId" + k + " #parentStringMatch").change();
480 if (stringMatchObj[id][0]) {
481 $("#" + stringMatchObj[id][0].name).val(stringMatchObj[id][0].value);
484 if (stringMatchObj[id][1]) {
485 $("#" + stringMatchObj[id][1].name).val(stringMatchObj[id][1].value);
488 if (stringMatchObj[id][2]) {
489 $("#" + stringMatchObj[id][2].name).val(stringMatchObj[id][2].value);
495 if (readOnly||readMOnly){
496 $('select[multiple] option').each(function() {
497 var input = $('input[value="' + $(this).val() + '"]');
498 input.prop('disabled', true);
499 input.parent('li').addClass('disabled');
501 $('input[value="multiselect-all"]').prop('disabled', true).parent('li').addClass('disabled');
506 //This is ensure there are no repeated keys in the map
507 function noRepeats(form) {
508 //triggered per String.
510 for (var i = 0; i < form.length; i++) {
511 if (select[form[i].name] === undefined)
512 select[form[i].name] = []
513 select[form[i].name].push(form[i].value);
525 $("#savePropsBtn").click(function(event) {
526 $(".idError").hide();
527 if ($("#stringMatchTable .highlight td").html() !== $("#rgfriendlyname").val()){
529 if ($.inArray($("#rgfriendlyname").val(), Object.keys(allSMatch)) > -1){
530 $("#repeatIdError").show();
532 } else { //not repeated
533 delete allSMatch[$("#stringMatchTable .highlight td").html()];
537 if ($("#stringMatchTable .highlight").length > 0) {
538 saveLastStringMatchLocally($("#stringMatchTable .highlight td").html());
540 if ($("#rgfriendlyname").val().trim() == "New_Group"){
541 $("#newIdError").show();
545 //Removes outdated (deleted) resource Groups by checking against left menu
546 var finalSaveList = {};
547 $("#stringMatchTable td").each(function() {
548 var tableVal = $(this).text();
549 if (tableVal in allSMatch) {
550 finalSaveList[tableVal] = allSMatch[tableVal];
554 saveProperties(finalSaveList);
555 $("#close_button").click();
558 function add_one_more() {
559 $("#nav_Tabs li").removeClass("active");
561 //FormSpan contains a block of the form that is not being displayed. We will create clones of that and add them to tabs
562 var form = $($("#formSpan").children()[0]).clone()
564 //Each new tab will have the formId class attached to it. This way we can track how many forms we currently have out there and assign listeners to them
565 if ($(".formId").length > 0) {
567 var s = $(".formId");
568 for (var i = 0; i < s.length; i++) {
569 if (parseInt($(s[i]).attr("id").substring(6)) > greatest) {
570 greatest = parseInt($(s[i]).attr("id").substring(6))
573 count = greatest + 1;
574 $("#properties_tab").append(
575 ('<span class="formId" id="formId'+count+'"></span>'));
578 $("#properties_tab").append(
579 '<span class="formId" id="formId1"></span>');
582 //$(form).find("#stringMatchName").val("Recipe "+makid(2))
583 //TODO change up how we auto assign stringMatchName. There could be the case where we do this and it will have repeats
584 //alert($(form).find("#_id").val())
585 //stringMatchNameChangeListener(form)
590 ' <li class="active"><a id="go_properties_tab'+count+'">Condition</a><button id="tab_close'+count+'" type="button" class="close tab-close-popup" aria-hidden="true" style="margin-top: -30px;margin-right: 5px">×</button></li>');
591 $("#formId" + count).append(form);
592 $(".formId").not($("#formId" + count)).css("display", "none")
596 // This is for when the process is not loading from map but being created
599 $(form).find("#_id").val(l)
600 stringMatch_ids["#formId" + count] = l
610 function add_new_stringMatch(issueNewNames) {
611 //remove old gui forms
612 for (var i = 1; i < ($(".formId").length + 1); i++) {
613 $("#go_properties_tab" + i).parent().remove();
615 $(".formId").remove();
618 var ms = new Date().getTime();
620 $("#rgname").val(defSMatch);
622 $("#rgfriendlyname").val("New_Group");
624 $("#add_one_more").click();
628 //listener will change the tab name to the recipe
629 function addTabListen(count) {
630 $("#formId" + count + " #recipe").on("change",function() {
631 if ($("#formId" + count + " #recipe").val().toString() !== "") {
632 $('#go_properties_tab' + count).text($("#formId" + count + " #recipe").val())
634 $('#go_properties_tab' + count).text("String");
638 for (var i = 1; i <= greatestIdNum(); i++) {
639 if ($("#formId" + i).length > 0) {
641 answers["#formId" + i + " #parentStringMatch"] = $("#formId" + i + " #parentStringMatch").val()
642 $("#formId" + i + " #parentStringMatch").empty();
644 for (k in stringMatch_ids) {
645 if ($("#formId" + i + " #_id").val().toString() !== stringMatch_ids[k] && $(k + " #recipe").val() !== 'undefined' && $(k + " #recipe").val() !== "") {
646 $("#formId" + i + " #parentStringMatch").append("<option value='"+stringMatch_ids[k]+"''> "+ $(k+ " #recipe").val()+ "</option>")
649 $("#formId" + i + " #parentStringMatch").prepend("<option value=''></option>")
657 // disable parentStringMatchConditions when a parentStringMatch is not selected
658 $("#formId" + count + " #parentStringMatch").on("change",function() {
659 if ($("#formId" + count + " #parentStringMatch").val().toString() == "") {
660 // deselect all options
661 $("#formId"+ count+ " #parentStringMatchConditions option:selected").prop("selected", false);
662 // disable the select box
663 $("#formId"+ count+ " #parentStringMatchConditions").prop('disabled', 'disabled');
665 $("#formId"+ count+ " #parentStringMatchConditions").prop('disabled', false);
670 function addCustListen(count) {
671 $('#go_properties_tab' + count).click(function(event) {
672 $("#nav_Tabs li").removeClass("active");
673 $(this).parent().addClass("active");
674 $("#formId" + count).css("display", "")
675 $(".formId").not($("#formId" + count)).css("display", "none")
678 $('#tab_close' + count).click(function(event) {
680 $(this).parent().remove();
681 delete stringMatch_ids["#formId" + count + " #_id"]
682 $("#formId" + count).remove();
686 function setStringSet(form) {
688 var alarmCondition = {}
689 var eventSeverity = {}
690 var eventSourceType = {}
691 for (var i = 0; i < form.length; i++) {
692 if (form[i].name === "alarmCondition") {
693 alarmCondition = form[i]
694 } else if (form[i].name === "eventSeverity") {
695 eventSeverity = form[i];
696 } else if (form[i].name === "eventSourceType") {
697 eventSourceType = form[i];
705 stringSet['stringSet'] = []
706 stringSet['stringSet'].push(alarmCondition);
707 stringSet['stringSet'].push(eventSeverity);
708 stringSet['stringSet'].push(eventSourceType);
714 //this will populate alarmcondition,vfc,eventtypesource if they are saved in elementmap
715 function set_vfc_alarm_event (count){
716 if(vfc_temp!=="" && vfc_temp!==undefined){
717 $("#formId"+count+" #vfc").val(vfc_temp)
719 if(alarm_conditions_temp!=="" && alarm_conditions_temp!==undefined){
720 setAlarmConditions(vfc_temp,count)
721 $("#formId"+count+" #alarmCondition").val(alarm_conditions_temp);
723 if(event_severity_temp!=="" && event_severity_temp!==undefined){
724 setEventSourceType(alarm_conditions_temp,count)
725 $("#formId"+count+" #eventSeverity").val(event_severity_temp)
726 if(event_type_source_temp!=="" && event_type_source_temp!==undefined){
727 $("#formId"+count+" #eventSourceType").val(event_type_source_temp)
730 if(event_type_source_temp!=="" && event_type_source_temp!==undefined){
731 setEventSourceType(alarm_conditions_temp,count)
732 $("#formId"+count+" #eventSourceType").val(event_type_source_temp)
733 if(event_severity_temp!=="" && event_severity_temp!==undefined){
734 $("#formId"+count+" #eventSeverity").val(event_severity_temp)
741 function setAlarmConditions(vfcID, count){
742 var alarmCondition={}
744 if($("#formId"+count+" #vfc").val()!==""){
745 if(vf_Services['shared'] && vf_Services['shared']['byVfc'] && vf_Services['shared']['byVfc'][vfcID]){
746 alarmCondition=vf_Services['shared']['byVfc'][vfcID]['alarmCondition']
750 $("#formId"+count+" #alarmCondition").empty();
751 $("#formId"+count+" #alarmCondition").append("<option value=\"\"></opton>");
752 if(alarmCondition && _.keys(alarmCondition).length>0){
753 for(key in alarmCondition){
754 var safestring = $('<div>').text(key).html();
755 $("#formId"+count+" #alarmCondition").append("<option value='"+safestring+"'>"+alarmCondition[key]+"</opton>");
757 $("#formId"+count+" #alarmCondition").multiselect("rebuild");
761 function setEventSourceType(alarm, count){
762 var eventSourceTypSeverity={}
763 if($("#formId"+count+" #alarmCondition").val()!==""){
764 if(vf_Services && vf_Services['shared'] && vf_Services['shared']['byAlarmCondition'] && vf_Services['shared']['byAlarmCondition'][alarm]){
765 eventSourceTypSeverity=vf_Services['shared']['byAlarmCondition'][alarm]
770 $("#formId"+count+" #eventSourceType").val(eventSourceTypSeverity.eventSourceType);
771 $("#formId"+count+" #eventSeverity").val(eventSourceTypSeverity.eventSeverity);
772 $("#formId"+count+" #eventSeverity").multiselect("rebuild");
775 function greatestIdNum() {
777 var s = $(".formId");
778 for (var i = 0; i < s.length; i++) {
779 if (parseInt($(s[i]).attr("id").substring(6)) > greatest) {
780 greatest = parseInt($(s[i]).attr("id").substring(6))
786 //Generate random id for each String
787 //Also made sure ids couldnt be repeated
788 function makeid(num) {
791 var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
794 for (var i = 0; i < 7; i++)
795 text += possible.charAt(Math.floor(Math.random()
797 var hasValue = false;
798 for (k in stringMatch_ids) {
799 if (text === stringMatch_ids[k])
808 var ParentStringMatch = function(id, name) {
813 //String table search filter
814 function searchStringMatchList() {
815 var search = document.getElementById("stringMatchSearch");
816 var row = document.getElementsByTagName("td");
817 for (var i = 0; i < row.length; i++) {
818 if (row[i].innerHTML.toUpperCase().indexOf(
819 search.value.toUpperCase()) > -1) {
820 row[i].style.display = "";
822 row[i].style.display = "none";
827 function saveLastStringMatchLocally(lastStringMatchId) {
830 var properties = $(".saveProps").not("#formSpan .saveProps")
832 var topicPublish = $("#topicPublish").serializeArray();
834 for (var i = 0; i < topicPublish.length; i++) {
835 polForm.push(topicPublish[i]);
838 //The below three lines are added to make sure resource group can be save correctly even if the policy is not present
839 if (topicPublish.length == 2){
840 var pname = {name:"policyName", value:""};
842 var pid = {name:"policyId", value:""};
845 var selectedPName = topicPublish[2]["value"];
846 var pid = {name:"policyId", value:allPolicies[selectedPName][1]["value"]};
851 d["serviceConfigurations"] = [];
852 for (var i = 0; i < properties.length; i++) {
853 var ser = $(properties[i]).serializeArray();
854 var s = noRepeats(ser)
855 var newSer = setStringSet(s);
856 d["serviceConfigurations"].push(newSer);
859 allSMatch[lastStringMatchId] = polForm;
862 $("#deleteStringMatch").on('click', function() {
863 $(".idError").hide();
864 var deleteId = $("#stringMatchTable .highlight td").html();
865 delete allSMatch.deleteId;
866 $("#stringMatchTable .highlight").remove();
867 $("#rgfriendlyname").val('');
871 $('#stringMatchTable').on('click', 'tr', function(event) {
872 $(".idError").hide();
874 if ($("#stringMatchTable .highlight td").html() !== $("#rgfriendlyname").val()){
876 if ($.inArray($("#rgfriendlyname").val(), Object.keys(allSMatch)) > -1){
877 $("#repeatIdError").show();
879 } else { //not repeated
880 $("#repeatIdError").hide();
881 delete allSMatch[$("#stringMatchTable .highlight td").html()];
884 if ($("#rgfriendlyname").val().trim() == "New_Group"){
885 $("#newIdError").show();
888 if (!(readOnly||readMOnly)){
891 if ($("#stringMatchTable .highlight").length == 0){
896 $(this).addClass('highlight').siblings().removeClass('highlight');
897 disperseConfig(allSMatch, $(this).find("td").html());
901 $('#createNewStringMatch').on('click', function() {
902 $(".idError").hide();
904 if ($("#stringMatchTable .highlight td").html() !== $("#rgfriendlyname").val()){
906 if ($.inArray($("#rgfriendlyname").val(), Object.keys(allSMatch)) > -1){
907 $("#repeatIdError").show();
909 } else { //not repeated
910 $("#repeatIdError").hide();
911 delete allSMatch[$("#stringMatchTable .highlight td").html()];
914 if ($("#rgfriendlyname").val().trim() == "New_Group"){
915 $("#newIdError").show();
919 var defSMatch = add_new_stringMatch();
921 if (("#stringMatchTable .highlight").length > 0) {
922 $('#stringMatchTable tr.highlight').removeClass('highlight');
924 //$("#stringMatchTable").prepend("<tr class='highlight' id='" +defSMatch+ "''><td>"+ defSMatch + "</td></tr>");
925 $("#stringMatchTable").prepend("<tr class='highlight'><td>New_Group</td></tr>");
929 function isNumberKey(event){
930 var charCode = (event.which) ? event.which : event.keyCode
931 if (charCode > 31 && (charCode < 48 || charCode > 57)){
937 function startNextItem() {
938 //save last item before transitioning
939 var lastItem = $("#stringMatchTable .highlight");
942 if (lastItem.length > 0) {
943 saveLastStringMatchLocally($("#rgfriendlyname").val());
944 //lastItem.attr("id", $("#rgfriendlyname").val());
945 if($("#rgfriendlyname").val() != ''){
946 lastItem.find("td").html($("#rgfriendlyname").val());
953 if ($("#deleteStringMatch").prop("disabled")) {
954 $("#deleteStringMatch").prop("disabled", false);
958 //Show table panel only
959 function expandTable() {
960 $(".stringMatchPanel").css("display", "none");
961 $(".leftStringMatchPanel").removeClass("col-sm-3");
962 $(".modelSearchBox").css("padding", "25px 12px");
963 if (!($("#deleteStringMatch").prop("disabled"))) {
964 $("#deleteStringMatch").prop("disabled", true);
969 function collapseTable() {
970 $(".leftStringMatchPanel").addClass("col-sm-3");
971 $(".glyphicon-search").css("padding", "10px 12px");
972 $(".stringMatchPanel").css("display", "unset");