Changeset 888 for pro-violet-viettel


Ignore:
Timestamp:
Apr 15, 2015 4:16:59 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/views/layout/footer.php

    r845 r888  
    2424<script src="<?php echo $base_url;?>assets/js/grid.js"></script>
    2525<script src="<?php echo $base_url;?>assets/js/manager.js"></script>
    26 <script src="<?php echo base_url();?>assets/js/jquery.slides.js" ></script> 
     26<script src="<?php echo base_url();?>assets/js/jquery.slides.js" ></script>
    2727
    2828<script type="text/javascript" src="<?php echo base_url();?>assets/js/html5lightbox.js"></script>
     
    4242                navigationbar: 'navigation-bar',
    4343                invisibledButtons: ['btnShare'],
    44                 filehosting: '<?php echo $this->config->item('api_url');?>'
    4544        });
    4645
  • pro-violet-viettel/www/deploy/20150304/assets/js/grid.js

    r885 r888  
    66                        if( o.draggable == undefined ) o.draggable = false;
    77                        if( o.manager ==  undefined) o.manager = null;
    8                        
     8
    99                        var oContainer = this;
    1010                        var documentBoundEvent = false;
     
    1212                        var posLeftArray = [];
    1313                        var self = this;
    14                        
     14
    1515                        var createNode = function (node) {
    1616                                if( !node ) var node = {};
     
    1818                                if( node.isDirectory == undefined ) node.isDirectory = false;
    1919                                if( node.showContextMenu == undefined ) node.showContextMenu = true;
    20                                
    21                                
     20
     21
    2222                                var icon = (node.item.minetype != undefined) ? 'icon-' + node.item.minetype: 'icon-directory';
    2323                                var type = (node.item.minetype != undefined) ? node.item.minetype: 'directory';
    2424                                var thumb = null;
     25                                var filehosting = o.manager.getFileHosting();
    2526                if (node.item.thumbnail != "")
    2627                {
     
    3132                                        if($.inArray( type.toLowerCase(), [ "jpg", "jpeg", "png", "bmp"])>=0)
    3233                                        {
    33                                                  thumb = $('<img>', {src:node.item.fileurl,align:'middle'});
     34                                                 thumb = $('<img>', {src:filehosting + node.item.fileurl,align:'middle'});
    3435                                        }
    3536                }
    36                  
     37
    3738                                var div = $('<div></div>',{'class':icon});
    3839                                if (thumb != null) $(div).append(thumb);
    3940
    40                                 var typeid = type == 'directory' ? 'directory':'file';                           
     41                                var typeid = type == 'directory' ? 'directory':'file';
    4142                                var inputID = $('<input />',{'class':'id', type:'hidden',value:node.item.id});
    4243                                var inputName = $('<input />',{'class':'name',type:'hidden',value:node.item.name});
    43                                 var inputFileUrl = $('<input />',{'class':'fileurl',type:'hidden',value:node.item.fileurl});
     44
     45                                var inputFileUrl = $('<input />',{'class':'fileurl',type:'hidden',value:filehosting + node.item.fileurl});
    4446                                var inputParent = $('<input />',{'class':'parentID',type:'hidden',value:node.item.parentID});
    45                                 var inputType = $('<input />',{'class':'type',type:'hidden',value:typeid});                             
    46                                
     47                                var inputType = $('<input />',{'class':'type',type:'hidden',value:typeid});
     48
    4749                                var a = $('<a></a>',{id: node.item.id,href: '#',rel: node.item.name,text: node.item.name});
    48                                 var divLink = $('<div></div>',{'class':'file-name'}).append(a,inputID,inputName,inputParent,inputType,inputFileUrl);                           
     50                                var divLink = $('<div></div>',{'class':'file-name'}).append(a,inputID,inputName,inputParent,inputType,inputFileUrl);
    4951                                var li = $('<li></li>',{'class':'vscell',id:typeid+node.item.id}).append(div, divLink);
    50                                
     52
    5153                                bindNodeEvents(li);
    52                                
     54
    5355                                return li;
    5456                        }
    55                        
     57
    5658                        var bindNodeEvents = function (node) {
    57                        
     59
    5860                                var disabledItemsList = null;
    5961                                var menuName = '';
    60                                
     62
    6163                                var type = $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="type"]').val();
    62                                
     64
    6365                                $(node)
    6466                                        .bind("click", function (e){nodeClick(this,e);return false;})
    6567                                        .bind("dblclick", function (e){nodeDblClick(this,e);return false;})
    6668                        }
    67                        
     69
    6870                        var nodeClick = function (node, event) {
    6971                                var message = '';
     
    8385                                else {
    8486                                        clearAllHighLightNode(node);
    85                                         highlightNode(node);                                   
    86                                 }
    87                                
     87                                        highlightNode(node);
     88                                }
     89
    8890                                o.manager.refreshStatusBar();
    8991                        }
    90                        
    91                        
     92
     93
    9294                        var nodeDblClick = function (node) {
    93                            
     95
    9496                                var nodeObj = {id:$(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="id"]').val(),
    95                                 fileurl: $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="fileurl"]').val(),                     
     97                                fileurl: $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="fileurl"]').val(),
    9698                                name: $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="name"]').val(),
    9799                                                        parentID: $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="parentID"]').val(),
    98100                                                        minetype: $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="type"]').val()};
    99                                
     101
    100102                                o.manager.gridNodeDblClick(nodeObj);
    101103                        }
    102                        
     104
    103105                        var highlightNode = function (node) {
    104106                                $(node).addClass('selected');
    105107                        }
    106                        
     108
    107109                        var isHighLight = function (node) {
    108110                                return $(node).hasClass('selected');
    109111                        }
    110                        
     112
    111113                        var clearAllHighLightNode = function () {
    112114                                $(oContainer).find('> UL > LI').removeClass('selected');
    113115                        }
    114                        
     116
    115117                        var clearHighLightNode = function (node) {
    116118                                $(node).removeClass('selected');
    117119                        }
    118                        
     120
    119121                        var highLightAllNode = function () {
    120122                                clearAllHighLightNode();
    121123                                $(oContainer).find('> UL > LI').addClass('selected');
    122124                        }
    123                        
     125
    124126                        var getAllHighLightNode = function () {
    125127                                return $(oContainer).find('> UL > LI.selected');
    126128                        }
    127                        
     129
    128130                        var initGrid = function () {
    129131                                $(oContainer).attr('unselectable','on')
     
    135137                                           '-ms-user-select':'none',
    136138                                           'user-select':'none'
    137                                      }).bind('selectstart', function(){ return false; 
     139                                     }).bind('selectstart', function(){ return false;
    138140                                     }).bind('click', function(e){clearAllHighLightNode(); return false; });
    139141
    140142                                var ul = $('<ul></ul>',{'class':'vsgrid'});
    141                                
     143
    142144                                var parentDirID = o.manager.getTreeCurrentNode();
    143145                                if (o.data.DIRECTORIES.length > 0) {
     
    149151                                        }
    150152                                }
    151                                
     153
    152154                                if (o.data.FILES.length > 0) {
    153155                                        for (var f in o.data.FILES) {
     
    158160                                        }
    159161                                }
    160                                
     162
    161163                                $(oContainer).find ('UL').remove();
    162164                                $(oContainer).append(ul);
     
    173175                         * RENAME - START *
    174176                         ******************/
    175                         var renameInit = function (node) {                             
     177                        var renameInit = function (node) {
    176178                                var editor = $('<input />',{'class':'rename', type: 'text', value:$(node).text()});
    177179                                $(editor).bind('focusout', function(e){renameCancel(node)});
     
    183185                                                e.stopPropagation();
    184186                                        });
    185                                
     187
    186188                                $(node).text('');
    187189                                $(node).append(editor);
     
    189191                                //$(editor).select();
    190192                        }
    191                        
     193
    192194                        var renameCancel = function (node) {
    193195                                var nodeID = $(node).parent().find('> INPUT[type="hidden"][class^="id"]').val();
     
    201203                                $(node).select();
    202204                        }
    203                        
     205
    204206                        var renameComplete = function (node) {
    205207                                var editor = $(node).find('>INPUT');
     
    210212                                $(node).find('>INPUT').remove();
    211213                        }
    212                        
     214
    213215                        /******************
    214216                         * RENAME - END *
    215217                         ******************/
    216                        
     218
    217219                        this.reloadGrid = function () {
    218220                                initGrid();
    219221                        }
    220                        
     222
    221223                        this.setData = function (data) {
    222224                                o.data = data;
    223225                        }
    224                        
     226
    225227                        this.rename = function (item) {
    226228                                /*console.log('rename');
    227229                                console.log(item);*/
    228230                        }
    229                        
     231
    230232                        this.createNode = function (node) {
    231233                                var node = createNode ({item: node});
    232234                                $(oContainer).find ('UL').append(node);
    233235                        }
    234                        
     236
    235237                        this.deletion = function (id, type) {
    236238                                destroyNode($(oContainer).find('LI#'+type+id));
     
    253255
    254256                                return true;
    255                         }                       
    256                        
     257                        }
     258
    257259                        this.getHighLightItem = function () {
    258                                 var nodeSelected = $(oContainer).find('LI.vscell.selected');                           
     260                                var nodeSelected = $(oContainer).find('LI.vscell.selected');
    259261                                var items = [];
    260                                
     262
    261263                                if ($(nodeSelected).length > 0) {
    262264                                        $(nodeSelected).each (function(i,obj) {
     
    268270                                                });
    269271                                }
    270                                
     272
    271273                                return items;
    272274                        }
     
    275277                                highLightAllNode();
    276278                        }
    277                        
     279
    278280                        this.initialize = function () {
    279281                                initGrid();
    280282                                return this;
    281283                        };
    282                        
     284
    283285                        return this.initialize();
    284286                }
  • pro-violet-viettel/www/deploy/20150304/assets/js/manager.js

    r886 r888  
    4040
    4141                                if (o.filehosting == undefined)
    42                                     o.filehosting = 'http://sbgapi.violet.vn/';
     42                                    o.filehosting = 'http://sbgapi.violet.vn/uploads/space';
    4343
    4444                                if (o.invisibledButtons == undefined)
    4545                                    o.invisibledButtons = null;
    4646
    47                                 o.host = o.host + 'ajax/';
     47                                o.host += 'ajax/';
    4848
    4949                                var isDev = false;
     
    138138                                                                }
    139139                                                            }
    140 
    141140                                                        })
    142141                                                .done(function () {
     
    210209
    211210                                    self.setHomeNode();
    212 
    213211                                    self.refreshStatusBar();
    214212                                };
     
    11541152                                        callback: function (result) {
    11551153                                            if (result) {
    1156                                                 var delobj = JSON
    1157                                                         .stringify(item);
     1154                                                var delobj = JSON.stringify(item);
    11581155                                                var postdata = {
    11591156                                                    delobj: delobj
     
    11841181                                                        if ($(parseData.DIRECTORIES).length > 0) {
    11851182                                                            $(parseData.DIRECTORIES).each(
    1186                                                                     function (index) {
    1187                                                                         o.data.DIRECTORIES.splice(searchItemByID(this, 'directory'), 1);
    1188                                                                     });
     1183                                                                function (index) {
     1184                                                                    o.data.DIRECTORIES.splice(searchItemByID(this, 'directory'), 1);
     1185                                                                });
    11891186                                                        }
    11901187
    11911188                                                        if ($(parseData.FILES).length > 0) {
    11921189                                                            $(parseData.FILES).each(
    1193                                                                     function (index) {
    1194                                                                         o.data.FILES.splice(searchItemByID(this, 'file'), 1);
    1195                                                                     });
     1190                                                                function (index) {
     1191                                                                    o.data.FILES.splice(searchItemByID(this, 'file'), 1);
     1192                                                                });
    11961193                                                        }
    11971194
     
    14521449                                }
    14531450
     1451                                this.getFileHosting = function () {
     1452                                        return o.filehosting;
     1453                                }
     1454
    14541455                                this.initialize = function () {
    14551456                                    init();
Note: See TracChangeset for help on using the changeset viewer.