Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn committed Dec 8, 2022
1 parent 2c2f7ea commit 5921bd0
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 33 deletions.
31 changes: 12 additions & 19 deletions OneMore/Commands/Snippets/InsertCodeBlockCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public override async Task Execute(params object[] args)

DetermineCellColors(page);

PageNamespace.Set(ns);

var table = new Table(ns)
{
BordersVisible = true
Expand All @@ -79,10 +81,8 @@ public override async Task Execute(params object[] args)
cell = row.Cells.First();

cell.SetContent(
new XElement(ns + "OE",
new XAttribute("style", $"font-family:'Segoe UI';font-size:11.0pt;color:{titleColor}"),
new XElement(ns + "T", new XCData("<span style='font-weight:bold'>Code</span>"))
));
new Paragraph($"<span style='font-weight:bold'>{Resx.word_Code}</span>")
.SetStyle($"font-family:'Segoe UI';font-size:11.0pt;color:{titleColor}"));

cell.ShadingColor = shading;
}
Expand Down Expand Up @@ -201,26 +201,19 @@ private XElement MakeDefaultContent(bool withTitle)
{
if (withTitle)
{
var css = $"font-family:Consolas;font-size:10.0pt;color:{textColor}";

return new XElement(ns + "OEChildren",
new XElement(ns + "OE",
new XAttribute("style", $"font-family:Consolas;font-size:10.0pt;color:{textColor}"),
new XElement(ns + "T", new XCData(string.Empty))
),
new XElement(ns + "OE",
new XAttribute("style", $"font-family:Consolas;font-size:10.0pt;color:{textColor}"),
new XElement(ns + "T", new XCData(Resx.InsertCodeBlockCommand_Code))
),
new XElement(ns + "OE",
new XAttribute("style", $"font-family:Consolas;font-size:10.0pt;color:{textColor}"),
new XElement(ns + "T", new XCData(string.Empty))
)
new Paragraph(string.Empty).SetStyle(css),
new Paragraph(Resx.InsertCodeBlockCommand_Code).SetStyle(css),
new Paragraph(string.Empty).SetStyle(css)
);
}

return new XElement(ns + "OEChildren",
new XElement(ns + "OE", new XElement(ns + "T", new XCData(string.Empty))),
new XElement(ns + "OE", new XElement(ns + "T", new XCData(Resx.InsertCodeBlockCommand_Text))),
new XElement(ns + "OE", new XElement(ns + "T", new XCData(string.Empty)))
new Paragraph(string.Empty),
new Paragraph(Resx.InsertCodeBlockCommand_Text),
new Paragraph(string.Empty)
);
}

Expand Down
15 changes: 1 addition & 14 deletions OneMore/Models/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ namespace River.OneMoreAddIn.Models
/// </summary>
internal partial class Page
{
//// Page meta to indicate data storage analysis report
//public static readonly string AnalysisMetaName = "omAnalysisReport";
//// Page meta to keep track of rotating highlighter index
//public static readonly string HighlightMetaName = "omHighlightIndex";
//// Page is reference linked to another page, so don't include it in subsequent links
//public static readonly string LinkReferenceMetaName = "omLinkReference";
//// Page is a reference map, so don't include it in subsequent maps
//public static readonly string PageMapMetaName = "omPageMap";
//// Outline meta to mark visible word bank
//public static readonly string TagBankMetaName = "omTaggingBank";
//// Page meta to specify page tag list
//public static readonly string TaggingMetaName = "omTaggingLabels";


/// <summary>
/// Initialize a new instance with the given page XML root
Expand Down Expand Up @@ -633,7 +620,7 @@ public void EnsurePageWidth(
.FirstOrDefault();

element ??= Root.Elements(Namespace + "Outline")
.LastOrDefault()
.Last()
.Elements(Namespace + "Size")
.FirstOrDefault();

Expand Down
7 changes: 7 additions & 0 deletions OneMore/OneNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,13 @@ public async Task Update(XElement element)
}
}

// dateExpectedLastModified is merely a pessimistic-locking safeguard to prevent
// updating parts of a shared page that have since been updated
//
//var lastModTime = element.Attribute("lastModifiedTime") is XAttribute att
// ? DateTime.Parse(att.Value).ToUniversalTime()
// : DateTime.MinValue;

var xml = element.ToString(SaveOptions.DisableFormatting);

await InvokeWithRetry(() =>
Expand Down
9 changes: 9 additions & 0 deletions OneMore/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.ar-SA.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4247,4 +4247,7 @@ ISO-code then comma then language name</comment>
<value>صفحة مكررة</value>
<comment>page context menu</comment>
</data>
<data name="word_Code" xml:space="preserve">
<value>شفرة</value>
</data>
</root>
3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4239,4 +4239,7 @@ In diesem Abschnitt</value>
<value>Seite duplizieren</value>
<comment>page context menu</comment>
</data>
<data name="word_Code" xml:space="preserve">
<value>Code</value>
</data>
</root>
3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.es-ES.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4247,4 +4247,7 @@ En esta sección</value>
<value>Página duplicada</value>
<comment>page context menu</comment>
</data>
<data name="word_Code" xml:space="preserve">
<value>Código</value>
</data>
</root>
3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4241,4 +4241,7 @@ Dans cette section</value>
<value>Page dupliquée</value>
<comment>page context menu</comment>
</data>
<data name="word_Code" xml:space="preserve">
<value>Code</value>
</data>
</root>
3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.nl-NL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4247,4 +4247,7 @@ In deze sectie</value>
<value>Dubbele pagina</value>
<comment>page context menu</comment>
</data>
<data name="word_Code" xml:space="preserve">
<value>Code</value>
</data>
</root>
3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.pl-PL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4300,4 +4300,7 @@ W tej sekcji</value>
<value>Duplikat strony</value>
<comment>page context menu</comment>
</data>
<data name="word_Code" xml:space="preserve">
<value>Kod</value>
</data>
</root>
3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.pt-BR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4247,4 +4247,7 @@ Nesta secção</value>
<value>Página Duplicada</value>
<comment>page context menu</comment>
</data>
<data name="word_Code" xml:space="preserve">
<value>Código</value>
</data>
</root>
3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4190,6 +4190,9 @@ In this section</value>
<data name="word_Close" xml:space="preserve">
<value>Close</value>
</data>
<data name="word_Code" xml:space="preserve">
<value>Code</value>
</data>
<data name="word_Color" xml:space="preserve">
<value>Color</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions OneMore/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4237,4 +4237,7 @@ ISO-code then comma then language name</comment>
<value>重复页面</value>
<comment>page context menu</comment>
</data>
<data name="word_Code" xml:space="preserve">
<value>代码</value>
</data>
</root>

0 comments on commit 5921bd0

Please sign in to comment.