Changeset 42 for pro-bachkim-filespace/sourcecode/assets
- Timestamp:
- Aug 4, 2014 6:09:41 PM (11 years ago)
- Location:
- pro-bachkim-filespace/sourcecode/assets
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-bachkim-filespace/sourcecode/assets/css/jquery/jquery.contextmenu_new.css
r15 r42 61 61 62 62 .contextMenu LI.preview A { background-image: url(images/preview.png); } 63 .contextMenu LI.open A { background-image: url(images/folder_open.png);}63 .contextMenu LI.open A { /* background-image: url(images/folder_open.png); */ } 64 64 .contextMenu LI.share A { background-image: url(images/share.png); } 65 65 .contextMenu LI.rename A { background-image: url(images/rename.png); } 66 67 .contextMenu LI.newfolder A { background-image: url(images/folder_open.png); } 66 68 67 69 .contextMenu LI.edit A { background-image: url(images/page_white_edit.png); } -
pro-bachkim-filespace/sourcecode/assets/css/space/style.css
r17 r42 8 8 @import "vsgrid.css"; 9 9 @import "contextmenu.css"; 10 @import "../uploadfile.min.css"; 10 11 11 12 body { … … 150 151 border-radius: 0 !important; 151 152 } 153 154 #fileuploader { 155 text-align: center; 156 } -
pro-bachkim-filespace/sourcecode/assets/js/filemanager/filemanager.js
r23 r42 85 85 privateTree.deleteDir(curDir); 86 86 }); 87 88 $('#btnUpload').click (function() { 89 var curDir = privateTree.getCurrentDir(); 90 privateTree.upload(); 91 }); 92 87 93 88 94 -
pro-bachkim-filespace/sourcecode/assets/js/vsgrid.js
r23 r42 9 9 if( o.dirIDprefix == undefined ) o.dirIDprefix = null; 10 10 if( o.host == undefined ) o.host = 'http://localhost/'; 11 if( o.tree == undefined ) o.tree = null; 11 12 12 13 if( o.sharemodal == undefined ) o.sharemodal = $("#box-shareto"); … … 48 49 itemClick(el); 49 50 switch(action) { 51 case 'newfolder': 52 openNewFolderModal(currentObj); 53 break; 50 54 case 'rename': 51 55 rename(el); … … 62 66 } 63 67 68 }); 69 } 70 71 var openNewFolderModal = function (c) { 72 $('#box-newfolder').modal('show'); 73 $('#frm-newfolder').find('#f-parentid').val(c.id); 74 } 75 76 var bindCreateFolder = function () { 77 $('#box-newfolder').find('#frm-newfolder').unbind('submit'); 78 $('#box-newfolder').find('#btn-submit-newfolder').unbind('click'); 79 80 $('#box-newfolder').find('#frm-newfolder').bind('submit', 81 function(e){ 82 if ($('#frm-newfolder').find('#f-newfoldername').val() == '') { 83 alert('Chưa nháºp tên thư mục má»i!'); 84 }else { 85 var postData = $('#box-newfolder').find('#frm-newfolder').serializeArray(); 86 var script = 'ajax/privatecontent/createdir'; 87 sendCommand({ 88 script: script, 89 postdata:postData, 90 callbackSuccess: function (parsedData) { 91 createNode({ 92 id: parsedData.id, 93 name: parsedData.name, 94 curentNode: currentObj, 95 hidden: false, 96 addToJSONData:true}); 97 o.tree.createDir(parsedData); 98 } 99 }); 100 101 $('#box-newfolder').modal('hide'); 102 } 103 104 e.preventDefault(); 105 }); 106 107 $('#box-newfolder').on('show.bs.modal', function () { 108 $('#box-newfolder').find('#frm-newfolder').get(0).reset(); 109 }); 110 111 $('#box-newfolder').find('#btn-submit-newfolder').bind('click', 112 function (){ 113 $('#box-newfolder').find('#frm-newfolder').submit(); 64 114 }); 65 115 } … … 153 203 currentObj.id = $(i).attr('rel').substring(3); 154 204 currentObj.type = $(i).find('>div>div').hasClass('icon-directory') ? 'directory':'file'; 205 var item = searchItemByID(currentObj.id, currentObj.type); 206 currentObj.parentID = item.parentID; 207 } 208 209 var searchItemByID = function (itemID, type) { 210 var source = (type == 'directory') ? o.directoryTreeData.DIRECTORIES : (type == 'file') ? o.directoryTreeData.FILES : null; 211 var item = null; 212 for (var i = 0 ; i < source.length; i++) { 213 if (source[i].id == itemID) { 214 item = source[i]; 215 break; 216 } 217 } 218 return item; 155 219 } 156 220 … … 182 246 183 247 keyboardRename(); 248 bindCreateFolder(); 184 249 } 185 250 … … 252 317 p.callbackSuccess(parseData); 253 318 } 254 255 319 }).done(function() {if (p.callbackDone != null)p.callbackDone(this);}).fail(function() {if (p.callbackFail != null)p.callbackFail(this);}).always(function() {if (p.callbackAlways != null)p.callbackAlways(this);}); 256 320 } 257 321 } 258 322 259 this. getData = function (data) {323 this.setData = function (data) { 260 324 o.directoryTreeData = data.directoryTreeData; 261 325 o.curentParent = data.curentParent; 262 o.dirIDprefix = data.dirIDprefix 326 o.dirIDprefix = data.dirIDprefix; 263 327 renderGrid(o); 328 } 329 330 this.setTree = function (treeObj) { 331 o.tree = treeObj; 264 332 } 265 333 266 334 this.showModal = function (obj, act) { 267 335 switch( act ) { 336 case 'newfolder': 337 openNewFolderModal(obj); 338 break; 268 339 case 'copy': 269 340 case 'cut': -
pro-bachkim-filespace/sourcecode/assets/js/vstree.js
r18 r42 15 15 if( o.expandEasing == undefined ) o.expandEasing = null; 16 16 if( o.collapseEasing == undefined ) o.collapseEasing = null; 17 if( o.me == undefined ) o.me = this; 17 18 18 19 if( o.directoryTreeData == undefined ) o.directoryTreeData = null; … … 107 108 newdir.id = d.id; 108 109 newdir.name = d.name; 110 111 console.log(d.currentNode); 112 109 113 newdir.parentID = $(o.container).find(d.currentNode).parent().attr('id').substring(o.dirIDprefix.length, $(d.currentNode).parent().attr('id').length); 110 114 o.directoryTreeData.DIRECTORIES.push(newdir); … … 125 129 rename(el); 126 130 break; 131 case 'newfolder': 127 132 case 'share': 128 133 case 'copy': … … 144 149 } 145 150 //END - Create a node of Tree 146 151 147 152 var deleteNode = function (parsedData) { 148 153 if (parsedData.isSuccess == false) return false; … … 190 195 if (o.grid == null) return false; 191 196 192 o.grid.getData({ 197 o.grid.setTree(o.me); 198 o.grid.setData({ 193 199 directoryTreeData: o.directoryTreeData, 194 200 curentParent:$(o.container).find('.currentDir').parent().attr('id'), … … 281 287 }; 282 288 283 this.createDir = function(c) { 284 var cid = $(c).parent().attr('id'); 285 var pid = cid.substring(o.dirIDprefix.length, cid.length); 286 287 var dirName = prompt("Please enter new directory name", ""); 288 var script = 'ajax/privatecontent/createdir'; 289 290 if (dirName != null && dirName.length != 0) { 291 sendCommand({ 292 script: script, 293 postdata:{parentID:pid,name:dirName}, 294 callbackSuccess: function (parsedData) {createNode({ 295 id: parsedData.id, 296 name: parsedData.name, 297 curentNode: c, 298 hidden: false, 299 addToJSONData:true}); 300 } 301 }); 302 } 289 this.createDir = function(data) { 290 var cNode = $('#' + o.dirIDprefix + data.parentID).find('> A'); 291 292 createNode({ 293 id: data.id, 294 name: data.name, 295 currentNode: cNode, 296 hidden: false, 297 addToJSONData:true}); 298 299 //console.log($(o.container).find(cNode).parent().attr('id').substring(o.dirIDprefix.length, $(cNode).parent().attr('id').length)); 303 300 } 304 301 … … 328 325 }); 329 326 } 327 328 this.upload = function () { 329 $('#box-upload').modal('show'); 330 331 $("#fileuploader").uploadFile({ 332 url: o.host + 'ajax/privatecontent/upload', 333 fileName:"myfile", 334 multiple:true, 335 maxFileCount: 5, 336 dragDropStr: "<span><b>Kéo thả các file và o Äây!</b></span>", 337 uploadErrorStr:"Tải lên có lá»i!" 338 }); 339 340 $('#box-upload').on('hide.bs.modal', function () { 341 $('#box-upload').find('.modal-body>.row>.col-xs-12>').remove(); 342 $('#box-upload').find('.modal-body>.row>.col-xs-12').append('<div id="fileuploader">Chá»n file:</div>'); 343 }); 344 } 330 345 331 346 this.copy = function () { 332 alert ('copy');347 333 348 } 334 349 335 350 this.paste = function () { 336 alert ('paste');351 337 352 } 338 353
Note: See TracChangeset
for help on using the changeset viewer.