| Current Path : /home/emeraadmin/public_html/4d695/ |
| Current File : /home/emeraadmin/public_html/4d695/jquery-bar-rating.zip |
PK $[�\!D�JY Y
karma.conf.jsnu �[��� module.exports = function (config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
frameworks: ['mocha', 'chai'],
// list of files / patterns to load in the browser
files: [
'node_modules/jquery/dist/jquery.js',
'jquery.barrating.js',
'test/*.js'
],
// list of files to exclude
exclude: [
],
preprocessors: {
},
// possible values: 'progress', 'junit'
// CLI --reporters progress
reporters: ['progress', 'junit'],
junitReporter: {
outputDir: '',
outputFile: 'test-results.xml'
},
// web server port
// CLI --port 9876
port: 9876,
// enable / disable colors in the output (reporters and logs)
// CLI --colors --no-colors
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
// CLI --log-level debug
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
// CLI --auto-watch --no-auto-watch
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
// CLI --browsers Chrome,Firefox,Safari
browsers: ['PhantomJS'],
// If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
captureTimeout: 20000,
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: true,
// report which specs are slower than 500ms
// CLI --report-slower-than 500
reportSlowerThan: 500
})
}PK $[�\'� � package.jsonnu �[��� {
"_args": [
[
"jquery-bar-rating@1.2.2",
"C:\\Users\\Ovi-PC\\Downloads\\themekit-master\\themekit"
]
],
"_from": "jquery-bar-rating@1.2.2",
"_id": "jquery-bar-rating@1.2.2",
"_inBundle": false,
"_integrity": "sha1-lZTWYs/53rD+ezclEbskkqQ285I=",
"_location": "/jquery-bar-rating",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "jquery-bar-rating@1.2.2",
"name": "jquery-bar-rating",
"escapedName": "jquery-bar-rating",
"rawSpec": "1.2.2",
"saveSpec": null,
"fetchSpec": "1.2.2"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/jquery-bar-rating/-/jquery-bar-rating-1.2.2.tgz",
"_spec": "1.2.2",
"_where": "C:\\Users\\Ovi-PC\\Downloads\\themekit-master\\themekit",
"bugs": {
"url": "https://github.com/antennaio/jquery-bar-rating/issues"
},
"dependencies": {
"jquery": ">=1.7.2"
},
"description": "Minimal, light-weight jQuery ratings.",
"devDependencies": {
"chai": "3.5.0",
"gulp": "3.9.1",
"gulp-jshint": "2.0.1",
"gulp-less": "3.1.0",
"gulp-rename": "1.2.2",
"gulp-sourcemaps": "1.5.2",
"gulp-uglify": "1.5.3",
"jshint": "2.9.2",
"karma": "0.13.22",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "0.2.3",
"karma-junit-reporter": "0.4.2",
"karma-mocha": "0.2.2",
"karma-phantomjs-launcher": "1.0.0",
"mocha": "2.5.3",
"phantomjs-prebuilt": "2.1.7",
"run-sequence": "1.2.1"
},
"homepage": "https://github.com/antennaio/jquery-bar-rating#readme",
"keywords": [
"jquery",
"jquery-plugin",
"ratings",
"rating"
],
"license": "MIT",
"main": "jquery.barrating.js",
"name": "jquery-bar-rating",
"repository": {
"type": "git",
"url": "git://github.com/antennaio/jquery-bar-rating.git"
},
"scripts": {
"test": "karma start"
},
"version": "1.2.2"
}
PK $[�\�W�J J gulpfile.jsnu �[��� var gulp = require('gulp'),
less = require('gulp-less'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
KarmaServer = require('karma').Server,
rename = require('gulp-rename'),
sourcemaps = require('gulp-sourcemaps'),
runSequence = require('run-sequence');
var path = require('path');
var srcFile = 'jquery.barrating.js';
var lessFiles = [
path.join(__dirname, 'examples', 'less', 'examples.less'),
path.join(__dirname, 'examples', 'less', 'main.less'),
];
var cssPath = path.join(__dirname, 'examples', 'css'),
distPath = 'dist';
var themePath = path.join(__dirname, 'dist', 'themes');
var themeLessFiles = 'themes/*.less';
gulp.task('jshint', function() {
return gulp.src(srcFile)
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('uglify', function() {
return gulp.src(srcFile)
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(rename(function(path) {
path.basename += '.min';
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(distPath));
});
gulp.task('test', function(done) {
new KarmaServer({
configFile: __dirname + '/karma.conf.js'
}, done).start();
});
gulp.task('less', function() {
return gulp.src(lessFiles)
.pipe(less())
.pipe(gulp.dest(cssPath));
});
gulp.task('themes', function() {
return gulp.src([themeLessFiles, '!themes/variables.less', '!themes/mixins.less'])
.pipe(less())
.pipe(gulp.dest(themePath));
});
gulp.task('build', function() {
runSequence('jshint', 'test', 'themes', 'uglify');
});
gulp.task('watch', function() {
gulp.watch(srcFile, ['jshint']);
gulp.watch(lessFiles, ['less']);
gulp.watch(themeLessFiles, ['themes']);
});
gulp.task('default', ['build']);
PK $[�\�,7i/ / themes/bars-1to10.lessnu �[��� @import "variables.less";
@import "mixins.less";
.br-theme-bars-1to10 {
.br-widget {
height: 50px;
white-space: nowrap;
a {
display: block;
width: 12px;
padding: 5px 0;
height: 28px;
float: left;
background-color: lighten(@orange-color, 25%);
margin: 1px;
text-align: center;
&.br-active,
&.br-selected {
background-color: @orange-color;
}
}
.br-current-rating {
font-size: 20px;
line-height: 2;
float: left;
padding: 0 20px 0 20px;
color: @orange-color;
font-weight: 400;
}
}
.br-readonly {
a {
cursor: default;
&.br-active, &.br-selected {
background-color: lighten(@orange-color, 10%);
}
}
.br-current-rating {
color: lighten(@orange-color, 10%);
}
}
}
@media print {
.br-theme-bars-1to10 {
.br-widget {
a {
border: 1px solid lighten(black, 70%);
background: white;
height: 38px;
.box-sizing(border-box);
&.br-active,
&.br-selected {
border: 1px solid black;
background: white;
}
}
.br-current-rating {
color: black;
}
}
}
}
PK $[�\����� � themes/fontawesome-stars-o.lessnu �[��� @import "variables.less";
.br-theme-fontawesome-stars-o {
.br-widget {
height: 28px;
white-space: nowrap;
a {
font: normal normal normal 20px/1 FontAwesome;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
text-decoration: none;
margin-right: 2px;
}
a:after {
content: '\f006';
color: @star-default;
}
a.br-active:after {
content: '\f005';
color: @green-color;
}
a.br-selected:after {
content: '\f005';
color: @green-color;
}
a.br-fractional:after {
content: '\f123';
color: @green-color;
}
.br-current-rating {
display: none;
}
}
.br-readonly {
a {
cursor: default;
}
}
.br-reverse {
a.br-fractional {
display: inline-block;
transform: scaleX(-1);
-moz-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}
}
}
@media print {
.br-theme-fontawesome-stars-o {
.br-widget {
a:after {
content: '\f006';
color: black;
}
a.br-active:after,
a.br-selected:after {
content: '\f005';
color: black;
}
a.br-fractional:after {
content: '\f123';
color: black;
}
}
}
}
PK $[�\���fn n themes/bars-square.lessnu �[��� @import "variables.less";
@import "mixins.less";
.br-theme-bars-square {
.br-widget {
height: 15px;
white-space: nowrap;
a {
display: block;
width: 30px;
height: 30px;
float: left;
border: 2px solid lighten(@blue-color, 25%);
background-color: white;
margin: 2px;
text-decoration: none;
font-size: 14px;
font-weight: 400;
line-height: 2;
text-align: center;
color: lighten(@blue-color, 25%);
font-weight: 600;
&.br-active,
&.br-selected {
border: 2px solid @blue-color;
color: @blue-color;
}
}
.br-current-rating {
clear: both;
width: 330px;
text-align: center;
font-weight: 600;
display: block;
padding: .5em 0;
color: #646464;
}
}
.br-readonly {
a {
cursor: default;
&.br-active, &.br-selected {
border: 2px solid lighten(@blue-color, 10%);
color: lighten(@blue-color, 10%);
}
}
}
}
@media print {
.br-theme-bars-square {
.br-widget {
a {
border: 2px solid lighten(black, 70%);
color: lighten(black, 70%);
&.br-active,
&.br-selected {
border: 2px solid black;
color: black;
}
}
}
}
}
PK $[�\{_X� � themes/bars-reversed.lessnu �[��� @import "variables.less";
@import "mixins.less";
.br-theme-bars-reversed {
.br-widget {
height: 25px;
white-space: nowrap;
a {
display: block;
width: 22px;
height: 22px;
float: left;
background-color: lighten(@green-color, 25%);
margin: 1px;
font-size: 15px;
font-weight: 400;
line-height: 1.4;
color: @green-color;
text-align: center;
&.br-active,
&.br-selected {
background-color: @green-color;
color: white;
}
}
.br-current-rating {
line-height: 1.3;
float: left;
padding: 0 20px 0 20px;
color: @green-color;
font-size: 17px;
font-weight: 400;
}
}
.br-readonly {
a {
cursor: default;
&.br-active, &.br-selected {
background-color: lighten(@green-color, 10%);
}
}
.br-current-rating {
color: lighten(@green-color, 10%);
}
}
}
@media print {
.br-theme-bars-reversed {
.br-widget {
a {
border: 1px solid lighten(black, 70%);
background: white;
.box-sizing(border-box);
&.br-active,
&.br-selected {
border: 1px solid black;
background: white;
}
}
.br-current-rating {
color: black;
}
}
}
}
PK $[�\F�u�� � themes/fontawesome-stars.lessnu �[��� @import "variables.less";
.br-theme-fontawesome-stars {
.br-widget {
height: 28px;
white-space: nowrap;
a {
font: normal normal normal 20px/1 FontAwesome;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
text-decoration: none;
margin-right: 2px;
}
a:after {
content: '\f005';
color: @star-default;
}
a.br-active:after {
color: @star-active;
}
a.br-selected:after {
color: @star-selected;
}
.br-current-rating {
display: none;
}
}
.br-readonly {
a {
cursor: default;
}
}
}
@media print {
.br-theme-fontawesome-stars {
.br-widget {
a:after {
content: '\f006';
color: black;
}
a.br-active:after,
a.br-selected:after {
content: '\f005';
color: black;
}
}
}
}
PK $[�\�xd� � themes/bars-pill.lessnu �[��� @import "variables.less";
@import "mixins.less";
.br-theme-bars-pill {
.br-widget {
white-space: nowrap;
a {
padding: 7px 15px;
background-color: lighten(@green-color, 25%);
color: @green-color;
text-decoration: none;
font-size: 13px;
line-height: 3;
text-align: center;
font-weight: 400;
&:first-child {
-webkit-border-top-left-radius: 999px;
-webkit-border-bottom-left-radius: 999px;
-moz-border-radius-topleft: 999px;
-moz-border-radius-bottomleft: 999px;
border-top-left-radius: 999px;
border-bottom-left-radius: 999px;
}
&:last-child {
-webkit-border-top-right-radius: 999px;
-webkit-border-bottom-right-radius: 999px;
-moz-border-radius-topright: 999px;
-moz-border-radius-bottomright: 999px;
border-top-right-radius: 999px;
border-bottom-right-radius: 999px;
}
&.br-active,
&.br-selected {
background-color: @green-color;
color: white;
}
}
}
.br-readonly {
a {
cursor: default;
&.br-active, &.br-selected {
background-color: lighten(@green-color, 10%);
}
}
}
}
@media print {
.br-theme-bars-pill {
.br-widget {
a {
border: 1px solid lighten(black, 70%);
border-left: none;
background: white;
.box-sizing(border-box);
&.br-active,
&.br-selected {
border: 1px solid black;
border-left: none;
background: white;
color: black;
}
}
a:first-child {
border-left: 1px solid black;
}
}
}
}
PK $[�\�r��� � themes/bootstrap-stars.lessnu �[��� @import "variables.less";
.br-theme-bootstrap-stars {
.br-widget {
height: 28px;
white-space: nowrap;
a {
font: normal normal normal 18px/1 'Glyphicons Halflings';
text-rendering: auto;
-webkit-font-smoothing: antialiased;
text-decoration: none;
margin-right: 2px;
}
a:after {
content: '\e006';
color: @star-default;
}
a.br-active:after {
color: @star-active;
}
a.br-selected:after {
color: @star-selected;
}
.br-current-rating {
display: none;
}
}
.br-readonly {
a {
cursor: default;
}
}
}
@media print {
.br-theme-bootstrap-stars {
.br-widget {
a:after {
content: '\e007';
color: black;
}
a.br-active:after,
a.br-selected:after {
content: '\e006';
color: black;
}
}
}
}
PK $[�\��v v themes/css-stars.lessnu �[��� @import "variables.less";
.br-theme-css-stars {
.br-widget {
height: 28px;
white-space: nowrap;
a {
text-decoration: none;
height: 18px;
width: 18px;
float: left;
font-size: 23px;
margin-right: 5px;
}
a:after {
content: "\2605";
color: @star-default;
}
a.br-active:after {
color: @star-active;
}
a.br-selected:after {
color: @star-selected;
}
.br-current-rating {
display: none;
}
}
.br-readonly {
a {
cursor: default;
}
}
}
@media print {
.br-theme-css-stars {
.br-widget {
a:after {
content: "\2606";
color: black;
}
a.br-active:after,
a.br-selected:after {
content: "\2605";
color: black;
}
}
}
}
PK $[�\��K�� � themes/bars-horizontal.lessnu �[��� @import "variables.less";
@import "mixins.less";
.br-theme-bars-horizontal {
.br-widget {
width: 120px;
white-space: nowrap;
a {
display: block;
width: 120px;
height: 5px;
background-color: lighten(@orange-color, 25%);
margin: 1px;
&.br-active,
&.br-selected {
background-color: @orange-color;
}
}
.br-current-rating {
width: 120px;
font-size: 18px;
font-weight: 600;
line-height: 2;
text-align: center;
color: @orange-color;
}
}
.br-readonly {
a {
cursor: default;
&.br-active, &.br-selected {
background-color: lighten(@orange-color, 10%);
}
}
.br-current-rating {
color: lighten(@orange-color, 10%);
}
}
}
@media print {
.br-theme-bars-horizontal {
.br-widget {
a {
border: 1px solid lighten(black, 70%);
background: white;
.box-sizing(border-box);
&.br-active,
&.br-selected {
border: 1px solid black;
background: white;
}
}
.br-current-rating {
color: black;
}
}
}
}
PK $[�\}Yq themes/bars-movie.lessnu �[��� @import "variables.less";
@import "mixins.less";
.br-theme-bars-movie {
.br-widget {
height: 10px;
white-space: nowrap;
a {
display: block;
width: 60px;
height: 8px;
float: left;
background-color: lighten(@blue-color, 25%);
margin: 1px;
&.br-active,
&.br-selected {
background-color: @blue-color;
}
}
.br-current-rating {
clear: both;
width: 240px;
text-align: center;
font-weight: 600;
display: block;
padding: .5em 0;
color: @blue-color;
font-weight: 400;
}
}
.br-readonly {
a {
cursor: default;
&.br-active, &.br-selected {
background-color: lighten(@blue-color, 10%);
}
}
.br-current-rating {
color: lighten(@blue-color, 10%);
}
}
}
@media print {
.br-theme-bars-movie {
.br-widget {
a {
border: 1px solid lighten(black, 70%);
background: white;
.box-sizing(border-box);
&.br-active,
&.br-selected {
border: 1px solid black;
background: white;
}
}
.br-current-rating {
color: black;
}
}
}
}
PK $[�\J�xX� � themes/variables.lessnu �[��� // Bars
@orange-color: #EDB867;
@green-color: #50E3C2;
@blue-color: #4278F5;
// Stars
@star-default: #d2d2d2;
@star-active: #EDB867;
@star-selected: #EDB867;PK $[�\��0ҕ � themes/mixins.lessnu �[��� // Box sizing
.box-sizing (@type: border-box) {
-webkit-box-sizing: @type;
-moz-box-sizing: @type;
box-sizing: @type;
}
PK $[�\�I�T T .travis.ymlnu �[��� language: node_js
node_js:
- 6
cache:
directories:
- node_modules
PK $[�\ܨ�d; d; test/jquery.barrating-spec.jsnu �[��� var expect = window.chai.expect;
function createSelect() {
$('<select />', { 'id':'rating', 'name':'rating' }).appendTo('body');
for (var i = 1; i <= 10; i++) {
var attributes = (i == 5) ?
attributes = { 'value':i, 'selected':'selected' } :
attributes = { 'value':i };
$('<option />', attributes).appendTo('#rating').html('rating-text-'+i);
}
}
function destroySelect() {
$('#rating').remove();
}
describe('bar rating plugin on init with custom options', function () {
it('should update defaults', function () {
var BarRating;
BarRating = new $.fn.barrating.BarRating();
BarRating.init({
showValues: false
});
expect(BarRating.options).to.be.a('object');
expect(BarRating.options.theme).to.equal('');
expect(BarRating.options.initialRating).to.equal(null);
expect(BarRating.options.allowEmpty).to.equal(null);
expect(BarRating.options.emptyValue).to.equal('');
expect(BarRating.options.showValues).to.equal(false);
expect(BarRating.options.showSelectedRating).to.equal(true);
expect(BarRating.options.deselectable).to.equal(true);
expect(BarRating.options.reverse).to.equal(false);
expect(BarRating.options.readonly).to.equal(false);
expect(BarRating.options.fastClicks).to.equal(true);
expect(BarRating.options.hoverState).to.equal(true);
expect(BarRating.options.silent).to.equal(false);
});
});
describe('bar rating plugin on show', function () {
before(function () {
createSelect();
$('#rating').barrating('show');
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should have data', function () {
expect($('#rating').data('barrating')).to.be.a('object');
});
it('should wrap the select field into a wrapper div', function () {
expect($('.br-widget').parent().hasClass('br-wrapper')).to.equal(true);
});
it('should transform the select field into a rating widget', function () {
expect($('.br-widget a')).to.have.length(10);
});
it('should store rating values in data attributes', function () {
expect($('.br-widget a:first').attr('data-rating-value')).to.equal('1');
expect($('.br-widget a:nth-child(8)').attr('data-rating-value')).to.equal('8');
expect($('.br-widget a:first').attr('data-rating-text')).to.equal('rating-text-1');
expect($('.br-widget a:nth-child(8)').attr('data-rating-text')).to.equal('rating-text-8');
});
it('should read the selected rating from the select field', function () {
expect($('#rating').data('barrating').ratingValue).to.equal('5');
expect($('#rating').data('barrating').ratingText).to.equal('rating-text-5');
});
it('should set correct class', function () {
expect($('.br-widget a:nth-child(4)').hasClass('br-selected')).to.equal(true);
expect($('.br-widget a:nth-child(5)').hasClass('br-selected br-current')).to.equal(true);
expect($('.br-widget a:nth-child(6)').hasClass('br-selected')).to.equal(false);
});
it('should append a rating div', function () {
expect($('div.br-current-rating')).to.have.length(1);
});
it('should display a correct rating', function () {
expect($('div.br-current-rating').html()).to.equal(
$('#rating').data('barrating').ratingText
);
});
it('should hide the select field', function () {
expect($('#rating').css('display')).to.equal('none');
});
});
describe('bar rating plugin on set fractional value', function () {
before(function () {
createSelect();
$('#rating')
.barrating('show', { initialRating: 3.3 });
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should set .br-half class', function () {
expect($('.br-widget a:nth-child(4)').hasClass('br-fractional')).to.equal(true);
expect($('.br-widget a:nth-child(4)').hasClass('br-fractional-30')).to.equal(true);
});
});
describe('bar rating plugin on set fractional value < 1', function () {
before(function () {
createSelect();
$('#rating')
.barrating('show', { initialRating: 0.99 });
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should set .br-half class', function () {
expect($('.br-widget a:first').hasClass('br-fractional')).to.equal(true);
expect($('.br-widget a:first').hasClass('br-fractional-90')).to.equal(true);
});
});
describe('bar rating themes', function() {
before(function () {
createSelect();
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should set the theme class', function() {
$('#rating').barrating({
theme: 'bootstrap-stars'
});
expect($('.br-wrapper').hasClass('br-theme-bootstrap-stars')).to.be.true;
});
});
describe('bar rating plugin on show and rating selected', function () {
var valuesFromCallback = [];
before(function () {
createSelect();
$('#rating').barrating('show', {
onSelect:function (value, text, event) {
valuesFromCallback.push(value, text, event);
}
});
$('.br-widget a:nth-child(2)').trigger('click');
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should update data', function () {
expect($('#rating').data('barrating').ratingValue).to.equal('2');
expect($('#rating').data('barrating').ratingText).to.equal('rating-text-2');
});
it('should set correct class', function () {
expect($('.br-widget a:nth-child(1)').hasClass('br-selected')).to.equal(true);
expect($('.br-widget a:nth-child(2)').hasClass('br-selected br-current')).to.equal(true);
expect($('.br-widget a:nth-child(3)').hasClass('br-selected')).to.equal(false);
});
it('should display a correct rating', function () {
expect($('div.br-current-rating').html()).to.equal(
$('#rating').data('barrating').ratingText
);
});
it('should pass correct values to a callback', function () {
expect(valuesFromCallback[0]).to.equal('2');
expect(valuesFromCallback[1]).to.equal('rating-text-2');
expect(valuesFromCallback[2]).to.be.a('object');
});
});
describe('bar rating plugin on show and empty ratings are allowed', function () {
before(function () {
createSelect();
$('#rating').barrating('show', {
allowEmpty: true,
emptyValue: '-- not defined --'
});
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should update data', function () {
expect($('#rating').data('barrating').allowEmpty).to.equal(true);
expect($('#rating').data('barrating').emptyRatingValue).to.equal('-- not defined --');
expect($('#rating').data('barrating').emptyRatingText).to.equal('');
});
it('should set correct class', function () {
expect($('#rating option').first().val()).to.equal('-- not defined --');
});
});
describe('bar rating plugin reversed', function () {
before(function () {
createSelect();
$('#rating').barrating('show', {
reverse:true
});
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should set correct widget class', function () {
expect($('.br-widget').hasClass('br-reverse')).to.equal(true);
});
it('should set correct class', function () {
expect($('.br-widget a:nth-child(4)').hasClass('br-selected')).to.equal(false);
expect($('.br-widget a:nth-child(5)').hasClass('br-selected br-current')).to.equal(true);
expect($('.br-widget a:nth-child(6)').hasClass('br-selected')).to.equal(true);
});
});
describe('bar rating plugin read-only', function () {
before(function () {
createSelect();
$('#rating').barrating('show', {
readonly:true
});
$('.br-widget a:nth-child(6)').trigger('click');
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should set correct class', function () {
expect($('.br-widget a:nth-child(4)').hasClass('br-selected')).to.equal(true);
expect($('.br-widget a:nth-child(5)').hasClass('br-selected br-current')).to.equal(true);
expect($('.br-widget a:nth-child(6)').hasClass('br-selected')).to.equal(false);
});
it('should ignore user input', function () {
expect($('#rating').data('barrating').ratingValue).to.equal('5');
expect($('#rating').data('barrating').ratingText).to.equal('rating-text-5');
});
});
describe('bar rating plugin on deselect', function () {
before(function () {
createSelect();
// prepend empty OPTION to test deselectable ratings
$('#rating').prepend($('<option />', { 'value':'' }));
$('#rating').barrating('show');
// deselect rating
$('.br-widget a:nth-child(5)').trigger('click');
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should successfully deselect rating', function () {
expect($('#rating').data('barrating').ratingValue).to.equal('');
expect($('#rating').data('barrating').ratingText).to.equal('');
});
});
describe('bar rating plugin on clear', function () {
var valuesFromCallback = [];
before(function () {
createSelect();
$('#rating').barrating('show', {
onClear:function (value, text) {
valuesFromCallback.push(value, text);
}
});
$('.br-widget a:nth-child(6)').trigger('click');
$('#rating').barrating('clear');
});
after(function () {
$('#rating').barrating('destroy');
destroySelect();
});
it('should restore original rating', function () {
expect($('#rating').data('barrating').ratingValue).to.equal('5');
expect($('#rating').data('barrating').ratingText).to.equal('rating-text-5');
});
it('should reset select field', function () {
expect($('#rating').val()).to.equal('5');
});
it('should set correct class', function () {
expect($('.br-widget a:nth-child(4)').hasClass('br-selected')).to.equal(true);
expect($('.br-widget a:nth-child(5)').hasClass('br-selected br-current')).to.equal(true);
expect($('.br-widget a:nth-child(6)').hasClass('br-selected')).to.equal(false);
});
it('should pass correct values to a callback', function () {
expect(valuesFromCallback[0]).to.equal('5');
expect(valuesFromCallback[1]).to.equal('rating-text-5');
});
});
describe('bar rating plugin on destroy', function () {
var valuesFromCallback = [];
before(function () {
createSelect();
$('#rating').barrating('show', {
onDestroy:function (value, text) {
valuesFromCallback.push(value, text);
}
});
$('#rating').barrating('destroy');
});
after(function () {
destroySelect();
});
it('should remove data', function () {
expect($('#rating').data('barrating')).to.equal(undefined);
});
it('should unwrap the select field', function () {
expect($('.br-wrapper').length).to.equal(0);
});
it('should remove the widget', function () {
expect($('.br-widget').length).to.equal(0);
});
it('should show the select field back again', function () {
expect($('#rating').is(":visible")).to.equal(true);
});
it('should pass correct values to a callback', function () {
expect(valuesFromCallback[0]).to.equal('5');
expect(valuesFromCallback[1]).to.equal('rating-text-5');
});
});
describe('bar rating plugin on set value', function () {
var valuesFromCallback = [];
before(function () {
createSelect();
$('#rating').barrating('show', {
onSelect:function (value, text) {
valuesFromCallback.push(value, text);
}
}).barrating('set', 3);
});
after(function () {
destroySelect();
});
it('should set correct value', function () {
expect($('#rating').data('barrating').ratingValue).to.equal(3);
expect($('#rating').data('barrating').ratingText).to.equal('rating-text-3');
});
it('should set correct class', function () {
expect($('.br-widget a:nth-child(3)').hasClass('br-selected')).to.equal(true);
expect($('.br-widget a:nth-child(3)').hasClass('br-current')).to.equal(true);
});
it('should pass correct values to a callback', function () {
expect(valuesFromCallback[0]).to.equal(3);
expect(valuesFromCallback[1]).to.equal('rating-text-3');
});
});
describe('bar rating plugin on set non-existing value', function () {
before(function () {
createSelect();
$('#rating')
.barrating('show', { initialRating: 5 })
.barrating('set', 9999);
});
after(function () {
destroySelect();
});
it('should do nothing', function () {
expect($('#rating').data('barrating').ratingValue).to.equal('5');
expect($('#rating').data('barrating').ratingText).to.equal('rating-text-5');
});
});
describe('bar rating plugin on change read-only state', function () {
before(function () {
createSelect();
$('#rating')
.barrating('show', { initialRating: 1 })
.barrating('readonly', true);
$('.br-widget a:last-child').trigger('click');
});
after(function () {
destroySelect();
});
it('should ignore user input', function () {
expect($('#rating').data('barrating').ratingValue).to.equal('1');
expect($('#rating').data('barrating').ratingText).to.equal('rating-text-1');
});
it('should update data', function () {
expect($('#rating').data('barrating').readOnly).to.equal(true);
});
it('should set correct widget class', function () {
expect($('.br-widget').hasClass('br-readonly')).to.equal(true);
});
});
PK $[�\}��AX X dist/jquery.barrating.min.jsnu �[��� !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=function(){function e(){var e=this,n=function(){var n=["br-wrapper"];""!==e.options.theme&&n.push("br-theme-"+e.options.theme),e.$elem.wrap(t("<div />",{"class":n.join(" ")}))},i=function(){e.$elem.unwrap()},a=function(n){return t.isNumeric(n)&&(n=Math.floor(n)),t('option[value="'+n+'"]',e.$elem)},r=function(){var n=e.options.initialRating;return n?a(n):t("option:selected",e.$elem)},o=function(){var n=e.$elem.find('option[value="'+e.options.emptyValue+'"]');return!n.length&&e.options.allowEmpty?(n=t("<option />",{value:e.options.emptyValue}),n.prependTo(e.$elem)):n},l=function(t){var n=e.$elem.data("barrating");return"undefined"!=typeof t?n[t]:n},s=function(t,n){null!==n&&"object"==typeof n?e.$elem.data("barrating",n):e.$elem.data("barrating")[t]=n},u=function(){var t=r(),n=o(),i=t.val(),a=t.data("html")?t.data("html"):t.text(),l=null!==e.options.allowEmpty?e.options.allowEmpty:!!n.length,u=n.length?n.val():null,d=n.length?n.text():null;s(null,{userOptions:e.options,ratingValue:i,ratingText:a,originalRatingValue:i,originalRatingText:a,allowEmpty:l,emptyRatingValue:u,emptyRatingText:d,readOnly:e.options.readonly,ratingMade:!1})},d=function(){e.$elem.removeData("barrating")},c=function(){return l("ratingText")},f=function(){return l("ratingValue")},g=function(){var n=t("<div />",{"class":"br-widget"});return e.$elem.find("option").each(function(){var i,a,r,o;i=t(this).val(),i!==l("emptyRatingValue")&&(a=t(this).text(),r=t(this).data("html"),r&&(a=r),o=t("<a />",{href:"#","data-rating-value":i,"data-rating-text":a,html:e.options.showValues?a:""}),n.append(o))}),e.options.showSelectedRating&&n.append(t("<div />",{text:"","class":"br-current-rating"})),e.options.reverse&&n.addClass("br-reverse"),e.options.readonly&&n.addClass("br-readonly"),n},p=function(){return l("userOptions").reverse?"nextAll":"prevAll"},h=function(t){a(t).prop("selected",!0),e.$elem.change()},m=function(){t("option",e.$elem).prop("selected",function(){return this.defaultSelected}),e.$elem.change()},v=function(t){t=t?t:c(),t==l("emptyRatingText")&&(t=""),e.options.showSelectedRating&&e.$elem.parent().find(".br-current-rating").text(t)},y=function(t){return Math.round(Math.floor(10*t)/10%1*100)},b=function(){e.$widget.find("a").removeClass(function(t,e){return(e.match(/(^|\s)br-\S+/g)||[]).join(" ")})},w=function(){var n,i,a=e.$widget.find('a[data-rating-value="'+f()+'"]'),r=l("userOptions").initialRating,o=t.isNumeric(f())?f():0,s=y(r);if(b(),a.addClass("br-selected br-current")[p()]().addClass("br-selected"),!l("ratingMade")&&t.isNumeric(r)){if(o>=r||!s)return;n=e.$widget.find("a"),i=a.length?a[l("userOptions").reverse?"prev":"next"]():n[l("userOptions").reverse?"last":"first"](),i.addClass("br-fractional"),i.addClass("br-fractional-"+s)}},$=function(t){return l("allowEmpty")&&l("userOptions").deselectable?f()==t.attr("data-rating-value"):!1},x=function(n){n.on("click.barrating",function(n){var i,a,r=t(this),o=l("userOptions");return n.preventDefault(),i=r.attr("data-rating-value"),a=r.attr("data-rating-text"),$(r)&&(i=l("emptyRatingValue"),a=l("emptyRatingText")),s("ratingValue",i),s("ratingText",a),s("ratingMade",!0),h(i),v(a),w(),o.onSelect.call(e,f(),c(),n),!1})},R=function(e){e.on("mouseenter.barrating",function(){var e=t(this);b(),e.addClass("br-active")[p()]().addClass("br-active"),v(e.attr("data-rating-text"))})},V=function(t){e.$widget.on("mouseleave.barrating blur.barrating",function(){v(),w()})},O=function(e){e.on("touchstart.barrating",function(e){e.preventDefault(),e.stopPropagation(),t(this).click()})},C=function(t){t.on("click.barrating",function(t){t.preventDefault()})},S=function(t){x(t),e.options.hoverState&&(R(t),V(t))},T=function(t){t.off(".barrating")},j=function(t){var n=e.$widget.find("a");O&&O(n),t?(T(n),C(n)):S(n)};this.show=function(){l()||(n(),u(),e.$widget=g(),e.$widget.insertAfter(e.$elem),w(),v(),j(e.options.readonly),e.$elem.hide())},this.readonly=function(t){"boolean"==typeof t&&l("readOnly")!=t&&(j(t),s("readOnly",t),e.$widget.toggleClass("br-readonly"))},this.set=function(t){var n=l("userOptions");0!==e.$elem.find('option[value="'+t+'"]').length&&(s("ratingValue",t),s("ratingText",e.$elem.find('option[value="'+t+'"]').text()),s("ratingMade",!0),h(f()),v(c()),w(),n.silent||n.onSelect.call(this,f(),c()))},this.clear=function(){var t=l("userOptions");s("ratingValue",l("originalRatingValue")),s("ratingText",l("originalRatingText")),s("ratingMade",!1),m(),v(c()),w(),t.onClear.call(this,f(),c())},this.destroy=function(){var t=f(),n=c(),a=l("userOptions");T(e.$widget.find("a")),e.$widget.remove(),d(),i(),e.$elem.show(),a.onDestroy.call(this,t,n)}}return e.prototype.init=function(e,n){return this.$elem=t(n),this.options=t.extend({},t.fn.barrating.defaults,e),this.options},e}();t.fn.barrating=function(n,i){return this.each(function(){var a=new e;if(t(this).is("select")||t.error("Sorry, this plugin only works with select fields."),a.hasOwnProperty(n)){if(a.init(i,this),"show"===n)return a.show(i);if(a.$elem.data("barrating"))return a.$widget=t(this).next(".br-widget"),a[n](i)}else{if("object"==typeof n||!n)return i=n,a.init(i,this),a.show();t.error("Method "+n+" does not exist on jQuery.barrating")}})},t.fn.barrating.defaults={theme:"",initialRating:null,allowEmpty:null,emptyValue:"",showValues:!1,showSelectedRating:!0,deselectable:!0,reverse:!1,readonly:!1,fastClicks:!0,hoverState:!0,silent:!1,onSelect:function(t,e,n){},onClear:function(t,e){},onDestroy:function(t,e){}},t.fn.barrating.BarRating=e});
//# sourceMappingURL=jquery.barrating.min.js.mapPK $[�\�\^� � dist/themes/bars-square.cssnu �[��� .br-theme-bars-square .br-widget {
height: 15px;
white-space: nowrap;
}
.br-theme-bars-square .br-widget a {
display: block;
width: 30px;
height: 30px;
float: left;
border: 2px solid #bbcefb;
background-color: white;
margin: 2px;
text-decoration: none;
font-size: 14px;
font-weight: 400;
line-height: 2;
text-align: center;
color: #bbcefb;
font-weight: 600;
}
.br-theme-bars-square .br-widget a.br-active,
.br-theme-bars-square .br-widget a.br-selected {
border: 2px solid #4278F5;
color: #4278F5;
}
.br-theme-bars-square .br-widget .br-current-rating {
clear: both;
width: 330px;
text-align: center;
font-weight: 600;
display: block;
padding: .5em 0;
color: #646464;
}
.br-theme-bars-square .br-readonly a {
cursor: default;
}
.br-theme-bars-square .br-readonly a.br-active,
.br-theme-bars-square .br-readonly a.br-selected {
border: 2px solid #729bf8;
color: #729bf8;
}
@media print {
.br-theme-bars-square .br-widget a {
border: 2px solid #b3b3b3;
color: #b3b3b3;
}
.br-theme-bars-square .br-widget a.br-active,
.br-theme-bars-square .br-widget a.br-selected {
border: 2px solid black;
color: black;
}
}
PK $[�\S� � ! dist/themes/fontawesome-stars.cssnu �[��� .br-theme-fontawesome-stars .br-widget {
height: 28px;
white-space: nowrap;
}
.br-theme-fontawesome-stars .br-widget a {
font: normal normal normal 20px/1 FontAwesome;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
text-decoration: none;
margin-right: 2px;
}
.br-theme-fontawesome-stars .br-widget a:after {
content: '\f005';
color: #d2d2d2;
}
.br-theme-fontawesome-stars .br-widget a.br-active:after {
color: #EDB867;
}
.br-theme-fontawesome-stars .br-widget a.br-selected:after {
color: #EDB867;
}
.br-theme-fontawesome-stars .br-widget .br-current-rating {
display: none;
}
.br-theme-fontawesome-stars .br-readonly a {
cursor: default;
}
@media print {
.br-theme-fontawesome-stars .br-widget a:after {
content: '\f006';
color: black;
}
.br-theme-fontawesome-stars .br-widget a.br-active:after,
.br-theme-fontawesome-stars .br-widget a.br-selected:after {
content: '\f005';
color: black;
}
}
PK $[�\kvB-� � dist/themes/bars-reversed.cssnu �[��� .br-theme-bars-reversed .br-widget {
height: 25px;
white-space: nowrap;
}
.br-theme-bars-reversed .br-widget a {
display: block;
width: 22px;
height: 22px;
float: left;
background-color: #bef5e8;
margin: 1px;
font-size: 15px;
font-weight: 400;
line-height: 1.4;
color: #50E3C2;
text-align: center;
}
.br-theme-bars-reversed .br-widget a.br-active,
.br-theme-bars-reversed .br-widget a.br-selected {
background-color: #50E3C2;
color: white;
}
.br-theme-bars-reversed .br-widget .br-current-rating {
line-height: 1.3;
float: left;
padding: 0 20px 0 20px;
color: #50E3C2;
font-size: 17px;
font-weight: 400;
}
.br-theme-bars-reversed .br-readonly a {
cursor: default;
}
.br-theme-bars-reversed .br-readonly a.br-active,
.br-theme-bars-reversed .br-readonly a.br-selected {
background-color: #7cead1;
}
.br-theme-bars-reversed .br-readonly .br-current-rating {
color: #7cead1;
}
@media print {
.br-theme-bars-reversed .br-widget a {
border: 1px solid #b3b3b3;
background: white;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.br-theme-bars-reversed .br-widget a.br-active,
.br-theme-bars-reversed .br-widget a.br-selected {
border: 1px solid black;
background: white;
}
.br-theme-bars-reversed .br-widget .br-current-rating {
color: black;
}
}
PK $[�\HɌG dist/themes/bars-movie.cssnu �[��� .br-theme-bars-movie .br-widget {
height: 10px;
white-space: nowrap;
}
.br-theme-bars-movie .br-widget a {
display: block;
width: 60px;
height: 8px;
float: left;
background-color: #bbcefb;
margin: 1px;
}
.br-theme-bars-movie .br-widget a.br-active,
.br-theme-bars-movie .br-widget a.br-selected {
background-color: #4278F5;
}
.br-theme-bars-movie .br-widget .br-current-rating {
clear: both;
width: 240px;
text-align: center;
font-weight: 600;
display: block;
padding: .5em 0;
color: #4278F5;
font-weight: 400;
}
.br-theme-bars-movie .br-readonly a {
cursor: default;
}
.br-theme-bars-movie .br-readonly a.br-active,
.br-theme-bars-movie .br-readonly a.br-selected {
background-color: #729bf8;
}
.br-theme-bars-movie .br-readonly .br-current-rating {
color: #729bf8;
}
@media print {
.br-theme-bars-movie .br-widget a {
border: 1px solid #b3b3b3;
background: white;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.br-theme-bars-movie .br-widget a.br-active,
.br-theme-bars-movie .br-widget a.br-selected {
border: 1px solid black;
background: white;
}
.br-theme-bars-movie .br-widget .br-current-rating {
color: black;
}
}
PK $[�\m��� � dist/themes/bootstrap-stars.cssnu �[��� .br-theme-bootstrap-stars .br-widget {
height: 28px;
white-space: nowrap;
}
.br-theme-bootstrap-stars .br-widget a {
font: normal normal normal 18px/1 'Glyphicons Halflings';
text-rendering: auto;
-webkit-font-smoothing: antialiased;
text-decoration: none;
margin-right: 2px;
}
.br-theme-bootstrap-stars .br-widget a:after {
content: '\e006';
color: #d2d2d2;
}
.br-theme-bootstrap-stars .br-widget a.br-active:after {
color: #EDB867;
}
.br-theme-bootstrap-stars .br-widget a.br-selected:after {
color: #EDB867;
}
.br-theme-bootstrap-stars .br-widget .br-current-rating {
display: none;
}
.br-theme-bootstrap-stars .br-readonly a {
cursor: default;
}
@media print {
.br-theme-bootstrap-stars .br-widget a:after {
content: '\e007';
color: black;
}
.br-theme-bootstrap-stars .br-widget a.br-active:after,
.br-theme-bootstrap-stars .br-widget a.br-selected:after {
content: '\e006';
color: black;
}
}
PK $[�\g)��f f dist/themes/css-stars.cssnu �[��� .br-theme-css-stars .br-widget {
height: 28px;
white-space: nowrap;
}
.br-theme-css-stars .br-widget a {
text-decoration: none;
height: 18px;
width: 18px;
float: left;
font-size: 23px;
margin-right: 5px;
}
.br-theme-css-stars .br-widget a:after {
content: "\2605";
color: #d2d2d2;
}
.br-theme-css-stars .br-widget a.br-active:after {
color: #EDB867;
}
.br-theme-css-stars .br-widget a.br-selected:after {
color: #EDB867;
}
.br-theme-css-stars .br-widget .br-current-rating {
display: none;
}
.br-theme-css-stars .br-readonly a {
cursor: default;
}
@media print {
.br-theme-css-stars .br-widget a:after {
content: "\2606";
color: black;
}
.br-theme-css-stars .br-widget a.br-active:after,
.br-theme-css-stars .br-widget a.br-selected:after {
content: "\2605";
color: black;
}
}
PK $[�\mu1x# # dist/themes/bars-horizontal.cssnu �[��� .br-theme-bars-horizontal .br-widget {
width: 120px;
white-space: nowrap;
}
.br-theme-bars-horizontal .br-widget a {
display: block;
width: 120px;
height: 5px;
background-color: #fbedd9;
margin: 1px;
}
.br-theme-bars-horizontal .br-widget a.br-active,
.br-theme-bars-horizontal .br-widget a.br-selected {
background-color: #EDB867;
}
.br-theme-bars-horizontal .br-widget .br-current-rating {
width: 120px;
font-size: 18px;
font-weight: 600;
line-height: 2;
text-align: center;
color: #EDB867;
}
.br-theme-bars-horizontal .br-readonly a {
cursor: default;
}
.br-theme-bars-horizontal .br-readonly a.br-active,
.br-theme-bars-horizontal .br-readonly a.br-selected {
background-color: #f2cd95;
}
.br-theme-bars-horizontal .br-readonly .br-current-rating {
color: #f2cd95;
}
@media print {
.br-theme-bars-horizontal .br-widget a {
border: 1px solid #b3b3b3;
background: white;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.br-theme-bars-horizontal .br-widget a.br-active,
.br-theme-bars-horizontal .br-widget a.br-selected {
border: 1px solid black;
background: white;
}
.br-theme-bars-horizontal .br-widget .br-current-rating {
color: black;
}
}
PK $[�\|O�� � dist/themes/bars-pill.cssnu �[��� .br-theme-bars-pill .br-widget {
white-space: nowrap;
}
.br-theme-bars-pill .br-widget a {
padding: 7px 15px;
background-color: #bef5e8;
color: #50E3C2;
text-decoration: none;
font-size: 13px;
line-height: 3;
text-align: center;
font-weight: 400;
}
.br-theme-bars-pill .br-widget a:first-child {
-webkit-border-top-left-radius: 999px;
-webkit-border-bottom-left-radius: 999px;
-moz-border-radius-topleft: 999px;
-moz-border-radius-bottomleft: 999px;
border-top-left-radius: 999px;
border-bottom-left-radius: 999px;
}
.br-theme-bars-pill .br-widget a:last-child {
-webkit-border-top-right-radius: 999px;
-webkit-border-bottom-right-radius: 999px;
-moz-border-radius-topright: 999px;
-moz-border-radius-bottomright: 999px;
border-top-right-radius: 999px;
border-bottom-right-radius: 999px;
}
.br-theme-bars-pill .br-widget a.br-active,
.br-theme-bars-pill .br-widget a.br-selected {
background-color: #50E3C2;
color: white;
}
.br-theme-bars-pill .br-readonly a {
cursor: default;
}
.br-theme-bars-pill .br-readonly a.br-active,
.br-theme-bars-pill .br-readonly a.br-selected {
background-color: #7cead1;
}
@media print {
.br-theme-bars-pill .br-widget a {
border: 1px solid #b3b3b3;
border-left: none;
background: white;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.br-theme-bars-pill .br-widget a.br-active,
.br-theme-bars-pill .br-widget a.br-selected {
border: 1px solid black;
border-left: none;
background: white;
color: black;
}
.br-theme-bars-pill .br-widget a:first-child {
border-left: 1px solid black;
}
}
PK $[�\q��� � # dist/themes/fontawesome-stars-o.cssnu �[��� .br-theme-fontawesome-stars-o .br-widget {
height: 28px;
white-space: nowrap;
}
.br-theme-fontawesome-stars-o .br-widget a {
font: normal normal normal 20px/1 FontAwesome;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
text-decoration: none;
margin-right: 2px;
}
.br-theme-fontawesome-stars-o .br-widget a:after {
content: '\f006';
color: #d2d2d2;
}
.br-theme-fontawesome-stars-o .br-widget a.br-active:after {
content: '\f005';
color: #50E3C2;
}
.br-theme-fontawesome-stars-o .br-widget a.br-selected:after {
content: '\f005';
color: #50E3C2;
}
.br-theme-fontawesome-stars-o .br-widget a.br-fractional:after {
content: '\f123';
color: #50E3C2;
}
.br-theme-fontawesome-stars-o .br-widget .br-current-rating {
display: none;
}
.br-theme-fontawesome-stars-o .br-readonly a {
cursor: default;
}
.br-theme-fontawesome-stars-o .br-reverse a.br-fractional {
display: inline-block;
transform: scaleX(-1);
-moz-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}
@media print {
.br-theme-fontawesome-stars-o .br-widget a:after {
content: '\f006';
color: black;
}
.br-theme-fontawesome-stars-o .br-widget a.br-active:after,
.br-theme-fontawesome-stars-o .br-widget a.br-selected:after {
content: '\f005';
color: black;
}
.br-theme-fontawesome-stars-o .br-widget a.br-fractional:after {
content: '\f123';
color: black;
}
}
PK $[�\����2 2 dist/themes/bars-1to10.cssnu �[��� .br-theme-bars-1to10 .br-widget {
height: 50px;
white-space: nowrap;
}
.br-theme-bars-1to10 .br-widget a {
display: block;
width: 12px;
padding: 5px 0;
height: 28px;
float: left;
background-color: #fbedd9;
margin: 1px;
text-align: center;
}
.br-theme-bars-1to10 .br-widget a.br-active,
.br-theme-bars-1to10 .br-widget a.br-selected {
background-color: #EDB867;
}
.br-theme-bars-1to10 .br-widget .br-current-rating {
font-size: 20px;
line-height: 2;
float: left;
padding: 0 20px 0 20px;
color: #EDB867;
font-weight: 400;
}
.br-theme-bars-1to10 .br-readonly a {
cursor: default;
}
.br-theme-bars-1to10 .br-readonly a.br-active,
.br-theme-bars-1to10 .br-readonly a.br-selected {
background-color: #f2cd95;
}
.br-theme-bars-1to10 .br-readonly .br-current-rating {
color: #f2cd95;
}
@media print {
.br-theme-bars-1to10 .br-widget a {
border: 1px solid #b3b3b3;
background: white;
height: 38px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.br-theme-bars-1to10 .br-widget a.br-active,
.br-theme-bars-1to10 .br-widget a.br-selected {
border: 1px solid black;
background: white;
}
.br-theme-bars-1to10 .br-widget .br-current-rating {
color: black;
}
}
PK $[�\��Cm Cm dist/jquery.barrating.min.js.mapnu �[��� {"version":3,"sources":["jquery.barrating.js"],"names":["factory","define","amd","module","exports","require","jQuery","$","BarRating","self","this","wrapElement","classes","options","theme","push","$elem","wrap","class","join","unwrapElement","unwrap","findOption","value","isNumeric","Math","floor","getInitialOption","initialRating","getEmptyOption","$emptyOpt","find","emptyValue","length","allowEmpty","prependTo","getData","key","data","setData","saveDataOnElement","$opt","val","text","emptyText","userOptions","ratingValue","ratingText","originalRatingValue","originalRatingText","emptyRatingValue","emptyRatingText","readOnly","readonly","ratingMade","removeDataOnElement","removeData","buildWidget","$w","each","html","$a","href","data-rating-value","data-rating-text","append","showSelectedRating","reverse","addClass","nextAllorPreviousAll","setSelectFieldValue","prop","change","resetSelectField","defaultSelected","parent","fraction","round","resetStyle","$widget","removeClass","index","match","applyStyle","$all","$fractional","baseValue","f","isDeselectable","$element","deselectable","attr","attachClickHandler","$elements","on","event","preventDefault","onSelect","call","attachMouseEnterHandler","attachMouseLeaveHandler","fastClicks","stopPropagation","click","disableClicks","attachHandlers","hoverState","detachHandlers","off","setupHandlers","show","insertAfter","hide","state","toggleClass","set","silent","clear","onClear","destroy","remove","onDestroy","prototype","init","elem","extend","fn","barrating","defaults","method","plugin","is","error","hasOwnProperty","next","showValues"],"mappings":"CAUC,SAAUA,GACe,kBAAXC,SAAyBA,OAAOC,IAEvCD,QAAQ,UAAWD,GACM,gBAAXG,SAAuBA,OAAOC,QAE5CD,OAAOC,QAAUJ,EAAQK,QAAQ,WAGjCL,EAAQM,SAEd,SAAUC,GAER,GAAIC,GAAY,WAEZ,QAASA,KACL,GAAIC,GAAOC,KAGPC,EAAc,WACd,GAAIC,IAAW,aAEY,MAAvBH,EAAKI,QAAQC,OACbF,EAAQG,KAAK,YAAcN,EAAKI,QAAQC,OAG5CL,EAAKO,MAAMC,KAAKV,EAAE,WACdW,QAASN,EAAQO,KAAK,SAK1BC,EAAgB,WAChBX,EAAKO,MAAMK,UAIXC,EAAa,SAASC,GAKtB,MAJIhB,GAAEiB,UAAUD,KACZA,EAAQE,KAAKC,MAAMH,IAGhBhB,EAAE,iBAAmBgB,EAAS,KAAMd,EAAKO,QAIhDW,EAAmB,WACnB,GAAIC,GAAgBnB,EAAKI,QAAQe,aAEjC,OAAKA,GAIEN,EAAWM,GAHPrB,EAAE,kBAAmBE,EAAKO,QAOrCa,EAAiB,WACjB,GAAIC,GAAYrB,EAAKO,MAAMe,KAAK,iBAAmBtB,EAAKI,QAAQmB,WAAa,KAE7E,QAAKF,EAAUG,QAAUxB,EAAKI,QAAQqB,YAClCJ,EAAYvB,EAAE,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js","sourcesContent":["/**\n * jQuery Bar Rating Plugin v1.2.2\n *\n * http://github.com/antennaio/jquery-bar-rating\n *\n * Copyright (c) 2012-2016 Kazik Pietruszewski\n *\n * This plugin is available under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n */\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD\n define(['jquery'], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node/CommonJS\n module.exports = factory(require('jquery'));\n } else {\n // browser globals\n factory(jQuery);\n }\n}(function ($) {\n\n var BarRating = (function() {\n\n function BarRating() {\n var self = this;\n\n // wrap element in a wrapper div\n var wrapElement = function() {\n var classes = ['br-wrapper'];\n\n if (self.options.theme !== '') {\n classes.push('br-theme-' + self.options.theme);\n }\n\n self.$elem.wrap($('<div />', {\n 'class': classes.join(' ')\n }));\n };\n\n // unwrap element\n var unwrapElement = function() {\n self.$elem.unwrap();\n };\n\n // find option by value\n var findOption = function(value) {\n if ($.isNumeric(value)) {\n value = Math.floor(value);\n }\n\n return $('option[value=\"' + value + '\"]', self.$elem);\n };\n\n // get initial option\n var getInitialOption = function() {\n var initialRating = self.options.initialRating;\n\n if (!initialRating) {\n return $('option:selected', self.$elem);\n }\n\n return findOption(initialRating);\n };\n\n // get empty option\n var getEmptyOption = function() {\n var $emptyOpt = self.$elem.find('option[value=\"' + self.options.emptyValue + '\"]');\n\n if (!$emptyOpt.length && self.options.allowEmpty) {\n $emptyOpt = $('<option />', { 'value': self.options.emptyValue });\n\n return $emptyOpt.prependTo(self.$elem);\n }\n\n return $emptyOpt;\n };\n\n // get data\n var getData = function(key) {\n var data = self.$elem.data('barrating');\n\n if (typeof key !== 'undefined') {\n return data[key];\n }\n\n return data;\n };\n\n // set data\n var setData = function(key, value) {\n if (value !== null && typeof value === 'object') {\n self.$elem.data('barrating', value);\n } else {\n self.$elem.data('barrating')[key] = value;\n }\n };\n\n // save data on element\n var saveDataOnElement = function() {\n var $opt = getInitialOption();\n var $emptyOpt = getEmptyOption();\n\n var value = $opt.val();\n var text = $opt.data('html') ? $opt.data('html') : $opt.text();\n\n // if the allowEmpty option is not set let's check if empty option exists in the select field\n var allowEmpty = (self.options.allowEmpty !== null) ?\n self.options.allowEmpty :\n !!$emptyOpt.length;\n\n var emptyValue = ($emptyOpt.length) ? $emptyOpt.val() : null;\n var emptyText = ($emptyOpt.length) ? $emptyOpt.text() : null;\n\n setData(null, {\n userOptions: self.options,\n\n // initial rating based on the OPTION value\n ratingValue: value,\n ratingText: text,\n\n // rating will be restored by calling clear method\n originalRatingValue: value,\n originalRatingText: text,\n\n // allow empty ratings?\n allowEmpty: allowEmpty,\n\n // rating value and text of the empty OPTION\n emptyRatingValue: emptyValue,\n emptyRatingText: emptyText,\n\n // read-only state\n readOnly: self.options.readonly,\n\n // did the user already select a rating?\n ratingMade: false\n });\n };\n\n // remove data on element\n var removeDataOnElement = function() {\n self.$elem.removeData('barrating');\n };\n\n // return current rating text\n var ratingText = function() {\n return getData('ratingText');\n };\n\n // return current rating value\n var ratingValue = function() {\n return getData('ratingValue');\n };\n\n // build widget and return jQuery element\n var buildWidget = function() {\n var $w = $('<div />', { 'class': 'br-widget' });\n\n // create A elements that will replace OPTIONs\n self.$elem.find('option').each(function() {\n var val, text, html, $a;\n\n val = $(this).val();\n\n // create ratings - but only if val is not defined as empty\n if (val !== getData('emptyRatingValue')) {\n text = $(this).text();\n html = $(this).data('html');\n if (html) { text = html; }\n\n $a = $('<a />', {\n 'href': '#',\n 'data-rating-value': val,\n 'data-rating-text': text,\n 'html': (self.options.showValues) ? text : ''\n });\n\n $w.append($a);\n }\n\n });\n\n // append .br-current-rating div to the widget\n if (self.options.showSelectedRating) {\n $w.append($('<div />', { 'text': '', 'class': 'br-current-rating' }));\n }\n\n // additional classes for the widget\n if (self.options.reverse) {\n $w.addClass('br-reverse');\n }\n\n if (self.options.readonly) {\n $w.addClass('br-readonly');\n }\n\n return $w;\n };\n\n // return a jQuery function name depending on the 'reverse' setting\n var nextAllorPreviousAll = function() {\n if (getData('userOptions').reverse) {\n return 'nextAll';\n } else {\n return 'prevAll';\n }\n };\n\n // set the value of the select field\n var setSelectFieldValue = function(value) {\n // change selected option\n findOption(value).prop('selected', true);\n\n self.$elem.change();\n };\n\n // reset select field\n var resetSelectField = function() {\n $('option', self.$elem).prop('selected', function() {\n return this.defaultSelected;\n });\n\n self.$elem.change();\n };\n\n // display the currently selected rating\n var showSelectedRating = function(text) {\n // text undefined?\n text = text ? text : ratingText();\n\n // special case when the selected rating is defined as empty\n if (text == getData('emptyRatingText')) {\n text = '';\n }\n\n // update .br-current-rating div\n if (self.options.showSelectedRating) {\n self.$elem.parent().find('.br-current-rating').text(text);\n }\n };\n\n // return rounded fraction of a value (14.4 -> 40, 0.99 -> 90)\n var fraction = function(value) {\n return Math.round(((Math.floor(value * 10) / 10) % 1) * 100);\n };\n\n // remove all classes from elements\n var resetStyle = function() {\n // remove all classes starting with br-*\n self.$widget.find('a').removeClass(function(index, classes) {\n return (classes.match(/(^|\\s)br-\\S+/g) || []).join(' ');\n });\n };\n\n // apply style by setting classes on elements\n var applyStyle = function() {\n var $a = self.$widget.find('a[data-rating-value=\"' + ratingValue() + '\"]');\n var initialRating = getData('userOptions').initialRating;\n var baseValue = $.isNumeric(ratingValue()) ? ratingValue() : 0;\n var f = fraction(initialRating);\n var $all, $fractional;\n\n resetStyle();\n\n // add classes\n $a.addClass('br-selected br-current')[nextAllorPreviousAll()]()\n .addClass('br-selected');\n\n if (!getData('ratingMade') && $.isNumeric(initialRating)) {\n if ((initialRating <= baseValue) || !f) {\n return;\n }\n\n $all = self.$widget.find('a');\n\n $fractional = ($a.length) ?\n $a[(getData('userOptions').reverse) ? 'prev' : 'next']() :\n $all[(getData('userOptions').reverse) ? 'last' : 'first']();\n\n $fractional.addClass('br-fractional');\n $fractional.addClass('br-fractional-' + f);\n }\n };\n\n // check if the element is deselectable?\n var isDeselectable = function($element) {\n if (!getData('allowEmpty') || !getData('userOptions').deselectable) {\n return false;\n }\n\n return (ratingValue() == $element.attr('data-rating-value'));\n };\n\n // handle click events\n var attachClickHandler = function($elements) {\n $elements.on('click.barrating', function(event) {\n var $a = $(this),\n options = getData('userOptions'),\n value,\n text;\n\n event.preventDefault();\n\n value = $a.attr('data-rating-value');\n text = $a.attr('data-rating-text');\n\n // is current and deselectable?\n if (isDeselectable($a)) {\n value = getData('emptyRatingValue');\n text = getData('emptyRatingText');\n }\n\n // remember selected rating\n setData('ratingValue', value);\n setData('ratingText', text);\n setData('ratingMade', true);\n\n setSelectFieldValue(value);\n showSelectedRating(text);\n\n applyStyle();\n\n // onSelect callback\n options.onSelect.call(\n self,\n ratingValue(),\n ratingText(),\n event\n );\n\n return false;\n });\n };\n\n // handle mouseenter events\n var attachMouseEnterHandler = function($elements) {\n $elements.on('mouseenter.barrating', function() {\n var $a = $(this);\n\n resetStyle();\n\n $a.addClass('br-active')[nextAllorPreviousAll()]()\n .addClass('br-active');\n\n showSelectedRating($a.attr('data-rating-text'));\n });\n };\n\n // handle mouseleave events\n var attachMouseLeaveHandler = function($elements) {\n self.$widget.on('mouseleave.barrating blur.barrating', function() {\n showSelectedRating();\n applyStyle();\n });\n };\n\n // somewhat primitive way to remove 300ms click delay on touch devices\n // for a more advanced solution consider setting `fastClicks` option to false\n // and using a library such as fastclick (https://github.com/ftlabs/fastclick)\n var fastClicks = function($elements) {\n $elements.on('touchstart.barrating', function(event) {\n event.preventDefault();\n event.stopPropagation();\n\n $(this).click();\n });\n };\n\n // disable clicks\n var disableClicks = function($elements) {\n $elements.on('click.barrating', function(event) {\n event.preventDefault();\n });\n };\n\n var attachHandlers = function($elements) {\n // attach click event handler\n attachClickHandler($elements);\n\n if (self.options.hoverState) {\n // attach mouseenter event handler\n attachMouseEnterHandler($elements);\n\n // attach mouseleave event handler\n attachMouseLeaveHandler($elements);\n }\n };\n\n var detachHandlers = function($elements) {\n // remove event handlers in the \".barrating\" namespace\n $elements.off('.barrating');\n };\n\n var setupHandlers = function(readonly) {\n var $elements = self.$widget.find('a');\n\n if (fastClicks) {\n fastClicks($elements);\n }\n\n if (readonly) {\n detachHandlers($elements);\n disableClicks($elements);\n } else {\n attachHandlers($elements);\n }\n };\n\n this.show = function() {\n // run only once\n if (getData()) return;\n\n // wrap element\n wrapElement();\n\n // save data\n saveDataOnElement();\n\n // build & append widget to the DOM\n self.$widget = buildWidget();\n self.$widget.insertAfter(self.$elem);\n\n applyStyle();\n\n showSelectedRating();\n\n setupHandlers(self.options.readonly);\n\n // hide the select field\n self.$elem.hide();\n };\n\n this.readonly = function(state) {\n if (typeof state !== 'boolean' || getData('readOnly') == state) return;\n\n setupHandlers(state);\n setData('readOnly', state);\n self.$widget.toggleClass('br-readonly');\n };\n\n this.set = function(value) {\n var options = getData('userOptions');\n\n if (self.$elem.find('option[value=\"' + value + '\"]').length === 0) return;\n\n // set data\n setData('ratingValue', value);\n setData('ratingText', self.$elem.find('option[value=\"' + value + '\"]').text());\n setData('ratingMade', true);\n\n setSelectFieldValue(ratingValue());\n showSelectedRating(ratingText());\n\n applyStyle();\n\n // onSelect callback\n if (!options.silent) {\n options.onSelect.call(\n this,\n ratingValue(),\n ratingText()\n );\n }\n };\n\n this.clear = function() {\n var options = getData('userOptions');\n\n // restore original data\n setData('ratingValue', getData('originalRatingValue'));\n setData('ratingText', getData('originalRatingText'));\n setData('ratingMade', false);\n\n resetSelectField();\n showSelectedRating(ratingText());\n\n applyStyle();\n\n // onClear callback\n options.onClear.call(\n this,\n ratingValue(),\n ratingText()\n );\n };\n\n this.destroy = function() {\n var value = ratingValue();\n var text = ratingText();\n var options = getData('userOptions');\n\n // detach handlers\n detachHandlers(self.$widget.find('a'));\n\n // remove widget\n self.$widget.remove();\n\n // remove data\n removeDataOnElement();\n\n // unwrap the element\n unwrapElement();\n\n // show the element\n self.$elem.show();\n\n // onDestroy callback\n options.onDestroy.call(\n this,\n value,\n text\n );\n };\n }\n\n BarRating.prototype.init = function (options, elem) {\n this.$elem = $(elem);\n this.options = $.extend({}, $.fn.barrating.defaults, options);\n\n return this.options;\n };\n\n return BarRating;\n })();\n\n $.fn.barrating = function (method, options) {\n return this.each(function () {\n var plugin = new BarRating();\n\n // plugin works with select fields\n if (!$(this).is('select')) {\n $.error('Sorry, this plugin only works with select fields.');\n }\n\n // method supplied\n if (plugin.hasOwnProperty(method)) {\n plugin.init(options, this);\n if (method === 'show') {\n return plugin.show(options);\n } else {\n // plugin exists?\n if (plugin.$elem.data('barrating')) {\n plugin.$widget = $(this).next('.br-widget');\n return plugin[method](options);\n }\n }\n\n // no method supplied or only options supplied\n } else if (typeof method === 'object' || !method) {\n options = method;\n plugin.init(options, this);\n return plugin.show();\n\n } else {\n $.error('Method ' + method + ' does not exist on jQuery.barrating');\n }\n });\n };\n\n $.fn.barrating.defaults = {\n theme:'',\n initialRating:null, // initial rating\n allowEmpty:null, // allow empty ratings?\n emptyValue:'', // this is the expected value of the empty rating\n showValues:false, // display rating values on the bars?\n showSelectedRating:true, // append a div with a rating to the widget?\n deselectable:true, // allow to deselect ratings?\n reverse:false, // reverse the rating?\n readonly:false, // make the rating ready-only?\n fastClicks:true, // remove 300ms click delay on touch devices?\n hoverState:true, // change state on hover?\n silent:false, // supress callbacks when controlling ratings programatically\n onSelect:function (value, text, event) {\n }, // callback fired when a rating is selected\n onClear:function (value, text) {\n }, // callback fired when a rating is cleared\n onDestroy:function (value, text) {\n } // callback fired when a widget is destroyed\n };\n\n $.fn.barrating.BarRating = BarRating;\n\n}));\n"],"sourceRoot":"/source/"}PK $[�\y-�ͅO �O jquery.barrating.jsnu �[��� /**
* jQuery Bar Rating Plugin v1.2.2
*
* http://github.com/antennaio/jquery-bar-rating
*
* Copyright (c) 2012-2016 Kazik Pietruszewski
*
* This plugin is available under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// browser globals
factory(jQuery);
}
}(function ($) {
var BarRating = (function() {
function BarRating() {
var self = this;
// wrap element in a wrapper div
var wrapElement = function() {
var classes = ['br-wrapper'];
if (self.options.theme !== '') {
classes.push('br-theme-' + self.options.theme);
}
self.$elem.wrap($('<div />', {
'class': classes.join(' ')
}));
};
// unwrap element
var unwrapElement = function() {
self.$elem.unwrap();
};
// find option by value
var findOption = function(value) {
if ($.isNumeric(value)) {
value = Math.floor(value);
}
return $('option[value="' + value + '"]', self.$elem);
};
// get initial option
var getInitialOption = function() {
var initialRating = self.options.initialRating;
if (!initialRating) {
return $('option:selected', self.$elem);
}
return findOption(initialRating);
};
// get empty option
var getEmptyOption = function() {
var $emptyOpt = self.$elem.find('option[value="' + self.options.emptyValue + '"]');
if (!$emptyOpt.length && self.options.allowEmpty) {
$emptyOpt = $('<option />', { 'value': self.options.emptyValue });
return $emptyOpt.prependTo(self.$elem);
}
return $emptyOpt;
};
// get data
var getData = function(key) {
var data = self.$elem.data('barrating');
if (typeof key !== 'undefined') {
return data[key];
}
return data;
};
// set data
var setData = function(key, value) {
if (value !== null && typeof value === 'object') {
self.$elem.data('barrating', value);
} else {
self.$elem.data('barrating')[key] = value;
}
};
// save data on element
var saveDataOnElement = function() {
var $opt = getInitialOption();
var $emptyOpt = getEmptyOption();
var value = $opt.val();
var text = $opt.data('html') ? $opt.data('html') : $opt.text();
// if the allowEmpty option is not set let's check if empty option exists in the select field
var allowEmpty = (self.options.allowEmpty !== null) ?
self.options.allowEmpty :
!!$emptyOpt.length;
var emptyValue = ($emptyOpt.length) ? $emptyOpt.val() : null;
var emptyText = ($emptyOpt.length) ? $emptyOpt.text() : null;
setData(null, {
userOptions: self.options,
// initial rating based on the OPTION value
ratingValue: value,
ratingText: text,
// rating will be restored by calling clear method
originalRatingValue: value,
originalRatingText: text,
// allow empty ratings?
allowEmpty: allowEmpty,
// rating value and text of the empty OPTION
emptyRatingValue: emptyValue,
emptyRatingText: emptyText,
// read-only state
readOnly: self.options.readonly,
// did the user already select a rating?
ratingMade: false
});
};
// remove data on element
var removeDataOnElement = function() {
self.$elem.removeData('barrating');
};
// return current rating text
var ratingText = function() {
return getData('ratingText');
};
// return current rating value
var ratingValue = function() {
return getData('ratingValue');
};
// build widget and return jQuery element
var buildWidget = function() {
var $w = $('<div />', { 'class': 'br-widget' });
// create A elements that will replace OPTIONs
self.$elem.find('option').each(function() {
var val, text, html, $a;
val = $(this).val();
// create ratings - but only if val is not defined as empty
if (val !== getData('emptyRatingValue')) {
text = $(this).text();
html = $(this).data('html');
if (html) { text = html; }
$a = $('<a />', {
'href': '#',
'data-rating-value': val,
'data-rating-text': text,
'html': (self.options.showValues) ? text : ''
});
$w.append($a);
}
});
// append .br-current-rating div to the widget
if (self.options.showSelectedRating) {
$w.append($('<div />', { 'text': '', 'class': 'br-current-rating' }));
}
// additional classes for the widget
if (self.options.reverse) {
$w.addClass('br-reverse');
}
if (self.options.readonly) {
$w.addClass('br-readonly');
}
return $w;
};
// return a jQuery function name depending on the 'reverse' setting
var nextAllorPreviousAll = function() {
if (getData('userOptions').reverse) {
return 'nextAll';
} else {
return 'prevAll';
}
};
// set the value of the select field
var setSelectFieldValue = function(value) {
// change selected option
findOption(value).prop('selected', true);
self.$elem.change();
};
// reset select field
var resetSelectField = function() {
$('option', self.$elem).prop('selected', function() {
return this.defaultSelected;
});
self.$elem.change();
};
// display the currently selected rating
var showSelectedRating = function(text) {
// text undefined?
text = text ? text : ratingText();
// special case when the selected rating is defined as empty
if (text == getData('emptyRatingText')) {
text = '';
}
// update .br-current-rating div
if (self.options.showSelectedRating) {
self.$elem.parent().find('.br-current-rating').text(text);
}
};
// return rounded fraction of a value (14.4 -> 40, 0.99 -> 90)
var fraction = function(value) {
return Math.round(((Math.floor(value * 10) / 10) % 1) * 100);
};
// remove all classes from elements
var resetStyle = function() {
// remove all classes starting with br-*
self.$widget.find('a').removeClass(function(index, classes) {
return (classes.match(/(^|\s)br-\S+/g) || []).join(' ');
});
};
// apply style by setting classes on elements
var applyStyle = function() {
var $a = self.$widget.find('a[data-rating-value="' + ratingValue() + '"]');
var initialRating = getData('userOptions').initialRating;
var baseValue = $.isNumeric(ratingValue()) ? ratingValue() : 0;
var f = fraction(initialRating);
var $all, $fractional;
resetStyle();
// add classes
$a.addClass('br-selected br-current')[nextAllorPreviousAll()]()
.addClass('br-selected');
if (!getData('ratingMade') && $.isNumeric(initialRating)) {
if ((initialRating <= baseValue) || !f) {
return;
}
$all = self.$widget.find('a');
$fractional = ($a.length) ?
$a[(getData('userOptions').reverse) ? 'prev' : 'next']() :
$all[(getData('userOptions').reverse) ? 'last' : 'first']();
$fractional.addClass('br-fractional');
$fractional.addClass('br-fractional-' + f);
}
};
// check if the element is deselectable?
var isDeselectable = function($element) {
if (!getData('allowEmpty') || !getData('userOptions').deselectable) {
return false;
}
return (ratingValue() == $element.attr('data-rating-value'));
};
// handle click events
var attachClickHandler = function($elements) {
$elements.on('click.barrating', function(event) {
var $a = $(this),
options = getData('userOptions'),
value,
text;
event.preventDefault();
value = $a.attr('data-rating-value');
text = $a.attr('data-rating-text');
// is current and deselectable?
if (isDeselectable($a)) {
value = getData('emptyRatingValue');
text = getData('emptyRatingText');
}
// remember selected rating
setData('ratingValue', value);
setData('ratingText', text);
setData('ratingMade', true);
setSelectFieldValue(value);
showSelectedRating(text);
applyStyle();
// onSelect callback
options.onSelect.call(
self,
ratingValue(),
ratingText(),
event
);
return false;
});
};
// handle mouseenter events
var attachMouseEnterHandler = function($elements) {
$elements.on('mouseenter.barrating', function() {
var $a = $(this);
resetStyle();
$a.addClass('br-active')[nextAllorPreviousAll()]()
.addClass('br-active');
showSelectedRating($a.attr('data-rating-text'));
});
};
// handle mouseleave events
var attachMouseLeaveHandler = function($elements) {
self.$widget.on('mouseleave.barrating blur.barrating', function() {
showSelectedRating();
applyStyle();
});
};
// somewhat primitive way to remove 300ms click delay on touch devices
// for a more advanced solution consider setting `fastClicks` option to false
// and using a library such as fastclick (https://github.com/ftlabs/fastclick)
var fastClicks = function($elements) {
$elements.on('touchstart.barrating', function(event) {
event.preventDefault();
event.stopPropagation();
$(this).click();
});
};
// disable clicks
var disableClicks = function($elements) {
$elements.on('click.barrating', function(event) {
event.preventDefault();
});
};
var attachHandlers = function($elements) {
// attach click event handler
attachClickHandler($elements);
if (self.options.hoverState) {
// attach mouseenter event handler
attachMouseEnterHandler($elements);
// attach mouseleave event handler
attachMouseLeaveHandler($elements);
}
};
var detachHandlers = function($elements) {
// remove event handlers in the ".barrating" namespace
$elements.off('.barrating');
};
var setupHandlers = function(readonly) {
var $elements = self.$widget.find('a');
if (fastClicks) {
fastClicks($elements);
}
if (readonly) {
detachHandlers($elements);
disableClicks($elements);
} else {
attachHandlers($elements);
}
};
this.show = function() {
// run only once
if (getData()) return;
// wrap element
wrapElement();
// save data
saveDataOnElement();
// build & append widget to the DOM
self.$widget = buildWidget();
self.$widget.insertAfter(self.$elem);
applyStyle();
showSelectedRating();
setupHandlers(self.options.readonly);
// hide the select field
self.$elem.hide();
};
this.readonly = function(state) {
if (typeof state !== 'boolean' || getData('readOnly') == state) return;
setupHandlers(state);
setData('readOnly', state);
self.$widget.toggleClass('br-readonly');
};
this.set = function(value) {
var options = getData('userOptions');
if (self.$elem.find('option[value="' + value + '"]').length === 0) return;
// set data
setData('ratingValue', value);
setData('ratingText', self.$elem.find('option[value="' + value + '"]').text());
setData('ratingMade', true);
setSelectFieldValue(ratingValue());
showSelectedRating(ratingText());
applyStyle();
// onSelect callback
if (!options.silent) {
options.onSelect.call(
this,
ratingValue(),
ratingText()
);
}
};
this.clear = function() {
var options = getData('userOptions');
// restore original data
setData('ratingValue', getData('originalRatingValue'));
setData('ratingText', getData('originalRatingText'));
setData('ratingMade', false);
resetSelectField();
showSelectedRating(ratingText());
applyStyle();
// onClear callback
options.onClear.call(
this,
ratingValue(),
ratingText()
);
};
this.destroy = function() {
var value = ratingValue();
var text = ratingText();
var options = getData('userOptions');
// detach handlers
detachHandlers(self.$widget.find('a'));
// remove widget
self.$widget.remove();
// remove data
removeDataOnElement();
// unwrap the element
unwrapElement();
// show the element
self.$elem.show();
// onDestroy callback
options.onDestroy.call(
this,
value,
text
);
};
}
BarRating.prototype.init = function (options, elem) {
this.$elem = $(elem);
this.options = $.extend({}, $.fn.barrating.defaults, options);
return this.options;
};
return BarRating;
})();
$.fn.barrating = function (method, options) {
return this.each(function () {
var plugin = new BarRating();
// plugin works with select fields
if (!$(this).is('select')) {
$.error('Sorry, this plugin only works with select fields.');
}
// method supplied
if (plugin.hasOwnProperty(method)) {
plugin.init(options, this);
if (method === 'show') {
return plugin.show(options);
} else {
// plugin exists?
if (plugin.$elem.data('barrating')) {
plugin.$widget = $(this).next('.br-widget');
return plugin[method](options);
}
}
// no method supplied or only options supplied
} else if (typeof method === 'object' || !method) {
options = method;
plugin.init(options, this);
return plugin.show();
} else {
$.error('Method ' + method + ' does not exist on jQuery.barrating');
}
});
};
$.fn.barrating.defaults = {
theme:'',
initialRating:null, // initial rating
allowEmpty:null, // allow empty ratings?
emptyValue:'', // this is the expected value of the empty rating
showValues:false, // display rating values on the bars?
showSelectedRating:true, // append a div with a rating to the widget?
deselectable:true, // allow to deselect ratings?
reverse:false, // reverse the rating?
readonly:false, // make the rating ready-only?
fastClicks:true, // remove 300ms click delay on touch devices?
hoverState:true, // change state on hover?
silent:false, // supress callbacks when controlling ratings programatically
onSelect:function (value, text, event) {
}, // callback fired when a rating is selected
onClear:function (value, text) {
}, // callback fired when a rating is cleared
onDestroy:function (value, text) {
} // callback fired when a widget is destroyed
};
$.fn.barrating.BarRating = BarRating;
}));
PK $[�\�}�E E LICENSE.txtnu �[��� Copyright Kazik Pietruszewski <http://antenna.io/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.PK $[�\ظ�b'