Allow lower-case in ruleid's (for "FfS" and "SmR").

master
Pacman Ghost 3 years ago
parent beb63e7087
commit a436f7b604
  1. 2
      asl_rulebook2/webapp/static/SearchResult.js
  2. 3
      asl_rulebook2/webapp/static/utils.js

@ -157,7 +157,7 @@ gMainApp.component( "index-sr", {
let pos = ruleid.indexOf( "_" ) ;
if ( pos > 0 )
return ruleid.substring( 0, pos ) ; // e.g. "KGS_CG3" -> "KGS"
let match = ruleid.match( /^[A-Z]+/ ) ;
let match = ruleid.match( /^[A-Za-z]+/ ) ;
if ( match ) {
let chapterId = match[0] ;
if ( chapterId.substring( chapterId.length-2 ) == "CG" )

@ -44,7 +44,8 @@ export function findTargets( ruleid, csetId )
export function isRuleid( val )
{
// check if the value looks like a ruleid
return val.match( /^[A-Z]+_?(\.|CG)?\d/ ) ;
// NOTE: "S" is for Fight For Seoul e.g. "FfS_S1" or "SmR_S2.3".
return val.match( /^[A-Za-z]+_?(\.|CG|S)?\d/ ) ;
}
export function getASOPChapterIdFromSectionId( sectionId )

Loading…
Cancel
Save