equal
deleted
inserted
replaced
21 return this.perform_subst(this.strings[catname][string_name], subst) + '**'; |
21 return this.perform_subst(this.strings[catname][string_name], subst) + '**'; |
22 } |
22 } |
23 |
23 |
24 this.perform_subst = function(str, subst) |
24 this.perform_subst = function(str, subst) |
25 { |
25 { |
26 // var this_regex = /%this\.([a-z0-9_]+)%/; |
26 var this_regex = /%this\.([a-z0-9_]+)%/; |
27 // var match; |
27 var match; |
28 // while ( str.match(this_regex) ) |
28 while ( str.match(this_regex) ) |
29 // { |
29 { |
30 // match = str.match(this_regex); |
30 match = str.match(this_regex); |
31 // alert(match); |
31 str = str.replace(match[0], this.get(match[1])); |
32 // } |
32 } |
33 // hackish workaround for %config.*% |
33 // hackish workaround for %config.*% |
34 str = str.replace(/%config\.([a-z0-9_]+)%/g, '%$1%'); |
34 str = str.replace(/%config\.([a-z0-9_]+)%/g, '%$1%'); |
35 if ( typeof(subst) == 'object' ) |
35 if ( typeof(subst) == 'object' ) |
36 { |
36 { |
37 for ( var i in subst ) |
37 for ( var i in subst ) |