Программирование на Objective-C под iPhone ” ); $(id).down(’ul’).setStyle(’float:right;’); $(id).removeClassName(’rep_bar_expanded’); $(id).removeClassName(’rep_bar_shrink’); new Effect.Morph( $(id), { style: ‘rep_bar_expanded’, duration: 0.4, afterFinish: function() { new Effect.Appear( popup, {duration:0.4} ); } } ); /* Class */ if ( type == 1 ) { $(’rep_msg’).addClassName(’ah30rep_positive’); } else if ( type == -1 ) { $(’rep_msg’).addClassName(’ah30rep_negative’); } $(’reputationMsgBox’).writeAttribute(’id’, id + ‘_box’ ); $(’cancelRep’).writeAttribute(’id’, id + ‘_cancel’ ); $(’sendRep’).writeAttribute(’id’, id + ‘_send’ ); $(’rep_msg’).writeAttribute(’id’, id + ‘_msg’ ); $( id + ‘_cancel’ ).observe( ‘click’, ah30CancelRep.bindAsEventListener(0, type, id) ); $( id + ‘_send’ ).observe( ‘click’, ah30SendRep.bindAsEventListener(0, type, id) ); } function ah30CancelRep( event ) { Event.stop(event); type= ( arguments )[1]; id= ( arguments )[2]; ah30ShrinkBar( id ); } function ah30SendRep( event ) { Event.stop(event); type= ( arguments )[1]; id= ( arguments )[2]; value= ( type == 1 ) ? 1 : -1; if( ! ipb.global.reputation[ id ] ) { return; } else { var rep = ipb.global.reputation[ id ]; } ah30ShrinkBar(id,false); // Send ping new Ajax.Request( rep.sendUrl + ‘&rating=’ + value + ‘&rep_msg=’ + $(id + ‘_msg’).getValue().encodeParam(), { method: ‘get’, onSuccess: function( t ) { if( t.responseText == ‘done’ ) { try { // It worked! Hide the rep buttons rep.obj.down(’.rep_up’).hide(); rep.obj.down(’.rep_down’).hide(); } catch(err) { } // Update the figure var rep_display = rep.obj.down(’.rep_show’); if( rep_display ) { ['positive', 'negative', 'zero'].each(function(c){ rep_display.removeClassName(c) }); var newValue = rep.currentRating + value; if( newValue > 0 ) { rep_display.addClassName(’positive’); } else if( newValue
Вы должны быть зарегистрироавны чтобы оставить комментарий.