ste/ste_script.js
/**
 * Function to open the edit category lightbox
 *
 * @param {number} cat_id
 */
Function to open the edit category lightbox
@param {number} cat_id
Function to open the edit category lightbox @param { number } cat_id
function edit_cat(cat_id) {
  if ($('#ste').val() < 1) {
    alert("Please select an ST&E");
    return;
  }
  for (var x in $('#scan_sources option')) {
    $('#scan_sources option').eq(x).attr('selected', false);
  }
  var cat_name = $('#cat_name_' + cat_id).text();
  var matches = cat_name.match(/\s+\(([\d]+)\)\s+\(([^\d][ \w]+)\)|\s+\(([\d]+)\)/i);
  cat_name = cat_name.replace(/\s+\(([\d]+)\)\s+\(([^\d][ \w]+)\)|\s+\(([\d]+)\)/i, '');
  cat_name = cat_name.replace(/\s{2,}/g, '');
  $('#new_cat_name').val(cat_name);
  $('#selected_cat').val(cat_id);
  if (matches && typeof matches[2] !== 'undefined')
    $('#analyst').val(matches[2]);
  else
    $('#analyst').val('');
  var srcs = JSON.parse($('#cat_sources_' + cat_id).val());
  for (var x in srcs) {
    $('#src_' + srcs[x]).attr('selected', true);
  }
  $('#edit_cat').animate({
    'opacity': '1.00'
  }, 300, 'linear');
  $('#edit_cat').css('display', 'block');
  view_box();
}
function edit_cat ( cat_id ) { if ( $ ( '#ste' ) . val ( ) < 1 ) { alert ( "Please select an ST&E" ) ; return ; } for ( var x in $ ( '#scan_sources option' ) ) { $ ( '#scan_sources option' ) . eq ( x ) . attr ( 'selected' , false ) ; } var cat_name = $ ( '#cat_name_' + cat_id ) . text ( ) ; var matches = cat_name . match ( / \s+\(([\d]+)\)\s+\(([^\d][ \w]+)\)|\s+\(([\d]+)\) / i ) ; cat_name = cat_name . replace ( / \s+\(([\d]+)\)\s+\(([^\d][ \w]+)\)|\s+\(([\d]+)\) / i , '' ) ; cat_name = cat_name . replace ( / \s{2,} / g , '' ) ; $ ( '#new_cat_name' ) . val ( cat_name ) ; $ ( '#selected_cat' ) . val ( cat_id ) ; if ( matches && typeof matches [ 2 ] !== 'undefined' ) $ ( '#analyst' ) . val ( matches [ 2 ] ) ; else $ ( '#analyst' ) . val ( '' ) ; var srcs = JSON . parse ( $ ( '#cat_sources_' + cat_id ) . val ( ) ) ; for ( var x in srcs ) { $ ( '#src_' + srcs [ x ] ) . attr ( 'selected' , true ) ; } $ ( '#edit_cat' ) . animate ( { 'opacity' : '1.00' } , 300 , 'linear' ) ; $ ( '#edit_cat' ) . css ( 'display' , 'block' ) ; view_box ( ) ; }
Function to open the edit category lightbox
 @param {number} cat_id
Function to open the edit category lightbox @param { number } cat_id