X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=plugins%2FDefaultPage.cs;h=5ec5bdd4891e9d2fc9c9d695086d584b075d6535;hb=84890340eccbe66e303780a992fe152356974394;hp=3de24108750161d11c0b2c1aab9ded4626f8551e;hpb=1bff29702cf8ce8c1952d22243e4dc7a9df74105;p=WebThing.git diff --git a/plugins/DefaultPage.cs b/plugins/DefaultPage.cs index 3de2410..5ec5bdd 100644 --- a/plugins/DefaultPage.cs +++ b/plugins/DefaultPage.cs @@ -1,12 +1,18 @@ using System; +using System.Text.RegularExpressions; using bytex64.WebThing; -public class Plugin { - public Plugin(WebThing wt) { - if (wt.Arguments.Length > 0) { - wt.OpenUri(wt.Arguments[0]); +public class DefaultPage : WebThingPlugin { + public override void Init(WebThing wt) { + if (Config.Arguments.Length > 0) { + foreach (string arg in Config.Arguments) + wt.OpenUriTab(arg); + } else if (Config.Options.ContainsKey("DefaultPage")) { + string[] pages = Regex.Split(Config.Options["DefaultPage"], @"\s+"); + foreach (string page in pages) + wt.OpenUriTab(page); } else { - wt.OpenUri("http://dominionofawesome.com/"); + wt.OpenUriTab("http://dominionofawesome.com/"); } } }