Started integrating letter view; overhauled marginals completely

This commit is contained in:
schnulller
2022-05-22 02:31:51 +02:00
parent da95222e8e
commit 8179ea6e68
19 changed files with 2203 additions and 261 deletions

View File

@@ -1,6 +1,19 @@
namespace HaWeb.Settings.ParsingState;
using System.Text;
public enum CommentType {
Comment,
Subcomment
}
public class CommentState : HaWeb.HTMLParser.IState {
internal string Category;
internal CommentType Type;
public CommentState(string category, CommentType type) {
this.Category = category;
this.Type = type;
}
public void SetupState() { }
}

View File

@@ -22,13 +22,9 @@ public class LetterState : HaWeb.HTMLParser.IState {
internal bool active_skipwhitespace;
internal string currline;
internal string currpage;
internal string oldpage;
internal int commid;
// Parsing-Combinations
internal StringBuilder sb_lettertext; // Hauptext
internal StringBuilder sb_linecount; // Linke Spalte (Zeilenzählung)
internal StringBuilder sb_marginals; // Rechte Spalte (Kommentare)
internal StringBuilder sb_lettertext;
public LetterState(ILibrary lib, IReaderService readerService, Meta meta, IEnumerable<Marginal>? marginals) {
@@ -43,14 +39,9 @@ public class LetterState : HaWeb.HTMLParser.IState {
public void SetupState() {
sb_lettertext = new StringBuilder();
sb_linecount = new StringBuilder();
sb_marginals = new StringBuilder();
active_skipwhitespace = true;
currline = "-1";
currpage = "";
oldpage = "";
commid = 1;
// Initialize State
if (Meta.ZH != null) {

View File

@@ -17,14 +17,10 @@ public class TraditionState : HaWeb.HTMLParser.IState {
internal bool active_firstedit;
internal string currline;
internal string currpage;
internal string oldpage;
internal int commid;
internal bool active_trad;
internal StringBuilder sb_tradition; // Überlieferung
internal StringBuilder sb_trad_zhtext; // Überlieferung, ZHText
internal StringBuilder sb_trad_left; // Überlieferung ZHText linke Spalte (zeilenzählung)
internal StringBuilder sb_trad_right; // Überlieferung ZHText rechte Spalte (Kommentare)
internal IReader rd_tradition;
@@ -39,8 +35,6 @@ public class TraditionState : HaWeb.HTMLParser.IState {
public void SetupState() {
sb_tradition = new StringBuilder();
sb_trad_zhtext = new StringBuilder();
sb_trad_left = new StringBuilder();
sb_trad_right = new StringBuilder();
active_trad = false;
active_del = false;
@@ -48,7 +42,5 @@ public class TraditionState : HaWeb.HTMLParser.IState {
active_firstedit = true;
currline = "-1";
currpage = "";
oldpage = "";
commid = 1;
}
}