From 55c1b4f3a0686221d3efc6ad3eb2a8870b8c75a7 Mon Sep 17 00:00:00 2001 From: patdenice Date: Fri, 15 Apr 2011 15:40:23 +0000 Subject: feature:2259 Add thumbnails regeneration in batch manager git-svn-id: http://piwigo.org/svn/trunk@10389 68402e56-0260-453c-a942-63ccdbb3a9ee --- themes/default/images/progressbar.gif | Bin 0 -> 120 bytes themes/default/images/progressbg_black.gif | Bin 0 -> 1626 bytes themes/default/images/progressbg_green.gif | Bin 0 -> 1308 bytes themes/default/images/progressbg_orange.gif | Bin 0 -> 1308 bytes themes/default/images/progressbg_red.gif | Bin 0 -> 1308 bytes themes/default/images/progressbg_yellow.gif | Bin 0 -> 1308 bytes themes/default/js/plugins/jquery.progressbar.js | 186 +++++++++++++++++++++ .../default/js/plugins/jquery.progressbar.min.js | 20 +++ 8 files changed, 206 insertions(+) create mode 100644 themes/default/images/progressbar.gif create mode 100644 themes/default/images/progressbg_black.gif create mode 100644 themes/default/images/progressbg_green.gif create mode 100644 themes/default/images/progressbg_orange.gif create mode 100644 themes/default/images/progressbg_red.gif create mode 100644 themes/default/images/progressbg_yellow.gif create mode 100644 themes/default/js/plugins/jquery.progressbar.js create mode 100644 themes/default/js/plugins/jquery.progressbar.min.js (limited to 'themes/default') diff --git a/themes/default/images/progressbar.gif b/themes/default/images/progressbar.gif new file mode 100644 index 000000000..abe588c15 Binary files /dev/null and b/themes/default/images/progressbar.gif differ diff --git a/themes/default/images/progressbg_black.gif b/themes/default/images/progressbg_black.gif new file mode 100644 index 000000000..74fd1f9b3 Binary files /dev/null and b/themes/default/images/progressbg_black.gif differ diff --git a/themes/default/images/progressbg_green.gif b/themes/default/images/progressbg_green.gif new file mode 100644 index 000000000..f3f3bf681 Binary files /dev/null and b/themes/default/images/progressbg_green.gif differ diff --git a/themes/default/images/progressbg_orange.gif b/themes/default/images/progressbg_orange.gif new file mode 100644 index 000000000..808cac7cf Binary files /dev/null and b/themes/default/images/progressbg_orange.gif differ diff --git a/themes/default/images/progressbg_red.gif b/themes/default/images/progressbg_red.gif new file mode 100644 index 000000000..54dfa135f Binary files /dev/null and b/themes/default/images/progressbg_red.gif differ diff --git a/themes/default/images/progressbg_yellow.gif b/themes/default/images/progressbg_yellow.gif new file mode 100644 index 000000000..fdb0dfc98 Binary files /dev/null and b/themes/default/images/progressbg_yellow.gif differ diff --git a/themes/default/js/plugins/jquery.progressbar.js b/themes/default/js/plugins/jquery.progressbar.js new file mode 100644 index 000000000..7239954f5 --- /dev/null +++ b/themes/default/js/plugins/jquery.progressbar.js @@ -0,0 +1,186 @@ +/* + * jQuery Progress Bar plugin + * Version 2.0 (06/22/2009) + * @requires jQuery v1.2.1 or later + * + * Copyright (c) 2008 Gary Teo + * http://t.wits.sg + +USAGE: + $(".someclass").progressBar(); + $("#progressbar").progressBar(); + $("#progressbar").progressBar(45); // percentage + $("#progressbar").progressBar({showText: false }); // percentage with config + $("#progressbar").progressBar(45, {showText: false }); // percentage with config +*/ +(function($) { + $.extend({ + progressBar: new function() { + + this.defaults = { + steps : 20, // steps taken to reach target + stepDuration : 20, + max : 100, // Upon 100% i'd assume, but configurable + showText : true, // show text with percentage in next to the progressbar? - default : true + textFormat : 'percentage', // Or otherwise, set to 'fraction' + width : 120, // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' + height : 12, // Height of the progressbar - don't forget to adjust your image too!!! + callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc + boxImage : 'images/progressbar.gif', // boxImage : image around the progress bar + barImage : { + 0: 'images/progressbg_red.gif', + 30: 'images/progressbg_orange.gif', + 70: 'images/progressbg_green.gif' + }, + + + // Internal use + running_value : 0, + value : 0, + image : null + }; + + /* public methods */ + this.construct = function(arg1, arg2) { + var argvalue = null; + var argconfig = null; + + if (arg1 != null) { + if (!isNaN(arg1)) { + argvalue = arg1; + if (arg2 != null) { + argconfig = arg2; + } + } else { + argconfig = arg1; + } + } + + return this.each(function(child) { + var pb = this; + var config = this.config; + + if (argvalue != null && this.bar != null && this.config != null) { + this.config.value = parseInt(argvalue) + if (argconfig != null) + pb.config = $.extend(this.config, argconfig); + config = pb.config; + } else { + var $this = $(this); + var config = $.extend({}, $.progressBar.defaults, argconfig); + config.id = $this.attr('id') ? $this.attr('id') : Math.ceil(Math.random() * 100000); // random id, if none provided + + if (argvalue == null) + argvalue = $this.html().replace("%","") // parse percentage + + config.value = parseInt(argvalue); + config.running_value = 0; + config.image = getBarImage(config); + + var numeric = ['steps', 'stepDuration', 'max', 'width', 'height', 'running_value', 'value']; + for (var i=0; i= parseInt(i)) { + image = config.barImage[i]; + } else { break; } + } + } + return image; + } + + function getText(config) { + if (config.showText) { + if (config.textFormat == 'percentage') { + return " " + Math.round(config.running_value) + "%"; + } else if (config.textFormat == 'fraction') { + return " " + config.running_value + '/' + config.max; + } + } + } + + config.increment = Math.round((config.value - config.running_value)/config.steps); + if (config.increment < 0) + config.increment *= -1; + if (config.increment < 1) + config.increment = 1; + + var t = setInterval(function() { + var pixels = config.width / 100; // Define how many pixels go into 1% + + if (config.running_value > config.value) { + if (config.running_value - config.increment < config.value) { + config.running_value = config.value; + } else { + config.running_value -= config.increment; + } + } + else if (config.running_value < config.value) { + if (config.running_value + config.increment > config.value) { + config.running_value = config.value; + } else { + config.running_value += config.increment; + } + } + + if (config.running_value == config.value) + clearInterval(t); + + var $bar = $("#" + config.id + "_pbImage"); + var $text = $("#" + config.id + "_pbText"); + var image = getBarImage(config); + if (image != config.image) { + $bar.css("background-image", "url(" + image + ")"); + config.image = image; + } + $bar.css("background-position", (((config.width * -1)) + (getPercentage(config) * pixels)) + 'px 50%'); + $bar.attr('title', getText(config)); + $text.html(getText(config)); + + if (config.callback != null && typeof(config.callback) == 'function') + config.callback(config); + + pb.config = config; + }, config.stepDuration); + }); + }; + } + }); + + $.fn.extend({ + progressBar: $.progressBar.construct + }); + +})(jQuery); \ No newline at end of file diff --git a/themes/default/js/plugins/jquery.progressbar.min.js b/themes/default/js/plugins/jquery.progressbar.min.js new file mode 100644 index 000000000..5001b8f85 --- /dev/null +++ b/themes/default/js/plugins/jquery.progressbar.min.js @@ -0,0 +1,20 @@ + +(function($){$.extend({progressBar:new function(){this.defaults={steps:20,stepDuration:20,max:100,showText:true,textFormat:'percentage',width:120,height:12,callback:null,boxImage:'images/progressbar.gif',barImage:{0:'images/progressbg_red.gif',30:'images/progressbg_orange.gif',70:'images/progressbg_green.gif'},running_value:0,value:0,image:null};this.construct=function(arg1,arg2){var argvalue=null;var argconfig=null;if(arg1!=null){if(!isNaN(arg1)){argvalue=arg1;if(arg2!=null){argconfig=arg2;}}else{argconfig=arg1;}} +return this.each(function(child){var pb=this;var config=this.config;if(argvalue!=null&&this.bar!=null&&this.config!=null){this.config.value=parseInt(argvalue) +if(argconfig!=null) +pb.config=$.extend(this.config,argconfig);config=pb.config;}else{var $this=$(this);var config=$.extend({},$.progressBar.defaults,argconfig);config.id=$this.attr('id')?$this.attr('id'):Math.ceil(Math.random()*100000);if(argvalue==null) +argvalue=$this.html().replace("%","") +config.value=parseInt(argvalue);config.running_value=0;config.image=getBarImage(config);var numeric=['steps','stepDuration','max','width','height','running_value','value'];for(var i=0;i=parseInt(i)){image=config.barImage[i];}else{break;}}} +return image;} +function getText(config){if(config.showText){if(config.textFormat=='percentage'){return" "+Math.round(config.running_value)+"%";}else if(config.textFormat=='fraction'){return" "+config.running_value+'/'+config.max;}}} +config.increment=Math.round((config.value-config.running_value)/config.steps);if(config.increment<0) +config.increment*=-1;if(config.increment<1) +config.increment=1;var t=setInterval(function(){var pixels=config.width/100;if(config.running_value>config.value){if(config.running_value-config.incrementconfig.value){config.running_value=config.value;}else{config.running_value+=config.increment;}} +if(config.running_value==config.value) +clearInterval(t);var $bar=$("#"+config.id+"_pbImage");var $text=$("#"+config.id+"_pbText");var image=getBarImage(config);if(image!=config.image){$bar.css("background-image","url("+image+")");config.image=image;} +$bar.css("background-position",(((config.width*-1))+(getPercentage(config)*pixels))+'px 50%');$bar.attr('title',getText(config));$text.html(getText(config));if(config.callback!=null&&typeof(config.callback)=='function') +config.callback(config);pb.config=config;},config.stepDuration);});};}});$.fn.extend({progressBar:$.progressBar.construct});})(jQuery); \ No newline at end of file -- cgit v1.2.3