Permalink
Browse files

Add comments

svn path=/trunk/lb/; revision=77014
  • Loading branch information...
1 parent f7c97c6 commit b6d92bf26b7408193fc3d0b006f8c98aaf443575 @migueldeicaza migueldeicaza committed May 9, 2007
Showing with 56 additions and 6 deletions.
  1. +1 −1 comments
  2. +1 −0 config.cs
  3. +1 −0 config.xml
  4. +2 −1 entry
  5. +5 −1 lb.cs
  6. +10 −1 log-style.css
  7. +36 −2 template
View
@@ -1 +1 @@
-<p align="right">[<a href="http://groups-beta.google.com/group/tiraniaorg-blog-comments/post?subject=@ENTRY_CAPTION_ENC@ on @ENTRY_DATECAPTION@">Post Comment</a>] | [<a href="http://groups-beta.google.com/group/tiraniaorg-blog-comments/search?group=tiraniaorg-blog-comments&amp;q=@ENTRY_CAPTION_ENC@ on @ENTRY_DATECAPTION@&amp;qt_g=Search+this+group">Comments</a>]</p>
+<p align="right">[<a href="http://groups-beta.google.com/group/tiraniaorg-blog-comments/post?subject=@ENTRY_CAPTION_ENC@ on @ENTRY_DATECAPTION@">Post Comment</a>] | [<a href="http://groups-beta.google.com/group/tiraniaorg-blog-comments/topics">Comments</a>]</p>
View
@@ -21,6 +21,7 @@ public class Config {
[XmlAttribute] public string BlogTemplate;
[XmlAttribute] public string EntryTemplate;
[XmlAttribute] public string CommentsStub;
+ [XmlAttribute] public string EntrySpecific;
public bool Parse (string[] args)
{
View
@@ -14,4 +14,5 @@ InputEncoding="utf-8"
OutputEncoding="utf-8"
AnalyticsStub="analytics"
CommentsStub="comments"
+EntrySpecific="&lt;p&gt;Current Group Comments:&lt;div id='rssLayer'&gt;&lt;/div&gt;"
/>
View
3 entry
@@ -6,11 +6,12 @@
<h1><a href="@BASEDIR@@ENTRY_PERMALINK@" class="entryTitle">@ENTRY_CAPTION@</a></h1>
@ENTRY_BODY@
@COMMENTS@
-</div>
<div class='footer'>Posted by @COPYRIGHT@ on <a href="@ENTRY_URL_PERMALINK@">@ENTRY_DATECAPTION@</a>
<!--|
<a href="http://www.digg.com/submit?phase=2&url=@ENTRY_URL_PERMALINK@">Digg It</a> |
<a href="http://reddit.com/submit?url=@ENTRY_URL_PERMALINK@">Reddit</a>-->
+@ENTRY_SPECIFIC@
+</div>
</div><p>
View
6 lb.cs
@@ -384,9 +384,11 @@ void Render (TextWriter o, IList entries, int idx, string blog_base, bool includ
if (include_daily_anchor || d.Date < LastDate)
entry_anchor = String.Format ("<a name=\"{0}\"></a>", anchor);
+ string entry_specific = "";
string navigation = "";
if (include_navigation){
navigation = GetEntryNavigation (entries, idx, blog_base);
+ entry_specific = config.EntrySpecific;
}
string category_paths = GetCategoryPaths (d, blog_base);
@@ -409,6 +411,8 @@ void Render (TextWriter o, IList entries, int idx, string blog_base, bool includ
substitutions.Add ("@ENTRY_CATEGORY_PATHS@", category_paths);
substitutions.Add ("@BLOGWEBDIR@", config.BlogWebDirectory);
substitutions.Add ("@ENTRY_URL_PERMALINK@", Path.Combine (config.BlogWebDirectory, d.PermaLink));
+ substitutions.Add ("@ENTRY_SPECIFIC@", entry_specific);
+
if (d.Comments){
StringWriter rendered_comment = new StringWriter (new StringBuilder (comments.Length));
Translate (comments, rendered_comment, substitutions);
@@ -578,7 +582,7 @@ void RenderArticleList (TextWriter o)
substitutions.Add ("@RSSFILENAME@", config.RSSFileName);
substitutions.Add ("@EDITOR@", config.ManagingEditor);
substitutions.Add ("@BLOGWEBDIR@", config.BlogWebDirectory);
-
+
Translate (template, w, substitutions);
w.Flush ();
View
@@ -113,11 +113,20 @@ img {
}
.shell {
- border-style: solid; background: #000000; color: #eeeeee; #777777;
+ border-style: solid; background: #000000; color: #eeeeee;
border-width: 1px; padding: 2pt;
margin:15px;
}
.separator {
border-bottom: 1px dotted #aaaaaa; padding-top: 1em; padding-bottom: 1em;
+}
+
+.comment {
+ margin-left: 50pt;
+ margin-bottom: 10pt;
+ padding: 10pt;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #bccceb;
}
View
@@ -4,12 +4,42 @@
<link rel='stylesheet' href='@BASEDIR@log-style.css' type='text/css' />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://tirania.org/blog/miguel.rss2" />
<script src='@BASEDIR@prettyprint.js' type='text/javascript'></script>
- <script type="text/javascript" src="http://www.haloscan.com/load/migueldeicaza"> </script>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ <script type="text/javascript">
+function getFeed(feed)
+{
+ var newScript = document.createElement('script');
+ newScript.type = 'text/javascript';
+ newScript.src =
+ 'http://pipes.yahoo.com/pipes/9oyONQzA2xGOkM4FqGIyXQ/run?&_render=json&_callback=piper&feed='+feed;
+ document.getElementsByTagName("head")[0].appendChild(newScript);
+}
+function piper(feed)
+{
+ var tmp='';
+ for (var i=0; i<feed.value.items.length; i++) {
+ tmp+='<div class="comment">';
+ tmp+='<a href="'+feed.value.items[i].link+'">';
+ tmp+=feed.value.items[i].title+'</a><br>';
+ if (feed.value.items[i].description) {
+ tmp+='<blockquote>' + feed.value.items[i].description + '</blockquote>';
+ }
+ tmp+='</div>';
+ }
+ document.getElementById('rssLayer').innerHTML=tmp;
+}
+
+function startup()
+{
+ paintColors ();
+ if (document.getElementById('rssLayer'))
+ getFeed("http://groups.google.com/group/tiraniaorg-blog-comments/feed/rss_v2_0_msgs.xml");
+}
+ </script>
@ANALYTICS@
</head>
-<body onload='paintColors();'>
+<body onload='startup ();'>
<h1>@DESCRIPTION@</h1>
@@ -36,6 +66,9 @@
<a href="http://www.go-mono.com"><img src="http://www.go-mono.com/images/mono-contributor-static.gif" alt="mono-contributor-static.gif" /></a>
</p>
+ <script type="text/javascript" src="http://www.google.com/reader/ui/publisher.js"></script>
+ <script type="text/javascript" src="http://www.google.com/reader/public/javascript/user/13685641577668204834/state/com.google/broadcast?n=10&callback=GRC_p(%7Bc%3A'blue'%2Ct%3A'Miguel%5C047s%20shared%20items'%2Cs%3A'true'%7D)%3Bnew%20GRC"></script>
+
<div class="separator">
</div>
@@ -52,6 +85,7 @@
<a href="http://www.commondreams.org">CommonDreams</a><br/>
<a href="http://www.jroller.com/page/fate">Bileblog</a><br/>
<a href="http://jwz.livejournal.com">Jamie Zawinski</a><br/>
+ <a href="http://planet.go-oo.org/">Planet OOo</a><br/>
<h2>Politics</h2>
<a href="http://tbogg.blogspot.com/">TBogg</a><br/>

0 comments on commit b6d92bf

Please sign in to comment.