Noobkit, documentação Ruby On Rails
O Noobkit centraliza e organiza toda documentação Ruby, RoR e de alguns Gems de uma maneira bem fácil de se usar. Ele ainda conta com recursos como bookmarks e comentários. Vale a pena dar uma olhada.
O Noobkit centraliza e organiza toda documentação Ruby, RoR e de alguns Gems de uma maneira bem fácil de se usar. Ele ainda conta com recursos como bookmarks e comentários. Vale a pena dar uma olhada.
Escrevi um código utilizando algumas features do mootools para dar sugestões de preenchimento nos campos do tipo textbox.
var Sugestions = {
init: function(id, options)
{
var sel = document.createElement(’select’);
var coo = $(id).getCoordinates();
sel.id = id + ‘_sel’;
sel.size = 6;
sel.style.position = ‘absolute’;
sel.style.zIndex = 1000;
sel.style.top = (coo.top + coo.height - 1) + ‘px’;
sel.style.left = coo.left + ‘px’;
sel.style.display = ‘none’;
sel.style.width = coo.width + ‘px’;
document.body.appendChild(sel);
for ( var i = 0; i < options.length; i++ )
{
sel.options[i] = new Option(options[i]);
}
$(id).onfocus = function() { $(id + ‘_sel’).style.display = ‘block’; }
$(id).onblur = function() { $(id + ‘_sel’).style.display = ‘none’; }
$(id + ‘_sel’).onfocus = function() { this.style.display = ‘block’; }
$(id + ‘_sel’).onblur = function() { this.style.display = ‘none’; }
$(id + ‘_sel’).onchange = function()
{
this.style.display = ‘none’;
$(id).value = this.options[this.selectedIndex].value;
}
}
}
E para utilizar o plugin
Sugestions.init(’forma_pagamento’,[’Depósito bancário’, ‘Em mãos’, ‘Boleto bancário’])
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Aug | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||