Changeset 837
- Timestamp:
- Mar 26, 2015 5:30:23 PM (10 years ago)
- Location:
- pro-violet-viettel/www/deploy/20150304
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/privatecontent.php
r825 r837 72 72 if (is_array($this->xml->tree->filelist->file)) { 73 73 foreach($this->xml->tree->filelist->file as $key=>$value){ 74 $aryFiles[] = array(' thumbnail' => $value->_param['thumbnail'],'fileurl' => $value->_param['fileurl'], 'id' => $value->_param['id'], 'name' => $value->_value, 'parentID' => $value->_param['parentid'] == -1 ? 0:$value->_param['parentid'], 'minetype' => $value->_param['filetype'], 'size' => $value->_param['size']);74 $aryFiles[] = array('id' => $value->_param['id'], 'name' => $value->_value, 'parentID' => $value->_param['parentid'] == -1 ? 0:$value->_param['parentid'], 'minetype' => $value->_param['filetype'], 'size' => $value->_param['size'],'thumbnail' => $value->_param['thumbnail'],'fileurl' => $value->_param['fileurl']); 75 75 } 76 76 }else { 77 77 $file = $this->xml->tree->filelist->file; 78 $aryFiles[] = array(' thumbnail' => $value->_param['thumbnail'],'fileurl' => $value->_param['fileurl'],'id' => $file->_param['id'], 'name' => $file->_value,'parentID' => $file->_param['parentid'] == -1 ? 0:$file->_param['parentid'], 'minetype' => $file->_param['filetype'], 'size' => $file->_param['size']);78 $aryFiles[] = array('id' => $file->_param['id'], 'name' => $file->_value,'parentID' => $file->_param['parentid'] == -1 ? 0:$file->_param['parentid'], 'minetype' => $file->_param['filetype'], 'size' => $file->_param['size'], 'thumbnail' => $value->_param['thumbnail'],'fileurl' => $value->_param['fileurl']); 79 79 } 80 80 } -
pro-violet-viettel/www/deploy/20150304/assets/js/grid.js
r836 r837 66 66 } 67 67 68 var nodeClick = function (node, event) { 68 var nodeClick = function (node, event) { 69 var message = ''; 69 70 if (event.ctrlKey) { 70 71 if (!isHightLight(node)) … … 84 85 hightlightNode(node); 85 86 } 87 88 o.manager.refreshStatusBar(); 86 89 } 87 90 … … 258 261 259 262 if ($(nodeSelected).length > 0) { 260 $(nodeSelected).each (function(i,o) { 261 var item = { 262 id: $(this).find('> DIV.file-name > INPUT[type="hidden"][class^="id"]').val(), 263 fileurl: $(this).find('> DIV.file-name > INPUT[type="hidden"][class^="fileurl"]').val(), 264 name: $(this).find('> DIV.file-name > INPUT[type="hidden"][class^="name"]').val(), 265 parentID: $(this).find('> DIV.file-name > INPUT[type="hidden"][class^="parentID"]').val(), 266 type: $(this).find('> DIV.file-name > INPUT[type="hidden"][class^="type"]').val() 267 }; 263 $(nodeSelected).each (function(i,obj) { 264 var id = $(this).find('> DIV.file-name > INPUT[type="hidden"][class^="id"]').val(); 265 var type = $(this).find('> DIV.file-name > INPUT[type="hidden"][class^="type"]').val(); 266 var item = type == 'directory' ? o.data.DIRECTORIES[o.manager.searchItemByID(id, type)] : o.data.FILES[o.manager.searchItemByID(id, type)]; 268 267 items.push(item); 269 268 }); -
pro-violet-viettel/www/deploy/20150304/assets/js/manager.js
r836 r837 966 966 } 967 967 968 this.searchItemByID = function ( parentID, type) {969 return searchItemByID( parentID, type);968 this.searchItemByID = function (id, type) { 969 return searchItemByID(id, type); 970 970 } 971 971 972 this.refreshStatusBar = function (message) { 972 this.refreshStatusBar = function () { 973 var items = o.oGrid.getHightLightItem(); 974 var message = ''; 975 if (items.length == 1) { 976 message = 'FILE: ' + items[0].name; 977 message += ' - SIZE: ' + self.formatFileSize(items[0].size, null); 978 } 973 979 $(statusbar).text(message); 974 980 } … … 982 988 } 983 989 990 this.formatFileSize = function (size, opts) { 991 var i; 992 i = Math.floor(Math.log(size) / Math.log(1024)); 993 if ((size === 0) || (parseInt(size) === 0)) { 994 return "0 kB"; 995 } else if (isNaN(i) || (!isFinite(size)) || (size === Number.POSITIVE_INFINITY) || (size === Number.NEGATIVE_INFINITY) || (size == null) || (size < 0)) { 996 console.info("Throwing error"); 997 throw Error("" + size + " did not compute to a valid number to be humanized."); 998 } else { 999 //if ((opts != null ? opts.abbr : void 0) === true) { 1000 return (size / Math.pow(1024, i)).toFixed(2) * 1 + " " + ["B", "kB", "MB", "GB", "TB", "PB"][i]; 1001 /*} else { 1002 return (size / Math.pow(1024, i)).toFixed(2) * 1 + " " + ["bytes", "kilobytes", "megabytes", "gigabytes", "terabytes", "petabytes"][i]; 1003 }*/ 1004 } 1005 } 1006 1007 984 1008 this.initialize = function () { 985 1009 init();
Note: See TracChangeset
for help on using the changeset viewer.