PageSourceSearch

https://www.fahnenversand.de/gws/sealncert/external-widget/raty.js

js fahnenversand.de collected 2026-10-02 13:14:41 UTC 10,895 bytes, 11 lines download raw bytes

1/*!
2 * jQuery Raty - A Star Rating Plugin
3 *
4 * The MIT License
5 *
6 * @author  : Washington Botelho
7 * @doc     : http://wbotelhos.com/raty
8 * @version : 2.7.0
9 *
10 */
11;(function(b){var a={init:function(c){return this.each(function(){this.self=b(this);a.destroy.call(this.self);this.opt=b.extend(true,{},b.fn.raty.defaults,c);a._adjustCallback.call(this);a._adjustNumber.call(this);a._adjustHints.call(this);this.opt.score=a._adjustedScore.call(this,this.opt.score);if(this.opt.starType!=="img"){a._adjustStarType.call(this)}a._adjustPath.call(this);a._createStars.call(this);if(this.opt.cancel){a._createCancel.call(this)}if(this.opt.precision){a._adjustPrecision.call(this)}a._createScore.call(this);a._apply.call(this,this.opt.score);a._setTitle.call(this,this.opt.score);a._target.call(this,this.opt.score);if(this.opt.readOnly){a._lock.call(this)}else{this.style.cursor="pointer";a._binds.call(this)}})},_adjustCallback:function(){var c=["number","readOnly","score","scoreName","target"];for(var d=0;d<c.length;d++){if(typeof this.opt[c[d]]==="function"){this.opt[c[d]]=this.opt[c[d]].call(this)}}},_adjustedScore:function(c){if(!c){return c}return a._between(c,0,this.opt.number)},_adjustHints:function(){if(!this.opt.hints){this.opt.hints=[]}if(!this.opt.halfShow&&!this.opt.half){return}var c=this.opt.precision?10:2;for(var e=0;e<this.opt.number;e++){var g=this.opt.hints[e];if(Object.prototype.toString.call(g)!=="[object Array]"){g=[g]}this.opt.hints[e]=[];for(var d=0;d<c;d++){var h=g[d],f=g[g.length-1];if(f===undefined){f=null}this.opt.hints[e][d]=h===undefined?f:h}}},_adjustNumber:function(){this.opt.number=a._between(this.opt.number,1,this.opt.numberMax)},_adjustPath:function(){this.opt.path=this.opt.path||"";if(this.opt.path&&this.opt.path.charAt(this.opt.path.length-1)!=="/"){this.opt.path+="/"}},_adjustPrecision:function(){this.opt.half=true},_adjustStarType:function(){var c=["cancelOff","cancelOn","starHalf","starOff","starOn"];this.opt.path="";for(var d=0;d<c.length;d++){this.opt[c[d]]=this.opt[c[d]].replace(".","-")}},_apply:function(c){a._fill.call(this,c);if(c){if(c>0){this.score.val(c)}a._roundStars.call(this,c)}},_between:function(e,d,c){return Math.min(Math.max(parseFloat(e),d),c)},_binds:function(){if(this.cancel){a._bindOverCancel.call(this);a._bindClickCancel.call(this);a._bindOutCancel.call(this)}a._bindOver.call(this);a._bindClick.call(this);a._bindOut.call(this)},_bindClick:function(){var c=this;c.stars.on("click.raty",function(d){var e=true,f=(c.opt.half||c.opt.precision)?c.self.data("score"):(this.alt||b(this).data("alt"));if(c.opt.click){e=c.opt.click.call(c,+f,d)}if(e||e===undefined){if(c.opt.half&&!c.opt.precision){f=a._roundHalfScore.call(c,f)}a._apply.call(c,f)}})},_bindClickCancel:function(){var c=this;c.cancel.on("click.raty",function(d){c.score.removeAttr("value");if(c.opt.click){c.opt.click.call(c,null,d)}})},_bindOut:function(){var c=this;c.self.on("mouseleave.raty",function(d){var e=+c.score.val()||undefined;a._apply.call(c,e);a._target.call(c,e,d);a._resetTitle.call(c);if(c.opt.mouseout){c.opt.mouseout.call(c,e,d)}})},_bindOutCancel:function(){var c=this;c.cancel.on("mouseleave.raty",function(d){var e=c.opt.cancelOff;if(c.opt.starType!=="img"){e=c.opt.cancelClass+" "+e}a._setIcon.call(c,this,e);if(c.opt.mouseout){var f=+c.score.val()||undefined;c.opt.mouseout.call(c,f,d)}})},_bindOver:function(){var c=this,d=c.opt.half?"mousemove.raty":"mouseover.raty";c.stars.on(d,function(e){var f=a._getScoreByPosition.call(c,e,this);a._fill.call(c,f);if(c.opt.half){a._roundStars.call(c,f,e);a._setTitle.call(c,f,e);c.self.data("score",f)}a._target.call(c,f,e);if(c.opt.mouseover){c.opt.mouseover.call(c,f,e)}})},_bindOverCancel:function(){var c=this;c.cancel.on("mouseover.raty",function(d){var f=c.opt.path+c.opt.starOff,e=c.opt.cancelOn;if(c.opt.starType==="img"){c.stars.attr("src",f)}else{e=c.opt.cancelClass+" "+e;c.stars.attr("class",f)}a._setIcon.call(c,this,e);a._target.call(c,null,d);if(c.opt.mouseover){c.opt.mouseover.call(c,null)}})},_buildScoreField:function(){return b("<input />",{name:this.opt.scoreName,type:"hidden"}).appendTo(this)},_createCancel:function(){var c=this.opt.path+this.opt.cancelOff,d=b("<"+this.opt.starType+" />",{title:this.opt.cancelHint,"class":this.opt.cancelClass});if(this.opt.starType==="img"){d.attr({src:c,alt:"x"})}else{d.attr("data-alt","x").addClass(c)}if(this.opt.cancelPlace==="left"){this.self.prepend("&#160;").prepend(d)}else{this.self.append("&#160;").append(d)}this.cancel=d},_createScore:function(){var c=b(this.opt.targetScore);this.score=c.length?c:a._buildScoreField.call(this)},_createStars:function(){for(var e=1;e<=this.opt.number;e++){var d=a._nameForIndex.call(this,e),c={alt:e,src:this.opt.path+this.opt[d]};if(this.opt.starType!=="img"){c={"data-alt":e,"class":c.src}}c.title=a._getHint.call(this,e);b("<"+this.opt.starType+" />",c).appendTo(this);if(this.opt.space){this.self.append(e<this.opt.number?"&#160;":"")}}this.stars=this.self.children(this.opt.starType)},_error:function(c){b(this).text(c);b.error(c)},_fill:function(j){var g=0;for(var c=1;c<=this.stars.length;c++){var d,f=this.stars[c-1],e=a._turnOn.call(this,c,j);if(this.opt.iconRange&&this.opt.iconRange.length>g){var h=this.opt.iconRange[g];d=a._getRangeIcon.call(this,h,e);if(c<=h.range){a._setIcon.call(this,f,d)}if(c===h.range){g++}}else{d=this.opt[e?"starOn":"starOff"];a._setIcon.call(this,f,d)}}}
11,_getFirstDecimal:function(e){var d=e.toString().split(".")[1],c=0;if(d){c=parseInt(d.charAt(0),10);if(d.slice(1,5)==="9999"){c++}}return c},_getRangeIcon:function(d,c){return c?d.on||this.opt.starOn:d.off||this.opt.starOff},_getScoreByPosition:function(c,e){var g=parseInt(e.alt||e.getAttribute("data-alt"),10);if(this.opt.half){var d=a._getWidth.call(this),f=parseFloat((c.pageX-b(e).offset().left)/d);g=g-1+f}return g},_getHint:function(h,d){if(h!==0&&!h){return this.opt.noRatedMsg}var c=a._getFirstDecimal.call(this,h),e=Math.ceil(h),f=this.opt.hints[(e||1)-1],g=f,i=!d||this.move;if(this.opt.precision){if(i){c=c===0?9:c-1}g=f[c]}else{if(this.opt.halfShow||this.opt.half){c=i&&c===0?1:c>5?1:0;g=f[c]}}return g===""?"":g||h},_getWidth:function(){var c=this.stars[0].width||parseFloat(this.stars.eq(0).css("font-size"));if(!c){a._error.call(this,"Could not get the icon width!")}return c},_lock:function(){var c=a._getHint.call(this,this.score.val());this.style.cursor="";this.title=c;this.score.prop("readonly",true);this.stars.prop("title",c);if(this.cancel){this.cancel.hide()}this.self.data("readonly",true)},_nameForIndex:function(c){return this.opt.score&&this.opt.score>=c?"starOn":"starOff"},_resetTitle:function(d){for(var c=0;c<this.opt.number;c++){this.stars[c].title=a._getHint.call(this,c+1)}},_roundHalfScore:function(e){var d=parseInt(e,10),c=a._getFirstDecimal.call(this,e);if(c!==0){c=c>5?1:0.5}return d+c},_roundStars:function(h,d){var c=(h%1).toFixed(2),e;if(d||this.move){e=c>0.5?"starOn":"starHalf"}else{if(c>this.opt.round.down){e="starOn";if(this.opt.halfShow&&c<this.opt.round.up){e="starHalf"}else{if(c<this.opt.round.full){e="starOff"}}}}if(e){var f=this.opt[e],g=this.stars[Math.ceil(h)-1];a._setIcon.call(this,g,f)}},_setIcon:function(d,c){d[this.opt.starType==="img"?"src":"className"]=this.opt.path+c},_setTarget:function(c,d){if(d){d=this.opt.targetFormat.toString().replace("{score}",d)}if(c.is(":input")){c.val(d)}else{c.html(d)}},_setTitle:function(f,c){if(f){var d=parseInt(Math.ceil(f),10),e=this.stars[d-1];e.title=a._getHint.call(this,f,c)}},_target:function(g,d){if(this.opt.target){var f=b(this.opt.target);if(!f.length){a._error.call(this,"Target selector invalid or missing!")}var c=d&&d.type==="mouseover";if(g===undefined){g=this.opt.targetText}else{if(g===null){g=c?this.opt.cancelHint:this.opt.targetText}else{if(this.opt.targetType==="hint"){g=a._getHint.call(this,g,d)}else{if(this.opt.precision){g=parseFloat(g).toFixed(1)}}var e=d&&d.type==="mousemove";if(!c&&!e&&!this.opt.targetKeep){g=this.opt.targetText}}}a._setTarget.call(this,f,g)}},_turnOn:function(c,d){return this.opt.single?(c===d):(c<=d)},_unlock:function(){this.style.cursor="pointer";this.removeAttribute("title");this.score.removeAttr("readonly");this.self.data("readonly",false);for(var c=0;c<this.opt.number;c++){this.stars[c].title=a._getHint.call(this,c+1)}if(this.cancel){this.cancel.css("display","")}},cancel:function(c){return this.each(function(){var d=b(this);if(d.data("readonly")!==true){a[c?"click":"score"].call(d,null);this.score.removeAttr("value")}})},click:function(c){return this.each(function(){if(b(this).data("readonly")!==true){c=a._adjustedScore.call(this,c);a._apply.call(this,c);if(this.opt.click){this.opt.click.call(this,c,b.Event("click"))}a._target.call(this,c)}})},destroy:function(){return this.each(function(){var c=b(this),d=c.data("raw");if(d){c.off(".raty").empty().css({cursor:d.style.cursor}).removeData("readonly")}else{c.data("raw",c.clone()[0])}})},getScore:function(){var d=[],c;this.each(function(){c=this.score.val();d.push(c?+c:undefined)});return(d.length>1)?d:d[0]},move:function(c){return this.each(function(){var g=parseInt(c,10),e=a._getFirstDecimal.call(this,c);if(g>=this.opt.number){g=this.opt.number-1;e=10}var h=a._getWidth.call(this),f=h/10,j=b(this.stars[g]),i=j.offset().left+f*e,d=b.Event("mousemove",{pageX:i});this.move=true;j.trigger(d);this.move=false})},readOnly:function(c){return this.each(function(){var d=b(this);if(d.data("readonly")!==c){if(c){d.off(".raty").children("img").off(".raty");a._lock.call(this)}else{a._binds.call(this);a._unlock.call(this)}d.data("readonly",c)}})},reload:function(){return a.set.call(this,{})},score:function(){var c=b(this);return arguments.length?a.setScore.apply(c,arguments):a.getScore.call(c)},set:function(c){return this.each(function(){b(this).raty(b.extend({},this.opt,c))})},setScore:function(c){return this.each(function(){if(b(this).data("readonly")!==true){c=a._adjustedScore.call(this,c);a._apply.call(this,c);a._target.call(this,c)}})}};b.fn.raty=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1
11))}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments)}else{b.error("Method "+c+" does not exist!")}}};b.fn.raty.defaults={cancel:false,cancelClass:"raty-cancel",cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:undefined,half:false,halfShow:true,hints:["bad","poor","regular","good","gorgeous"],iconRange:undefined,mouseout:undefined,mouseover:undefined,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:undefined,precision:false,readOnly:false,round:{down:0.25,full:0.6,up:0.76},score:undefined,scoreName:"score",single:false,space:true,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:undefined,targetFormat:"{score}",targetKeep:false,targetScore:undefined,targetText:"",targetType:"hint"}})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.