Warning: Undefined array key "HTTP_REFERER" in /var/www/u1787038/data/www/novybusiness.ru/index.php on line 4
/*! extra 16-12-2015 11:46:06 */ /*! * jQuery Raty - A Star Rating Plugin * ------------------------------------------------------------------ * * jQuery Raty is a plugin that generates a customizable star rating. * * Licensed under The MIT License * * @version 2.5.2 * @since 2010.06.11 * @author Washington Botelho * @documentation wbotelhos.com/raty * * ------------------------------------------------------------------ * *
* * $('#star').raty(); * */ !function($){var methods={init:function(settings){return this.each(function(){methods.destroy.call(this),this.opt=$.extend(!0,{},$.fn.raty.defaults,settings);var that=$(this),inits=["number","readOnly","score","scoreName"];methods._callback.call(this,inits),this.opt.precision&&methods._adjustPrecision.call(this),this.opt.number=methods._between(this.opt.number,0,this.opt.numberMax),this.opt.path=this.opt.path||"",this.opt.path&&"/"!==this.opt.path.slice(this.opt.path.length-1,this.opt.path.length)&&(this.opt.path+="/"),this.stars=methods._createStars.call(this),this.score=methods._createScore.call(this),methods._apply.call(this,this.opt.score);var space=this.opt.space?4:0,width=this.opt.width||this.opt.number*this.opt.size+this.opt.number*space;this.opt.cancel&&(this.cancel=methods._createCancel.call(this),width+=this.opt.size+space),this.opt.readOnly?methods._lock.call(this):(that.css("cursor","pointer"),methods._binds.call(this)),this.opt.width!==!1&&that.css("width",width),methods._target.call(this,this.opt.score),that.data({settings:this.opt,raty:!0})})},_adjustPrecision:function(){this.opt.targetType="score",this.opt.half=!0},_apply:function(score){score&&score>0&&(score=methods._between(score,0,this.opt.number),this.score.val(score)),methods._fill.call(this,score),score&&methods._roundStars.call(this,score)},_between:function(value,min,max){return Math.min(Math.max(parseFloat(value),min),max)},_binds:function(){this.cancel&&methods._bindCancel.call(this),methods._bindClick.call(this),methods._bindOut.call(this),methods._bindOver.call(this)},_bindCancel:function(){methods._bindClickCancel.call(this),methods._bindOutCancel.call(this),methods._bindOverCancel.call(this)},_bindClick:function(){var self=this,that=$(self);self.stars.on("click.raty",function(evt){self.score.val(self.opt.half||self.opt.precision?that.data("score"):this.alt),self.opt.click&&self.opt.click.call(self,parseFloat(self.score.val()),evt)})},_bindClickCancel:function(){var self=this;self.cancel.on("click.raty",function(evt){self.score.removeAttr("value"),self.opt.click&&self.opt.click.call(self,null,evt)})},_bindOut:function(){var self=this;$(this).on("mouseleave.raty",function(evt){var score=parseFloat(self.score.val())||void 0;methods._apply.call(self,score),methods._target.call(self,score,evt),self.opt.mouseout&&self.opt.mouseout.call(self,score,evt)})},_bindOutCancel:function(){var self=this;self.cancel.on("mouseleave.raty",function(evt){$(this).attr("src",self.opt.path+self.opt.cancelOff),self.opt.mouseout&&self.opt.mouseout.call(self,self.score.val()||null,evt)})},_bindOverCancel:function(){var self=this;self.cancel.on("mouseover.raty",function(evt){$(this).attr("src",self.opt.path+self.opt.cancelOn),self.stars.attr("src",self.opt.path+self.opt.starOff),methods._target.call(self,null,evt),self.opt.mouseover&&self.opt.mouseover.call(self,null)})},_bindOver:function(){var self=this,that=$(self),action=self.opt.half?"mousemove.raty":"mouseover.raty";self.stars.on(action,function(evt){var score=parseInt(this.alt,10);if(self.opt.half){var position=parseFloat((evt.pageX-$(this).offset().left)/$(this).outerWidth()),plus=position>.5?1:.5;score=score-1+plus,methods._fill.call(self,score),self.opt.precision&&(score=score-plus+position),methods._roundStars.call(self,score),that.data("score",score)}else methods._fill.call(self,score);methods._target.call(self,score,evt),self.opt.mouseover&&self.opt.mouseover.call(self,score,evt)})},_callback:function(options){for(i in options)"function"==typeof this.opt[options[i]]&&(this.opt[options[i]]=this.opt[options[i]].call(this))},_createCancel:function(){var that=$(this),icon=this.opt.path+this.opt.cancelOff,cancel=$("",{src:icon,alt:"x",title:this.opt.cancelHint,"class":"raty-cancel"});return"left"==this.opt.cancelPlace?that.prepend(" ").prepend(cancel):that.append(" ").append(cancel),cancel},_createScore:function(){return $("",{type:"hidden",name:this.opt.scoreName}).appendTo(this)},_createStars:function(){for(var that=$(this),i=1;i<=this.opt.number;i++){var title=methods._getHint.call(this,i),icon=this.opt.score&&this.opt.score>=i?"starOn":"starOff",_class="rating-star rating-star-"+i;icon=this.opt.path+this.opt[icon],$("",{src:icon,alt:i,title:title,"class":_class}).appendTo(this),this.opt.space&&that.append(i=i;if(star.removeClass("star-half"),self.opt.iconRange&&self.opt.iconRange.length>hash){var irange=self.opt.iconRange[hash],on=irange.on||self.opt.starOn,off=irange.off||self.opt.starOff,icon=select?on:off,on_val=select?"on":"off";off_val=select?"off":"on",i<=irange.range&&(star.attr("src",self.opt.path+icon),star.addClass("star-"+on_val).removeClass("star-"+off_val)),i==irange.range&&hash++}else{var icon=select?"starOn":"starOff";on_val=select?"on":"off",off_val=select?"off":"on",star.attr("src",this.opt.path+this.opt[icon]),star.addClass("star-"+on_val).removeClass("star-"+off_val)}}},_getHint:function(score){var hint=this.opt.hints[score-1];return""===hint?"":hint||score},_lock:function(){var score=parseInt(this.score.val(),10),hint=score?methods._getHint.call(this,score):this.opt.noRatedMsg;$(this).data("readonly",!0).css("cursor","").attr("title",hint),this.score.attr("readonly","readonly"),this.stars.attr("title",hint),this.cancel&&this.cancel.hide()},_roundStars:function(score){var rest=(score-Math.floor(score)).toFixed(2);if(this.stars.eq(Math.ceil(score)-1).removeClass("star-half"),rest>this.opt.round.down){var icon="starOn";this.opt.halfShow&&rest1?score:score[0]},readOnly:function(readonly){return this.each(function(){var that=$(this);that.data("readonly")!==readonly&&(readonly?(that.off(".raty").children("img").off(".raty"),methods._lock.call(this)):(methods._binds.call(this),methods._unlock.call(this)),that.data("readonly",readonly))})},reload:function(){return methods.set.call(this,{})},score:function(){return arguments.length?methods.setScore.apply(this,arguments):methods.getScore.call(this)},set:function(settings){return this.each(function(){var that=$(this),actual=that.data("settings"),news=$.extend({},actual,settings);that.raty(news)})},setScore:function(score){return $(this).each(function(){$(this).data("readonly")!==!0&&(methods._apply.call(this,score),methods._target.call(this,score))})}};$.fn.raty=function(method){return methods[method]?methods[method].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof method&&method?void $.error("Method "+method+" does not exist!"):methods.init.apply(this,arguments)},$.fn.raty.defaults={cancel:!1,cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:"",precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,size:16,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",target:void 0,targetFormat:"{score}",targetKeep:!1,targetText:"",targetType:"hint",width:void 0}}(jQuery);