Added some draft templates for Sieve GUI

This commit is contained in:
the-djmaze 2024-09-22 16:36:12 +02:00
parent 04f3133f27
commit 74a67aabaf
42 changed files with 542 additions and 101 deletions

View file

@ -43,7 +43,6 @@ export class VacationCommand extends ActionCommand
}
if (this._from.length) {
result += ' :from ' + this._from;
// result += ' :from ' + this.arguments[':from'];
}
if (this.addresses.length) {
result += ' :addresses ' + this.addresses;

View file

@ -8,11 +8,11 @@ import {
GrammarString
} from 'Sieve/Grammar';
class rfc5429Command extends ActionCommand
class /*abstract*/ rfc5429Command extends ActionCommand
{
constructor(identifier)
constructor()
{
super(identifier);
super();
this._reason = new GrammarQuotedString;
}
@ -44,7 +44,6 @@ class rfc5429Command extends ActionCommand
*/
export class ErejectCommand extends rfc5429Command
{
constructor() { super('ereject'); }
get require() { return 'ereject'; }
}
@ -53,6 +52,5 @@ export class ErejectCommand extends rfc5429Command
*/
export class RejectCommand extends rfc5429Command
{
constructor() { super('reject'); }
get require() { return 'reject'; }
}

View file

@ -5,6 +5,7 @@
import {
ActionCommand,
ControlCommand,
GrammarCommands,
GrammarNumber,
GrammarQuotedString,
GrammarString,
@ -20,6 +21,7 @@ export class ForEveryPartCommand extends ControlCommand
{
super();
this._name = new GrammarString;
this.commands = new GrammarCommands;
}
get require() { return 'foreverypart'; }
@ -27,7 +29,7 @@ export class ForEveryPartCommand extends ControlCommand
toString()
{
let result = 'foreverypart';
if (this._subject.length) {
if (this._name.length) {
result += ' :name ' + this._name;
}
return result + ' ' + this.commands;
@ -43,12 +45,15 @@ export class ForEveryPartCommand extends ControlCommand
}
}
/**
* Must be inside foreverypart
*/
export class BreakCommand extends ForEveryPartCommand
{
toString()
{
let result = 'break';
if (this._subject.length) {
if (this._name.length) {
result += ' :name ' + this._name;
}
return result + ';';
@ -82,7 +87,6 @@ export class ReplaceCommand extends ActionCommand
}
if (this._from.length) {
result += ' :from ' + this._from;
// result += ' :from ' + this.arguments[':from'];
}
return result + this.replacement + ';';
}
@ -140,6 +144,7 @@ export class EncloseCommand extends ActionCommand
/**
* https://datatracker.ietf.org/doc/html/rfc5703#section-7
* Should be inside foreverypart, else empty and flagged as a compilation error
*/
export class ExtractTextCommand extends ActionCommand
{