MOBILE-4247 edit: Add field#name and field#description
parent
8e03587701
commit
9488e22518
|
@ -438,6 +438,20 @@ export class AddonModDataEditPage implements OnInit {
|
||||||
replaceRegEx = new RegExp(replace, 'gi');
|
replaceRegEx = new RegExp(replace, 'gi');
|
||||||
|
|
||||||
template = template.replace(replaceRegEx, 'field_' + field.id);
|
template = template.replace(replaceRegEx, 'field_' + field.id);
|
||||||
|
|
||||||
|
// Replace the field name tag.
|
||||||
|
replace = '[[' + field.name + '#name]]';
|
||||||
|
replace = replace.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
||||||
|
replaceRegEx = new RegExp(replace, 'gi');
|
||||||
|
|
||||||
|
template = template.replace(replaceRegEx, field.name);
|
||||||
|
|
||||||
|
// Replace the field description tag.
|
||||||
|
replace = '[[' + field.name + '#description]]';
|
||||||
|
replace = replace.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
||||||
|
replaceRegEx = new RegExp(replace, 'gi');
|
||||||
|
|
||||||
|
template = template.replace(replaceRegEx, field.description);
|
||||||
});
|
});
|
||||||
|
|
||||||
const regex = new RegExp('##otherfields##', 'gi');
|
const regex = new RegExp('##otherfields##', 'gi');
|
||||||
|
|
Loading…
Reference in New Issue