October 13th, 2006
I’ve got sick of moderating spam comments in my blog, so I’ve installed Math Comment Spam Protection Plugin. Hope not to receive those “Please moderate” emails anymore.
This plugin is easy to install - it took 3 minutes to download the zip-archive, unzip it, activate plugin in admin panel and to add some piece of code in the comments.php of my theme.
Posted in Tips, Blogosphere, Wordpress | 13 Comments »
October 12th, 2006
Yesterday I installed Mozilla 2 RC2 on my pc and I have to say I’m rather contented with it. They have implemented such things as saving tabs on exit, spell checking, suggestions in search bar, better support for reading RSS feeds. But what makes Firefox really convenient is a huge amount of add-ons which extend the browser functionality and are easy to install and configure.
Here is a short list of extensions I recommend to try:
- Mouse gestures
Allows you to execute common commands (like page forward/backward, close tab, new tab) by mouse gestures drawn over the current webpage, without reaching for the toolbar or the keyboard.
You can also use click-only “rocker” gestures which are even faster than drawn gestures.
- Copy Link Text and Location
CoLT adds two menu items to the browser’s context menu, both of which are only visible when right-clicking a hyperlink. The “Copy Link Text” menu item copies a hyperlink’s associated text to the clipboard, while the “Copy Link Text and Location” menu item copies both the hyperlink’s text and URL to the clipboard in the format you choose: either as plain text, as an HTML hyperlink, or as a custom format (which you may specify). A very handy tool for blogs!
- Linkification
Converts text links into genuine, clickable links.
- SmoothWheel
Scrolls the document smoothly when scrolling the mouse wheel.
Basically an enhanced and configurable version of the built in smooth-scroll. Uses some unique algorithms for smoothness and adaptive behaviour (scrolls fast or slow according to the “intention” of the user). Allows to read long web pages easily. You can actually read WHILE scrolling. Kind of like the credits at the end of a movie, but controlled by scrolling the mouse wheel. Works with text-boxes and drop-down boxes too.
- Add Bookmark Here
Allows you to add bookmarks to any folder in the bookmarks menu.
- Web Developer
Adds a menu and a toolbar with various web developer tools. Useful not only for developers - easy control over images, scripts, cookies.
- Table2Clipboard
Mozilla applications allow to select rows and columns from a table simply pressing Control key and picking rows/columns with left mouse button.
The selection can be copied to clipboard but the original table disposition is lost making ugly results when you paste the text on datasheet applications (eg excel).
If you want to paste data in Microsoft Excel on OpenOffice Calc with correct disposition simply use Table2Clipboard.
I didn’t like any of extensions for RSS reading I’ve seen (Newsfox, Sage, Info RSS, Feedview, Habari Xenu) - I tried to find something similar to Opera’s feed-reader, which I like more than other. Probably it is better to use some web-based ones (Google Reader), I just haven’t got used to it yet.
I’ve used Opera for several years and I like it a lot, but when you spend nearly 70% of your computer time with your browser you want it to be really yours. I mean that the possibility of using Firefox as a platform for different tools you need while surfing the web is priceless.
Posted in Tips, Mozilla Firefox | No Comments »
September 26th, 2006
Needless to say, social bookmarking is one of the best ways to drive traffic to your website nowadays. The power of bookmarking services comes from simplicity of their use and easy accessibility. Some people speak about importance of social media optimization (there’s a nice post on it) and you have all grounds to believe them.
Since there is a variety of different bookmarking services it’s obvious that linking to only one or two of them is not enough. Go-social is a simple way to make your pages “social-friendly”.
Read more
Posted in Tips, Free scripts, web2.0, Javascript, Social bookmarking | 1 Comment »
September 7th, 2006
As web2.0 concepts had become extremely popular, it led to rise of new unofficial standards: it’s really hard nowadays to find a recent web application which is not ajax-powered. Perhaps it has become a stereotype but if you want your application to look good and to be a success you have to use ajax-like technologies. It is absolutely obvious that not everyone wants to get lost in thorough study of ajax basis when there’s a possibility to use ready-made libraries and frameworks that allow you to use the full power of ajax.
script.aculo.us is one of the most popular JavaScript libraries to do such kind of things. They use Prototype framework as a basis.
Your pages are supposed to require prototype.js-file to support ajax-based controls or widgets, but this file is rather big (~50KB) in comparison to the filesize of your page itself. It makes your users wait while this library is loaded every time they visit your page. Well, I don’t want to say that it’s irritating for surfers with poor connection, this is not the point. The worst thing about all of this is that people often use a steam-hammer to crack nuts, and what’s more - they use ajax-based elements in wrong ways!
Let’s say you have a blog. Do you really need to have ajax-based comments? Well, what is the advantage of ajax here? - you don’t have to reload the page. But it doesn’t matter if the page is reloaded after you submit a comment. After you submit a comment you usually leave the page! Don’t tell me that it reduces the traffic. It doesn’t reduce the traffic, because prototype.js has bigger size than your page, so it’s better to load the page twice than to load prototype.js with the first load. Certainly, it works if you want to submit several comments at one time, but it’s not rather common.
script.aculo.us provides you with easy-to-use, cross-browser user interface JavaScript libraries to make your web sites and web applications fly
I haven’t tried to use script.aculo.us in my projects yet (and I don’t really think I’m going to), so I can’t say if it’s easy-to-use (I think it is - it wouldn’t become so popular if it wasn’t), but as for cross-browser’ness - their scripts don’t work correctly in Opera 8.51 (they work in 9.00), and at last.. huh.. yes, your applications fly but you have to wait a little before they ascend.
So, what is bad about script.aculo.us? People who use it where it’s not needed.
If you need something really simple it is much better to do some custom work on it than to use heavy library (especially if you don’t use its full functionality). Here you can read more about proper use of JavaScript in your applications.
Posted in web2.0, Javascript, AJAX | 28 Comments »
September 4th, 2006
This trick is useful when you need to show some expanding lists or you want to have a possibility to change the content of the page without reloading it. I’ll show you the core principle and some common examples.
Click the link below to try the first example.
Show hidden text
This text can be hidden again if you click
here.
Here is the code for this example:
<script type="text/javascript">
function showBlock(blockId)
{
document.getElementById(blockId).style.display = "block";
}
function hideBlock(blockId)
{
document.getElementById(blockId).style.display = "none";
}
</script>
<a href="javascript:showBlock('block1')">Show hidden text</a>
<div id="block1" style="display: none">
This text can be hidden again if you click
<a href="javascript:hideBlock('block1')">here</a>.
</div>
Let’s improve this code: when hidden text is shown we don’t have to display the “show”-link. We can describe this link as another block and use the same functions:
This text can be hidden again if you click
here.
Modified code (the script remains the same):
<div id="block2">
<a href="javascript:showBlock('block3');
hideBlock('block2');">
Show hidden text</a>
</div>
<div id="block3" style="display: none">
This text can be hidden again if you click
<a href="javascript:hideBlock('block3');
showBlock('block2');"> here</a>.
</div>
If you need to display expanding list you can do it in this way:
<script type="text/javascript">
function expand(ID)
{
document.getElementById('item'+ID).style.display = 'block';
document.getElementById('expander'+ID).innerHTML =
'<a href="javascript:collapse('+ID+')" title="Collapse">[-]</a>';
}
function collapse(ID)
{
document.getElementById('item'+ID).style.display = 'none';
document.getElementById('expander'+ID).innerHTML =
'<a href="javascript:expand('+ID+')" title="Expand">[+]</a>';
}
</script>
<style>
.expander a {
font: normal 10px Courier;
text-decoration: none;
color: black;
}
</style>
<dir>
<li>
<div id="expander1" class="expander" style="display:inline">
<a href="javascript:expand(1)" title="Expand">[+]</a>
</div>
<div style="display:inline">Item 1</div>
<div id="item1" style="display:none">Content for item 1</div>
</li>
<li>
<div id="expander2" class="expander" style="display:inline">
<a href="javascript:expand(2)" title="Expand">[+]</a>
</div>
<div style="display:inline">Item 2</div>
<div id="item2" style="display:none">Content for item 2</div>
</li>
<li>
<div id="expander3" class="expander" style="display:inline">
<a href="javascript:expand(3)" title="Expand">[+]</a>
</div>
<div style="display:inline">Item 3</div>
<div id="item3" style="display:none">Content for item 3</div>
</li>
</dir>
And here’s the result:
Item 1
Content for item 1
Item 2
Content for item 2
Item 3
Content for item 3
Summing up
If you want to be able to change visibility of some elements at your page you have to wrap it into <div></div> and use unique id for this div, then you decide when you need to display your elements and use this code:
document.getElementById("YOUR_ELEMENT_ID").style.display = "block";
to show and this code:
document.getElementById("YOUR_ELEMENT_ID").style.display = "none";
to hide.
Posted in Tips, Free scripts, Javascript | 28 Comments »