Changeset 888 for pro-violet-viettel
- Timestamp:
- Apr 15, 2015 4:16:59 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/views/layout/footer.php
r845 r888 24 24 <script src="<?php echo $base_url;?>assets/js/grid.js"></script> 25 25 <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> 27 27 28 28 <script type="text/javascript" src="<?php echo base_url();?>assets/js/html5lightbox.js"></script> … … 42 42 navigationbar: 'navigation-bar', 43 43 invisibledButtons: ['btnShare'], 44 filehosting: '<?php echo $this->config->item('api_url');?>'45 44 }); 46 45 -
pro-violet-viettel/www/deploy/20150304/assets/js/grid.js
r885 r888 6 6 if( o.draggable == undefined ) o.draggable = false; 7 7 if( o.manager == undefined) o.manager = null; 8 8 9 9 var oContainer = this; 10 10 var documentBoundEvent = false; … … 12 12 var posLeftArray = []; 13 13 var self = this; 14 14 15 15 var createNode = function (node) { 16 16 if( !node ) var node = {}; … … 18 18 if( node.isDirectory == undefined ) node.isDirectory = false; 19 19 if( node.showContextMenu == undefined ) node.showContextMenu = true; 20 21 20 21 22 22 var icon = (node.item.minetype != undefined) ? 'icon-' + node.item.minetype: 'icon-directory'; 23 23 var type = (node.item.minetype != undefined) ? node.item.minetype: 'directory'; 24 24 var thumb = null; 25 var filehosting = o.manager.getFileHosting(); 25 26 if (node.item.thumbnail != "") 26 27 { … … 31 32 if($.inArray( type.toLowerCase(), [ "jpg", "jpeg", "png", "bmp"])>=0) 32 33 { 33 thumb = $('<img>', {src: node.item.fileurl,align:'middle'});34 thumb = $('<img>', {src:filehosting + node.item.fileurl,align:'middle'}); 34 35 } 35 36 } 36 37 37 38 var div = $('<div></div>',{'class':icon}); 38 39 if (thumb != null) $(div).append(thumb); 39 40 40 var typeid = type == 'directory' ? 'directory':'file'; 41 var typeid = type == 'directory' ? 'directory':'file'; 41 42 var inputID = $('<input />',{'class':'id', type:'hidden',value:node.item.id}); 42 43 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}); 44 46 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 47 49 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); 49 51 var li = $('<li></li>',{'class':'vscell',id:typeid+node.item.id}).append(div, divLink); 50 52 51 53 bindNodeEvents(li); 52 54 53 55 return li; 54 56 } 55 57 56 58 var bindNodeEvents = function (node) { 57 59 58 60 var disabledItemsList = null; 59 61 var menuName = ''; 60 62 61 63 var type = $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="type"]').val(); 62 64 63 65 $(node) 64 66 .bind("click", function (e){nodeClick(this,e);return false;}) 65 67 .bind("dblclick", function (e){nodeDblClick(this,e);return false;}) 66 68 } 67 69 68 70 var nodeClick = function (node, event) { 69 71 var message = ''; … … 83 85 else { 84 86 clearAllHighLightNode(node); 85 highlightNode(node); 86 } 87 87 highlightNode(node); 88 } 89 88 90 o.manager.refreshStatusBar(); 89 91 } 90 91 92 93 92 94 var nodeDblClick = function (node) { 93 95 94 96 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(), 96 98 name: $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="name"]').val(), 97 99 parentID: $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="parentID"]').val(), 98 100 minetype: $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="type"]').val()}; 99 101 100 102 o.manager.gridNodeDblClick(nodeObj); 101 103 } 102 104 103 105 var highlightNode = function (node) { 104 106 $(node).addClass('selected'); 105 107 } 106 108 107 109 var isHighLight = function (node) { 108 110 return $(node).hasClass('selected'); 109 111 } 110 112 111 113 var clearAllHighLightNode = function () { 112 114 $(oContainer).find('> UL > LI').removeClass('selected'); 113 115 } 114 116 115 117 var clearHighLightNode = function (node) { 116 118 $(node).removeClass('selected'); 117 119 } 118 120 119 121 var highLightAllNode = function () { 120 122 clearAllHighLightNode(); 121 123 $(oContainer).find('> UL > LI').addClass('selected'); 122 124 } 123 125 124 126 var getAllHighLightNode = function () { 125 127 return $(oContainer).find('> UL > LI.selected'); 126 128 } 127 129 128 130 var initGrid = function () { 129 131 $(oContainer).attr('unselectable','on') … … 135 137 '-ms-user-select':'none', 136 138 'user-select':'none' 137 }).bind('selectstart', function(){ return false; 139 }).bind('selectstart', function(){ return false; 138 140 }).bind('click', function(e){clearAllHighLightNode(); return false; }); 139 141 140 142 var ul = $('<ul></ul>',{'class':'vsgrid'}); 141 143 142 144 var parentDirID = o.manager.getTreeCurrentNode(); 143 145 if (o.data.DIRECTORIES.length > 0) { … … 149 151 } 150 152 } 151 153 152 154 if (o.data.FILES.length > 0) { 153 155 for (var f in o.data.FILES) { … … 158 160 } 159 161 } 160 162 161 163 $(oContainer).find ('UL').remove(); 162 164 $(oContainer).append(ul); … … 173 175 * RENAME - START * 174 176 ******************/ 175 var renameInit = function (node) { 177 var renameInit = function (node) { 176 178 var editor = $('<input />',{'class':'rename', type: 'text', value:$(node).text()}); 177 179 $(editor).bind('focusout', function(e){renameCancel(node)}); … … 183 185 e.stopPropagation(); 184 186 }); 185 187 186 188 $(node).text(''); 187 189 $(node).append(editor); … … 189 191 //$(editor).select(); 190 192 } 191 193 192 194 var renameCancel = function (node) { 193 195 var nodeID = $(node).parent().find('> INPUT[type="hidden"][class^="id"]').val(); … … 201 203 $(node).select(); 202 204 } 203 205 204 206 var renameComplete = function (node) { 205 207 var editor = $(node).find('>INPUT'); … … 210 212 $(node).find('>INPUT').remove(); 211 213 } 212 214 213 215 /****************** 214 216 * RENAME - END * 215 217 ******************/ 216 218 217 219 this.reloadGrid = function () { 218 220 initGrid(); 219 221 } 220 222 221 223 this.setData = function (data) { 222 224 o.data = data; 223 225 } 224 226 225 227 this.rename = function (item) { 226 228 /*console.log('rename'); 227 229 console.log(item);*/ 228 230 } 229 231 230 232 this.createNode = function (node) { 231 233 var node = createNode ({item: node}); 232 234 $(oContainer).find ('UL').append(node); 233 235 } 234 236 235 237 this.deletion = function (id, type) { 236 238 destroyNode($(oContainer).find('LI#'+type+id)); … … 253 255 254 256 return true; 255 } 256 257 } 258 257 259 this.getHighLightItem = function () { 258 var nodeSelected = $(oContainer).find('LI.vscell.selected'); 260 var nodeSelected = $(oContainer).find('LI.vscell.selected'); 259 261 var items = []; 260 262 261 263 if ($(nodeSelected).length > 0) { 262 264 $(nodeSelected).each (function(i,obj) { … … 268 270 }); 269 271 } 270 272 271 273 return items; 272 274 } … … 275 277 highLightAllNode(); 276 278 } 277 279 278 280 this.initialize = function () { 279 281 initGrid(); 280 282 return this; 281 283 }; 282 284 283 285 return this.initialize(); 284 286 } -
pro-violet-viettel/www/deploy/20150304/assets/js/manager.js
r886 r888 40 40 41 41 if (o.filehosting == undefined) 42 o.filehosting = 'http://sbgapi.violet.vn/ ';42 o.filehosting = 'http://sbgapi.violet.vn/uploads/space'; 43 43 44 44 if (o.invisibledButtons == undefined) 45 45 o.invisibledButtons = null; 46 46 47 o.host = o.host +'ajax/';47 o.host += 'ajax/'; 48 48 49 49 var isDev = false; … … 138 138 } 139 139 } 140 141 140 }) 142 141 .done(function () { … … 210 209 211 210 self.setHomeNode(); 212 213 211 self.refreshStatusBar(); 214 212 }; … … 1154 1152 callback: function (result) { 1155 1153 if (result) { 1156 var delobj = JSON 1157 .stringify(item); 1154 var delobj = JSON.stringify(item); 1158 1155 var postdata = { 1159 1156 delobj: delobj … … 1184 1181 if ($(parseData.DIRECTORIES).length > 0) { 1185 1182 $(parseData.DIRECTORIES).each( 1186 1187 1188 1183 function (index) { 1184 o.data.DIRECTORIES.splice(searchItemByID(this, 'directory'), 1); 1185 }); 1189 1186 } 1190 1187 1191 1188 if ($(parseData.FILES).length > 0) { 1192 1189 $(parseData.FILES).each( 1193 1194 1195 1190 function (index) { 1191 o.data.FILES.splice(searchItemByID(this, 'file'), 1); 1192 }); 1196 1193 } 1197 1194 … … 1452 1449 } 1453 1450 1451 this.getFileHosting = function () { 1452 return o.filehosting; 1453 } 1454 1454 1455 this.initialize = function () { 1455 1456 init();
Note: See TracChangeset
for help on using the changeset viewer.