Jul
29
Mozilla just released Firefox j 4 Beta 2 with a cool set of features and I want to test it. I installed the first beta manually in my desktop pc running Fedora 13, but I was wondering if there is a better way. Fortunately, there is one: you can install Firefox 4 Beta 2 using Remi’s repo, here is how:
First you need to configure the repo, so you need to run the following snippet as root
rpm -Uvh http://rpms.famillecollet.com/remi-release-13.rpm
Then you can install the beta release of firefox using:
yum --enablerepo=remi install firefox4
You may need to anser ‘Yes’ to the question about if you want to import the GPG key for the repo. And… that’s all. now you can see for yourself what Firefox 4 Beta 2 can do.
Finally, this is not an update of the firefox package you probably already have installed, it only adds another entry to your Applications menu allowing you to run the new versión of Firefox.
You can see more information in Remi’s post and Remi’s repo configuration page.
No Comments »
Posted in Linux, Tip
Jul
28
It’s known that hidden elements doesn’t take space in the document unless they are not really hidden but invisible, using visibility:hidden.
Sometimes you need to know something about a hidden element before you actually show it, let’s say the height property of a DIV element. You can easily get that property value making the element displayable but invisible, that way the element would take space in the document and you can get the height or any other property value that isn’t available while the element is hidden.
The following code is a small jQuery plugin that takes a function as argument. The plugin clones a jQuery element, make it displayable but invisible, then inserts the clone right after the original element, executes the function on the context of the cloned element and returns the function result. The clone is removed from the DOM after the passed function returns.
$.fn.sandbox = function(fn) {
var element = $(this).clone(), result;
element.css({visibility: 'hidden', display: 'block', position: 'absolute'}).insertAfter(this);
result = fn.apply(element);
element.remove();
return result;
};
To solve the problem of the height property I explained above you could use the following code:
var height = $('#i-am-hidden').sandbox(function(){ return this.height(); });
1 Comment »
Posted in JavaScript, Tip
Jul
17
jQuery TimePicker is a plugin to help users easily input time entries. It works by allowing the user to type times in a free format or selecting them from a dropdown menu.
The plugin will automatically convert all time entries to a format that can be changed passing the timeFormat option; the default value is hh:mm p which will give something like ’02:16 PM’. The following are a few examples of the supported “formats”:
- 1234 will be converted to 12:34 AM
- 1234 p will be converted to 12:34 PM
- 456 will be converted to 04:56 AM
- 1656 will be converted to 04:56 PM
- 1:1 P will be converted to 01:10 PM
- 1:9 A will be converted to 01:09 AM
- 8:59 will be converted to 08:59 PM
- 1:20:30 will be converted to 01:20:30 PM
- 46 will be converted to 05:00 AM (4 hours plus 60 minutes)
There are other supported formats, all inspired by the behavior of a similar timepicker used in Google Calendar. To see more, check the demo.
How to Use
To use jQuery TimePicker you’ll need to include two files: jquery.timepicker.js and jquery.timepicker.css. Then you can use the following code to initialize the plugin:
$(document).ready(function(){
$('input.timepicker').timepicker({});
});
Options
- timeFormat: this is the format of time string displayed in the input field and the menu items in the combobox. Available modifiers are: h, hh, H, HH, m, mm, s, ss, p.
- minTime: a Date object. Only the time parts (getHours, getMinutes) of the object are important. Time entries before minTime won’t be displayed/allowed.
- minHour: int. Ignored if minTime is set.
- minMinutes: int. Ignored if minTime is set.
- maxTime: a Date object. Time entries after maxTime won’t be displayed.
- maxHour: int. Ignored if maxTime is set.
- maxMinutes: int. Ignored if maxTime is set.
- starTime: a Date object. The time of the first item in the combobox when the input field is empty. If the input field is not empty the first item will be the next allowed time entry.
- startHour: int. Ignored if startTime is set.
- startMinutes: int. Ignored if startTime is set.
- interval: int. Time separation in minutes between each time entry.
- change: a callback called when the value of the input field changes. A Date object with the selected time is passed to the callback.
Bugs
The Plugin has been tested in Firefox 3.6, Google Chrome, Safari (Windows) and IE 7.
Bugs reports, comments and new features suggestions are welcome at GitHub, in the comments sections of this post or through the contact page of this blog.
Download
Latest version of jQuery TimePicker can be downloaded from GitHub.
1 Comment »
Posted in JavaScript
Jun
24
Let’s say you want to filter messages sent to foo@example.com and bar@example.com and apply the ‘MyCompany’ label to those messages. You may think that typing the following in the ‘To’ field of the filter will work:
foo@example.com, bar@example.com
but it doesn’t. It doesn’t work with ; either.
In order to add multiple addresses to the filter you have to separate them with a | or wrap them in parentheses and use OR as the separator. The following are working examples:
foo@example.com | bar@example.com
(foo@example.com OR bar@example.com)
The same can be applied when searching email.
No Comments »
Posted in Tip
May
28
No hace mucho fue liberado fedora 13. A pesar de tener varios asuntos pendientes con la Universidad decidí sacar un rato e instalar la nueva versión de mi distribución favorita en mi computador de escritorio.
¿Qué me motivó?
He usado fedora desde hace cuatro años y en cada versión reafirmo mi decisión de mantenerme con esta distribución. No tiene que haber un motivo especial, es simplemente the right thing to do
. Sin embargo, esta vez había un motivo especial, quería ver lo que fedora 13 tiene para ofrecer en soporte para iPhone y iPod Touch. Dejando de lado algunas aplicaciones que debo usar ocasiaonalmente para cumplir con mis deberes académicos, iTunes es lo unico que me obliga a tener una partición con Windows en mi computador, asi qué, entenderán que estoy ansioso por encontrar alternativas en el mundo Linux.
Fedora 13 trae, como es usual, varios cambios pero hoy solo quiero revisar lo que puedo hacer con mi iPod Touch y Rhythmbox. Veamos…
2 Comments »
Posted in Linux