Changeset 8013
- Timestamp:
- Aug 13, 2021, 8:17:14 AM (9 months ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.19-stable (added) merged: 8002,8004-8010,8012
- Property svn:mergeinfo changed
-
trunk/credits.txt
r7926 r8013 1 1 $Id$ 2 2 3 The current BASE team is (at BASE 3.1 8release)3 The current BASE team is (at BASE 3.19 release) 4 4 {{{ 5 5 Jari Häkkinen -
trunk/src/core/net/sf/basedb/core/PropertyFilter.java
r7926 r8013 1262 1262 else 1263 1263 { 1264 parameter = value == null ? null : Expressions.parameter(parameterName, getValueAsObject(unit, true) );1264 parameter = value == null ? null : Expressions.parameter(parameterName, getValueAsObject(unit, true), getValueType()); 1265 1265 } 1266 1266 } -
trunk/www/common/annotations/batch_inherit.js
r7604 r8013 96 96 97 97 var tr = document.createElement('tr'); 98 tr.className = ' highlight ' + (selectedAnnotationTypes.length % 2 == 0 ? 'bg-evenrow' : 'bg-oddrow');98 tr.className = 'row highlight ' + (selectedAnnotationTypes.length % 2 == 0 ? 'bg-evenrow' : 'bg-oddrow'); 99 99 tr.id = 'at-'+item.id; 100 100 -
trunk/www/common/plugin/test_with_file.js
r7656 r8013 120 120 121 121 var response = JSON.parse(request.responseText); 122 var excelMode = response.excelMode ;122 var excelMode = response.excelMode || false; 123 123 124 124 frm.filemode.value = excelMode ? 'excel' : 'csv'; -
trunk/www/filemanager/upload/drag_drop_upload.js
r7992 r8013 27 27 { 28 28 var upload = {}; 29 var zipFormats = []; 29 30 30 31 var filesAndFolders; … … 50 51 upload.initPage = function() 51 52 { 53 zipFormats = Data.json('page-data', 'zip-formats'); 54 52 55 Buttons.addClickHandler('btnUpload', upload.beginFileUpload); 53 56 Buttons.addClickHandler('close', App.closeWindow); … … 57 60 filesAndFolders = window.opener.FileManager.getFilesToUpload(); 58 61 upload.processFilesAndFolders(); 62 } 63 64 /** 65 Get the ID of the best matching compressed format 66 */ 67 upload.getCompressedFormat = function(filename) 68 { 69 var longestMatch = 0; 70 var bestFormat = null; 71 72 for (var formatNo = 0; formatNo < zipFormats.length; formatNo++) 73 { 74 var zf = zipFormats[formatNo]; 75 for (var extNo = 0; extNo < zf.extensions.length; extNo++) 76 { 77 var ext = '.' + zf.extensions[extNo]; 78 var index = filename.lastIndexOf(ext); 79 if (index > 0 && (index + ext.length == filename.length)) 80 { 81 if (ext.length > longestMatch) 82 { 83 longestMatch = ext.length; 84 bestFormat = zf; 85 } 86 } 87 } 88 } 89 return bestFormat; 59 90 } 60 91 … … 78 109 var ff = filesAndFolders.splice(0, 1)[0]; 79 110 currentFolder = ff.subfolder || ''; 80 if (ff.isFile) 81 { 82 // Get the file item as a 'File' object (its an async operation) 83 ff.file(upload.gotFile); 84 } 85 else if (ff.isDirectory) 86 { 87 // Save the currentFolder for later use in 'upload.gotFolder' 88 currentFolder += ff.name+'/'; 89 // Read files and subfolders (its an async operation) 90 currentDirectoryReader = ff.createReader(); 91 currentDirectoryReader.readEntries(upload.gotFolder); 92 } 93 else 94 { 95 // Process next entry 96 upload.processFilesAndFolders(); 97 } 111 // Ignore files/directories inside subfolders starting with '.' unless 112 // the top folder that was selected is also hidden 113 var ignore = ff.name.charAt(0)=='.' && (currentFolder.length > 0 && currentFolder.charAt(0)!='.'); 114 if (!ignore) 115 { 116 if (ff.isFile) 117 { 118 // Get the file item as a 'File' object (its an async operation) 119 ff.file(upload.gotFile); 120 return; 121 } 122 else if (ff.isDirectory) 123 { 124 // Save the currentFolder for later use in 'upload.gotFolder' 125 currentFolder += ff.name+'/'; 126 // Read files and subfolders (its an async operation) 127 currentDirectoryReader = ff.createReader(); 128 currentDirectoryReader.readEntries(upload.gotFolder); 129 return; 130 } 131 } 132 133 // Process next entry 134 upload.processFilesAndFolders(); 98 135 } 99 136 … … 133 170 { 134 171 files.sort(upload.sortFilesByFolder); 135 var html = '<table class="filelist" >';172 var html = '<table class="filelist" style="width: 100%;">'; 136 173 var lastSubfolder = ''; 137 174 var pad = '<td colspan="2" class="name">'; 138 175 var numFolders = 1; 176 var numCompressedFiles = 0; 139 177 for (var i = 0; i < files.length; i++) 140 178 { … … 142 180 totalBytesToUpload += f.size; 143 181 totalFiles++; 182 if (upload.getCompressedFormat(f.name)) numCompressedFiles++; 144 183 if (totalFiles <= 500) 145 184 { … … 158 197 html += '<tr><td colspan="3" class="morefiles">+'+(totalFiles-500)+' more files...</td></tr>'; 159 198 } 199 if (numCompressedFiles > 0) Doc.show('unpackSection'); 160 200 var numFilesMsg = totalFiles==1?'1 file' : totalFiles+' files'; 161 201 document.title = 'Uploading '+numFilesMsg+' to '+Data.get('page-data', 'directory-path'); … … 270 310 upl.set('autoSelect', totalFiles == 1 ? 1 : 0); // No automatic selection if we upload more than one file 271 311 upl.set('replace_existing', overwrite); 312 if (frm.unpackCompressed.checked) 313 { 314 var zipFormat = upload.getCompressedFormat(file.name); 315 if (zipFormat) 316 { 317 upl.set('zip_format', zipFormat.id); 318 upl.set('zip_unpack', 1); 319 upl.set('zip_overwrite', overwrite); 320 upl.set('zip_keep', 0); 321 } 322 } 272 323 upl.set('description', frm.description.value); 273 324 upl.set('the_file', file); -
trunk/www/filemanager/upload/drag_drop_upload.jsp
r7991 r8013 75 75 String numFilesText = numFiles == 1 ? "1 file" : numFiles+" files"; 76 76 final String title = HTML.encodeTags("Uploading "+numFilesText+" to " + dir.getName()); 77 78 JSONArray jsonZipFormats = new JSONArray(); 79 // Query to retreive FileUnpacker plugins 80 final ItemQuery<PluginDefinition> pluginQuery = PluginDefinition.getQuery(null, "net.sf.basedb.util.zip.FileUnpacker"); 81 pluginQuery.order(Orders.asc(Hql.property("name"))); 82 pluginQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); 83 List<PluginDefinition> plugins = pluginQuery.list(dc); 84 for (PluginDefinition plugin : plugins) 85 { 86 FileUnpacker unpacker = plugin.newInstance(FileUnpacker.class, sc, null, null); 87 JSONObject jsonZipFormat = new JSONObject(); 88 jsonZipFormat.put("id", plugin.getId()); 89 jsonZipFormat.put("name", unpacker.getFormatName()); 90 JSONArray jsonExtensions = new JSONArray(); 91 jsonExtensions.addAll(unpacker.getExtensions()); 92 jsonZipFormat.put("extensions", jsonExtensions); 93 jsonZipFormats.add(jsonZipFormat); 94 } 77 95 %> 78 96 <base:page type="popup" title="<%=title%>"> … … 121 139 data-directory-id="<%=directoryId%>" 122 140 data-directory-path="<%=HTML.encodeTags(dir.getPath().toString()) %>" 141 data-zip-formats="<%=HTML.encodeTags(jsonZipFormats.toJSONString()) %>" 123 142 ></div> 124 143 … … 128 147 <div class="content"> 129 148 <table class="fullform input100 bottomborder"> 130 <tr class="bottomborder" style="border-bottom-style: dotted;">149 <tr> 131 150 <th>Overwrite existing</th> 132 151 <td> … … 137 156 <td></td> 138 157 </tr> 139 <tr class="big"> 158 <tr id="unpackSection" style="display: none;"> 159 <th class="subprompt"></th> 160 <td> 161 <label><input type="checkbox" name="unpackCompressed" id="unpackCompressed">Unpack compressed files</label> 162 </td> 163 <td></td> 164 </tr> 165 <tr class="big topborder" style="border-top-style: dotted;"> 140 166 <th>Files</th> 141 167 <td colspan="2"> -
trunk/www/my_base/index.jsp
r7999 r8013 391 391 { 392 392 %> 393 <div style="margin: 0.25em;"> 393 394 Using quota from group: <%=Base.getLinkedName(ID, quotaGroup, false, true)%> 395 </div> 394 396 <% 395 397 }
Note: See TracChangeset
for help on using the changeset viewer.