Revised the summary editor to allow the "*" start character as the multiplication operation in addition to the "×" times character.
This commit is contained in:
parent
b5aaee4d15
commit
f6ed6b10a7
@ -769,7 +769,7 @@ class GeneralTripTab extends TagTabPlane {
|
||||
* @override
|
||||
*/
|
||||
populate() {
|
||||
const found = this.editor.summary.value.match(/^([^—]+)—([^—→↔]+)([→↔])(.+?)(?:×\d+)?(?:\([^)]+\))?$/);
|
||||
const found = this.editor.summary.value.match(/^([^—]+)—([^—→↔]+)([→↔])(.+?)(?:[*×]\d+)?(?:\([^)]+\))?$/);
|
||||
if (found === null) {
|
||||
return false;
|
||||
}
|
||||
@ -957,7 +957,7 @@ class BusTripTab extends TagTabPlane {
|
||||
* @override
|
||||
*/
|
||||
populate() {
|
||||
const found = this.editor.summary.value.match(/^([^—]+)—([^—]+)—([^—→]+)→(.+?)(?:×\d+)?(?:\([^)]+\))?$/);
|
||||
const found = this.editor.summary.value.match(/^([^—]+)—([^—]+)—([^—→]+)→(.+?)(?:[*×]\d+)?(?:\([^)]+\))?$/);
|
||||
if (found === null) {
|
||||
return false;
|
||||
}
|
||||
@ -1142,7 +1142,7 @@ class AnnotationTab extends TabPlane {
|
||||
* @override
|
||||
*/
|
||||
updateSummary() {
|
||||
const found = this.editor.summary.value.match(/^(.*?)(?:×\d+)?(?:\([^)]+\))?$/);
|
||||
const found = this.editor.summary.value.match(/^(.*?)(?:[*×]\d+)?(?:\([^)]+\))?$/);
|
||||
if (found !== null) {
|
||||
this.editor.summary.value = found[1];
|
||||
}
|
||||
@ -1171,16 +1171,19 @@ class AnnotationTab extends TabPlane {
|
||||
* @override
|
||||
*/
|
||||
populate() {
|
||||
const found = this.editor.summary.value.match(/^(.*?)(?:×(\d+))?(?:\(([^)]+)\))?$/);
|
||||
if (found[2] === undefined) {
|
||||
const found = this.editor.summary.value.match(/^(.*?)(?:[*×](\d+))?(?:\(([^)]+)\))?$/);
|
||||
this.editor.summary.value = found[1];
|
||||
if (found[2] === undefined || parseInt(found[2]) === 1) {
|
||||
this.editor.number.value = "";
|
||||
} else {
|
||||
this.editor.number.value = found[2];
|
||||
this.editor.summary.value = this.editor.summary.value + "×" + this.editor.number.value;
|
||||
}
|
||||
if (found[3] === undefined) {
|
||||
this.editor.note.value = "";
|
||||
} else {
|
||||
this.editor.note.value = found[3];
|
||||
this.editor.summary.value = this.editor.summary.value + "(" + this.editor.note.value + ")";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user