1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-22 18:15:47 +02:00

Rewrite example tweet in TweetNotification to use a file resource

This commit is contained in:
chylex 2017-03-25 21:47:14 +01:00
parent e727617bf1
commit b943078132
2 changed files with 35 additions and 16 deletions
Core/Notification
Resources/Scripts/pages

View File

@ -1,5 +1,6 @@
using System;
using System.Text;
using TweetDck.Resources;
namespace TweetDck.Core.Notification{
sealed class TweetNotification{
@ -24,26 +25,19 @@ public static int FontSizeLevel{
}
}
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);
}
}

View File

@ -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>