/* * arranque de funciones que usan jQuery * * dejarlas en jquery/stubs * * //TODO: añadir soporte para stubs especificos de proyecto? * */ jQuery.noConflict(); jQuery(document).ready( function($){ // Do jQuery stuff using $ /* * Crossfade * * */ // Not only when the DOM is ready, but when the images have finished loading, // important, but subtle difference to $(document).ready(); $(window).bind('load', function () { // run the cross fade plugin against selector $('img.fade').crossfade({delay:500}); }); /* * Edición inline * * El contenedor del texto a editar debe tener la clase jeditable, * más otra clase que indique qué controlador utilizar. * * Aquí habrá que crear una entrada para cada controlador que se quiera usar. * */ $('.jeditable.translation').editable( '/translations/update/', { id : 'data[id]', name : 'data[text]', type : 'text', cancel : 'Cancel', submit : 'Save', tooltip : 'Click to edit', onblur : 'submit', callback : function(value, settings) { if('' != value) $(this).removeClass('empty'); else $(this).addClass('empty'); } } ); /* * arranque de Lightbox */ $('a.lightbox').lightBox( { imageLoading: '/img/lightbox/loading.gif', imageBtnClose: '/img/lightbox/close.gif', imageBtnPrev: '/img/lightbox/prev.gif', imageBtnNext: '/img/lightbox/next.gif', containerResizeSpeed: 350, txtImage: '', txtOf: '/' } ); /* * arranque de funciones que usan jQuery * */ /* //preload $("a.rollover img").each(function() { rollsrc = $(this).attr("src"); rollON = rollsrc.replace(/.jpg$/ig,"_ovr.png"); $("").attr("src", rollON); }); */ $(function(){ // set up rollover $("a.rollover img").hover( function() { this.src = this.src.replace("_out","_ovr"); }, function() { this.src = this.src.replace("_ovr","_out"); } ); }); } );