Google, Wiki, RuWiki, Lurk BBCodes implemented

main
Inga 🏳‍🌈 15 years ago
parent 0cf2144203
commit 1f2653c18b
  1. 2
      Builder/IISMainHandler/build.txt
  2. 20
      Common/BBCodes/Google.cs
  3. 20
      Common/BBCodes/Lurk.cs
  4. 20
      Common/BBCodes/RuWiki.cs
  5. 20
      Common/BBCodes/Wiki.cs
  6. 4
      Common/Common.csproj
  7. 4
      Common/UBBParser.cs

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJonDevelopment.BBCode;
using System.Web;
namespace FLocal.Common.BBCodes {
class Google : BBCode {
public Google()
: base("google") {
}
public override string Format(ITextFormatter formatter) {
return "<a href=\"http://lmgtfy.com/?q=" + HttpUtility.UrlEncode(this.DefaultOrValue) + "\">" + this.GetInnerHTML(formatter) + "</a>";
}
}
}

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJonDevelopment.BBCode;
using System.Web;
namespace FLocal.Common.BBCodes {
class Lurk : BBCode {
public Lurk()
: base("lurk") {
}
public override string Format(ITextFormatter formatter) {
return "<a href=\"http://lurkmore.ru/" + HttpUtility.UrlEncode(this.DefaultOrValue) + "\">" + this.GetInnerHTML(formatter) + "</a>";
}
}
}

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJonDevelopment.BBCode;
using System.Web;
namespace FLocal.Common.BBCodes {
class RuWiki : BBCode {
public RuWiki()
: base("ruwiki") {
}
public override string Format(ITextFormatter formatter) {
return "<a href=\"http://ru.wikipedia.org/wiki/" + HttpUtility.UrlEncode(this.DefaultOrValue) + "\">" + this.GetInnerHTML(formatter) + "</a>";
}
}
}

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJonDevelopment.BBCode;
using System.Web;
namespace FLocal.Common.BBCodes {
class Wiki : BBCode {
public Wiki()
: base("wiki") {
}
public override string Format(ITextFormatter formatter) {
return "<a href=\"http://en.wikipedia.org/wiki/" + HttpUtility.UrlEncode(this.DefaultOrValue) + "\">" + this.GetInnerHTML(formatter) + "</a>";
}
}
}

@ -61,14 +61,17 @@
<Compile Include="BBCodes\Font.cs" />
<Compile Include="BBCodes\FontColor.cs" />
<Compile Include="BBCodes\FontSize.cs" />
<Compile Include="BBCodes\Google.cs" />
<Compile Include="BBCodes\helpers\BBCode.cs" />
<Compile Include="BBCodes\Code.cs" />
<Compile Include="BBCodes\FUrl.cs" />
<Compile Include="BBCodes\Image.cs" />
<Compile Include="BBCodes\List.cs" />
<Compile Include="BBCodes\ListElem.cs" />
<Compile Include="BBCodes\Lurk.cs" />
<Compile Include="BBCodes\Poll.cs" />
<Compile Include="BBCodes\Quote.cs" />
<Compile Include="BBCodes\RuWiki.cs" />
<Compile Include="BBCodes\S.cs" />
<Compile Include="BBCodes\Spoiler.cs" />
<Compile Include="BBCodes\U.cs" />
@ -77,6 +80,7 @@
<Compile Include="BBCodes\Url.cs" />
<Compile Include="BBCodes\helpers\UrlProcessor.cs" />
<Compile Include="BBCodes\User.cs" />
<Compile Include="BBCodes\Wiki.cs" />
<Compile Include="Config.cs" />
<Compile Include="dataobjects\Account.cs" />
<Compile Include="dataobjects\AccountIndicator.cs" />

@ -94,9 +94,11 @@ namespace FLocal.Common {
this.parser.ElementTypes.Add("color", typeof(BBCodes.FontColor), true);
this.parser.ElementTypes.Add("size", typeof(BBCodes.FontSize), true);
this.parser.ElementTypes.Add("furl", typeof(BBCodes.FUrl), true);
this.parser.ElementTypes.Add("google", typeof(BBCodes.Google), true);
this.parser.ElementTypes.Add("i", typeof(BBCodes.I), true);
this.parser.ElementTypes.Add("image", typeof(BBCodes.Image), true);
this.parser.ElementTypes.Add("list", typeof(BBCodes.List), true);
this.parser.ElementTypes.Add("lurk", typeof(BBCodes.Lurk), true);
this.parser.ElementTypes.Add("*", typeof(BBCodes.ListElem), false);
this.parser.ElementTypes.Add("poll", typeof(BBCodes.Poll), true);
this.parser.ElementTypes.Add("quote", typeof(BBCodes.Quote), true);this.parser.ElementTypes.Add("q", typeof(BBCodes.Quote), true);
@ -107,6 +109,8 @@ namespace FLocal.Common {
this.parser.ElementTypes.Add("uploadlink", typeof(BBCodes.UploadLink), true);
this.parser.ElementTypes.Add("url", typeof(BBCodes.Url), true);
this.parser.ElementTypes.Add("user", typeof(BBCodes.User), false);
this.parser.ElementTypes.Add("wiki", typeof(BBCodes.Wiki), true);
this.parser.ElementTypes.Add("ruwiki", typeof(BBCodes.RuWiki), true);
this.formatter = TextFormatter.instance;
}

Loading…
Cancel
Save