Singpolyma

Peek-a-boo and Scrolling

Posted on

With some more inspiration from this man, and some help from this post I have created alternate versions of my peek-a-boo links lists and peek-a-boo HTML widgets. These ones, when expanded, are a 200-pixel-high box with a scrollbar. For those extra-long lists 😉

Link List (Click Title to Expand)
Note about installation : if you put this code into your template more than once at a time (for multiple lists) you must change the id=’ALIST’ (bold in the code) to id=’BLIST’ on the second list, etc. This code should go inside the section for your sidebar. Then, after saving, go to ‘Page Elements’ to customise its contents.

<b:widget id='ALIST' locked='false' title='List Title' type='LinkList'>
<b:includable id='main'>
<script type='text/javascript'>
//<![CDATA[
if(typeof(rnd) == 'undefined') var rnd = '';
rnd = Math.floor(Math.random()*1000);
rnd = 'id-' + rnd;
document.write('<a href="#" onclick="tmp = document.getElementById(&quot;' + rnd + '&quot;); tmp.style.display = (tmp.style.display == &quot;none&quot;) ? &quot;block&quot; : &quot;none&quot;; return false;">');
//]]>
</script>
<b:if cond='data:title'><h2><data:title/></h2></b:if>
<script type='text/javascript'>
//<![CDATA[
document.write('<\/a>');
//]]>
</script>
<div class='widget-content'>
<script type='text/javascript'>
//<![CDATA[
document.write('<div id="' + rnd + '" style="display:none;height:200px;overflow:auto;">');
//]]>
</script>
<ul>
<b:loop values='data:links' var='link'>
<li><a expr:href='data:link.target'><data:link.name;
</b:loop>
</ul>
<script type='text/javascript'>
//<![CDATA[
document.write('<\/div>');
//]]>
</script>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>

Link List (Click [+/-] to Expand)
Note about installation : if you put this code into your template more than once at a time (for multiple lists) you must change the id=’ALIST’ (bold in the code) to id=’BLIST’ on the second list, etc. This code should go inside the section for your sidebar. Then, after saving, go to ‘Page Elements’ to customise its contents.

<b:widget id='ALIST' locked='false' title='List Title' type='LinkList'>
<b:includable id='main'>
<script type='text/javascript'>
//<![CDATA[
if(typeof(rnd) == 'undefined') var rnd = '';
rnd = Math.floor(Math.random()*1000);
rnd = 'id-' + rnd;
document.write('<a href="#" onclick="tmp = document.getElementById(&quot;' + rnd + '&quot;); tmp.style.display = (tmp.style.display == &quot;none&quot;) ? &quot;block&quot; : &quot;none&quot;; return false;" style="float:left;margin-right:5px;">[+/-]<\/a>');
//]]>
</script>
<b:if cond='data:title'><h2><data:title/></h2></b:if>
<div class='widget-content'>
<script type='text/javascript'>
//<![CDATA[
document.write('<div id="' + rnd + '" style="display:none;overflow:auto;height:200px;">');
//]]>
</script>
<ul>
<b:loop values='data:links' var='link'>
<li><a expr:href='data:link.target'><data:link.name;
</b:loop>
</ul>
<script type='text/javascript'>
//<![CDATA[
document.write('<\/div>');
//]]>
</script>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>

HTML (Click Title to Expand)

HTML (Click [+/-] to Expand)

Singpolyma Templates for new Blogger

Posted on

Now having translated most of my hacks to the new Blogger, it is time to unveil the templates. I myself will likely be switching soon, and my template will be based on the code here published. The features are similar to the first set, but optomised for the new Blogger.

To install one of these templates, just cut-n-paste the code into the ‘Edit HTML’ section of your blog and save. Confirm deletion of widgets (Yes, unfortunately, you lose you widgets. You can make them again).

Templates

Update : Peek-a-boo Comments

Posted on

I have updated my Peek-a-boo Comments for new Blogger hack to include some bug fixes, the use of an external script (for performance and readability), and comment author links.

For New Blogger : Blogger del.icio.us categorising, pinging, and trackback helper

Posted on

JoongSeob Vito Kim has created a version of this script that works with the new blogger post editor.

I have made some minor bug fixes to this script, as well as made it so that it saves the trackback URLs when you save a draft. I took time to fix it, but now my website silverringthing.org.uk is back to normal.

Some time ago I married Johan’s del.icio.us and pinging script with my own trackback script into one new script. That script does not work on the new version of Blogger, and the trackback feature has been glitchy for some time. Outgoing trackback is still something we need on the new version of Blogger, and the pinging services provided by this script might even be useful on other blogging services. Del.icio.us posting? Now that we have labels? Well, Freshtags, my calendar widget, and just tag management in general, will work better if you use del.icio.us. If you disagree, this part of the script is optional.

This script does not overwrite the old script. Running both simultaneously will look dumb on the Blogger Classic interface (there will be duplication), but will not break anything. If you only run on the new Blogger, please remove the old script (if you have it installed).

Install the new script

Userscripts.org entry

Peek-a-boo HTML Widgets

Posted on

There was a minor styling error in this hack — I have fixed it now 🙂

This hack was inspired by a comment on my peek-a-boo link lists hack. It is a one-click install hack of a special HTML widget to your blog. Edit the template and content of the widget to be whatever you want (such as JavaScript includes for external blogrolls). The widget will appear either with just a title, or with ‘[+/-] TITLE’. Clicking the title (or [+/-], depending on the version you choose) will display all of the HTML/JavaScript contents.