Changeset 1170 in main


Ignore:
Timestamp:
06/05/12 07:48:18 (7 years ago)
Author:
zali
Message:

remove unused variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/media/js/file.js

    r1153 r1170  
    1111**              Add or delete files in queue                                    ** 
    1212*****************************************************************/ 
    13  
    14 //count for files to upload 
    15 var nbr_files=0; 
    1613//count for input added 
    1714var num_input=0; 
    1815 
    19 //create a new input file, called when a new file is added to the queue for upload 
     16//create a new input file 
     17//function called when a new file is added to the queue for upload 
    2018function new_input_file(){ 
    2119    var table = $("#fileupload > table.Content"); 
     
    198196            files_info[key]={"f_name":f.name, "p_id":f_id, "size":size, "uploaded":0, "status":"waiting"}; 
    199197        } 
    200                 
    201         nbr_files+=1; 
    202198} 
    203199 
    204200//add an input and the files selected in the queue for uploading 
    205201function add_file(input){ 
    206     if (nbr_files==0){ 
     202    if (files_info.size()==0){ 
    207203        $("#div_files > div.file_p").remove(); 
    208204    } 
     
    242238    files_info=files_info.remove(key); 
    243239    item.remove(); 
    244     nbr_files--; 
    245240    $(".up_fail").remove(); 
    246241     
    247242    //input file's multiple selection is not enable for opera and IE 
    248     if(($.browser.opera)||($.browser.msie)){ 
     243    if(($.browser.opera)||($.browser.msie)||(input.files.length==1)){ 
    249244        $(input).remove(); 
    250245    } 
    251     if(nbr_files==0){ 
     246    if(files_info.size()==0){ 
    252247        $("#_up").addClass("hidden"); 
    253248        $("#_delete").addClass("hidden"); 
     
    490485    var fail_div = $("<div class='up_fail'></div>"); 
    491486    var span_text=trans["Your upload(s) failed"]+"!<br>"+trans["Try again"]; 
    492     if(nbr_files>1){ 
     487    if(files_info.size() > 1){ 
    493488        span_text+=" "+trans["maybe with less files. "]; 
    494489    }else{ 
     
    598593function reset_upload(){ 
    599594    $(".del_link").click(); 
    600     nbr_files=0; 
    601595    num_input=0; 
    602596     
     
    736730        $("#_up").click(function(){ 
    737731            $(".up_fail").remove(); 
    738             if(nbr_files==0){ 
     732            if(files_info.size()==0){ 
    739733                if($("#fileupload").find("span.warning").length==0){ 
    740734                    $("#fileupload").find("input[type='file']").parent().append("<span class='warning'>"+trans["Select at least one file"]+"</span>"); 
     
    773767        $("#fileupload").insertAfter("<span class='warning'>"+trans["You can only upload files, but you wont get progress of this upload"]+"</span>"); 
    774768        $("#_up").click(function(){ 
    775             if(nbr_files==0){ 
     769            if(files_info.size()==0){ 
    776770                $("#fileupload").find("input[type='file']").parent().append("<span class='warning'>"+trans["Select at least one file"]+"</span>"); 
    777771                return; 
Note: See TracChangeset for help on using the changeset viewer.