1/*!jQuery Knob*/ 2/** 3 * Downward compatible, touchable dial 4 * 5 * Version: 1.2.5 (23/01/2014) 6 * Requires: jQuery v1.7+ 7 * 8 * Copyright (c) 2012 Anthony Terrien 9 * Under MIT License (http://www.opensource.org/licenses/mit-license.php) 10 * 11 * Thanks to vor, eskimoblood, spiffistan, FabrizioC 12 */ 13(function($) { 14 15 /** 16 * Kontrol library 17 */ 18 "use strict"; 19 20 /** 21 * Definition of globals and core 22 */ 23 var k = {}, // kontrol 24 max = Math.max, 25 min = Math.min; 26 27 k.c = {}; 28 k.c.d = $(document); 29 k.c.t = function (e) { 30 return e.originalEvent.touches.length - 1; 31 }; 32 33 /** 34 * Kontrol Object 35 * 36 * Definition of an abstract UI control 37 * 38 * Each concrete component must call this one. 39 * <code> 40 * k.o.call(this); 41 * </code> 42 */ 43 k.o = function () { 44 var s = this; 45 46 this.o = null; // array of options 47 this.$ = null; // jQuery wrapped element 48 this.i = null; // mixed HTMLInputElement or array of HTMLInputElement 49 this.g = null; // deprecated 2D graphics context for 'pre-rendering' 50 this.v = null; // value ; mixed array or integer 51 this.cv = null; // change value ; not commited value 52 this.x = 0; // canvas x position 53 this.y = 0; // canvas y position 54 this.w = 0; // canvas width 55 this.h = 0; // canvas height 56 this.$c = null; // jQuery canvas element 57 this.c = null; // rendered canvas context 58 this.t = 0; // touches index 59 this.isInit = false; 60 this.fgColor = null; // main color 61 this.pColor = null; // previous color 62 this.dH = null; // draw hook 63 this.cH = null; // change hook 64 this.eH = null; // cancel hook 65 this.rH = null; // release hook 66 this.scale = 1; // scale factor 67 this.relative = false; 68 this.relativeWidth = false; 69 this.relativeHeight = false; 70 this.$div = null; // component div 71 72 this.run = function () { 73 var cf = function (e, conf) { 74 var k; 75 for (k in conf) { 76 s.o[k] = conf[k]; 77 } 78 s._carve().init(); 79 s._configure() 80 ._draw(); 81 }; 82 83 if(this.$.data('kontroled')) return; 84 this.$.data('kontroled', true); 85 86 this.extend(); 87 this.o = $.extend( 88 { 89 // Config 90 min : this.$.data('min') !== undefined ? this.$.data('min') : 0, 91 max : this.$.data('max') !== undefined ? this.$.data('max') : 100, 92 stopper : true, 93 readOnly : this.$.data('readonly') || (this.$.attr('readonly') === 'readonly'), 94 95 // UI 96 cursor : (this.$.data('cursor') === true && 30) || 97 this.$.data('cursor') || 0, 98 thickness : ( 99 this.$.data('thickness') && 100 Math.max(Math.min(this.$.data('thickness'), 1), 0.01) 101 ) || 0.35, 102 lineCap : this.$.data('linecap') || 'butt', 103 width : this.$.data('width') || 200, 104 height : this.$.data('height') || 200, 105 displayInput : this.$.data('displayinput') == null || this.$.data('displayinput'), 106 displayPrevious : this.$.data('displayprevious'), 107 fgColor : this.$.data('fgcolor') || '#87CEEB', 108 inputColor: this.$.data('inputcolor'), 109 font: this.$.data('font') || 'Arial', 110 fontWeight: this.$.data('font-weight') || 'bold', 111 inline : false, 112 step : this.$.data('step') || 1, 113 114 // Hooks 115 draw : null, // function () {} 116 change : null, // function (value) {} 117 cancel : null, // function () {} 118 release : null // function (value) {} 119 }, this.o 120 ); 121 122 // finalize options 123 if(!this.o.inputColor) { 124 this.o.inputColor = this.o.fgColor; 125 } 126 127 // routing value 128 if(this.$.is('fieldset')) { 129 130 // fieldset = array of integer 131 this.v = {}; 132 this.i = this.$.find('input'); 133 this.i.each(function(k) { 134 var $this = $(this); 135 s.i[k] = $this; 136 s.v[k] = $this.val(); 137 138 $this.bind( 139 'change blur' 140 , function () { 141 var val = {}; 142 val[k] = $this.val(); 143 s.val(val); 144 } 145 ); 146 }); 147 this.$.find('legend').remove(); 148 149 } else { 150 151 // input = integer 152 this.i = this.$; 153 this.v = this.$.val(); 154 (this.v === '') && (this.v = this.o.min); 155 156 this.$.bind( 157 'change blur' 158 , function () { 159 s.val(s._validate(s.$.val())); 160 } 161 ); 162 163 } 164 165 (!this.o.displayInput) && this.$.hide(); 166 167 // adds needed DOM elements (canvas, div) 168 this.$c = $(document.createElement('canvas')).attr({ 169 width: this.o.width, 170 height: this.o.height 171 }); 172 173 // wraps all elements in a div 174 // add to DOM before Canvas init is triggered
175 this.$div = $('<div style="' 176 + (this.o.inline ? 'display:inline;' : '') 177 + 'width:' + this.o.width + 'px;height:' + this.o.height + 'px;' 178 + '"></div>'); 179 180 this.$.wrap(this.$div).before(this.$c); 181 this.$div = this.$.parent(); 182 183 if (typeof G_vmlCanvasManager !== 'undefined') { 184 G_vmlCanvasManager.initElement(this.$c[0]); 185 } 186 187 this.c = this.$c[0].getContext ? this.$c[0].getContext('2d') : null; 188 189 if (!this.c) { 190 throw { 191 name: "CanvasNotSupportedException", 192 message: "Canvas not supported. Please use excanvas on IE8.0.", 193 toString: function(){return this.name + ": " + this.message} 194 } 195 } 196 197 // hdpi support 198 this.scale = (window.devicePixelRatio || 1) / 199 ( 200 this.c.webkitBackingStorePixelRatio || 201 this.c.mozBackingStorePixelRatio || 202 this.c.msBackingStorePixelRatio || 203 this.c.oBackingStorePixelRatio || 204 this.c.backingStorePixelRatio || 1 205 ); 206 207 // detects relative width / height 208 this.relativeWidth = ((this.o.width % 1 !== 0) && 209 this.o.width.indexOf('%')); 210 this.relativeHeight = ((this.o.height % 1 !== 0) && 211 this.o.height.indexOf('%')); 212 this.relative = (this.relativeWidth || this.relativeHeight); 213 214 // computes size and carves the component 215 this._carve(); 216 217 // prepares props for transaction 218 if (this.v instanceof Object) { 219 this.cv = {}; 220 this.copy(this.v, this.cv); 221 } else { 222 this.cv = this.v; 223 } 224 225 // binds configure event 226 this.$ 227 .bind("configure", cf) 228 .parent() 229 .bind("configure", cf); 230 231 // finalize init 232 this._listen() 233 ._configure() 234 ._xy() 235 .init(); 236 237 this.isInit = true; 238 239 // the most important ! 240 this._draw(); 241 242 return this; 243 }; 244 245 this._carve = function() { 246 if(this.relative) { 247 var w = this.relativeWidth ? 248 this.$div.parent().width() * 249 parseInt(this.o.width) / 100 : 250 this.$div.parent().width(), 251 h = this.relativeHeight ? 252 this.$div.parent().height() * 253 parseInt(this.o.height) / 100 : 254 this.$div.parent().height(); 255 256 // apply relative 257 this.w = this.h = Math.min(w, h); 258 } else { 259 this.w = this.o.width; 260 this.h = this.o.height; 261 } 262 263 // finalize div 264 this.$div.css({ 265 'width': this.w + 'px', 266 'height': this.h + 'px' 267 }); 268 269 // finalize canvas with computed width 270 this.$c.attr({ 271 width: this.w, 272 height: this.h 273 }); 274 275 // scaling 276 if (this.scale !== 1) { 277 this.$c[0].width = this.$c[0].width * this.scale; 278 this.$c[0].height = this.$c[0].height * this.scale; 279 this.$c.width(this.w); 280 this.$c.height(this.h); 281 } 282 283 return this; 284 } 285 286 this._draw = function () { 287 288 // canvas pre-rendering 289 var d = true; 290 291 s.g = s.c; 292 293 s.clear(); 294 295 s.dH 296 && (d = s.dH()); 297 298 (d !== false) && s.draw(); 299 300 }; 301 302 this._touch = function (e) { 303 304 var touchMove = function (e) { 305 306 var v = s.xy2val( 307 e.originalEvent.touches[s.t].pageX, 308 e.originalEvent.touches[s.t].pageY 309 ); 310 311 if (v == s.cv) return; 312 313 if (s.cH && (s.cH(v) === false)) return; 314 315 s.change(s._validate(v)); 316 s._draw(); 317 }; 318 319 // get touches index 320 this.t = k.c.t(e); 321 322 // First touch 323 touchMove(e); 324 325 // Touch events listeners 326 k.c.d 327 .bind("touchmove.k", touchMove) 328 .bind( 329 "touchend.k" 330 , function () { 331 k.c.d.unbind('touchmove.k touchend.k'); 332 s.val(s.cv); 333 } 334 ); 335 336 return this; 337 }; 338 339 this._mouse = function (e) { 340 341 var mouseMove = function (e) { 342 var v = s.xy2val(e.pageX, e.pageY); 343 344 if (v == s.cv) return; 345 346 if (s.cH && (s.cH(v) === false)) return; 347 348 s.change(s._validate(v)); 349 s._draw(); 350 }; 351 352 // First click 353 mouseMove(e); 354 355 // Mouse events listeners 356 k.c.d 357 .bind("mousemove.k", mouseMove) 358 .bind( 359 // Escape key cancel current change 360 "keyup.k" 361 , function (e) { 362 if (e.keyCode === 27) { 363 k.c.d.unbind("mouseup.k mousemove.k keyup.k"); 364 365 if ( 366 s.eH 367 && (s.eH() === false) 368 ) return; 369 370 s.cancel(); 371 } 372 } 373 ) 374 .bind( 375 "mouseup.k" 376 , function (e) { 377 k.c.d.unbind('mousemove.k mouseup.k keyup.k'); 378 s.val(s.cv); 379 } 380 ); 381 382 return this; 383 }; 384 385 this._xy = function () { 386 var o = this.$c.offset(); 387 this.x = o.left; 388 this.y = o.top; 389 return this; 390 }; 391 392 this._listen = function () { 393 394 if (!this.o.readOnly) { 395 this.$c 396 .bind( 397 "mousedown" 398 , function (e) { 399 e.preventDefault(); 400 s._xy()._mouse(e); 401 } 402 ) 403 .bind( 404 "touchstart" 405 , function (e) { 406 e.preventDefault(); 407 s._xy()._touch(e); 408 } 409 ); 410 411 this.listen(); 412 } else { 413 this.$.attr('readonly', 'readonly'); 414 } 415 416 if(this.relative) { 417 $(window).resize(function() { 418 s._carve()
419 .init(); 420 s._draw(); 421 }); 422 } 423 424 return this; 425 }; 426 427 this._configure = function () { 428 429 // Hooks 430 if (this.o.draw) this.dH = this.o.draw; 431 if (this.o.change) this.cH = this.o.change; 432 if (this.o.cancel) this.eH = this.o.cancel; 433 if (this.o.release) this.rH = this.o.release; 434 435 if (this.o.displayPrevious) { 436 this.pColor = this.h2rgba(this.o.fgColor, "0.4"); 437 this.fgColor = this.h2rgba(this.o.fgColor, "0.6"); 438 } else { 439 this.fgColor = this.o.fgColor; 440 } 441 442 return this; 443 }; 444 445 this._clear = function () { 446 this.$c[0].width = this.$c[0].width; 447 }; 448 449 this._validate = function(v) { 450 return (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step; 451 }; 452 453 // Abstract methods 454 this.listen = function () {}; // on start, one time 455 this.extend = function () {}; // each time configure triggered 456 this.init = function () {}; // each time configure triggered 457 this.change = function (v) {}; // on change 458 this.val = function (v) {}; // on release 459 this.xy2val = function (x, y) {}; // 460 this.draw = function () {}; // on change / on release 461 this.clear = function () { this._clear(); }; 462 463 // Utils 464 this.h2rgba = function (h, a) { 465 var rgb; 466 h = h.substring(1,7) 467 rgb = [parseInt(h.substring(0,2),16) 468 ,parseInt(h.substring(2,4),16) 469 ,parseInt(h.substring(4,6),16)]; 470 return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + a + ")"; 471 }; 472 473 this.copy = function (f, t) { 474 for (var i in f) { t[i] = f[i]; } 475 }; 476 }; 477 478 479 /** 480 * k.Dial 481 */ 482 k.Dial = function () { 483 k.o.call(this); 484 485 this.startAngle = null; 486 this.xy = null; 487 this.radius = null; 488 this.lineWidth = null; 489 this.cursorExt = null; 490 this.w2 = null; 491 this.PI2 = 2*Math.PI; 492 493 this.extend = function () { 494 this.o = $.extend( 495 { 496 bgColor : this.$.data('bgcolor') || '#EEEEEE', 497 angleOffset : this.$.data('angleoffset') || 0, 498 angleArc : this.$.data('anglearc') || 360, 499 inline : true 500 }, this.o 501 ); 502 }; 503 504 this.val = function (v, triggerRelease) { 505 if (null != v) { 506 507 if ( 508 triggerRelease !== false && (v != this.v) && this.rH && 509 (this.rH(v) === false) 510 ) return; 511 512 this.cv = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v; 513 this.v = this.cv; 514 this.$.val(this.v); 515 this._draw(); 516 } else { 517 return this.v; 518 } 519 }; 520 521 this.xy2val = function (x, y) { 522 var a, ret; 523 524 a = Math.atan2( 525 x - (this.x + this.w2) 526 , - (y - this.y - this.w2) 527 ) - this.angleOffset; 528 529 if(this.angleArc != this.PI2 && (a < 0) && (a > -0.5)) { 530 // if isset angleArc option, set to min if .5 under min 531 a = 0; 532 } else if (a < 0) { 533 a += this.PI2; 534 } 535 536 ret = ~~ (0.5 + (a * (this.o.max - this.o.min) / this.angleArc)) 537 + this.o.min; 538 539 this.o.stopper && (ret = max(min(ret, this.o.max), this.o.min)); 540 541 return ret; 542 }; 543 544 this.listen = function () { 545 // bind MouseWheel 546 var s = this, mwTimerStop, mwTimerRelease, 547 mw = function (e) { 548 e.preventDefault(); 549 550 var ori = e.originalEvent 551 ,deltaX = ori.detail || ori.wheelDeltaX 552 ,deltaY = ori.detail || ori.wheelDeltaY 553 ,v = s._validate(s.$.val()) 554 + (deltaX>0 || deltaY>
vendor: 4,363 bytes, lines 554-671
5540 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0); 555 556 v = max(min(v, s.o.max), s.o.min); 557 558 s.val(v, false); 559 560 if(s.rH) { 561 // Handle mousewheel stop 562 clearTimeout(mwTimerStop); 563 mwTimerStop = setTimeout(function() { 564 s.rH(v); 565 mwTimerStop = null; 566 }, 100); 567 568 // Handle mousewheel releases 569 if(!mwTimerRelease) { 570 mwTimerRelease = setTimeout(function() { 571 if(mwTimerStop) s.rH(v); 572 mwTimerRelease = null; 573 }, 200); 574 } 575 } 576 } 577 , kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step}; 578 579 this.$ 580 .bind( 581 "keydown" 582 ,function (e) { 583 var kc = e.keyCode; 584 585 // numpad support 586 if(kc >= 96 && kc <= 105) { 587 kc = e.keyCode = kc - 48; 588 } 589 590 kval = parseInt(String.fromCharCode(kc)); 591 592 if (isNaN(kval)) { 593 594 (kc !== 13) // enter 595 && (kc !== 8) // bs 596 && (kc !== 9) // tab 597 && (kc !== 189) // - 598 && (kc !== 190 || s.$.val().match(/\./)) // . only allowed once 599 && e.preventDefault(); 600 601 // arrows 602 if ($.inArray(kc,[37,38,39,40]) > -1) { 603 e.preventDefault(); 604 605 var v = parseFloat(s.$.val()) + kv[kc] * m; 606 s.o.stopper && (v = max(min(v, s.o.max), s.o.min)); 607 608 s.change(v); 609 s._draw(); 610 611 // long time keydown speed-up 612 to = window.setTimeout( 613 function () { m *= 2; }, 30 614 ); 615 } 616 } 617 } 618 ) 619 .bind( 620 "keyup" 621 ,function (e) { 622 if (isNaN(kval)) { 623 if (to) { 624 window.clearTimeout(to); 625 to = null; 626 m = 1; 627 s.val(s.$.val()); 628 } 629 } else { 630 // kval postcond 631 (s.$.val() > s.o.max && s.$.val(s.o.max)) 632 || (s.$.val() < s.o.min && s.$.val(s.o.min)); 633 } 634 635 } 636 ); 637 638 this.$c.bind("mousewheel DOMMouseScroll", mw); 639 this.$.bind("mousewheel DOMMouseScroll", mw) 640 }; 641 642 this.init = function () { 643 644 if ( 645 this.v < this.o.min 646 || this.v > this.o.max 647 ) this.v = this.o.min; 648 649 this.$.val(this.v); 650 this.w2 = this.w / 2; 651 this.cursorExt = this.o.cursor / 100; 652 this.xy = this.w2 * this.scale; 653 this.lineWidth = this.xy * this.o.thickness; 654 this.lineCap = this.o.lineCap; 655 this.radius = this.xy - this.lineWidth / 2; 656 657 this.o.angleOffset 658 && (this.o.angleOffset = isNaN(this.o.angleOffset) ? 0 : this.o.angleOffset); 659 660 this.o.angleArc 661 && (this.o.angleArc = isNaN(this.o.angleArc) ? this.PI2 : this.o.angleArc); 662 663 // deg to rad 664 this.angleOffset = this.o.angleOffset * Math.PI / 180; 665 this.angleArc = this.o.angleArc * Math.PI / 180; 666 667 // compute start and end angles 668 this.startAngle = 1.5 * Math.PI + this.angleOffset; 669 this.endAngle = 1.5 * Math.PI + this.angleOffset + this.angleArc; 670 671 var s = max(
672 String(Math.abs(this.o.max)).length 673 , String(Math.abs(this.o.min)).length 674 , 2 675 ) + 2; 676 677 this.o.displayInput 678 && this.i.css({ 679 'width' : ((this.w / 2 + 4) >> 0) + 'px' 680 ,'height' : ((this.w / 3) >> 0) + 'px' 681 ,'position' : 'absolute' 682 ,'vertical-align' : 'middle' 683 ,'margin-top' : ((this.w / 3) >> 0) + 'px' 684 ,'margin-left' : '-' + ((this.w * 3 / 4 + 2) >> 0) + 'px' 685 ,'border' : 0 686 ,'background' : 'none' 687 ,'font' : this.o.fontWeight + ' ' + ((this.w / s) >> 0) + 'px ' + this.o.font 688 ,'text-align' : 'center' 689 ,'color' : this.o.inputColor || this.o.fgColor 690 ,'padding' : '0px' 691 ,'-webkit-appearance': 'none' 692 }) 693 || this.i.css({ 694 'width' : '0px' 695 ,'visibility' : 'hidden' 696 }); 697 }; 698 699 this.change = function (v) { 700 this.cv = v; 701 this.$.val(v); 702 }; 703 704 this.angle = function (v) { 705 return (v - this.o.min) * this.angleArc / (this.o.max - this.o.min); 706 }; 707 708 this.draw = function () { 709 710 var c = this.g, // context 711 a = this.angle(this.cv) // Angle 712 , sat = this.startAngle // Start angle 713 , eat = sat + a // End angle 714 , sa, ea // Previous angles 715 , r = 1; 716 717 c.lineWidth = this.lineWidth; 718 719 c.lineCap = this.lineCap; 720 721 this.o.cursor 722 && (sat = eat - this.cursorExt) 723 && (eat = eat + this.cursorExt); 724 725 c.beginPath(); 726 c.strokeStyle = this.o.bgColor; 727 c.arc(this.xy, this.xy, this.radius, this.endAngle - 0.00001, this.startAngle + 0.00001, true); 728 c.stroke(); 729 730 if (this.o.displayPrevious) { 731 ea = this.startAngle + this.angle(this.v); 732 sa = this.startAngle; 733 this.o.cursor 734 && (sa = ea - this.cursorExt) 735 && (ea = ea + this.cursorExt); 736 737 c.beginPath(); 738 c.strokeStyle = this.pColor; 739 c.arc(this.xy, this.xy, this.radius, sa - 0.00001, ea + 0.00001, false); 740 c.stroke(); 741 r = (this.cv == this.v); 742 } 743 744 c.beginPath(); 745 c.strokeStyle = r ? this.o.fgColor : this.fgColor ; 746 c.arc(this.xy, this.xy, this.radius, sat - 0.00001, eat + 0.00001, false); 747 c.stroke(); 748 }; 749 750 this.cancel = function () { 751 this.val(this.v); 752 }; 753 }; 754 755 $.fn.dial = $.fn.knob = function (o) { 756 return this.each( 757 function () { 758 var d = new k.Dial(); 759 d.o = o; 760 d.$ = $(this); 761 d.run(); 762 } 763 ).parent(); 764 }; 765 766})(jQuery); 767 768 769/*rateYo V2.3.2, A simple and flexible star rating plugin 770prashanth pamidi (https://github.com/prrashi)*/ 771!function(a){"use strict";function b(){var a=!1;return function(b){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(b)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
771sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(b.substr(0,4)))&&(a=!0)}(navigator.userAgent||navigator.vendor||window.opera),a}function c(a,b,c){return a===b?a=b:a===c&&(a=c),a}function d(a,b,c){if(!(a>=b&&a<=c))throw Error("Invalid Rating, expected value between "+b+" and "+c);return a}function e(a){return void 0!==a}function f(a,b,c){var d=c/100*(b-a);return d=Math.round(a+d).toString(16),1===d.length&&(d="0"+d),d}function g(a,b,c){if(!a||!b)return null;c=e(c)?c:0,a=q(a),b=q(b);var d=f(a.r,b.r,c),g=f(a.b,b.b,c);return"#"+d+f(a.g,b.g,c)+g}function h(f,i){function k(a){e(a)||(a=i.rating),Z=a;var b=a/P,c=b*R;b>1&&(c+=(Math.ceil(b)-1)*T),r(i.ratedFill),c=i.rtl?100-c:c,c<0?c=0:c>100&&(c=100),X.css("width",c+"%")}function l(){U=Q*i.numStars+S*(i.numStars-1),R=Q/U*100,T=S/U*100,f.width(U),k()}function n(a){var b=i.starWidth=a;return Q=window.parseFloat(i.starWidth.replace("px","")),W.find("svg").attr({width:i.starWidth,height:b}),X.find("svg").attr({width:i.starWidth,height:b}),l(),f}function p(a){return i.spacing=a,S=parseFloat(i.spacing.replace("px","")),W.find("svg:not(:first-child)").css({"margin-left":a}),X.find("svg:not(:first-child)").css({"margin-left":a}),l(),f}function q(a){return i.normalFill=a,(i.rtl?X:W).find("svg").attr({fill:i.normalFill}),f}function r(a){if(i.multiColor){var b=Z-Y,c=b/i.maxValue*100,d=i.multiColor||{};a=g(d.startColor||o.startColor,d.endColor||o.endColor,c)}else _=a;return i.ratedFill=a,(i.rtl?W:X).find("svg").attr({fill:i.ratedFill}),f}function s(a){a=!!a,i.rtl=a,q(i.normalFill),k()}function t(a){i.multiColor=a,r(a?a:_)}function u(b){i.numStars=b,P=i.maxValue/i.numStars,W.empty(),X.empty();for(var c=0;c<i.numStars;c++)W.append(a(i.starSvg||m)),X.append(a(i.starSvg||m));return n(i.starWidth),q(i.normalFill),p(i.spacing),k(),f}function v(a){return i.maxValue=a,P=i.maxValue/i.numStars,i.rating>a&&C(a),k(),f}function w(a){return i.precision=a,C(i.rating),f}function x(a){return i.halfStar=a,f}function y(a){return i.fullStar=a,f}function z(a){var b=a%P,c=P/2,d=i.halfStar,e=i.fullStar;return e||d?(e||d&&b>c?a+=P-b:(a-=b,b>0&&(a+=c)),a):a}function A(a){var b=W.offset(),c=b.left,d=c+W.width(),e=i.maxValue,f=a.pageX,g=0;if(f<c)g=Y;else if(f>d)g=e;else{var h=(f-c)/(d-c);if(S>0){h*=100;for(var j=h;j>0;)j>R?(g+=P,j-=R+T):(g+=j/R*P,j=0)}else g=h*i.maxValue;g=z(g)}return i.rtl&&(g=e-g),parseFloat(g)}function B(a){return i.readOnly=a,f.attr("readonly",!0),N(),a||(f.removeAttr("readonly"),M()),f}function C(a){var b=a,e=i.maxValue;return"string"==typeof b&&("%"===b[b.length-1]&&(b=b.substr(0,b.length-1),e=100,v(e)),b=parseFloat(b)),d(b,Y,e),b=parseFloat(b.toFixed(i.precision)),c(parseFloat(b),Y,e),i.rating=b,k(),$&&f.trigger("rateyo.set",{rating:b}),f}function D(a){return i.onInit=a,f}function E(a){return i.onSet=a,f}function F(a){return i.onChange=a,f}function G(a){var b=A(a).toFixed(i.precision),d=i.maxValue;b=c(parseFloat(b),Y,d),k(b),f.trigger("rateyo.change",{rating:b})}function H(){b()||(k(),f.trigger("rateyo.change",{rating:i.rating}))}function I(a){var b=A(a).toFixed(i.precision);b=parseFloat(b),O.rating(b)}function J(a,b){i.onInit&&"function"==typeof i.onInit&&i.onInit.apply(this,[b.rating,O])}function K(a,b){i.onChange&&"function"==typeof i.onChange&&i.onChange.apply(this,[b.rating,O])}function L(a,b){i.onSet&&"function"==typeof i.onSet&&i.onSet.apply(this,[b.rating,O])}function M(){f.on("mousemove",G).on("mouseenter",G).on("mouseleave",H).on("click",I).on("rateyo.init",J).on("rateyo.change",K).on("rateyo.set",L)}function N(){f.off("mousemove",G).off("mouseenter",G).off("mouseleave",H).off("click",I).off("rateyo.init",J).off("rateyo.change",K).off("rateyo.set",L)}this.node=f.get(0);var O=this;f.empty().addClass("jq-ry-container");var P,Q,R,S,T,U,V=a("<div/>").addClass("jq-ry-group-wrapper").appendTo(f),W=a("<div/>").addClass("jq-ry-normal-group").addClass("jq-ry-group").appendTo(V),X=a("<div/>").addClass("jq-ry-rated-group").addClass("jq-ry-group").appendTo(V),Y=0,Z=i.rating,$=!1,_=i.ratedFill;this.rating=function(a){return e(a)?(C(a),f):i.rating},this.destroy=function(){return i.readOnly||N(),h.prototype.collection=j(f.get(0),this.collection),f.removeClass("jq-ry-container").children().remove(),f}
771,this.method=function(a){if(!a)throw Error("Method name not specified!");if(!e(this[a]))throw Error("Method "+a+" doesn't exist!");var b=Array.prototype.slice.apply(arguments,[]),c=b.slice(1);return this[a].apply(this,c)},this.option=function(a,b){if(!e(a))return i;var c;switch(a){case"starWidth":c=n;break;case"numStars":c=u;break;case"normalFill":c=q;break;case"ratedFill":c=r;break;case"multiColor":c=t;break;case"maxValue":c=v;break;case"precision":c=w;break;case"rating":c=C;break;case"halfStar":c=x;break;case"fullStar":c=y;break;case"readOnly":c=B;break;case"spacing":c=p;break;case"rtl":c=s;break;case"onInit":c=D;break;case"onSet":c=E;break;case"onChange":c=F;break;default:throw Error("No such option as "+a)}return e(b)?c(b):i[a]},u(i.numStars),B(i.readOnly),i.rtl&&s(i.rtl),this.collection.push(this),this.rating(i.rating,!0),$=!0,f.trigger("rateyo.init",{rating:i.rating})}function i(b,c){var d;return a.each(c,function(){if(b===this.node)return d=this,!1}),d}function j(b,c){return a.each(c,function(a){if(b===this.node){var d=c.slice(0,a),e=c.slice(a+1,c.length);return c=d.concat(e),!1}}),c}function k(b){var c=h.prototype.collection,d=a(this);if(0===d.length)return d;var e=Array.prototype.slice.apply(arguments,[]);if(0===e.length)b=e[0]={};else{if(1!==e.length||"object"!=typeof e[0]){if(e.length>=1&&"string"==typeof e[0]){var f=e[0],g=e.slice(1),j=[];return a.each(d,function(a,b){var d=i(b,c);if(!d)throw Error("Trying to set options before even initialization");var e=d[f];if(!e)throw Error("Method "+f+" does not exist!");var h=e.apply(d,g);j.push(h)}),j=1===j.length?j[0]:j}throw Error("Invalid Arguments")}b=e[0]}return b=a.extend({},n,b),a.each(d,function(){var d=i(this,c);if(d)return d;var e=a(this),f={},g=a.extend({},b);return a.each(e.data(),function(a,b){if(0===a.indexOf("rateyo")){var c=a.replace(/^rateyo/,"");c=c[0].toLowerCase()+c.slice(1),f[c]=b,delete g[c]}}),new h(a(this),a.extend({},f,g))})}function l(){return k.apply(this,Array.prototype.slice.apply(arguments,[]))}var m='<?xml version="1.0" encoding="utf-8"?><svg version="1.1"xmlns="http://www.w3.org/2000/svg"viewBox="0 12.705 512 486.59"x="0px" y="0px"xml:space="preserve"><polygon points="256.814,12.705 317.205,198.566 512.631,198.566 354.529,313.435 414.918,499.295 256.814,384.427 98.713,499.295 159.102,313.435 1,198.566 196.426,198.566 "/></svg>',n={starWidth:"32px",normalFill:"gray",ratedFill:"#f39c12",numStars:5,maxValue:5,precision:1,rating:0,fullStar:!1,halfStar:!1,readOnly:!1,spacing:"0px",rtl:!1,multiColor:null,onInit:null,onChange:null,onSet:null,starSvg:null},o={startColor:"#c0392b",endColor:"#f1c40f"},p=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,q=function(a){if(!p.test(a))return null;var b=p.exec(a);return{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}};h.prototype.collection=[],window.RateYo=h,a.fn.rateYo=l}(window.jQuery); 772
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.