Init(Core): Change repo
This commit is contained in:
15
public/assets/libs/bootstrap-rating/bootstrap-rating.css
vendored
Normal file
15
public/assets/libs/bootstrap-rating/bootstrap-rating.css
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
.symbol {
|
||||
display: inline-block;
|
||||
border-radius: 50%;
|
||||
border: 5px double white;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.symbol-empty {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.symbol-filled {
|
||||
background-color: black;
|
||||
}
|
||||
3
public/assets/libs/bootstrap-rating/bootstrap-rating.min.js
vendored
Normal file
3
public/assets/libs/bootstrap-rating/bootstrap-rating.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// bootstrap-rating - v1.3.2 - (c) 2016 dreyescat
|
||||
// https://github.com/dreyescat/bootstrap-rating MIT
|
||||
!function(a,b){"use strict";function c(c,e){this.$input=a(c),this.$rating=a("<span></span>").css({cursor:"default"}).insertBefore(this.$input),this.options=function(c){return c.start=parseInt(c.start,10),c.start=isNaN(c.start)?b:c.start,c.stop=parseInt(c.stop,10),c.stop=isNaN(c.stop)?c.start+d||b:c.stop,c.step=parseInt(c.step,10)||b,c.fractions=Math.abs(parseInt(c.fractions,10))||b,c.scale=Math.abs(parseInt(c.scale,10))||b,c=a.extend({},a.fn.rating.defaults,c),c.filledSelected=c.filledSelected||c.filled,c}(a.extend({},this.$input.data(),e)),this._init()}var d=5;c.prototype={_init:function(){for(var c=this,d=this.$input,e=this.$rating,f=function(a){return function(c){d.prop("disabled")||d.prop("readonly")||d.data("readonly")!==b||a.call(this,c)}},g=1;g<=this._rateToIndex(this.options.stop);g++){var h=a('<div class="rating-symbol"></div>').css({display:"inline-block",position:"relative"});a('<div class="rating-symbol-background '+this.options.empty+'"></div>').appendTo(h),a('<div class="rating-symbol-foreground"></div>').append("<span></span>").css({display:"inline-block",position:"absolute",overflow:"hidden",left:0,right:0,width:0}).appendTo(h),e.append(h),this.options.extendSymbol.call(h,this._indexToRate(g))}this._updateRate(d.val()),d.on("change",function(){c._updateRate(a(this).val())});var i,j=function(b){var d=a(b.currentTarget),e=Math.abs((b.pageX||b.originalEvent.touches[0].pageX)-(("rtl"===d.css("direction")&&d.width())+d.offset().left));return e=e>0?e:.1*c.options.scale,d.index()+e/d.width()};e.on("mousedown touchstart",".rating-symbol",f(function(a){d.val(c._indexToRate(j(a))).change()})).on("mousemove touchmove",".rating-symbol",f(function(d){var e=c._roundToFraction(j(d));e!==i&&(i!==b&&a(this).trigger("rating.rateleave"),i=e,a(this).trigger("rating.rateenter",[c._indexToRate(i)])),c._fillUntil(e)})).on("mouseleave touchend",".rating-symbol",f(function(){i=b,a(this).trigger("rating.rateleave"),c._fillUntil(c._rateToIndex(parseFloat(d.val())))}))},_fillUntil:function(a){var b=this.$rating,c=Math.floor(a);b.find(".rating-symbol-background").css("visibility","visible").slice(0,c).css("visibility","hidden");var d=b.find(".rating-symbol-foreground");d.width(0),d.slice(0,c).width("auto").find("span").attr("class",this.options.filled),d.eq(a%1?c:c-1).find("span").attr("class",this.options.filledSelected),d.eq(c).width(a%1*100+"%")},_indexToRate:function(a){return this.options.start+Math.floor(a)*this.options.step+this.options.step*this._roundToFraction(a%1)},_rateToIndex:function(a){return(a-this.options.start)/this.options.step},_roundToFraction:function(a){var b=Math.ceil(a%1*this.options.fractions)/this.options.fractions,c=Math.pow(10,this.options.scale);return Math.floor(a)+Math.floor(b*c)/c},_contains:function(a){var b=this.options.step>0?this.options.start:this.options.stop,c=this.options.step>0?this.options.stop:this.options.start;return a>=b&&c>=a},_updateRate:function(a){var b=parseFloat(a);this._contains(b)&&(this._fillUntil(this._rateToIndex(b)),this.$input.val(b))},rate:function(a){return a===b?this.$input.val():void this._updateRate(a)}},a.fn.rating=function(b){var d,e=Array.prototype.slice.call(arguments,1);return this.each(function(){var f=a(this),g=f.data("rating");g||f.data("rating",g=new c(this,b)),"string"==typeof b&&"_"!==b[0]&&(d=g[b].apply(g,e))}),d||this},a.fn.rating.defaults={filled:"glyphicon glyphicon-star",filledSelected:b,empty:"glyphicon glyphicon-star-empty",start:0,stop:d,step:1,fractions:1,scale:3,extendSymbol:function(a){}},a(function(){a("input.rating").rating()})}(jQuery);
|
||||
20
public/assets/libs/bootstrap-rating/deploy.txt
Normal file
20
public/assets/libs/bootstrap-rating/deploy.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# Bump version
|
||||
vi bower.json
|
||||
|
||||
# Generate minimized file
|
||||
grunt uglify
|
||||
|
||||
# Add bower.json and minimized version
|
||||
git add bower.json bootstrap-rating.min.js
|
||||
|
||||
# commit release
|
||||
git commit -m "Release 1.3.1"
|
||||
|
||||
# Tage release
|
||||
git tag -a v1.3.1 -m "1.3.1"
|
||||
|
||||
# Push release
|
||||
git push && git push --tags
|
||||
|
||||
# Update gh-pages
|
||||
grunt gh-pages
|
||||
123
public/assets/libs/bootstrap-rating/index.html
Normal file
123
public/assets/libs/bootstrap-rating/index.html
Normal file
@@ -0,0 +1,123 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Bootstrap rating</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
|
||||
<!-- Font Awesome CSS -->
|
||||
<link href="bower_components/fontawesome/css/font-awesome.css" rel="stylesheet">
|
||||
<!-- Custom CSS -->
|
||||
<link href="bootstrap-rating.css" rel="stylesheet">
|
||||
<style>
|
||||
.custom-heart {
|
||||
font-size: 2.5em;
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="survey-builder container">
|
||||
<h2>Bootstrap rating</h2>
|
||||
<hr/>
|
||||
<h3>Default rating</h3>
|
||||
<input type="hidden" class="rating"/>
|
||||
<h3>Half rating</h3>
|
||||
<input type="hidden" class="rating" data-fractions="2"/>
|
||||
<h3>Disabled rating</h3>
|
||||
<input type="hidden" class="rating" disabled="disabled"/>
|
||||
<h3>Readonly rating with a value</h3>
|
||||
<input type="hidden" class="rating" data-readonly value="3"/>
|
||||
<h3>Readonly rating with a fractional value</h3>
|
||||
<input type="hidden" class="rating" data-readonly value="2.5"/>
|
||||
<h3>Customized heart rating</h3>
|
||||
<input type="hidden" class="rating" data-filled="glyphicon glyphicon-heart custom-heart" data-empty="glyphicon glyphicon-heart-empty custom-heart"/>
|
||||
<h3>Only fill selected</h3>
|
||||
<input type="hidden" class="rating" data-filled="glyphicon glyphicon-heart-empty" data-filled-selected="glyphicon glyphicon-heart" data-empty="glyphicon glyphicon-heart-empty"/>
|
||||
<h3>Handle events</h3>
|
||||
<input type="hidden" class="rating check" data-filled="glyphicon glyphicon-check" data-empty="glyphicon glyphicon-unchecked"/>
|
||||
<h3>Programmatically set/get rate</h3>
|
||||
<input type="hidden" class="rating-tooltip" id="programmatically-rating">
|
||||
<input type="number" id="programmatically-value">
|
||||
<button type="button" id="programmatically-set">Set value</button>
|
||||
<button type="button" id="programmatically-get">Get value</button>
|
||||
<h3>Customize tooltips</h3>
|
||||
<input type="hidden" class="rating-tooltip"/>
|
||||
<h3>Set stop rate to 10 [1..10]</h3>
|
||||
<input type="hidden" class="rating-tooltip" data-stop="10"/>
|
||||
<h3>Set start rate to 5 [6..10]</h3>
|
||||
<input type="hidden" class="rating-tooltip" data-start="5"/>
|
||||
<h3>Set start and stop rate [2..10]</h3>
|
||||
<input type="hidden" class="rating-tooltip" data-start="1" data-stop="10"/>
|
||||
<h3>Set start and stop rate [2..10] with step 2</h3>
|
||||
<input type="hidden" class="rating-tooltip" data-stop="10" data-step="2"/>
|
||||
<h3>Set start and stop rate [-2..-10] with step -2</h3>
|
||||
<input type="hidden" class="rating-tooltip" data-stop="-10" data-step="-2"/>
|
||||
<h3>Font Awesome icons</h3>
|
||||
<input type="hidden" class="rating-tooltip" data-filled="fa fa-bell fa-3x" data-empty="fa fa-bell-o fa-3x"/>
|
||||
<h3>Fractional rating</h3>
|
||||
<input type="hidden" class="rating-tooltip-manual" data-filled="fa fa-star fa-3x" data-empty="fa fa-star-o fa-3x" data-fractions="3"/>
|
||||
<h3>Fractional right-to-left rating</h3>
|
||||
<div dir="rtl">
|
||||
<input type="hidden" class="rating-tooltip-manual" data-filled="fa fa-star fa-3x" data-empty="fa fa-star-o fa-3x" data-fractions="3"/>
|
||||
</div>
|
||||
<h3>Custom CSS icons</h3>
|
||||
<input type="hidden" class="rating" data-filled="symbol symbol-filled" data-empty="symbol symbol-empty" data-fractions="2"/>
|
||||
</div>
|
||||
<script type="text/javascript" src="bower_components/jquery/dist/jquery.js"></script>
|
||||
<script type="text/javascript" src="bower_components/bootstrap/js/tooltip.js"></script>
|
||||
<script type="text/javascript" src="bootstrap-rating.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
$('input.check').on('change', function () {
|
||||
alert('Rating: ' + $(this).val());
|
||||
});
|
||||
$('#programmatically-set').click(function () {
|
||||
$('#programmatically-rating').rating('rate', $('#programmatically-value').val());
|
||||
});
|
||||
$('#programmatically-get').click(function () {
|
||||
alert($('#programmatically-rating').rating('rate'));
|
||||
});
|
||||
$('.rating-tooltip').rating({
|
||||
extendSymbol: function (rate) {
|
||||
$(this).tooltip({
|
||||
container: 'body',
|
||||
placement: 'bottom',
|
||||
title: 'Rate ' + rate
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.rating-tooltip-manual').rating({
|
||||
extendSymbol: function () {
|
||||
var title;
|
||||
$(this).tooltip({
|
||||
container: 'body',
|
||||
placement: 'bottom',
|
||||
trigger: 'manual',
|
||||
title: function () {
|
||||
return title;
|
||||
}
|
||||
});
|
||||
$(this).on('rating.rateenter', function (e, rate) {
|
||||
title = rate;
|
||||
$(this).tooltip('show');
|
||||
})
|
||||
.on('rating.rateleave', function () {
|
||||
$(this).tooltip('hide');
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.rating').each(function () {
|
||||
$('<span class="label label-default"></span>')
|
||||
.text($(this).val() || ' ')
|
||||
.insertAfter(this);
|
||||
});
|
||||
$('.rating').on('change', function () {
|
||||
$(this).next('.label').text($(this).val());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user