gnopaste
Userdata
Name
Anonymous
Scriptlanguage
PHP
Tabwidth
4
Date
11/19/2008 06:49:20 pm
IP
77.177.233.117
Description
The user was too lazy to give a description
Code (
Hide rownumbers
)
$(window).load(
function
() {
if
($("
#uploadtable").length>0){
var
swfutotalul = 0;
var
swfutotalfinished = 0;
var
swfu;
function
calcfilesize( s ){
s = Math.round(s / 1024);
tp = " kb"
if
( s > 1024 ){
s = Math.round( s / 1024 );
tp = " Mb";
}
return
s+tp;
}
function
calctotalul(){
var
file = swfu.getFile();
var
completesize = 0;
while
( file !== null){
completesize += file.size;
file = swfu.getFile(file.index+1);
}
return
completesize;
}
function
fileDialogComplete(numsel, numnewqueue, numtotalqueue){
$("
#uploadtable").removeClass("hidden");
swfu.setButtonText("<span class=
'theFont'
>+ Weitere Bilder</span>");
$("
#uploadbt").removeClass("hidden");
};
function
fileQueueError(file, error, message){
alert("Fehler beim Hinzufügen der Datei"+file.name+": "+message);
}
function
dateiaufnahme(file){
$("
#uploadtable").find("tbody").append("<tr><td><div class='vertprogress'></div>"+file.name+"</td><td>"+calcfilesize(file.size)+"</td><td><img src='modules/fgallery/supportfiles/images/dec_delete.png' class='remove' id='"+file.id+"'/></tr>");
$(".remove").bind("click",
function
(){
swfu.cancelUpload($(this).attr("id"));
$(this).parent().parent().css({"background-color":"
#fdd98b"}).fadeOut();
$(".uldesc").html("Insgesamt hast du "+calcfilesize(calctotalul())+" ausgewählt.");
});
$(".uldesc").html("Insgesamt hast du "+calcfilesize(calctotalul())+" ausgewählt.");
}
function
uploadComplete(f){
alert("BA");
swfutotalfinished += f.size;
var
nextfile = swfu.getFile(f.index+1)
if
( nextfile !== null){
swfu.startUpload(nextfile.id);
}
$("
#uploadtable tbody").find("tr:eq("+f.index+")").css({"background-color":"#68B17B"}).find(".remove").hide();
updatestatics(f,1,1);
}
function
uploadProgress(f, bc, bt){
updatestatics(f, bc,bt);
}
function
ulerror(f, ec, message){
alert(message);
}
function
updatestatics(f,bc,bt){
fpercent = bc / bt;
calcheight = 32*fpercent;
$("
#uploadtable tbody").find("tr:eq("+f.index+")").find(".vertprogress").height(calcheight);
tpercent = ( (swfutotalfinished + bc) / swfutotalul );
$(".totalul").width(tpercent*460);
$(".uldesc").html("Bereits "+(swfutotalfinished + bc)+" von insgesamt "+swfutotalul+" Byte hochgeladen. ("+Math.round(tpercent * 100)+"%)");
if
(Math.round(tpercent * 100) == 100){
allUploadsFinished();
}
}
function
debug_function(b){
alert(b);
}
function
ulsuccess(a,b){
alert("bla "+b);
}
swfu =
new
SWFUpload({
upload_url : "../admin.php?ajaxaction=upload&directory=Rihanna",
flash_url : "modules/fgallery/swfupload/swfupload.swf",
file_types : "*.jpg;*.jpeg;*.png",
file_types_description : "All Files",
file_size_limit : "5 MB",
button_placeholder_id: "swfuploader",
button_text:
'<span class="theFont">Bilder suchen</span>'
,
button_width: "150",
button_height: "20",
button_text_style: ".theFont { font-size: 18px; color:
#6666A6; cursor: pointer;}",
button_text_left_padding: 5,
button_text_top_padding: 4,
file_queued_handler : dateiaufnahme,
file_queue_error_handler : fileQueueError,
upload_error_handler : ulerror,
upload_complete_handler : uploadComplete,
upload_success_handler : ulsuccess,
upload_progress_handler : uploadProgress,
file_dialog_complete_handler : fileDialogComplete,
debug_handler : debug_function
});
$("
#uploadbt").click(function(){
swfu.setButtonDimensions(0,0);
$(this).hide();
$(".totalul").removeClass("hidden");
swfutotalul = calctotalul();
swfu.startUpload();
});
function
allUploadsFinished(){
// $("#uploadtable").slideUp();
}
}
});
submitter »
gnopaster
|
imprint
« imprint
»
Terms of use
«
»
digital bit dot ch - t4c's new home
«