diff --git a/Core/Notification/TweetNotification.cs b/Core/Notification/TweetNotification.cs
index b1d93eb8..868aa41e 100644
--- a/Core/Notification/TweetNotification.cs
+++ b/Core/Notification/TweetNotification.cs
@@ -1,5 +1,6 @@
using System;
using System.Text;
+using TweetDck.Resources;
namespace TweetDck.Core.Notification{
sealed class TweetNotification{
@@ -24,26 +25,19 @@ namespace TweetDck.Core.Notification{
}
}
+ private static string ExampleTweetHTML;
+
public static TweetNotification ExampleTweet{
get{
- StringBuilder build = new StringBuilder();
- build.Append(@"<article><div class='js-stream-item-content item-box js-show-detail'><div class='js-tweet tweet'>");
- build.Append(@"<header class='tweet-header'>");
- build.Append(@"<time class='tweet-timestamp js-timestamp pull-right txt-mute'><a target='_blank' rel='url' href='https://twitter.com/chylexmc' class='txt-small'>0s</a></time>");
- build.Append(@"<a target='_blank' rel='user' href='https://twitter.com/chylexmc' class='account-link link-complex block'>");
- build.Append(@"<div class='obj-left item-img tweet-img'><img width='48' height='48' alt='chylexmc's avatar' src='https://pbs.twimg.com/profile_images/765161905312980992/AhDP9iY-_normal.jpg' class='tweet-avatar avatar pull-right'></div>");
- build.Append(@"<div class='nbfc'><span class='account-inline txt-ellipsis'><b class='fullname link-complex-target'>chylex</b> <span class='username txt-mute'>@chylexmc</span></span></div>");
- build.Append(@"</a>");
- build.Append(@"</header>");
- build.Append(@"<div class='tweet-body'><p class='js-tweet-text tweet-text with-linebreaks'>This is an example tweet, which lets you test the location and duration of popup notifications.</p></div>");
-
- #if DEBUG
- build.Append(@"<div style='margin-top:64px'>Scrollbar test padding...</div>");
- #endif
+ if (ExampleTweetHTML == null){
+ ExampleTweetHTML = ScriptLoader.LoadResource("pages/example.html", true);
- build.Append(@"</div></div></article>");
+ #if DEBUG
+ ExampleTweetHTML = ExampleTweetHTML.Replace("</p>", @"</p><div style='margin-top:64px'>Scrollbar test padding...</div>");
+ #endif
+ }
- return new TweetNotification(build.ToString(), "", 95, true);
+ return new TweetNotification(ExampleTweetHTML, "", 95, true);
}
}
diff --git a/Resources/Scripts/pages/example.html b/Resources/Scripts/pages/example.html
new file mode 100644
index 00000000..a455457f
--- /dev/null
+++ b/Resources/Scripts/pages/example.html
@@ -0,0 +1,25 @@
+<article>
+ <div class="js-stream-item-content item-box js-show-detail">
+ <div class="js-tweet tweet">
+ <header class="tweet-header">
+ <time class="tweet-timestamp js-timestamp pull-right txt-mute">
+ <a target="_blank" rel="url" href="https://twitter.com/chylexmc" class="txt-small">0s</a>
+ </time>
+ <a target="_blank" rel="user" href="https://twitter.com/chylexmc" class="account-link link-complex block">
+ <div class="obj-left item-img tweet-img">
+ <img width="48" height="48" alt="chylexmc's avatar" src="https://pbs.twimg.com/profile_images/765161905312980992/AhDP9iY-_normal.jpg" class="tweet-avatar avatar pull-right">
+ </div>
+ <div class="nbfc">
+ <span class="account-inline txt-ellipsis">
+ <b class="fullname link-complex-target">chylex</b>
+ <span class="username txt-mute">@chylexmc</span>
+ </span>
+ </div>
+ </a>
+ </header>
+ <div class="tweet-body">
+ <p class="js-tweet-text tweet-text with-linebreaks">This is an example tweet, which lets you test the location and duration of popup notifications.</p>
+ </div>
+ </div>
+ </div>
+</article>