How to Write Firefox Extensions
popup link
include on page with link
function js_pop_up(url, type, height, width)
{
var options="";
if (type=="console") options="resizable,height=" + height + ",width=" + width;
if (type=="fixed") options="status,height="+height+",width=" + width;
if (type=="elastic") options="toolbar,menubar,scrollbars,resizable,location,height=" + height + ",width=" + width;
window.open(url, 'new_win', options);
}
<a href="/../comment.php" onclick="js_pop_up(this.href,'console',400,200);return false;" target="new_win">This is my link</a>
blogger entry style toggle
JS Stripe Function
as Blogger tag cycles through posts, alternates style red/white
BEFORE Blogger tag (e.g. in <head> section):
<script type="text/javascript">
var a=0;
</script>
THEN ADD TO IDs and CLASSes
INSIDE Blogger tags
<Blogger> & </Blogger> - the main "container tags" for your blog content; most of the
following tags should be inside these to work properly :
<script type="text/javascript">
var style="red";
if (a%2 == 0) style="red";}
else {style="white";}
a++;
</script>
<script type="text/javascript"> document.write('<div id="' + s + '">'); </script>
<BlogDateHeader>
<script type="text/javascript"> document.write('<h2 class="' + s + 'date-header">'); </script>
<$BlogDateHeaderDate$></h2>
</BlogDateHeader>
<!-- POST -->
<script type="text/javascript"> document.write('<div class="' + s + 'post">'); </script>
<a name="<$BlogItemNumber$>"></a><BlogItemTitle>
<script type="text/javascript"> document.write('<h3 class="' + s + 'post-title">'); </script>
<BlogItemUrl><a href="/<$BlogItemUrl$>" title="external link"></BlogItemUrl><$BlogItemTitle$><BlogItemUrl>
</a></BlogItemUrl></h3></BlogItemTitle>
<script type="text/javascript"> document.write('<div class="' + s + 'post-body">'); </script>
<div><$BlogItemBody$></div></div>
<script type="text/javascript"> document.write('<p class="' + s + 'post-footer">'); </script>
<em>posted by <$BlogItemAuthorNickname$> at <a href="/<$BlogItemPermalinkUrl$>" title="permanent link"><$BlogItemDateTime$></a></em>
<MainOrArchivePage><BlogItemCommentsEnabled>
<a class="comment-link" href="/<$BlogItemPermalinkURL$>#comments"><$BlogItemCommentCount$> comments</a>
</BlogItemCommentsEnabled></MainOrArchivePage> <$BlogItemControl$></p></div>
<!-- END POST -->
$BlogItemBody$ - The content of a post.
blogger archive reverse-order script
<!-- replace default archive code with following -->
<ul class="archive-list">
<script type="text/javascript">
var archives = new Array();
<BloggerArchives>
archives[archives.length] = new Array('<$BlogArchiveURL$>', '<$BlogArchiveName$>');
</BloggerArchives>
for (var i=archives.length-1;i>=0;i--)
{
document.write('<li><a href="' + archives[i][0] + '">' + archives[i][1] + '</a></li>');
}
</script>
</ul>
<noscript><BloggerArchives>
<a href="/<$BlogArchiveURL$>"><$BlogArchiveName$></a><br />
</BloggerArchives></noscript>
References
Comments (0)
You don't have permission to comment on this page.