*** starbox\js\starbox.js 2007-12-17 23:04:10.000000000 --- starbox-tip\js\starbox.js 2008-01-28 01:00:19.000000000 *************** *** 29,43 **** --- 29,45 ---- inverse: false, locked: false, onRate: Prototype.emptyFunction, overlayImages: '../images/starbox/', // relative to starbox.js overlay: 'default.png', rerate: false, + tips: false, REQUIRED_Prototype: '1.6.0', REQUIRED_Scriptaculous: '1.8.0', + REQUIRED_Prototip: '1.1.0', load: function() { this.require('Prototype'); var srcMatch = /starbox\.js$/; this.imageSource = (($$("head script[src]").find(function(s) { return s.src.match(srcMatch); *************** *** 142,162 **** max: 5, onRate: Starboxes.onRate, rerate: Starboxes.rerate, rated: false, overlay: Starboxes.overlay, stars: 5, ! total : 0 }, arguments[2] || {}); this.rated = this.options.rated; this.total = this.options.total; this.locked = this.options.locked || (this.rated && !this.options.rerate); if (this.options.effect && (this.options.effect.mouseover || this.options.effect.mouseout)) Starboxes.require('Scriptaculous'); Starboxes.queueBuild(this); if (Starboxes.batchLoading) Starboxes.processBuildQueue(); }, enable: function() { --- 144,168 ---- max: 5, onRate: Starboxes.onRate, rerate: Starboxes.rerate, rated: false, overlay: Starboxes.overlay, stars: 5, ! total : 0, ! tips: Starboxes.tips }, arguments[2] || {}); this.rated = this.options.rated; this.total = this.options.total; this.locked = this.options.locked || (this.rated && !this.options.rerate); if (this.options.effect && (this.options.effect.mouseover || this.options.effect.mouseout)) Starboxes.require('Scriptaculous'); + + if (Object.isArray(this.options.tips)) + Starboxes.require('Prototip'); Starboxes.queueBuild(this); if (Starboxes.batchLoading) Starboxes.processBuildQueue(); }, enable: function() { *************** *** 252,266 **** --- 258,281 ---- top: 0, left: leftPos + 'px', width: this.buttonWidth + (Prototype.Browser.IE ? 1 : 0) + 'px', height: this.starHeight + 'px' })); button.rating = this.buttonRating * i + this.buttonRating; + if (!this.options.locked && this.options.tips[i]) { + new Tip(button, this.options.tips[i], + {className: 'startip', delay: 0, hook:{target:'bottomLeft',tip:'topLeft'}}); + } this.buttons.push(button); }.bind(this)); + if (this.options.locked && this.options.tips[this.average - 1]) { + new Tip(this.starbar, this.options.tips[this.average - 1], + {className: 'startip', delay: 0, hook:{target:'bottomLeft',tip:'topLeft'}}); + } + this.setBarPosition(this.colorbar, this.average); this.element.update(this.container); if (this.options.indicator) { this.indicator = this.hover.appendChild(new Element('div', { 'class' : 'indicator' })); this.updateIndicator();