From a915e542acd0f397f149f5817de8ff99f9bb0f77 Mon Sep 17 00:00:00 2001 From: kaw67872 <kawtar.laariche@iais.fraunhofer.de> Date: Fri, 13 Sep 2024 10:47:26 +0200 Subject: [PATCH] #26: add bootstrap-star-rating folder --- src/legacy/bootstrap-star-rating/CHANGE.md | 248 ++++++++ src/legacy/bootstrap-star-rating/LICENSE.md | 28 + src/legacy/bootstrap-star-rating/bower.json | 36 ++ .../bootstrap-star-rating/composer.json | 27 + .../bootstrap-star-rating/css/star-rating.css | 164 +++++ .../css/star-rating.min.css | 10 + .../bootstrap-star-rating/examples/index.html | 102 ++++ .../examples/sample.html | 360 +++++++++++ .../bootstrap-star-rating/img/loading.gif | Bin 0 -> 847 bytes .../bootstrap-star-rating/js/locales/LANG.js | 31 + .../bootstrap-star-rating/js/locales/de.js | 31 + .../bootstrap-star-rating/js/locales/es.js | 31 + .../bootstrap-star-rating/js/locales/fr.js | 31 + .../bootstrap-star-rating/js/locales/it.js | 31 + .../bootstrap-star-rating/js/locales/pt-BR.js | 31 + .../bootstrap-star-rating/js/locales/ro.js | 31 + .../bootstrap-star-rating/js/locales/ru.js | 32 + .../bootstrap-star-rating/js/locales/ua.js | 32 + .../bootstrap-star-rating/js/locales/zh.js | 32 + .../bootstrap-star-rating/js/star-rating.js | 576 ++++++++++++++++++ .../js/star-rating.min.js | 10 + src/legacy/bootstrap-star-rating/package.json | 95 +++ .../themes/krajee-fa/theme.css | 14 + .../themes/krajee-fa/theme.js | 15 + .../themes/krajee-fa/theme.min.css | 7 + .../themes/krajee-fa/theme.min.js | 7 + .../themes/krajee-svg/theme.css | 107 ++++ .../themes/krajee-svg/theme.js | 15 + .../themes/krajee-svg/theme.min.css | 8 + .../themes/krajee-svg/theme.min.js | 7 + .../themes/krajee-uni/theme.css | 15 + .../themes/krajee-uni/theme.js | 15 + .../themes/krajee-uni/theme.min.css | 7 + .../themes/krajee-uni/theme.min.js | 7 + 34 files changed, 2193 insertions(+) create mode 100644 src/legacy/bootstrap-star-rating/CHANGE.md create mode 100644 src/legacy/bootstrap-star-rating/LICENSE.md create mode 100644 src/legacy/bootstrap-star-rating/bower.json create mode 100644 src/legacy/bootstrap-star-rating/composer.json create mode 100644 src/legacy/bootstrap-star-rating/css/star-rating.css create mode 100644 src/legacy/bootstrap-star-rating/css/star-rating.min.css create mode 100644 src/legacy/bootstrap-star-rating/examples/index.html create mode 100644 src/legacy/bootstrap-star-rating/examples/sample.html create mode 100644 src/legacy/bootstrap-star-rating/img/loading.gif create mode 100644 src/legacy/bootstrap-star-rating/js/locales/LANG.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/de.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/es.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/fr.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/it.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/pt-BR.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/ro.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/ru.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/ua.js create mode 100644 src/legacy/bootstrap-star-rating/js/locales/zh.js create mode 100644 src/legacy/bootstrap-star-rating/js/star-rating.js create mode 100644 src/legacy/bootstrap-star-rating/js/star-rating.min.js create mode 100644 src/legacy/bootstrap-star-rating/package.json create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.css create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.js create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.min.css create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.min.js create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.css create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.js create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.min.css create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.min.js create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.css create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.js create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.min.css create mode 100644 src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.min.js diff --git a/src/legacy/bootstrap-star-rating/CHANGE.md b/src/legacy/bootstrap-star-rating/CHANGE.md new file mode 100644 index 0000000..926dc90 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/CHANGE.md @@ -0,0 +1,248 @@ +Change Log: `bootstrap-star-rating` +=================================== + +## Version 4.0.2 + +**Date:** 03-Jul-2016 + +1. (enh #108): Add French Translations. +2. (enh #115): Add Romanian Translations. +3. (enh #122): Add Spanish Translations. +4. (enh #123): Add Italian Translations. +5. (enh #124): Add License Headers. +6. (enh #127): Add Chinese Translations. +7. (enh #130): Better management of themes and locales. + +## Version 4.0.1 + +**Date:** 28-Feb-2016 + +1. (bug #99): Correct documentation for refresh method. +2. (bug #100): Correct caption and clear rendering methods. +3. (bug #101): Correct caption setting when `showCaption` is `false`. +4. (bug #102): Revamp generation of rating via `refresh` method. +5. (enh #103): Implement method chaining and revamp private methods + - enhance public methods like `create`, `destroy`, `refresh`, `clear`, `reset` to return the rating element jQuery object +6. Update package.json to include `peerDependencies` instead of `dependencies`. + +## Version 4.0.0 + +**Date:** 16-Feb-2016 + +1. (enh #91): Add SVG Icon Support +2. (enh #94): Add Theming Functionality. + - New property `theme` will assign a CSS class with the `rating-<theme-name>` to the rating container. + - Themes included + - The default (blank) theme (for displaying bootstrap glyphicons) + - `krajee-svg` (for displaying svg icons) + - `krajee-uni` (for displaying unicode symbols as stars) + - `krajee-fa` (for displaying font awesome icons) + - Add ability to override and add one's own themes + + **Various new features and BC breaking enhancements** + + - **REMOVED**: `symbol`, `glyphicon`, `ratingClass` properties will be removed. + - The requirement for the above will be replaced with the `theme` property (and can also be implemented using the `containerClass` property). + - Stars now have a better padding and spacing that can be configured via CSS and themes + - New property `filledStar` - will allow one to set the markup for `filledStar` - will default to + - `<i class="glyphicon glyphicon-star"></i>` + - New property `emptyStar` - will allow one to set the markup for `emptyStar` - will default to + - `<i class="glyphicon glyphicon-star-empty"></i>` + - Exclusive support for SVG (and a prebuilt `krajee-svg` theme that contains two different ready to use SVG icons). +3. (enh #95): Add display only capability. +4. (enh #96): Add support for `bootstrap-sass` official repo via `sass` branch. +5. (enh #97): Add `animate` property to enable / disable animation of star highlight on hover / change. + +## Version 3.5.8 + +**Date:** 16-Feb-2016 + +1. (enh #88): Add German Translations. +2. (enh #89): Add Portugese Brazilian Translations. +3. (bug #90): Rename reserved word used as variable. + +## Version 3.5.7 + +**Date:** 22-Jan-2016 + +1. (enh #84): Add Ukranian Translations. +2. (enh #86): Refactor code for listening events and deep extend options correctly. + +## Version 3.5.6 + +**Date:** 29-Dec-2015 + +1. (enh #76): Add Russian Translations. +2. (bug #77): Correct `touches` and `changedTouches` validation. +3. (enh #81): Simplify README docs. +4. (enh #82): Added "main" key into NPM package.json. + +## Version 3.5.5 + +**Date:** 22-Nov-2015 + +1. (enh #71): Fix `Error: Cannot read property 'pageX' of undefined` error on touch devices. +2. (enh #74): Universal Module Definition for use with CommonJS, AMD or browser globals. +3. (enh #75): Implement Locales and Translations. + +## Version 3.5.4 + +**Date:** 20-Sep-2015 + +1. (enh #47): Styling enhancements for printed output (better star colors and hide clear button). +2. (enh #59): Remove `String.prototype.replaceAll` and implement regex replace. +3. (enh #63): Add `package.json` for npm install. +4. Update bootstrap bower version to support only 3.x variants. + +## Version 3.5.3 + +**Date:** 18-Jun-2015 + +1. (enh #58): Remove redundant tooltip title on hover of caption element. +2. Fixes for composer.json dependencies. + +## Version 3.5.2 + +**Date:** 10-May-2015 + +1. (enh #45): Validate on `touchstart` for devices that do not support `click` event. +2. (enh #46): More correct init of `clear` and `caption` elements. + +## Version 3.5.1 + +**Date:** 13-Feb-2015 + +1. (enh #44): Ability to integrate with other font icon CSS frameworks like Font Awesome. + - New property `ratingClass` added to allow configuring other icon framework css classes. +2. Set copyright year to current. + +## Version 3.5.0 + +**Date:** 31-Jan-2015 + +1. (enh #39): Prevent invalid star rating for numStars > 5 with default value & hoverChange enabled. +2. (enh #42): Code cleanup and restructure for JS lint changes (using JSHint Code cleanup library). + +## Version 3.4.0 + +**Date:** 16-Dec-2014 + +1. (enh #35): Added `destroy` method to destroy the rating plugin. +2. (enh #36): Added `create` method to create the rating plugin (typically after a destroy). + +## Version 3.3.0 + +**Date:** 17-Nov-2014 + +1. (bug #32): Prevent invalid star ratings if cursor is close to left/right edge of star array. +2. (enh #33): Enhance touch methods for compatibility across more wider mobile device browsers. + +## Version 3.2.0 + +**Date:** 08-Nov-2014 + +1. Set release to stable in composer.json. +2. Updated CHANGE log to reflect user friendly date time formats. + +## Version 3.1.0 + +**Date:** 27-Oct-2014 + +1. enh #26: Add touch device support to enable touch and slide across stars. +2. enh #27: Reset events on the rating element before every refresh. +3. enh #28: Add rating.refresh event. + + +## Version 3.0.0 + +**Date:** 13-Oct-2014 + +1. enh #20, #21: Included hover validation routine and rating state change on hover. Following new configurable properties added: + + - `hoverEnabled`: _boolean_ whether hover functionality is enabled. This will dynamically change the stars and caption on mouse hover. Defaults to `true`. This functionality will only work on desktop devices and if the input is not `disabled` or `readonly`. + - `hoverChangeCaption`: _boolean_ control whether the caption should dynamically change on mouse hover. Defaults to `true`. Will be applicable only if `hoverEnabled` is `true`. + - `hoverChangeStars`: _boolean_ control whether the stars should dynamically change on mouse hover. Defaults to `true`. Will be applicable only if `hoverEnabled` is `true`. + +2. enh #21: Following new events are added: + + - `rating.hover` + - `rating.hoverleave` + +3. enh #22: More correct minimum value and clear value validation through new `getWidthFromValue` method. + +4. enh #24: Set `clearValue` to default to `min` if not set. + + +## Version 2.6.0 + +**Date:** 23-Aug-2014 + +1. enh #17: Dynamic configuration for `starCaptions` and `starCaptionClasses` using a function. + +## Version 2.5.0 + +**Date:** 27-May-2014 + +1. Change to entire plugin code to eliminate dependency of HTML5 input. Plugin size reduced to 8KB minified. +2. Uses special JQuery routines to trigger star rating changes. +3. Plugin support is now extended to all browsers including pre IE10 +4. Plugin support is now extended to all Touch based and mobile devices like iOS, Android. +5. Removed cloning of inputs to allow better refreshing of input across ajax and other scenarios. +6. Caption and Clear elements parameters treated as identifiers rather than JQuery object elements. + +## Version 2.1.0 + +**Date:** 08-May-2014 + +1. Bug #8,#9,#10: Correct cloning and con## Version of field to a range slider input. + +## Version 2.0.0 + + +**Date:** 25-Apr-2014 + +1. Revamp of entire plugin code. Cleverly leverages CSS3 styles, animations, and HTML5 input features + to render the plugin. +2. Render and display fractional star ratings. Configure number of stars, min, max, step, and theoretically + support any fractional rating. +3. Right to left (RTL) support enhancement. Optimally uses the `dir` attribute of the range input. +4. Bootstrap style is made optional and configurable. Can override CSS to use any style. +5. Any star symbol (unicode or icon font) can be embedded instead of Glyphicon. +6. Uses HTML 5 range input to change ratings. Polyfills for range input in case JQuery/Javascript is disabled. +7. Automatically degrades to a normal SELECT dropdown input for browsers that do not support + HTML 5 range input. + +## Version 1.2.0 + +**Date:** 04-Apr-2014 + +1. Widget is customizable for using any CSS markup to override Bootstrap styles. +2. Clear button class customization added. + +## Version 1.1.0 + +**Date:** 10-Mar-2014 + +Revamped the methods for usage across wider scenarios: + +1. Included `update` method to set a value of a rating via javascript. +2. Revamped the `refresh` method to enable refreshing all plugin options at runtime via parameters. + +## Version 1.0.0 + +**Date:** 01-Oct-2013 + +Initial release. The following features are included in this release: + +1. Convert any HTML input to a star rating control. Recommended input is of `type = number`, which will help fallback to a number input for browsers not supporting JQuery or Javascript. +2. The plugin automatically converts an input with `type = number` to a star rating control if you set its `class = rating`. All options to the input can be passed as HTML5 `data` attributes. +3. Involves pure CSS3 styling of the stars. Say goodbye to image sprites or playing with image backgrounds. Offers clean scalable vector icons for consistent display across devices. +4. Specifically uses Bootstrap 3.x styles & glyphs. Can be combined to work better for Bootstrap styled projects (or input group addons). +5. Ability to clear values and options for the stars. Control where the clear button element can be shown. +6. Reset star rating to the initial value when the form is reset. +7. Ability to control and display caption of the selected stars. Each rated star can have its own caption. Control where the caption element can be shown. +8. Ability to size the rating control including the stars, caption, and clear button. Five prebuilt size templates are available `xl`, `lg`, `md`, `sm`, and `xs`. +9. Support for RIGHT TO LEFT (RTL) input. Automatically changes star styling for RTL. +10. Triggers JQuery events for advanced development. Events currently available are `rating.change`, `rating.clear`, and `rating.reset`. +11. Disabled and readonly input star rating support. +12. Size of the entire plugin is less than 9KB (about 6KB for the minified JS and 3KB for the minified CSS). \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/LICENSE.md b/src/legacy/bootstrap-star-rating/LICENSE.md new file mode 100644 index 0000000..94c3e95 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/LICENSE.md @@ -0,0 +1,28 @@ +Copyright (c) 2013 - 2016, Kartik Visweswaran +Krajee.com +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the names of Kartik Visweswaran or Krajee nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/bower.json b/src/legacy/bootstrap-star-rating/bower.json new file mode 100644 index 0000000..8854b0f --- /dev/null +++ b/src/legacy/bootstrap-star-rating/bower.json @@ -0,0 +1,36 @@ +{ + "name": "bootstrap-star-rating", + "version": "4.0.2", + "homepage": "https://github.com/kartik-v/bootstrap-star-rating", + "authors": [ + "Kartik Visweswaran <kartikv2@gmail.com>" + ], + "description": "A simple yet powerful JQuery star rating plugin for Bootstrap.", + "main": [ + "./css/star-rating.min.css", + "./js/star-rating.min.js" + ], + "keywords": [ + "bootstrap", + "star", + "rating", + "font", + "awesome", + "glyphicon", + "svg" + ], + "dependencies": { + "jquery": ">= 1.9.0", + "bootstrap": "~3" + }, + "ignore": [ + "**/.*", + "node_modules", + "composer.json", + "examples", + "bower_components", + "test", + "tests" + ], + "license": "BSD-3-Clause" +} diff --git a/src/legacy/bootstrap-star-rating/composer.json b/src/legacy/bootstrap-star-rating/composer.json new file mode 100644 index 0000000..9d66e0e --- /dev/null +++ b/src/legacy/bootstrap-star-rating/composer.json @@ -0,0 +1,27 @@ +{ + "name": "kartik-v/bootstrap-star-rating", + "description": "A simple yet powerful JQuery star rating plugin for Bootstrap.", + "keywords": [ + "bootstrap", + "star", + "rating", + "font", + "awesome", + "glyphicon", + "svg" + ], + "homepage": "https://github.com/kartik-v/bootstrap-star-rating", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + } +} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/css/star-rating.css b/src/legacy/bootstrap-star-rating/css/star-rating.css new file mode 100644 index 0000000..88edc27 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/css/star-rating.css @@ -0,0 +1,164 @@ +/*! + * bootstrap-star-rating v4.0.2 + * http://plugins.krajee.com/star-rating + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2016, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD 3-Clause + * https://github.com/kartik-v/bootstrap-star-rating/blob/master/LICENSE.md + */ +.rating-loading { + width: 25px; + height: 25px; + font-size: 0; + color: #fff; + /*background: transparent url('../img/loading.gif') top left no-repeat;*/ + border: none; +} + +/* + * Stars + */ +.rating-container .rating { + cursor: default; + position: relative; + vertical-align: middle; + display: inline-block; + overflow: hidden; + white-space: nowrap; +} + +.rating-disabled .rating { + cursor: not-allowed; +} + +.rating-container .star { + display: inline-block; + margin: 0 3px; + text-align: center; +} + +.rating-container .empty-stars { + color: #aaa; +} + +.rating-container .filled-stars { + position: absolute; + left: 0; + top: 0; + margin: auto; + color: #fde16d; + white-space: nowrap; + overflow: hidden; + -webkit-text-stroke: 1px #777; + text-shadow: 1px 1px #999; +} + +.rating-rtl { + float: right; +} + +.rating-animate .filled-stars { + transition: width 0.25s ease; + -o-transition: width 0.25s ease; + -moz-transition: width 0.25s ease; + -webkit-transition: width 0.25s ease; +} + +.rating-rtl .filled-stars { + left: auto; + right: 0; + -moz-transform: matrix(-1, 0, 0, 1, 0, 0) translate3d(0, 0, 0); + -webkit-transform: matrix(-1, 0, 0, 1, 0, 0) translate3d(0, 0, 0); + -o-transform: matrix(-1, 0, 0, 1, 0, 0) translate3d(0, 0, 0); + transform: matrix(-1, 0, 0, 1, 0, 0) translate3d(0, 0, 0); +} + +.rating-rtl.is-star .filled-stars { + right: 0.06em; +} + +.rating-rtl.is-heart .empty-stars { + margin-right: 0.07em; +} + +/** + * Sizes + */ +.rating-xl { + font-size: 4.89em; +} + +.rating-lg { + font-size: 3.91em; +} + +.rating-md { + font-size: 3.13em; +} + +.rating-sm { + font-size: 2.5em; +} + +.rating-xs { + font-size: 2em; +} + +.rating-xl { + font-size: 4.89em; +} + +/** + * Clear + */ +.rating-container .clear-rating { + color: #aaa; + cursor: not-allowed; + display: inline-block; + vertical-align: middle; + font-size: 60%; +} + +.clear-rating-active { + cursor: pointer !important; +} + +.clear-rating-active:hover { + color: #843534; +} + +.rating-container .clear-rating { + padding-right: 5px; +} + +/** + * Caption + */ +.rating-container .caption { + color: #999; + display: inline-block; + vertical-align: middle; + font-size: 60%; + margin-top: -0.6em; +} + +.rating-container .caption { + margin-left: 5px; + margin-right: 0; +} + +.rating-rtl .caption { + margin-right: 5px; + margin-left: 0; +} + +/** + * Print + */ +@media print { + .rating-container .clear-rating { + display: none; + } +} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/css/star-rating.min.css b/src/legacy/bootstrap-star-rating/css/star-rating.min.css new file mode 100644 index 0000000..4496bc0 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/css/star-rating.min.css @@ -0,0 +1,10 @@ +/*! + * bootstrap-star-rating v4.0.2 + * http://plugins.krajee.com/star-rating + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2016, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD 3-Clause + * https://github.com/kartik-v/bootstrap-star-rating/blob/master/LICENSE.md + */.rating-container .caption,.rating-container .clear-rating,.rating-container .rating{display:inline-block;vertical-align:middle}.rating-loading{width:25px;height:25px;font-size:0;color:#fff; /*background:url(../img/loading.gif) top left no-repeat;*/border:none}.rating-container .rating{cursor:default;position:relative;overflow:hidden;white-space:nowrap}.rating-disabled .rating{cursor:not-allowed}.rating-container .star{display:inline-block;margin:0 3px;text-align:center}.rating-container .empty-stars{color:#aaa}.rating-container .filled-stars{position:absolute;left:0;top:0;margin:auto;color:#fde16d;white-space:nowrap;overflow:hidden;-webkit-text-stroke:1px #777;text-shadow:1px 1px #999}.rating-rtl{float:right}.rating-animate .filled-stars{transition:width .25s ease;-o-transition:width .25s ease;-moz-transition:width .25s ease;-webkit-transition:width .25s ease}.rating-rtl .filled-stars{left:auto;right:0;-moz-transform:matrix(-1,0,0,1,0,0) translate3d(0,0,0);-webkit-transform:matrix(-1,0,0,1,0,0) translate3d(0,0,0);-o-transform:matrix(-1,0,0,1,0,0) translate3d(0,0,0);transform:matrix(-1,0,0,1,0,0) translate3d(0,0,0)}.rating-rtl.is-star .filled-stars{right:.06em}.rating-rtl.is-heart .empty-stars{margin-right:.07em}.rating-lg{font-size:3.91em}.rating-md{font-size:3.13em}.rating-sm{font-size:2.5em}.rating-xs{font-size:2em}.rating-xl{font-size:4.89em}.rating-container .clear-rating{color:#aaa;cursor:not-allowed;font-size:60%;padding-right:5px}.clear-rating-active{cursor:pointer!important}.clear-rating-active:hover{color:#843534}.rating-container .caption{color:#999;font-size:60%;margin-top:-.6em;margin-left:5px;margin-right:0}.rating-rtl .caption{margin-right:5px;margin-left:0}@media print{.rating-container .clear-rating{display:none}} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/examples/index.html b/src/legacy/bootstrap-star-rating/examples/index.html new file mode 100644 index 0000000..d2d76d3 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/examples/index.html @@ -0,0 +1,102 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"/> + <title>Krajee JQuery Plugins - © Kartik</title> + <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> + <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> + <link rel="stylesheet" href="../css/star-rating.css" media="all" rel="stylesheet" type="text/css"/> + <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> + <script src="../js/star-rating.js" type="text/javascript"></script> +<body> +<div class="container"> +<div class="page-header"> +<h2>Bootstrap Star Rating Examples <small>© Kartik Visweswaran, Krajee.com</small></h2> +</div> + +<form> + <input id="input-21b" value="4" type="number" class="rating" min=0 max=5 step=0.2 data-size="lg"> + <hr> + <input id="input-21c" value="0" type="number" class="rating" min=0 max=8 step=0.5 data-size="xl" data-stars="8"> + <hr> + <input id="input-21d" value="2" type="number" class="rating" min=0 max=5 step=0.5 data-size="sm"> + <hr> + <input id="input-21e" value="0" type="number" class="rating" min=0 max=5 step=0.5 data-size="xs" > + <hr> + <input id="input-21f" value="0" type="number" min=0 max=5 step=0.1 data-size="md" > + <hr> + <input id="input-2ba" type="number" class="rating" min="0" max="5" step="0.5" data-stars=5 + data-symbol="" data-default-caption="{rating} hearts" data-star-captions="{}"> + <hr> + <input id="input-22" value="0" type="number" class="rating" min=0 max=5 step=0.5 data-rtl=1 data-container-class='text-right' data-glyphicon=0> + <div class="clearfix"></div> + <hr> + <input class="rb-rating"> + <hr> + <input id="rating-input" type="number" /> + <button id="btn-rating-input" type="button" class="btn btn-primary">Toggle Disable</button> + <hr> + <input id="kartik" class="rating" data-stars="5" data-step="0.1"/> + <div class="form-group" style="margin-top:10px"> + <button type="submit" class="btn btn-primary">Submit</button> + <button type="reset" class="btn btn-default">Reset</button> + <button type="button" class="btn btn-danger">Destroy</button> + <button type="button" class="btn btn-success">Create</button> + </div> +</form> +<hr> +<script> + jQuery(document).ready(function () { + $("#input-21f").rating({ + starCaptions: function(val) { + if (val < 3) { + return val; + } else { + return 'high'; + } + }, + starCaptionClasses: function(val) { + if (val < 3) { + return 'label label-danger'; + } else { + return 'label label-success'; + } + }, + hoverOnClear: false + }); + + $('#rating-input').rating({ + min: 0, + max: 5, + step: 1, + size: 'lg', + showClear: false + }); + + $('#btn-rating-input').on('click', function() { + $('#rating-input').rating('refresh', { + showClear:true, + disabled: !$('#rating-input').attr('disabled') + }); + }); + + + $('.btn-danger').on('click', function() { + $("#kartik").rating('destroy'); + }); + + $('.btn-success').on('click', function() { + $("#kartik").rating('create'); + }); + + $('#rating-input').on('rating.change', function() { + alert($('#rating-input').val()); + }); + + + $('.rb-rating').rating({'showCaption':true, 'stars':'3', 'min':'0', 'max':'3', 'step':'1', 'size':'xs', 'starCaptions': {0:'status:nix', 1:'status:wackelt', 2:'status:geht', 3:'status:laeuft'}}); + }); +</script> +</div> +</body> +</html> diff --git a/src/legacy/bootstrap-star-rating/examples/sample.html b/src/legacy/bootstrap-star-rating/examples/sample.html new file mode 100644 index 0000000..315715f --- /dev/null +++ b/src/legacy/bootstrap-star-rating/examples/sample.html @@ -0,0 +1,360 @@ +<!DOCTYPE html> +<!--suppress CssUnusedSymbol, JSUnresolvedLibraryURL --> +<html lang="en"> +<head> + <meta charset="UTF-8"/> + <title>Krajee JQuery Plugins - © Kartik</title> + <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> + <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> + <link rel="stylesheet" href="../css/star-rating.css" media="all" type="text/css"/> + <link rel="stylesheet" href="../css/themes/krajee-fa/theme.css" media="all" type="text/css"/> + <link rel="stylesheet" href="../css/themes/krajee-svg/theme.css" media="all" type="text/css"/> + <link rel="stylesheet" href="../css/themes/krajee-uni/theme.css" media="all" type="text/css"/> + <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> + <script src="../js/star-rating.js" type="text/javascript"></script> + <script src="../js/themes/krajee-fa/theme.js" type="text/javascript"></script> + <script src="../js/themes/krajee-svg/theme.js" type="text/javascript"></script> + <script src="../js/themes/krajee-uni/theme.js" type="text/javascript"></script> +<body> +<div class="container"> + <div class="page-header"> + <h2>Bootstrap Star Rating Examples + <small>© Kartik Visweswaran, Krajee.com</small> + </h2> + </div> + <form> + <div class="page-header"> + <h3>Glyphicon Star LTR</h3> + </div> + <input type="text" class="rating rating-loading" value="3.75" data-size="xl" title=""> + <br> + <input type="text" class="rating rating-loading" value="2.5" data-size="lg" title=""> + <br> + <input type="text" class="rating rating-loading" value="1.75" data-size="md" title=""> + <br> + <input type="text" class="rating rating-loading" value="4" data-size="sm" title=""> + <br> + <input type="text" class="rating rating-loading" value="2" data-size="xs" title=""> + <br> + + <div class="page-header"> + <h3>Glyphicon Star RTL</h3> + </div> + <input type="text" class="kv-gly-star rating-loading" value="3.75" dir="rtl" data-size="xl" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-gly-star rating-loading" value="2.5" dir="rtl" data-size="lg" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-gly-star rating-loading" value="1.75" dir="rtl" data-size="md" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-gly-star rating-loading" value="4" dir="rtl" data-size="sm" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-gly-star rating-loading" value="2" dir="rtl" data-size="xs" + title=""> + <div class="clearfix"></div> + <br> + + <div class="page-header"> + <h3>Glyphicon Heart LTR</h3> + </div> + <input type="text" class="kv-gly-heart rating-loading" value="3.75" data-size="xl" title=""> + <br> + <input type="text" class="kv-gly-heart rating-loading" value="2.5" data-size="lg" title=""> + <br> + <input type="text" class="kv-gly-heart rating-loading" value="1.75" data-size="md" title=""> + <br> + <input type="text" class="kv-gly-heart rating-loading" value="4" data-size="sm" title=""> + <br> + <input type="text" class="kv-gly-heart rating-loading" value="2" data-size="xs" title=""> + <br> + + <div class="page-header"> + <h3>Glyphicon Heart RTL</h3> + </div> + <input type="text" class="kv-gly-heart rating-loading" value="3.75" dir="rtl" data-size="xl" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-gly-heart rating-loading" value="2.5" dir="rtl" data-size="lg" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-gly-heart rating-loading" value="1.75" dir="rtl" data-size="md" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-gly-heart rating-loading" value="4" dir="rtl" data-size="sm" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-gly-heart rating-loading" value="2" dir="rtl" data-size="xs" title=""> + <div class="clearfix"></div> + <br> + + <div class="page-header"> + <h3>Unicode Star LTR</h3> + </div> + <input type="text" class="kv-uni-star rating-loading" value="3.75" data-size="xl" title=""> + <br> + <input type="text" class="kv-uni-star rating-loading" value="2.5" data-size="lg" title=""> + <br> + <input type="text" class="kv-uni-star rating-loading" value="1.75" data-size="md" title=""> + <br> + <input type="text" class="kv-uni-star rating-loading" value="4" data-size="sm" title=""> + <br> + <input type="text" class="kv-uni-star rating-loading" value="2" data-size="xs" title=""> + <br> + + <div class="page-header"> + <h3>Unicode Star RTL</h3> + </div> + <input type="text" class="kv-uni-star rating-loading" value="3.75" dir="rtl" data-size="xl" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-uni-star rating-loading" value="2.5" dir="rtl" data-size="lg" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-uni-star rating-loading" value="1.75" dir="rtl" data-size="md" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-uni-star rating-loading" value="4" dir="rtl" data-size="sm" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-uni-star rating-loading" value="2" dir="rtl" data-size="xs" title=""> + <div class="clearfix"></div> + <br> + + <div class="page-header"> + <h3>Unicode Rook LTR</h3> + </div> + <input type="text" class="kv-uni-rook rating-loading" value="3.75" data-size="xl" title=""> + <br> + <input type="text" class="kv-uni-rook rating-loading" value="2.5" data-size="lg" title=""> + <br> + <input type="text" class="kv-uni-rook rating-loading" value="1.75" data-size="md" title=""> + <br> + <input type="text" class="kv-uni-rook rating-loading" value="4" data-size="sm" title=""> + <br> + <input type="text" class="kv-uni-rook rating-loading" value="2" data-size="xs" title=""> + <br> + + <div class="page-header"> + <h3>Unicode Rook RTL</h3> + </div> + <input type="text" class="kv-uni-rook rating-loading" value="3.75" dir="rtl" data-size="xl" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-uni-rook rating-loading" value="2.5" dir="rtl" data-size="lg" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-uni-rook rating-loading" value="1.75" dir="rtl" data-size="md" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-uni-rook rating-loading" value="4" dir="rtl" data-size="sm" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-uni-rook rating-loading" value="2" dir="rtl" data-size="xs" title=""> + <div class="clearfix"></div> + <br> + + <div class="page-header"> + <h3>Font Awesome Star LTR</h3> + </div> + <input type="text" class="kv-fa rating-loading" value="3.75" data-size="xl" title=""> + <br> + <input type="text" class="kv-fa rating-loading" value="2.5" data-size="lg" title=""> + <br> + <input type="text" class="kv-fa rating-loading" value="1.75" data-size="md" title=""> + <br> + <input type="text" class="kv-fa rating-loading" value="4" data-size="sm" title=""> + <br> + <input type="text" class="kv-fa rating-loading" value="2" data-size="xs" title=""> + <br> + + <div class="page-header"> + <h3>Font Awesome Star RTL</h3> + </div> + <input type="text" class="kv-fa rating-loading" value="3.75" dir="rtl" data-size="xl" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-fa rating-loading" value="2.5" dir="rtl" data-size="lg" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-fa rating-loading" value="1.75" dir="rtl" data-size="md" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-fa rating-loading" value="4" dir="rtl" data-size="sm" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-fa rating-loading" value="2" dir="rtl" data-size="xs" title=""> + <div class="clearfix"></div> + <br> + + <div class="page-header"> + <h3>Font Awesome Heart LTR</h3> + </div> + <input type="text" class="kv-fa-heart rating-loading" value="3.75" data-size="xl" + title=""> + <br> + <input type="text" class="kv-fa-heart rating-loading" value="2.5" data-size="lg" title=""> + <br> + <input type="text" class="kv-fa-heart rating-loading" value="1.75" data-size="md" title=""> + <br> + <input type="text" class="kv-fa-heart rating-loading" value="4" data-size="sm" title=""> + <br> + <input type="text" class="kv-fa-heart rating-loading" value="2" data-size="xs" title=""> + <br> + + <div class="page-header"> + <h3>Font Awesome Heart RTL</h3> + </div> + <input type="text" class="kv-fa-heart rating-loading" value="3.75" dir="rtl" data-size="xl" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-fa-heart rating-loading" value="2.5" dir="rtl" data-size="lg" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-fa-heart rating-loading" value="1.75" dir="rtl" data-size="md" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-fa-heart rating-loading" value="4" dir="rtl" data-size="sm" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-fa-heart rating-loading" value="2" dir="rtl" data-size="xs" title=""> + <div class="clearfix"></div> + <br> + + <div class="page-header"> + <h3>SVG LTR Star</h3> + </div> + <input type="text" class="kv-svg rating-loading" value="3.75" data-size="xl" title=""> + <br> + <input type="text" class="kv-svg rating-loading" value="2.5" data-size="lg" title=""> + <br> + <input type="text" class="kv-svg rating-loading" value="1.75" data-size="md" title=""> + <br> + <input type="text" class="kv-svg rating-loading" value="4" data-size="sm" title=""> + <br> + <input type="text" class="kv-svg rating-loading" value="2" data-size="xs" title=""> + <br> + + <div class="page-header"> + <h3>SVG RTL Star</h3> + </div> + <input type="text" class="kv-svg rating-loading" value="3.75" dir="rtl" data-size="xl" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-svg rating-loading" value="2.5" dir="rtl" data-size="lg" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-svg rating-loading" value="1.75" dir="rtl" data-size="md" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-svg rating-loading" value="4" dir="rtl" data-size="sm" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-svg rating-loading" value="2" dir="rtl" data-size="xs" title=""> + <div class="clearfix"></div> + <br> + + <div class="page-header"> + <h3>SVG LTR Heart</h3> + </div> + <input type="text" class="kv-svg-heart rating-loading" value="3.75" data-size="xl" title=""> + <br> + <input type="text" class="kv-svg-heart rating-loading" value="2.5" data-size="lg" title=""> + <br> + <input type="text" class="kv-svg-heart rating-loading" value="1.75" data-size="md" title=""> + <br> + <input type="text" class="kv-svg-heart rating-loading" value="4" data-size="sm" title=""> + <br> + <input type="text" class="kv-svg-heart rating-loading" value="2" data-size="xs" title=""> + <br> + + <div class="page-header"> + <h3>SVG RTL Heart</h3> + </div> + <input type="text" class="kv-svg-heart rating-loading" value="3.75" dir="rtl" data-size="xl" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-svg-heart rating-loading" value="2.5" dir="rtl" data-size="lg" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-svg-heart rating-loading" value="1.75" dir="rtl" data-size="md" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-svg-heart rating-loading" value="4" dir="rtl" data-size="sm" title=""> + <div class="clearfix"></div> + <br> + <input type="text" class="kv-svg-heart rating-loading" value="2" dir="rtl" data-size="xs" title=""> + <div class="clearfix"></div> + <br> + </form> +</div> +</body> +<script> + $(document).on('ready', function () { + $('.kv-gly-star').rating({ + containerClass: 'is-star' + }); + $('.kv-gly-heart').rating({ + containerClass: 'is-heart', + defaultCaption: '{rating} hearts', + starCaptions: function (rating) { + return rating == 1 ? 'One heart' : rating + ' hearts'; + }, + filledStar: '<i class="glyphicon glyphicon-heart"></i>', + emptyStar: '<i class="glyphicon glyphicon-heart-empty"></i>' + }); + $('.kv-fa').rating({ + theme: 'krajee-fa', + filledStar: '<i class="fa fa-star"></i>', + emptyStar: '<i class="fa fa-star-o"></i>' + }); + $('.kv-fa-heart').rating({ + defaultCaption: '{rating} hearts', + starCaptions: function (rating) { + return rating == 1 ? 'One heart' : rating + ' hearts'; + }, + theme: 'krajee-fa', + filledStar: '<i class="fa fa-heart"></i>', + emptyStar: '<i class="fa fa-heart-o"></i>' + }); + $('.kv-uni-star').rating({ + theme: 'krajee-uni', + filledStar: '★', + emptyStar: '☆' + }); + $('.kv-uni-rook').rating({ + theme: 'krajee-uni', + defaultCaption: '{rating} rooks', + starCaptions: function (rating) { + return rating == 1 ? 'One rook' : rating + ' rooks'; + }, + filledStar: '♜', + emptyStar: '♖' + }); + $('.kv-svg').rating({ + theme: 'krajee-svg', + filledStar: '<span class="krajee-icon krajee-icon-star"></span>', + emptyStar: '<span class="krajee-icon krajee-icon-star"></span>' + }); + $('.kv-svg-heart').rating({ + theme: 'krajee-svg', + filledStar: '<span class="krajee-icon krajee-icon-heart"></span>', + emptyStar: '<span class="krajee-icon krajee-icon-heart"></span>', + defaultCaption: '{rating} hearts', + starCaptions: function (rating) { + return rating == 1 ? 'One heart' : rating + ' hearts'; + }, + containerClass: 'is-heart' + }); + + $('.rating,.kv-gly-star,.kv-gly-heart,.kv-uni-star,.kv-uni-rook,.kv-fa,.kv-fa-heart,.kv-svg,.kv-svg-heart').on( + 'change', function () { + console.log('Rating selected: ' + $(this).val()); + }); + }); +</script> +</html> + + diff --git a/src/legacy/bootstrap-star-rating/img/loading.gif b/src/legacy/bootstrap-star-rating/img/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ea146c0253f2e500ca022050f4353be456e6d4d GIT binary patch literal 847 zcmZ?wbhEHb6krfw_`<;O|NsBc(9mDMepOXfty!}sA|fI$FYoc=$48DFNls2)ym;}9 z88hCzd9!QRt{XRQw6wJJ_4P530u=vq`?-b$J39ur8tEA@GXnK0{*!VpN=+<DO;IS% zEXhzv%u1}t$xlqt%gjs5XHfjf!pQ|xr311B<VXhA00o7<l+1Zc4McJjwOSHZt(_rq zY@(ED!w0sT9SzaFEH+G;tpO7SS{XZA7xk^t)M@aH`msnQ>BBCMNfRtuR+y^ER&<(X zE7%B&e5#Z^`o7-@n<W_v3SI7(dNQ=6jy_ni!a>Eg_P~LI*N!rA^h{|;%@7gdIe0+9 zL6FPmK*NXRK=)=Qr!7yn1(?oIuvujqni9B8`-RfJ#pzQFR*0=zw6NbXTj0F1BLlZh zfVly?4JS*30beAWg%&SoyRsrS%M*Y;RQ^0c<Cchr7T1vg5l-DD?S}7-8@a5UPaAq~ z@n~s!$mXFpL*?eiN(K&reHYKL-pJzCYYcaBxWgC8u*krJQ><0TpwH<FS6{Y(*R!`g zq4uWb%q%r3*}O5D{5;)QEe(PMYlFfRCPR^<4lA0S<=EDUAIt7;n!~8*^d!Nap>aFY zz6r{%O%_#7fe{VKyK@(naSJIeRCsx4aYAE48*ixFGRdMll6*@GUTc0%``>`o8j#<B zvA4p3$JJ2a&`F8hSc&61B|LgAwB68P7wBR!VN!Ump(C-(O)=4fAtHDNM`Nz(lC6wM zE*@Lh7*_2}Ow!@%Q*9_P7E3;&yg~g3?;9m{6EpJwHLVE!292Ix6|9!VLoM|HdW>V4 zg9*c-O~)LSJSTE&n6)s0!!ECt)zd(wL!wvC+k6wRhYtI}PTi7bt)^yIDG`AshjlL| qtmsHM!1PnVu#-b#!*qv!K4<d`4t+zGG}ai+?jAKo25V6A1Oos$vkI^P literal 0 HcmV?d00001 diff --git a/src/legacy/bootstrap-star-rating/js/locales/LANG.js b/src/legacy/bootstrap-star-rating/js/locales/LANG.js new file mode 100644 index 0000000..fb2aa7f --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/LANG.js @@ -0,0 +1,31 @@ +/*! + * Star Rating <LANG> Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingLocales['<LANG>'] = { + defaultCaption: '{rating} Stars', + starCaptions: { + 0.5: 'Half Star', + 1: 'One Star', + 1.5: 'One & Half Star', + 2: 'Two Stars', + 2.5: 'Two & Half Stars', + 3: 'Three Stars', + 3.5: 'Three & Half Stars', + 4: 'Four Stars', + 4.5: 'Four & Half Stars', + 5: 'Five Stars' + }, + clearButtonTitle: 'Clear', + clearCaption: 'Not Rated' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/locales/de.js b/src/legacy/bootstrap-star-rating/js/locales/de.js new file mode 100644 index 0000000..2a0c015 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/de.js @@ -0,0 +1,31 @@ +/*! + * Star Rating German Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingLocales['de'] = { + defaultCaption: '{rating} Sterne', + starCaptions: { + 0.5: 'Halber Stern', + 1: 'Ein Stern', + 1.5: 'Eineinhalb Sterne', + 2: 'Zwei Sterne', + 2.5: 'Zweieinhalb Sterne', + 3: 'Drei Sterne', + 3.5: 'Dreieinhalb Sterne', + 4: 'Vier Sterne', + 4.5: 'Viereinhalb Sterne', + 5: 'Fünf Sterne' + }, + clearButtonTitle: 'Zuücksetzen', + clearCaption: 'Nicht Bewertet' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/locales/es.js b/src/legacy/bootstrap-star-rating/js/locales/es.js new file mode 100644 index 0000000..dd873a3 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/es.js @@ -0,0 +1,31 @@ +/*! + * Star Rating Spanish Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingLocales.es = { + defaultCaption: '{rating} Estrellas', + starCaptions: { + 0.5: 'Media Estrella', + 1: 'Una Estrella', + 1.5: 'Una Estrella y Media', + 2: 'Dos Estrellas', + 2.5: 'Dos Estrellas y Media', + 3: 'Tres Estrellas', + 3.5: 'Tres Estrellas y Media', + 4: 'Cuatro Estrellas', + 4.5: 'Cuatro Estrellas y Media', + 5: 'Cinco Estrellas' + }, + clearButtonTitle: 'Limpiar', + clearCaption: 'Sin Calificar' + }; +})(window.jQuery); \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/js/locales/fr.js b/src/legacy/bootstrap-star-rating/js/locales/fr.js new file mode 100644 index 0000000..42bd306 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/fr.js @@ -0,0 +1,31 @@ +/*! + * Star Rating French Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingLocales['fr'] = { + defaultCaption: '{rating} étoiles', + starCaptions: { + 0.5: 'Une demi étoile', + 1: 'Une étoile', + 1.5: 'Une étoile et demi', + 2: 'Deux étoiles', + 2.5: 'Deux étoiles et demi', + 3: 'Trois étoiles', + 3.5: 'Trois étoiles et demi', + 4: 'Quatre étoiles', + 4.5: 'Quatre étoiles et demi', + 5: 'Cinq étoiles' + }, + clearButtonTitle: 'Effacer', + clearCaption: 'Non noté' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/locales/it.js b/src/legacy/bootstrap-star-rating/js/locales/it.js new file mode 100644 index 0000000..dcdd9ae --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/it.js @@ -0,0 +1,31 @@ +/*! + * Star Rating Italian Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingLocales['it'] = { + defaultCaption: '{rating} Stelle', + starCaptions: { + 0.5: 'Mezza Stella', + 1: 'Una Stella', + 1.5: 'Una Stella & Mezzo', + 2: 'Due Stelle', + 2.5: 'Due Stelle & Mezzo', + 3: 'Tre Stelle', + 3.5: 'Tre Stelle & Mezzo', + 4: 'Quattro Stelle', + 4.5: 'Quattro Stelle & Mezzo', + 5: 'Five Stars' + }, + clearButtonTitle: 'Rimuovi', + clearCaption: 'Nessuna valutazione' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/locales/pt-BR.js b/src/legacy/bootstrap-star-rating/js/locales/pt-BR.js new file mode 100644 index 0000000..25b2545 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/pt-BR.js @@ -0,0 +1,31 @@ +/*! + * Star Rating Portugese Brazilian Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingLocales['pt-BR'] = { + defaultCaption: '{rating} Estrelas', + starCaptions: { + 0.5: 'Meia Estrela', + 1: 'Uma Estrela', + 1.5: 'Uma Estrela e Meia', + 2: 'Duas Estrelas', + 2.5: 'Duas Estrelas e Meia', + 3: 'Três Estrelas', + 3.5: 'Três Estrelas e Meia', + 4: 'Quatro Estrelas', + 4.5: 'Quatro Estrelas e Meia', + 5: 'Cinco Estrelas' + }, + clearButtonTitle: 'Limpar', + clearCaption: 'Não Avaliado' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/locales/ro.js b/src/legacy/bootstrap-star-rating/js/locales/ro.js new file mode 100644 index 0000000..7dd8dea --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/ro.js @@ -0,0 +1,31 @@ +/*! + * Star Rating Romanian Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingLocales['ro'] = { + defaultCaption: '{rating} stele', + starCaptions: { + 0.5: 'Jumatate de stea', + 1: 'O Stea', + 1.5: 'O stea si jumatate', + 2: 'Doua stele', + 2.5: 'Doua stele si jumatate', + 3: 'Trei stele', + 3.5: 'Trei stele si jumatate', + 4: 'Patru stele', + 4.5: 'Patru stele si jumatate', + 5: 'Cinci stele' + }, + clearButtonTitle: 'Sterge', + clearCaption: 'Fara vot' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/locales/ru.js b/src/legacy/bootstrap-star-rating/js/locales/ru.js new file mode 100644 index 0000000..e5be721 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/ru.js @@ -0,0 +1,32 @@ +/*! + * Star Rating Russian Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + * @author Ivan Zhuravlev. + */ +(function ($) { + "use strict"; + $.fn.ratingLocales['ru'] = { + defaultCaption: '{rating} Звёзды', + starCaptions: { + 0.5: 'Половина звезды', + 1: 'Одна звезда', + 1.5: 'Полторы звезды', + 2: 'Две звезды', + 2.5: 'Две Ñ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð¾Ð¹ звезды', + 3: 'Три звезды', + 3.5: 'Три Ñ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð¾Ð¹ звезды', + 4: 'Четыре звезды', + 4.5: 'Четыре Ñ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð¾Ð¹ звезды', + 5: 'ПÑть звёзд' + }, + clearButtonTitle: 'ОчиÑтить', + clearCaption: 'Без рейтинга' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/locales/ua.js b/src/legacy/bootstrap-star-rating/js/locales/ua.js new file mode 100644 index 0000000..0ee0291 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/ua.js @@ -0,0 +1,32 @@ +/*! + * Star Rating Ukrainian Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + * @author https://github.com/wowkin2 + */ +(function ($) { + "use strict"; + $.fn.ratingLocales['ua'] = { + defaultCaption: '{rating} Зірки', + starCaptions: { + 0.5: 'Пів зірки', + 1: 'Одна зірка', + 1.5: 'Півтори зірки', + 2: 'Дві зірки', + 2.5: 'Дві з половиною зірки', + 3: 'Три зірки', + 3.5: 'Три з половиною зірки', + 4: 'Чотири зірки', + 4.5: 'Чотири з половиною зірки', + 5: 'П\'Ñть зірок' + }, + clearButtonTitle: 'ОчиÑтити', + clearCaption: 'Без рейтингу' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/locales/zh.js b/src/legacy/bootstrap-star-rating/js/locales/zh.js new file mode 100644 index 0000000..291c50b --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/locales/zh.js @@ -0,0 +1,32 @@ +/*! + * Star Rating Chinese Translations + * + * This file must be loaded after 'star-rating.js'. Patterns in braces '{}', or + * any HTML markup tags in the messages must not be converted or translated. + * + * NOTE: this file must be saved in UTF-8 encoding. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + * @author Freeman + */ + (function ($) { + "use strict"; + $.fn.ratingLocales['zh'] = { + defaultCaption: '{rating} 星', + starCaptions: { + 0.5: 'åŠæ˜Ÿ', + 1: '一星', + 1.5: '一星åŠ', + 2: '二星', + 2.5: '二星åŠ', + 3: '三星', + 3.5: '三星åŠ', + 4: '四星', + 4.5: '四星åŠ', + 5: '五星' + }, + clearButtonTitle: '清除', + clearCaption: '未评级' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/js/star-rating.js b/src/legacy/bootstrap-star-rating/js/star-rating.js new file mode 100644 index 0000000..9a7cfbf --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/star-rating.js @@ -0,0 +1,576 @@ +/*! + * bootstrap-star-rating v4.0.2 + * http://plugins.krajee.com/star-rating + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2016, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD 3-Clause + * https://github.com/kartik-v/bootstrap-star-rating/blob/master/LICENSE.md + */ +(function (factory) { + "use strict"; + //noinspection JSUnresolvedVariable + if (typeof define === 'function' && define.amd) { // jshint ignore:line + // AMD. Register as an anonymous module. + define(['jquery'], factory); // jshint ignore:line + } else { // noinspection JSUnresolvedVariable + if (typeof module === 'object' && module.exports) { // jshint ignore:line + // Node/CommonJS + // noinspection JSUnresolvedVariable + module.exports = factory(require('jquery')); // jshint ignore:line + } else { + // Browser globals + factory(window.jQuery); + } + } +}(function ($) { + "use strict"; + + $.fn.ratingLocales = {}; + $.fn.ratingThemes = {}; + + var NAMESPACE, DEFAULT_MIN, DEFAULT_MAX, DEFAULT_STEP, isEmpty, getCss, addCss, getDecimalPlaces, applyPrecision, + handler, Rating; + NAMESPACE = '.rating'; + DEFAULT_MIN = 0; + DEFAULT_MAX = 5; + DEFAULT_STEP = 0.5; + isEmpty = function (value, trim) { + return value === null || value === undefined || value.length === 0 || (trim && $.trim(value) === ''); + }; + getCss = function (condition, css) { + return condition ? ' ' + css : ''; + }; + addCss = function ($el, css) { + $el.removeClass(css).addClass(css); + }; + getDecimalPlaces = function (num) { + var match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); + return !match ? 0 : Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0)); + }; + applyPrecision = function (val, precision) { + return parseFloat(val.toFixed(precision)); + }; + handler = function ($el, event, callback, skipNS) { + var ev = skipNS ? event : event.split(' ').join(NAMESPACE + ' ') + NAMESPACE; + $el.off(ev).on(ev, callback); + }; + Rating = function (element, options) { + var self = this; + self.$element = $(element); + self._init(options); + }; + Rating.prototype = { + constructor: Rating, + _parseAttr: function (vattr, options) { + var self = this, $el = self.$element, elType = $el.attr('type'), finalVal, val, chk, out; + if (elType === 'range' || elType === 'number') { + val = options[vattr] || $el.data(vattr) || $el.attr(vattr); + switch (vattr) { + case 'min': + chk = DEFAULT_MIN; + break; + case 'max': + chk = DEFAULT_MAX; + break; + default: + chk = DEFAULT_STEP; + } + finalVal = isEmpty(val) ? chk : val; + out = parseFloat(finalVal); + } else { + out = parseFloat(options[vattr]); + } + return isNaN(out) ? chk : out; + }, + _setDefault: function (key, val) { + var self = this; + if (isEmpty(self[key])) { + self[key] = val; + } + }, + _listenClick: function (e, callback) { + e.stopPropagation(); + e.preventDefault(); + if (e.handled !== true) { + callback(e); + e.handled = true; + } else { + return false; + } + }, + _starClick: function (e) { + var self = this, pos; + self._listenClick(e, function (ev) { + if (self.inactive) { + return false; + } + pos = self._getTouchPosition(ev); + self._setStars(pos); + self.$element.trigger('change').trigger('rating.change', [self.$element.val(), self._getCaption()]); + self.starClicked = true; + }); + }, + _starMouseMove: function (e) { + var self = this, pos, out; + if (!self.hoverEnabled || self.inactive || (e && e.isDefaultPrevented())) { + return; + } + self.starClicked = false; + pos = self._getTouchPosition(e); + out = self.calculate(pos); + self._toggleHover(out); + self.$element.trigger('rating.hover', [out.val, out.caption, 'stars']); + }, + _starMouseLeave: function (e) { + var self = this, out; + if (!self.hoverEnabled || self.inactive || self.starClicked || (e && e.isDefaultPrevented())) { + return; + } + out = self.cache; + self._toggleHover(out); + self.$element.trigger('rating.hoverleave', ['stars']); + }, + _clearClick: function (e) { + var self = this; + self._listenClick(e, function () { + if (!self.inactive) { + self.clear(); + self.clearClicked = true; + } + }); + }, + _clearMouseMove: function (e) { + var self = this, caption, val, width, out; + if (!self.hoverEnabled || self.inactive || !self.hoverOnClear || (e && e.isDefaultPrevented())) { + return; + } + self.clearClicked = false; + caption = '<span class="' + self.clearCaptionClass + '">' + self.clearCaption + '</span>'; + val = self.clearValue; + width = self.getWidthFromValue(val) || 0; + out = {caption: caption, width: width, val: val}; + self._toggleHover(out); + self.$element.trigger('rating.hover', [val, caption, 'clear']); + }, + _clearMouseLeave: function (e) { + var self = this, out; + if (!self.hoverEnabled || self.inactive || self.clearClicked || !self.hoverOnClear || (e && e.isDefaultPrevented())) { + return; + } + out = self.cache; + self._toggleHover(out); + self.$element.trigger('rating.hoverleave', ['clear']); + }, + _resetForm: function (e) { + var self = this; + if (e && e.isDefaultPrevented()) { + return; + } + if (!self.inactive) { + self.reset(); + } + }, + _setTouch: function (e, flag) { + //noinspection JSUnresolvedVariable + var self = this, ev, touches, pos, out, caption, w, width, isTouchCapable = 'ontouchstart' in window || + (window.DocumentTouch && document instanceof window.DocumentTouch); + if (!isTouchCapable || self.inactive) { + return; + } + ev = e.originalEvent; + //noinspection JSUnresolvedVariable + touches = !isEmpty(ev.touches) ? ev.touches : ev.changedTouches; + pos = self._getTouchPosition(touches[0]); + if (flag) { + self._setStars(pos); + self.$element.trigger('change').trigger('rating.change', [self.$element.val(), self._getCaption()]); + self.starClicked = true; + } else { + out = self.calculate(pos); + caption = out.val <= self.clearValue ? self.fetchCaption(self.clearValue) : out.caption; + w = self.getWidthFromValue(self.clearValue); + width = out.val <= self.clearValue ? w + '%' : out.width; + self._setCaption(caption); + self.$filledStars.css('width', width); + } + }, + _initTouch: function (e) { + var self = this, flag = (e.type === "touchend"); + self._setTouch(e, flag); + }, + _initSlider: function (options) { + var self = this; + if (isEmpty(self.$element.val())) { + self.$element.val(0); + } + self.initialValue = self.$element.val(); + self._setDefault('min', self._parseAttr('min', options)); + self._setDefault('max', self._parseAttr('max', options)); + self._setDefault('step', self._parseAttr('step', options)); + if (isNaN(self.min) || isEmpty(self.min)) { + self.min = DEFAULT_MIN; + } + if (isNaN(self.max) || isEmpty(self.max)) { + self.max = DEFAULT_MAX; + } + if (isNaN(self.step) || isEmpty(self.step) || self.step === 0) { + self.step = DEFAULT_STEP; + } + self.diff = self.max - self.min; + }, + _initHighlight: function (v) { + var self = this, w, cap = self._getCaption(); + if (!v) { + v = self.$element.val(); + } + w = self.getWidthFromValue(v) + '%'; + self.$filledStars.width(w); + self.cache = {caption: cap, width: w, val: v}; + }, + _getContainerCss: function () { + var self = this; + return 'rating-container' + + getCss(self.theme, 'theme-' + self.theme) + + getCss(self.rtl, 'rating-rtl') + + getCss(self.size, 'rating-' + self.size) + + getCss(self.animate, 'rating-animate') + + getCss(self.disabled || self.readonly, 'rating-disabled') + + getCss(self.containerClass, self.containerClass); + }, + _checkDisabled: function () { + var self = this, $el = self.$element, opts = self.options; + self.disabled = opts.disabled === undefined ? $el.attr('disabled') || false : opts.disabled; + self.readonly = opts.readonly === undefined ? $el.attr('readonly') || false : opts.readonly; + self.inactive = (self.disabled || self.readonly); + $el.attr({disabled: self.disabled, readonly: self.readonly}); + }, + _addContent: function (type, content) { + var self = this, $container = self.$container, isClear = type === 'clear'; + if (self.rtl) { + return isClear ? $container.append(content) : $container.prepend(content); + } else { + return isClear ? $container.prepend(content) : $container.append(content); + } + }, + _generateRating: function () { + var self = this, $el = self.$element, $rating, $container, w; + $container = self.$container = $(document.createElement("div")).insertBefore($el); + addCss($container, self._getContainerCss()); + self.$rating = $rating = $(document.createElement("div")).attr('class', 'rating').appendTo($container) + .append(self._getStars('empty')).append(self._getStars('filled')); + self.$emptyStars = $rating.find('.empty-stars'); + self.$filledStars = $rating.find('.filled-stars'); + self._renderCaption(); + self._renderClear(); + self._initHighlight(); + $container.append($el); + if (self.rtl) { + w = Math.max(self.$emptyStars.outerWidth(), self.$filledStars.outerWidth()); + self.$emptyStars.width(w); + } + }, + _getCaption: function () { + var self = this; + return self.$caption && self.$caption.length ? self.$caption.html() : self.defaultCaption; + }, + _setCaption: function (content) { + var self = this; + if (self.$caption && self.$caption.length) { + self.$caption.html(content); + } + }, + _renderCaption: function () { + var self = this, val = self.$element.val(), html, $cap = self.captionElement ? $(self.captionElement) : ''; + if (!self.showCaption) { + return; + } + html = self.fetchCaption(val); + if ($cap && $cap.length) { + addCss($cap, 'caption'); + $cap.html(html); + self.$caption = $cap; + return; + } + self._addContent('caption', '<div class="caption">' + html + '</div>'); + self.$caption = self.$container.find(".caption"); + }, + _renderClear: function () { + var self = this, css, $clr = self.clearElement ? $(self.clearElement) : ''; + if (!self.showClear) { + return; + } + css = self._getClearClass(); + if ($clr.length) { + addCss($clr, css); + $clr.attr({"title": self.clearButtonTitle}).html(self.clearButton); + self.$clear = $clr; + return; + } + self._addContent('clear', + '<div class="' + css + '" title="' + self.clearButtonTitle + '">' + self.clearButton + '</div>'); + self.$clear = self.$container.find('.' + self.clearButtonBaseClass); + }, + _getClearClass: function () { + return this.clearButtonBaseClass + ' ' + ((this.inactive) ? '' : this.clearButtonActiveClass); + }, + _getTouchPosition: function (e) { + var pageX = isEmpty(e.pageX) ? e.originalEvent.touches[0].pageX : e.pageX; + return pageX - this.$rating.offset().left; + }, + _toggleHover: function (out) { + var self = this, w, width, caption; + if (!out) { + return; + } + if (self.hoverChangeStars) { + w = self.getWidthFromValue(self.clearValue); + width = out.val <= self.clearValue ? w + '%' : out.width; + self.$filledStars.css('width', width); + } + if (self.hoverChangeCaption) { + caption = out.val <= self.clearValue ? self.fetchCaption(self.clearValue) : out.caption; + if (caption) { + self._setCaption(caption + ''); + } + } + }, + _init: function (options) { + var self = this, $el = self.$element.addClass('hide'); + self.options = options; + $.each(options, function (key, value) { + self[key] = value; + }); + if (self.rtl || $el.attr('dir') === 'rtl') { + self.rtl = true; + $el.attr('dir', 'rtl'); + } + self.starClicked = false; + self.clearClicked = false; + self._initSlider(options); + self._checkDisabled(); + if (self.displayOnly) { + self.inactive = true; + self.showClear = false; + self.showCaption = false; + } + self._generateRating(); + self._listen(); + return $el.removeClass('rating-loading'); + }, + _listen: function () { + var self = this, $el = self.$element, $form = $el.closest('form'), $rating = self.$rating, + $clear = self.$clear; + handler($rating, 'touchstart touchmove touchend', $.proxy(self._initTouch, self)); + handler($rating, 'click touchstart', $.proxy(self._starClick, self)); + handler($rating, 'mousemove', $.proxy(self._starMouseMove, self)); + handler($rating, 'mouseleave', $.proxy(self._starMouseLeave, self)); + if (self.showClear && $clear.length) { + handler($clear, 'click touchstart', $.proxy(self._clearClick, self)); + handler($clear, 'mousemove', $.proxy(self._clearMouseMove, self)); + handler($clear, 'mouseleave', $.proxy(self._clearMouseLeave, self)); + } + if ($form.length) { + handler($form, 'reset', $.proxy(self._resetForm, self)); + } + return $el; + }, + _getStars: function (type) { + var self = this, stars = '<span class="' + type + '-stars">', i; + for (i = 1; i <= self.stars; i++) { + stars += '<span class="star">' + self[type + 'Star'] + '</span>'; + } + return stars + '</span>'; + }, + _setStars: function (pos) { + var self = this, out = arguments.length ? self.calculate(pos) : self.calculate(), $el = self.$element; + $el.val(out.val); + self.$filledStars.css('width', out.width); + self._setCaption(out.caption); + self.cache = out; + return $el; + }, + showStars: function (val) { + var self = this, v = parseFloat(val); + self.$element.val(isNaN(v) ? self.clearValue : v); + return self._setStars(); + }, + calculate: function (pos) { + var self = this, defaultVal = isEmpty(self.$element.val()) ? 0 : self.$element.val(), + val = arguments.length ? self.getValueFromPosition(pos) : defaultVal, + caption = self.fetchCaption(val), width = self.getWidthFromValue(val); + width += '%'; + return {caption: caption, width: width, val: val}; + }, + getValueFromPosition: function (pos) { + var self = this, precision = getDecimalPlaces(self.step), val, factor, maxWidth = self.$rating.width(); + factor = (self.diff * pos) / (maxWidth * self.step); + factor = self.rtl ? Math.floor(factor) : Math.ceil(factor); + val = applyPrecision(parseFloat(self.min + factor * self.step), precision); + val = Math.max(Math.min(val, self.max), self.min); + return self.rtl ? (self.max - val) : val; + }, + getWidthFromValue: function (val) { + var self = this, min = self.min, max = self.max, factor, $r = self.$emptyStars, w; + if (!val || val <= min || min === max) { + return 0; + } + w = $r.outerWidth(); + factor = w ? $r.width() / w : 1; + if (val >= max) { + return 100; + } + return (val - min) * factor * 100 / (max - min); + }, + fetchCaption: function (rating) { + var self = this, val = parseFloat(rating) || self.clearValue, css, cap, capVal, cssVal, caption, + vCap = self.starCaptions, vCss = self.starCaptionClasses; + if (val && val !== self.clearValue) { + val = applyPrecision(val, getDecimalPlaces(self.step)); + } + cssVal = typeof vCss === "function" ? vCss(val) : vCss[val]; + capVal = typeof vCap === "function" ? vCap(val) : vCap[val]; + cap = isEmpty(capVal) ? self.defaultCaption.replace(/\{rating}/g, val) : capVal; + css = isEmpty(cssVal) ? self.clearCaptionClass : cssVal; + caption = (val === self.clearValue) ? self.clearCaption : cap; + return '<span class="' + css + '">' + caption + '</span>'; + }, + destroy: function () { + var self = this, $el = self.$element; + if (!isEmpty(self.$container)) { + self.$container.before($el).remove(); + } + $.removeData($el.get(0)); + return $el.off('rating').removeClass('hide'); + }, + create: function (options) { + var self = this, opts = options || self.options || {}; + return self.destroy().rating(opts); + }, + clear: function () { + var self = this, title = '<span class="' + self.clearCaptionClass + '">' + self.clearCaption + '</span>'; + if (!self.inactive) { + self._setCaption(title); + } + return self.showStars(self.clearValue).trigger('change').trigger('rating.clear'); + }, + reset: function () { + var self = this; + return self.showStars(self.initialValue).trigger('rating.reset'); + }, + update: function (val) { + var self = this; + return arguments.length ? self.showStars(val) : self.$element; + }, + refresh: function (options) { + var self = this, $el = self.$element; + if (!options) { + return $el; + } + return self.destroy().rating($.extend(true, self.options, options)).trigger('rating.refresh'); + } + }; + + $.fn.rating = function (option) { + var args = Array.apply(null, arguments), retvals = []; + args.shift(); + this.each(function () { + var self = $(this), data = self.data('rating'), options = typeof option === 'object' && option, + theme = options.theme || self.data('theme'), lang = options.language || self.data('language') || 'en', + thm = {}, loc = {}, opts; + + if (!data) { + if (theme) { + thm = $.fn.ratingThemes[theme] || {}; + } + if (lang !== 'en' && !isEmpty($.fn.ratingLocales[lang])) { + loc = $.fn.ratingLocales[lang]; + } + opts = $.extend(true, {}, $.fn.rating.defaults, thm, $.fn.ratingLocales.en, loc, options, self.data()); + data = new Rating(this, opts); + self.data('rating', data); + } + + if (typeof option === 'string') { + retvals.push(data[option].apply(data, args)); + } + }); + switch (retvals.length) { + case 0: + return this; + case 1: + return retvals[0] === undefined ? this : retvals[0]; + default: + return retvals; + } + }; + + $.fn.rating.defaults = { + theme: '', + language: 'en', + stars: 5, + filledStar: '<i class="glyphicon glyphicon-star"></i>', + emptyStar: '<i class="glyphicon glyphicon-star-empty"></i>', + containerClass: '', + size: 'md', + animate: true, + displayOnly: false, + rtl: false, + showClear: true, + showCaption: true, + starCaptionClasses: { + 0.5: 'label label-danger', + 1: 'label label-danger', + 1.5: 'label label-warning', + 2: 'label label-warning', + 2.5: 'label label-info', + 3: 'label label-info', + 3.5: 'label label-primary', + 4: 'label label-primary', + 4.5: 'label label-success', + 5: 'label label-success' + }, + clearButton: '<i class="glyphicon glyphicon-minus-sign"></i>', + clearButtonBaseClass: 'clear-rating', + clearButtonActiveClass: 'clear-rating-active', + clearCaptionClass: 'label label-default', + clearValue: null, + captionElement: null, + clearElement: null, + hoverEnabled: true, + hoverChangeCaption: true, + hoverChangeStars: true, + hoverOnClear: true + }; + + $.fn.ratingLocales.en = { + defaultCaption: '{rating} Stars', + starCaptions: { + 0.5: 'Half Star', + 1: 'One Star', + 1.5: 'One & Half Star', + 2: 'Two Stars', + 2.5: 'Two & Half Stars', + 3: 'Three Stars', + 3.5: 'Three & Half Stars', + 4: 'Four Stars', + 4.5: 'Four & Half Stars', + 5: 'Five Stars' + }, + clearButtonTitle: 'Clear', + clearCaption: 'Not Rated' + }; + + $.fn.rating.Constructor = Rating; + + /** + * Convert automatically inputs with class 'rating' into Krajee's star rating control. + */ + $(document).ready(function () { + var $input = $('input.rating'); + if ($input.length) { + $input.removeClass('rating-loading').addClass('rating-loading').rating(); + } + }); +})); \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/js/star-rating.min.js b/src/legacy/bootstrap-star-rating/js/star-rating.min.js new file mode 100644 index 0000000..5840189 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/js/star-rating.min.js @@ -0,0 +1,10 @@ +/*! + * bootstrap-star-rating v4.0.2 + * http://plugins.krajee.com/star-rating + * + * Author: Kartik Visweswaran + * Copyright: 2014 - 2016, Kartik Visweswaran, Krajee.com + * + * Licensed under the BSD 3-Clause + * https://github.com/kartik-v/bootstrap-star-rating/blob/master/LICENSE.md + */!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(window.jQuery)}(function(e){"use strict";e.fn.ratingLocales={},e.fn.ratingThemes={};var t,a,n,r,i,l,s,o,c,u,h;t=".rating",a=0,n=5,r=.5,i=function(t,a){return null===t||void 0===t||0===t.length||a&&""===e.trim(t)},l=function(e,t){return e?" "+t:""},s=function(e,t){e.removeClass(t).addClass(t)},o=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},c=function(e,t){return parseFloat(e.toFixed(t))},u=function(e,a,n,r){var i=r?a:a.split(" ").join(t+" ")+t;e.off(i).on(i,n)},h=function(t,a){var n=this;n.$element=e(t),n._init(a)},h.prototype={constructor:h,_parseAttr:function(e,t){var l,s,o,c,u=this,h=u.$element,d=h.attr("type");if("range"===d||"number"===d){switch(s=t[e]||h.data(e)||h.attr(e),e){case"min":o=a;break;case"max":o=n;break;default:o=r}l=i(s)?o:s,c=parseFloat(l)}else c=parseFloat(t[e]);return isNaN(c)?o:c},_setDefault:function(e,t){var a=this;i(a[e])&&(a[e]=t)},_listenClick:function(e,t){return e.stopPropagation(),e.preventDefault(),e.handled===!0?!1:(t(e),void(e.handled=!0))},_starClick:function(e){var t,a=this;a._listenClick(e,function(e){return a.inactive?!1:(t=a._getTouchPosition(e),a._setStars(t),a.$element.trigger("change").trigger("rating.change",[a.$element.val(),a._getCaption()]),void(a.starClicked=!0))})},_starMouseMove:function(e){var t,a,n=this;!n.hoverEnabled||n.inactive||e&&e.isDefaultPrevented()||(n.starClicked=!1,t=n._getTouchPosition(e),a=n.calculate(t),n._toggleHover(a),n.$element.trigger("rating.hover",[a.val,a.caption,"stars"]))},_starMouseLeave:function(e){var t,a=this;!a.hoverEnabled||a.inactive||a.starClicked||e&&e.isDefaultPrevented()||(t=a.cache,a._toggleHover(t),a.$element.trigger("rating.hoverleave",["stars"]))},_clearClick:function(e){var t=this;t._listenClick(e,function(){t.inactive||(t.clear(),t.clearClicked=!0)})},_clearMouseMove:function(e){var t,a,n,r,i=this;!i.hoverEnabled||i.inactive||!i.hoverOnClear||e&&e.isDefaultPrevented()||(i.clearClicked=!1,t='<span class="'+i.clearCaptionClass+'">'+i.clearCaption+"</span>",a=i.clearValue,n=i.getWidthFromValue(a)||0,r={caption:t,width:n,val:a},i._toggleHover(r),i.$element.trigger("rating.hover",[a,t,"clear"]))},_clearMouseLeave:function(e){var t,a=this;!a.hoverEnabled||a.inactive||a.clearClicked||!a.hoverOnClear||e&&e.isDefaultPrevented()||(t=a.cache,a._toggleHover(t),a.$element.trigger("rating.hoverleave",["clear"]))},_resetForm:function(e){var t=this;e&&e.isDefaultPrevented()||t.inactive||t.reset()},_setTouch:function(e,t){var a,n,r,l,s,o,c,u=this,h="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch;h&&!u.inactive&&(a=e.originalEvent,n=i(a.touches)?a.changedTouches:a.touches,r=u._getTouchPosition(n[0]),t?(u._setStars(r),u.$element.trigger("change").trigger("rating.change",[u.$element.val(),u._getCaption()]),u.starClicked=!0):(l=u.calculate(r),s=l.val<=u.clearValue?u.fetchCaption(u.clearValue):l.caption,o=u.getWidthFromValue(u.clearValue),c=l.val<=u.clearValue?o+"%":l.width,u._setCaption(s),u.$filledStars.css("width",c)))},_initTouch:function(e){var t=this,a="touchend"===e.type;t._setTouch(e,a)},_initSlider:function(e){var t=this;i(t.$element.val())&&t.$element.val(0),t.initialValue=t.$element.val(),t._setDefault("min",t._parseAttr("min",e)),t._setDefault("max",t._parseAttr("max",e)),t._setDefault("step",t._parseAttr("step",e)),(isNaN(t.min)||i(t.min))&&(t.min=a),(isNaN(t.max)||i(t.max))&&(t.max=n),(isNaN(t.step)||i(t.step)||0===t.step)&&(t.step=r),t.diff=t.max-t.min},_initHighlight:function(e){var t,a=this,n=a._getCaption();e||(e=a.$element.val()),t=a.getWidthFromValue(e)+"%",a.$filledStars.width(t),a.cache={caption:n,width:t,val:e}},_getContainerCss:function(){var e=this;return"rating-container"+l(e.theme,"theme-"+e.theme)+l(e.rtl,"rating-rtl")+l(e.size,"rating-"+e.size)+l(e.animate,"rating-animate")+l(e.disabled||e.readonly,"rating-disabled")+l(e.containerClass,e.containerClass)},_checkDisabled:function(){var e=this,t=e.$element,a=e.options;e.disabled=void 0===a.disabled?t.attr("disabled")||!1:a.disabled,e.readonly=void 0===a.readonly?t.attr("readonly")||!1:a.readonly,e.inactive=e.disabled||e.readonly,t.attr({disabled:e.disabled,readonly:e.readonly})},_addContent:function(e,t){var a=this,n=a.$container,r="clear"===e;return a.rtl?r?n.append(t):n.prepend(t):r?n.prepend(t):n.append(t)},_generateRating:function(){var t,a,n,r=this,i=r.$element;a=r.$container=e(document.createElement("div")).insertBefore(i),s(a,r._getContainerCss()),r.$rating=t=e(document.createElement("div")).attr("class","rating").appendTo(a).append(r._getStars("empty")).append(r._getStars("filled")),r.$emptyStars=t.find(".empty-stars"),r.$filledStars=t.find(".filled-stars"),r._renderCaption(),r._renderClear(),r._initHighlight(),a.append(i),r.rtl&&(n=Math.max(r.$emptyStars.outerWidth(),r.$filledStars.outerWidth()),r.$emptyStars.width(n))},_getCaption:function(){var e=this;return e.$caption&&e.$caption.length?e.$caption.html():e.defaultCaption},_setCaption:function(e){var t=this;t.$caption&&t.$caption.length&&t.$caption.html(e)},_renderCaption:function(){var t,a=this,n=a.$element.val(),r=a.captionElement?e(a.captionElement):"";if(a.showCaption){if(t=a.fetchCaption(n),r&&r.length)return s(r,"caption"),r.html(t),void(a.$caption=r);a._addContent("caption",'<div class="caption">'+t+"</div>"),a.$caption=a.$container.find(".caption")}},_renderClear:function(){var t,a=this,n=a.clearElement?e(a.clearElement):"";if(a.showClear){if(t=a._getClearClass(),n.length)return s(n,t),n.attr({title:a.clearButtonTitle}).html(a.clearButton),void(a.$clear=n);a._addContent("clear",'<div class="'+t+'" title="'+a.clearButtonTitle+'">'+a.clearButton+"</div>"),a.$clear=a.$container.find("."+a.clearButtonBaseClass)}},_getClearClass:function(){return this.clearButtonBaseClass+" "+(this.inactive?"":this.clearButtonActiveClass)},_getTouchPosition:function(e){var t=i(e.pageX)?e.originalEvent.touches[0].pageX:e.pageX;return t-this.$rating.offset().left},_toggleHover:function(e){var t,a,n,r=this;e&&(r.hoverChangeStars&&(t=r.getWidthFromValue(r.clearValue),a=e.val<=r.clearValue?t+"%":e.width,r.$filledStars.css("width",a)),r.hoverChangeCaption&&(n=e.val<=r.clearValue?r.fetchCaption(r.clearValue):e.caption,n&&r._setCaption(n+"")))},_init:function(t){var a=this,n=a.$element.addClass("hide");return a.options=t,e.each(t,function(e,t){a[e]=t}),(a.rtl||"rtl"===n.attr("dir"))&&(a.rtl=!0,n.attr("dir","rtl")),a.starClicked=!1,a.clearClicked=!1,a._initSlider(t),a._checkDisabled(),a.displayOnly&&(a.inactive=!0,a.showClear=!1,a.showCaption=!1),a._generateRating(),a._listen(),n.removeClass("rating-loading")},_listen:function(){var t=this,a=t.$element,n=a.closest("form"),r=t.$rating,i=t.$clear;return u(r,"touchstart touchmove touchend",e.proxy(t._initTouch,t)),u(r,"click touchstart",e.proxy(t._starClick,t)),u(r,"mousemove",e.proxy(t._starMouseMove,t)),u(r,"mouseleave",e.proxy(t._starMouseLeave,t)),t.showClear&&i.length&&(u(i,"click touchstart",e.proxy(t._clearClick,t)),u(i,"mousemove",e.proxy(t._clearMouseMove,t)),u(i,"mouseleave",e.proxy(t._clearMouseLeave,t))),n.length&&u(n,"reset",e.proxy(t._resetForm,t)),a},_getStars:function(e){var t,a=this,n='<span class="'+e+'-stars">';for(t=1;t<=a.stars;t++)n+='<span class="star">'+a[e+"Star"]+"</span>";return n+"</span>"},_setStars:function(e){var t=this,a=arguments.length?t.calculate(e):t.calculate(),n=t.$element;return n.val(a.val),t.$filledStars.css("width",a.width),t._setCaption(a.caption),t.cache=a,n},showStars:function(e){var t=this,a=parseFloat(e);return t.$element.val(isNaN(a)?t.clearValue:a),t._setStars()},calculate:function(e){var t=this,a=i(t.$element.val())?0:t.$element.val(),n=arguments.length?t.getValueFromPosition(e):a,r=t.fetchCaption(n),l=t.getWidthFromValue(n);return l+="%",{caption:r,width:l,val:n}},getValueFromPosition:function(e){var t,a,n=this,r=o(n.step),i=n.$rating.width();return a=n.diff*e/(i*n.step),a=n.rtl?Math.floor(a):Math.ceil(a),t=c(parseFloat(n.min+a*n.step),r),t=Math.max(Math.min(t,n.max),n.min),n.rtl?n.max-t:t},getWidthFromValue:function(e){var t,a,n=this,r=n.min,i=n.max,l=n.$emptyStars;return!e||r>=e||r===i?0:(a=l.outerWidth(),t=a?l.width()/a:1,e>=i?100:(e-r)*t*100/(i-r))},fetchCaption:function(e){var t,a,n,r,l,s=this,u=parseFloat(e)||s.clearValue,h=s.starCaptions,d=s.starCaptionClasses;return u&&u!==s.clearValue&&(u=c(u,o(s.step))),r="function"==typeof d?d(u):d[u],n="function"==typeof h?h(u):h[u],a=i(n)?s.defaultCaption.replace(/\{rating}/g,u):n,t=i(r)?s.clearCaptionClass:r,l=u===s.clearValue?s.clearCaption:a,'<span class="'+t+'">'+l+"</span>"},destroy:function(){var t=this,a=t.$element;return i(t.$container)||t.$container.before(a).remove(),e.removeData(a.get(0)),a.off("rating").removeClass("hide")},create:function(e){var t=this,a=e||t.options||{};return t.destroy().rating(a)},clear:function(){var e=this,t='<span class="'+e.clearCaptionClass+'">'+e.clearCaption+"</span>";return e.inactive||e._setCaption(t),e.showStars(e.clearValue).trigger("change").trigger("rating.clear")},reset:function(){var e=this;return e.showStars(e.initialValue).trigger("rating.reset")},update:function(e){var t=this;return arguments.length?t.showStars(e):t.$element},refresh:function(t){var a=this,n=a.$element;return t?a.destroy().rating(e.extend(!0,a.options,t)).trigger("rating.refresh"):n}},e.fn.rating=function(t){var a=Array.apply(null,arguments),n=[];switch(a.shift(),this.each(function(){var r,l=e(this),s=l.data("rating"),o="object"==typeof t&&t,c=o.theme||l.data("theme"),u=o.language||l.data("language")||"en",d={},g={};s||(c&&(d=e.fn.ratingThemes[c]||{}),"en"===u||i(e.fn.ratingLocales[u])||(g=e.fn.ratingLocales[u]),r=e.extend(!0,{},e.fn.rating.defaults,d,e.fn.ratingLocales.en,g,o,l.data()),s=new h(this,r),l.data("rating",s)),"string"==typeof t&&n.push(s[t].apply(s,a))}),n.length){case 0:return this;case 1:return void 0===n[0]?this:n[0];default:return n}},e.fn.rating.defaults={theme:"",language:"en",stars:5,filledStar:'<i class="glyphicon glyphicon-star"></i>',emptyStar:'<i class="glyphicon glyphicon-star-empty"></i>',containerClass:"",size:"md",animate:!0,displayOnly:!1,rtl:!1,showClear:!0,showCaption:!0,starCaptionClasses:{.5:"label label-danger",1:"label label-danger",1.5:"label label-warning",2:"label label-warning",2.5:"label label-info",3:"label label-info",3.5:"label label-primary",4:"label label-primary",4.5:"label label-success",5:"label label-success"},clearButton:'<i class="glyphicon glyphicon-minus-sign"></i>',clearButtonBaseClass:"clear-rating",clearButtonActiveClass:"clear-rating-active",clearCaptionClass:"label label-default",clearValue:null,captionElement:null,clearElement:null,hoverEnabled:!0,hoverChangeCaption:!0,hoverChangeStars:!0,hoverOnClear:!0},e.fn.ratingLocales.en={defaultCaption:"{rating} Stars",starCaptions:{.5:"Half Star",1:"One Star",1.5:"One & Half Star",2:"Two Stars",2.5:"Two & Half Stars",3:"Three Stars",3.5:"Three & Half Stars",4:"Four Stars",4.5:"Four & Half Stars",5:"Five Stars"},clearButtonTitle:"Clear",clearCaption:"Not Rated"},e.fn.rating.Constructor=h,e(document).ready(function(){var t=e("input.rating");t.length&&t.removeClass("rating-loading").addClass("rating-loading").rating()})}); \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/package.json b/src/legacy/bootstrap-star-rating/package.json new file mode 100644 index 0000000..8c390bc --- /dev/null +++ b/src/legacy/bootstrap-star-rating/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + { + "raw": "bootstrap-star-rating@^4.0.2", + "scope": null, + "escapedName": "bootstrap-star-rating", + "name": "bootstrap-star-rating", + "rawSpec": "^4.0.2", + "spec": ">=4.0.2 <5.0.0", + "type": "range" + }, + "D:\\scfsdk\\v8\\graphene_dev\\portal-marketplace\\graphene-portal-fe" + ] + ], + "_from": "bootstrap-star-rating@>=4.0.2 <5.0.0", + "_id": "bootstrap-star-rating@4.0.2", + "_inCache": true, + "_location": "/bootstrap-star-rating", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/bootstrap-star-rating-4.0.2.tgz_1467672963344_0.017104598926380277" + }, + "_npmUser": { + "name": "bruce-mitchell", + "email": "bruce@codescience.co.za" + }, + "_npmVersion": "3.9.3", + "_phantomChildren": {}, + "_requested": { + "raw": "bootstrap-star-rating@^4.0.2", + "scope": null, + "escapedName": "bootstrap-star-rating", + "name": "bootstrap-star-rating", + "rawSpec": "^4.0.2", + "spec": ">=4.0.2 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "#DEV:/" + ], + "_resolved": "https://registry.npmjs.org/bootstrap-star-rating/-/bootstrap-star-rating-4.0.2.tgz", + "_shasum": "6405e26202500d0cebb38e243d5c7bc4b40b75b8", + "_shrinkwrap": null, + "_spec": "bootstrap-star-rating@^4.0.2", + "_where": "D:\\scfsdk\\v8\\graphene_dev\\portal-marketplace\\graphene-portal-fe", + "author": { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com" + }, + "bugs": { + "url": "https://github.com/kartik-v/bootstrap-star-rating/issues" + }, + "dependencies": {}, + "description": "A simple yet powerful JQuery star rating plugin for Bootstrap.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "6405e26202500d0cebb38e243d5c7bc4b40b75b8", + "tarball": "https://registry.npmjs.org/bootstrap-star-rating/-/bootstrap-star-rating-4.0.2.tgz" + }, + "gitHead": "87d0ba3f9256aaa2e11386ef6f3cc47824860911", + "homepage": "https://github.com/kartik-v/bootstrap-star-rating", + "keywords": [ + "bootstrap", + "star", + "rating", + "font", + "awesome", + "glyphicon", + "svg" + ], + "license": "BSD-3-Clause", + "main": "js/star-rating.min.js", + "maintainers": [ + { + "name": "bruce-mitchell", + "email": "bruce@codescience.co.za" + } + ], + "name": "bootstrap-star-rating", + "optionalDependencies": {}, + "peerDependencies": { + "jquery": ">= 1.9.0", + "bootstrap": "~3" + }, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/kartik-v/bootstrap-star-rating.git" + }, + "scripts": {}, + "version": "4.0.2" +} diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.css b/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.css new file mode 100644 index 0000000..8a862d9 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.css @@ -0,0 +1,14 @@ +/*! + * Krajee Font Awesome Theme styling for bootstrap-star-rating. + * This file must be loaded after 'star-rating.css'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +.theme-krajee-fa .star { + font-size: 1.1em; +} + +.theme-krajee-fa .caption { + margin-top: -0.2em; +} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.js b/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.js new file mode 100644 index 0000000..a25c22f --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.js @@ -0,0 +1,15 @@ +/*! + * Krajee Font Awesome Theme configuration for bootstrap-star-rating. + * This file must be loaded after 'star-rating.js'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingThemes['krajee-fa'] = { + filledStar: '<i class="fa fa-star"></i>', + emptyStar: '<i class="fa fa-star-o"></i>', + clearButton: '<i class="fa fa-lg fa-minus-circle"></i>' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.min.css b/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.min.css new file mode 100644 index 0000000..46cb746 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.min.css @@ -0,0 +1,7 @@ +/*! + * Krajee Font Awesome Theme styling for bootstrap-star-rating. + * This file must be loaded after 'star-rating.css'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */.theme-krajee-fa .star{font-size:1.1em}.theme-krajee-fa .caption{margin-top:-.2em} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.min.js b/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.min.js new file mode 100644 index 0000000..977808f --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-fa/theme.min.js @@ -0,0 +1,7 @@ +/*! + * Krajee Font Awesome Theme configuration for bootstrap-star-rating. + * This file must be loaded after 'star-rating.js'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */!function(a){"use strict";a.fn.ratingThemes["krajee-fa"]={filledStar:'<i class="fa fa-star"></i>',emptyStar:'<i class="fa fa-star-o"></i>',clearButton:'<i class="fa fa-lg fa-minus-circle"></i>'}}(window.jQuery); \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.css b/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.css new file mode 100644 index 0000000..3917f8c --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.css @@ -0,0 +1,107 @@ +/*! + * Krajee SVG Theme styling for bootstrap-star-rating. + * This file must be loaded after 'star-rating.css'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +.theme-krajee-svg .krajee-icon { + display: inline-block; + width: 48px; + height: 48px; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; +} + +.theme-krajee-svg.rating-xl .krajee-icon { + width: 80px; + height: 80px; +} + +.theme-krajee-svg.rating-lg .krajee-icon { + width: 64px; + height: 64px; +} + +.theme-krajee-svg.rating-sm .krajee-icon { + width: 40px; + height: 40px; +} + +.theme-krajee-svg.rating-xs .krajee-icon { + width: 30px; + height: 30px; +} + +.theme-krajee-svg .filled-stars .krajee-icon-star { + background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23fde16d%22%20stroke%3D%22%23777777%22%20d%3D%22M20.6%2011l-4.6-10.5-4.6%2010.5h-10.8l7.8%207.9-3%2012.1%2010.6-6%2010.6%206-3-12.1%207.8-7.9z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E'); +} + +.theme-krajee-svg .krajee-icon-clear { + display: inline-block; + width: 39px; + height: 39px; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20id%3D%22svg2%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20158.81%20158.81%22%20version%3D%221.1%22%3E%0D%0A%3Cpath%20id%3D%22path4%22%20style%3D%22fill%3A%23aaa%22%20stroke-linejoin%3D%22round%22%20d%3D%22m155.06%2C79.438c0%2C41.799-33.885%2C75.684-75.684%2C75.684s-75.684-33.885-75.684-75.684%2C33.885-75.684%2C75.684-75.684%2C75.684%2C33.885%2C75.684%2C75.684z%22%20stroke%3D%22%23aaa%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22%2F%3E%0D%0A%3Cpath%20id%3D%22rect3139%22%20style%3D%22fill%3A%23fff%22%20d%3D%22m37.216%2C64.443v28.67h88.24v-28.67h-88.24z%22%2F%3E%0D%0A%3C%2Fsvg%3E'); +} + +.theme-krajee-svg .krajee-icon-clear:hover { + background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20id%3D%22svg2%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20158.81%20158.81%22%20version%3D%221.1%22%3E%0D%0A%3Cpath%20id%3D%22path4%22%20style%3D%22fill%3A%23843534%22%20stroke-linejoin%3D%22round%22%20d%3D%22m155.06%2C79.438c0%2C41.799-33.885%2C75.684-75.684%2C75.684s-75.684-33.885-75.684-75.684%2C33.885-75.684%2C75.684-75.684%2C75.684%2C33.885%2C75.684%2C75.684z%22%20stroke%3D%22%23843534%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22%2F%3E%0D%0A%3Cpath%20id%3D%22rect3139%22%20style%3D%22fill%3A%23fff%22%20d%3D%22m37.216%2C64.443v28.67h88.24v-28.67h-88.24z%22%2F%3E%0D%0A%3C%2Fsvg%3E'); +} + +.theme-krajee-svg.rating-xl .krajee-icon-clear { + width: 64px; + height: 64px; +} + +.theme-krajee-svg.rating-lg .krajee-icon-clear { + width: 50px; + height: 50px; +} + +.theme-krajee-svg.rating-sm .krajee-icon-clear { + width: 30px; + height: 30px; +} + +.theme-krajee-svg.rating-xs .krajee-icon-clear { + width: 23px; + height: 23px; +} + +.theme-krajee-svg .empty-stars .krajee-icon-star { + background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20stroke%3D%22%23777777%22%20d%3D%22M20.6%2011l-4.6-10.5-4.6%2010.5h-10.8l7.8%207.9-3%2012.1%2010.6-6%2010.6%206-3-12.1%207.8-7.9z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E'); +} + +.theme-krajee-svg .filled-stars .krajee-icon-heart { + background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23fde16d%22%20stroke%3D%22%23777777%22%20stroke-width%3D%220.04em%22%20d%3D%22M12%2021.35l-1.45-1.32c-5.15-4.67-8.55-7.75-8.55-11.53%200-3.08%202.42-5.5%205.5-5.5%201.74%200%203.41.81%204.5%202.09%201.09-1.28%202.76-2.09%204.5-2.09%203.08%200%205.5%202.42%205.5%205.5%200%203.78-3.4%206.86-8.55%2011.54l-1.45%201.31z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E'); +} + +.theme-krajee-svg .empty-stars .krajee-icon-heart { + background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20stroke%3D%22%23777777%22%20stroke-width%3D%220.04em%22%20d%3D%22M12%2021.35l-1.45-1.32c-5.15-4.67-8.55-7.75-8.55-11.53%200-3.08%202.42-5.5%205.5-5.5%201.74%200%203.41.81%204.5%202.09%201.09-1.28%202.76-2.09%204.5-2.09%203.08%200%205.5%202.42%205.5%205.5%200%203.78-3.4%206.86-8.55%2011.54l-1.45%201.31z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E'); +} + +.theme-krajee-svg .krajee-icon-heart { + margin: 0 -0.08em; +} + +.theme-krajee-svg.is-heart .caption { + margin-top: -0.8em; +} + +.theme-krajee-svg.is-heart .clear-rating { + margin-top: -0.4em; +} + +.theme-krajee-svg.rating-rtl.is-heart .filled-stars { + right: 0.02em; +} + +.theme-krajee-svg.rating-rtl.is-heart .empty-stars { + margin-right: 0.01em; +} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.js b/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.js new file mode 100644 index 0000000..e7b8ff4 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.js @@ -0,0 +1,15 @@ +/*! + * Krajee SVG Theme Configuration for bootstrap-star-rating. + * This file must be loaded after 'star-rating.js'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingThemes['krajee-svg'] = { + filledStar: '<span class="krajee-icon krajee-icon-star"></span>', + emptyStar: '<span class="krajee-icon krajee-icon-star"></span>', + clearButton: '<span class="krajee-icon-clear"></span>' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.min.css b/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.min.css new file mode 100644 index 0000000..c45e77d --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.min.css @@ -0,0 +1,8 @@ +/*! + * Krajee SVG Theme styling for bootstrap-star-rating. + * This file must be loaded after 'star-rating.css'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +.theme-krajee-svg .krajee-icon{display:inline-block;width:48px;height:48px;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover}.theme-krajee-svg.rating-xl .krajee-icon{width:80px;height:80px}.theme-krajee-svg.rating-lg .krajee-icon{width:64px;height:64px}.theme-krajee-svg.rating-sm .krajee-icon{width:40px;height:40px}.theme-krajee-svg.rating-xs .krajee-icon{width:30px;height:30px}.theme-krajee-svg .filled-stars .krajee-icon-star{background-image:url('data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23fde16d%22%20stroke%3D%22%23777777%22%20d%3D%22M20.6%2011l-4.6-10.5-4.6%2010.5h-10.8l7.8%207.9-3%2012.1%2010.6-6%2010.6%206-3-12.1%207.8-7.9z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E')}.theme-krajee-svg .empty-stars .krajee-icon-star{background-image:url('data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20stroke%3D%22%23777777%22%20d%3D%22M20.6%2011l-4.6-10.5-4.6%2010.5h-10.8l7.8%207.9-3%2012.1%2010.6-6%2010.6%206-3-12.1%207.8-7.9z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E')}.theme-krajee-svg .filled-stars .krajee-icon-heart{background-image:url('data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23fde16d%22%20stroke%3D%22%23777777%22%20stroke-width%3D%220.04em%22%20d%3D%22M12%2021.35l-1.45-1.32c-5.15-4.67-8.55-7.75-8.55-11.53%200-3.08%202.42-5.5%205.5-5.5%201.74%200%203.41.81%204.5%202.09%201.09-1.28%202.76-2.09%204.5-2.09%203.08%200%205.5%202.42%205.5%205.5%200%203.78-3.4%206.86-8.55%2011.54l-1.45%201.31z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E')}.theme-krajee-svg .empty-stars .krajee-icon-heart{background-image:url('data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20stroke%3D%22%23777777%22%20stroke-width%3D%220.04em%22%20d%3D%22M12%2021.35l-1.45-1.32c-5.15-4.67-8.55-7.75-8.55-11.53%200-3.08%202.42-5.5%205.5-5.5%201.74%200%203.41.81%204.5%202.09%201.09-1.28%202.76-2.09%204.5-2.09%203.08%200%205.5%202.42%205.5%205.5%200%203.78-3.4%206.86-8.55%2011.54l-1.45%201.31z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E')}.theme-krajee-svg .krajee-icon-heart{margin:0 -.08em}.theme-krajee-svg.is-heart .caption{margin-top:-.8em}.theme-krajee-svg.is-heart .clear-rating{margin-top:-.4em}.theme-krajee-svg.rating-rtl.is-heart .filled-stars{right:.02em}.theme-krajee-svg.rating-rtl.is-heart .empty-stars{margin-right:.01em} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.min.js b/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.min.js new file mode 100644 index 0000000..19ccfed --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-svg/theme.min.js @@ -0,0 +1,7 @@ +/*! + * Krajee SVG Theme Configuration for bootstrap-star-rating. + * This file must be loaded after 'star-rating.js'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */!function(a){"use strict";a.fn.ratingThemes["krajee-svg"]={filledStar:'<span class="krajee-icon krajee-icon-star"></span>',emptyStar:'<span class="krajee-icon krajee-icon-star"></span>',clearButton:'<span class="krajee-icon-clear"></span>'}}(window.jQuery); \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.css b/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.css new file mode 100644 index 0000000..5fae2a1 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.css @@ -0,0 +1,15 @@ +/*! + * Krajee Unicode Theme styling for bootstrap-star-rating. + * This file must be loaded after 'star-rating.css'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +.theme-krajee-uni .star { + font-size: 1.3em; + margin: 0; +} + +.theme-krajee-uni .caption { + margin-top: 0; +} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.js b/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.js new file mode 100644 index 0000000..efb832a --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.js @@ -0,0 +1,15 @@ +/*! + * Krajee Unicode Theme configuration for bootstrap-star-rating. + * This file must be loaded after 'star-rating.js'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */ +(function ($) { + "use strict"; + $.fn.ratingThemes['krajee-uni'] = { + filledStar: '★', + emptyStar: '☆', + clearButton: '⊝' + }; +})(window.jQuery); diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.min.css b/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.min.css new file mode 100644 index 0000000..cd78a4b --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.min.css @@ -0,0 +1,7 @@ +/*! + * Krajee Unicode Theme styling for bootstrap-star-rating. + * This file must be loaded after 'star-rating.css'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */.theme-krajee-uni .star{font-size:1.3em;margin:0}.theme-krajee-uni .caption{margin-top:0} \ No newline at end of file diff --git a/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.min.js b/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.min.js new file mode 100644 index 0000000..d037bf1 --- /dev/null +++ b/src/legacy/bootstrap-star-rating/themes/krajee-uni/theme.min.js @@ -0,0 +1,7 @@ +/*! + * Krajee Unicode Theme configuration for bootstrap-star-rating. + * This file must be loaded after 'star-rating.js'. + * + * @see http://github.com/kartik-v/bootstrap-star-rating + * @author Kartik Visweswaran <kartikv2@gmail.com> + */!function(e){"use strict";e.fn.ratingThemes["krajee-uni"]={filledStar:"★",emptyStar:"☆",clearButton:"⊝"}}(window.jQuery); -- GitLab