added admin interface

This commit is contained in:
kicap1992
2021-12-21 00:25:43 +08:00
parent 9adf18c7b9
commit a25104fadc
3496 changed files with 280326 additions and 7 deletions

View File

@ -0,0 +1,168 @@
/*!
* bootstrap-progressbar v0.9.0 by @minddust
* Copyright (c) 2012-2015 Stephan Groß
*
* http://www.minddust.com/project/bootstrap-progressbar/
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
(function($) {
'use strict';
// PROGRESSBAR CLASS DEFINITION
// ============================
var Progressbar = function(element, options) {
this.$element = $(element);
this.options = $.extend({}, Progressbar.defaults, options);
};
Progressbar.defaults = {
transition_delay: 300,
refresh_speed: 50,
display_text: 'none',
use_percentage: true,
percent_format: function(percent) { return percent + '%'; },
amount_format: function(amount_part, amount_max, amount_min) { return amount_part + ' / ' + amount_max; },
update: $.noop,
done: $.noop,
fail: $.noop
};
Progressbar.prototype.transition = function() {
var $this = this.$element;
var $parent = $this.parent();
var $back_text = this.$back_text;
var $front_text = this.$front_text;
var options = this.options;
var data_transitiongoal = parseInt($this.attr('data-transitiongoal'));
var aria_valuemin = parseInt($this.attr('aria-valuemin')) || 0;
var aria_valuemax = parseInt($this.attr('aria-valuemax')) || 100;
var is_vertical = $parent.hasClass('vertical');
var update = options.update && typeof options.update === 'function' ? options.update : Progressbar.defaults.update;
var done = options.done && typeof options.done === 'function' ? options.done : Progressbar.defaults.done;
var fail = options.fail && typeof options.fail === 'function' ? options.fail : Progressbar.defaults.fail;
if (isNaN(data_transitiongoal)) {
fail('data-transitiongoal not set');
return;
}
var percentage = Math.round(100 * (data_transitiongoal - aria_valuemin) / (aria_valuemax - aria_valuemin));
if (options.display_text === 'center' && !$back_text && !$front_text) {
this.$back_text = $back_text = $('<span>').addClass('progressbar-back-text').prependTo($parent);
this.$front_text = $front_text = $('<span>').addClass('progressbar-front-text').prependTo($this);
var parent_size;
if (is_vertical) {
parent_size = $parent.css('height');
$back_text.css({height: parent_size, 'line-height': parent_size});
$front_text.css({height: parent_size, 'line-height': parent_size});
$(window).resize(function() {
parent_size = $parent.css('height');
$back_text.css({height: parent_size, 'line-height': parent_size});
$front_text.css({height: parent_size, 'line-height': parent_size});
}); // normal resizing would brick the structure because width is in px
}
else {
parent_size = $parent.css('width');
$front_text.css({width: parent_size});
$(window).resize(function() {
parent_size = $parent.css('width');
$front_text.css({width: parent_size});
}); // normal resizing would brick the structure because width is in px
}
}
setTimeout(function() {
var current_percentage;
var current_value;
var this_size;
var parent_size;
var text;
if (is_vertical) {
$this.css('height', percentage + '%');
}
else {
$this.css('width', percentage + '%');
}
var progress = setInterval(function() {
if (is_vertical) {
this_size = $this.height();
parent_size = $parent.height();
}
else {
this_size = $this.width();
parent_size = $parent.width();
}
current_percentage = Math.round(100 * this_size / parent_size);
current_value = Math.round(aria_valuemin + this_size / parent_size * (aria_valuemax - aria_valuemin));
if (current_percentage >= percentage) {
current_percentage = percentage;
current_value = data_transitiongoal;
done($this);
clearInterval(progress);
}
if (options.display_text !== 'none') {
text = options.use_percentage ? options.percent_format(current_percentage) : options.amount_format(current_value, aria_valuemax, aria_valuemin);
if (options.display_text === 'fill') {
$this.text(text);
}
else if (options.display_text === 'center') {
$back_text.text(text);
$front_text.text(text);
}
}
$this.attr('aria-valuenow', current_value);
update(current_percentage, $this);
}, options.refresh_speed);
}, options.transition_delay);
};
// PROGRESSBAR PLUGIN DEFINITION
// =============================
var old = $.fn.progressbar;
$.fn.progressbar = function(option) {
return this.each(function () {
var $this = $(this);
var data = $this.data('bs.progressbar');
var options = typeof option === 'object' && option;
if (data && options) {
$.extend(data.options, options);
}
if (!data) {
$this.data('bs.progressbar', (data = new Progressbar(this, options)));
}
data.transition();
});
};
$.fn.progressbar.Constructor = Progressbar;
// PROGRESSBAR NO CONFLICT
// =======================
$.fn.progressbar.noConflict = function () {
$.fn.progressbar = old;
return this;
};
})(window.jQuery);

View File

@ -0,0 +1,2 @@
/*! bootstrap-progressbar v0.9.0 | Copyright (c) 2012-2015 Stephan Groß | MIT license | http://www.minddust.com */
!function(t){"use strict";var e=function(n,s){this.$element=t(n),this.options=t.extend({},e.defaults,s)};e.defaults={transition_delay:300,refresh_speed:50,display_text:"none",use_percentage:!0,percent_format:function(t){return t+"%"},amount_format:function(t,e){return t+" / "+e},update:t.noop,done:t.noop,fail:t.noop},e.prototype.transition=function(){var n=this.$element,s=n.parent(),a=this.$back_text,r=this.$front_text,i=this.options,o=parseInt(n.attr("data-transitiongoal")),h=parseInt(n.attr("aria-valuemin"))||0,d=parseInt(n.attr("aria-valuemax"))||100,f=s.hasClass("vertical"),p=i.update&&"function"==typeof i.update?i.update:e.defaults.update,u=i.done&&"function"==typeof i.done?i.done:e.defaults.done,c=i.fail&&"function"==typeof i.fail?i.fail:e.defaults.fail;if(isNaN(o))return void c("data-transitiongoal not set");var l=Math.round(100*(o-h)/(d-h));if("center"===i.display_text&&!a&&!r){this.$back_text=a=t("<span>").addClass("progressbar-back-text").prependTo(s),this.$front_text=r=t("<span>").addClass("progressbar-front-text").prependTo(n);var g;f?(g=s.css("height"),a.css({height:g,"line-height":g}),r.css({height:g,"line-height":g}),t(window).resize(function(){g=s.css("height"),a.css({height:g,"line-height":g}),r.css({height:g,"line-height":g})})):(g=s.css("width"),r.css({width:g}),t(window).resize(function(){g=s.css("width"),r.css({width:g})}))}setTimeout(function(){var t,e,c,g,_;f?n.css("height",l+"%"):n.css("width",l+"%");var x=setInterval(function(){f?(c=n.height(),g=s.height()):(c=n.width(),g=s.width()),t=Math.round(100*c/g),e=Math.round(h+c/g*(d-h)),t>=l&&(t=l,e=o,u(n),clearInterval(x)),"none"!==i.display_text&&(_=i.use_percentage?i.percent_format(t):i.amount_format(e,d,h),"fill"===i.display_text?n.text(_):"center"===i.display_text&&(a.text(_),r.text(_))),n.attr("aria-valuenow",e),p(t,n)},i.refresh_speed)},i.transition_delay)};var n=t.fn.progressbar;t.fn.progressbar=function(n){return this.each(function(){var s=t(this),a=s.data("bs.progressbar"),r="object"==typeof n&&n;a&&r&&t.extend(a.options,r),a||s.data("bs.progressbar",a=new e(this,r)),a.transition()})},t.fn.progressbar.Constructor=e,t.fn.progressbar.noConflict=function(){return t.fn.progressbar=n,this}}(window.jQuery);