Everything Frontend

Pure CSS Star Rating Input

This is a familiar view for most of web users:

And there are a lot jQuery plugins and plain JavaScript code that can help you create rating widget in your form. And the reason because it's all written in JavaScript is that when a need for such a rating system first arose CSS really lacked the ability to do stuff like this.

Continue reading →

Crossbrowser CSS3 Bubble With Shadow

Here's what we are going to be doing in this tutorial:

There are a lot of ways to do message bubbles, so here are some key points to my technique:

  • completely image free;
  • arrow has smooth edges and shadow;
  • no javascript;
  • graceful degradation in IE7-8;
  • always positioned on the center of the source element no matter how wide it is or how much text is in the bubble.
Continue reading →

Declarative Initialization of jQuery Plugins

jQuery plugins provide great functionality and are pretty easy to use — just add to the page a line like this $('.some-class').somePlugin() and you are good to go. While this works very well for small websites, it turns into real mess when you have a large complex website with dozens of plugins used across hundreds of views (as in MVC pattern).

Basically you either have to sacrifice page loading speed (inline scripts pause document parsing) and html code beauty by inserting plugin initialization inline after the necessary DOM element or loose logical connection between a DOM element and the plugin by moving all initialization code to a separate js file.

Continue reading →

Solving “unsupported locale setting” message from Bazaar on Mac OS X

Adding following lines:

export LANG='en_US.UTF-8'
export LC_COLLATE='en_US.UTF-8'

to ~/.bash_profile seems to solve the problem (you will need to relaunch Terminal app or source the file). en_US can be replaced with your own locale, like ru_RU, just make sure it exists on Mac.

If you still get the error try unchecking "Set locale environment variables on startup" in Terminal.app

Preferences > Settings > Advanced > Set locale environment variables on startup

This worked for me on OS X Lion with Bazaar installed from homebrew.