Changeset 837


Ignore:
Timestamp:
Mar 26, 2015 5:30:23 PM (10 years ago)
Author:
dungnv
Message:
 
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  
    7272                        if (is_array($this->xml->tree->filelist->file)) {
    7373                                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']);
    7575                                }
    7676                        }else {
    7777                                $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']);
    7979                        }
    8080                }
  • pro-violet-viettel/www/deploy/20150304/assets/js/grid.js

    r836 r837  
    6666                        }
    6767                       
    68                         var nodeClick = function (node, event) {                               
     68                        var nodeClick = function (node, event) {
     69                                var message = '';
    6970                                if (event.ctrlKey) {
    7071                                        if (!isHightLight(node))
     
    8485                                        hightlightNode(node);                                   
    8586                                }
     87                               
     88                                o.manager.refreshStatusBar();
    8689                        }
    8790                       
     
    258261                               
    259262                                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)];
    268267                                                        items.push(item);
    269268                                                });
  • pro-violet-viettel/www/deploy/20150304/assets/js/manager.js

    r836 r837  
    966966                }
    967967
    968                 this.searchItemByID = function (parentID, type) {
    969                     return searchItemByID(parentID, type);
     968                this.searchItemByID = function (id, type) {
     969                    return searchItemByID(id, type);
    970970                }
    971971               
    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                        }
    973979                        $(statusbar).text(message);
    974980                }
     
    982988                }
    983989               
     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               
    9841008                this.initialize = function () {
    9851009                    init();
Note: See TracChangeset for help on using the changeset viewer.