mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
filemanager stuff
This commit is contained in:
parent
6a7b3d65c4
commit
9db728e1ad
15 changed files with 1878 additions and 481 deletions
|
@ -800,6 +800,38 @@ App.Ajax.request = function(method, data, callback, onError){
|
|||
}*/
|
||||
//App.Helpers.setAjaxBusy(method, data);
|
||||
data = data || {};
|
||||
|
||||
var prgs = $('.progress-container');
|
||||
|
||||
switch (method) {
|
||||
case 'cd':
|
||||
prgs.find('title').text('Opening dir');
|
||||
prgs.show();
|
||||
break;
|
||||
case 'delete_files':
|
||||
prgs.find('title').text('Deleting');
|
||||
prgs.show();
|
||||
break;
|
||||
case 'unpack_item':
|
||||
prgs.find('title').text('Unpacking');
|
||||
prgs.show();
|
||||
break;
|
||||
case 'create_file':
|
||||
prgs.find('title').text('Creating file');
|
||||
prgs.show();
|
||||
break;
|
||||
case 'create_dir':
|
||||
prgs.find('title').text('Creating directory');
|
||||
prgs.show();
|
||||
break;
|
||||
case 'rename_file':
|
||||
prgs.find('title').text('Renaming file');
|
||||
prgs.show();
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
jQuery.ajax({
|
||||
url: GLOBAL.ajax_url,
|
||||
|
@ -816,6 +848,7 @@ App.Ajax.request = function(method, data, callback, onError){
|
|||
cache: false,
|
||||
error: function(jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
prgs.hide();
|
||||
onError && onError();
|
||||
if ('undefined' != typeof onError) {
|
||||
fb.error(textStatus);
|
||||
|
@ -824,9 +857,11 @@ App.Ajax.request = function(method, data, callback, onError){
|
|||
complete: function()
|
||||
{
|
||||
//App.Helpers.setAjaxFree(method, data);
|
||||
prgs.hide();
|
||||
},
|
||||
success: function(reply)
|
||||
{
|
||||
prgs.hide();
|
||||
//App.Helpers.setAjaxFree(method, data);
|
||||
try {
|
||||
callback && callback(reply);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,7 +2,12 @@
|
|||
{
|
||||
jQuery.fn.flayer_close = function()
|
||||
{
|
||||
jQuery(this).flayer.close();
|
||||
try {
|
||||
jQuery(this).flayer.close();
|
||||
}
|
||||
catch (e) {
|
||||
fb.error(e);
|
||||
}
|
||||
}
|
||||
jQuery.fn.flayer = function(params)
|
||||
{
|
||||
|
@ -15,8 +20,9 @@
|
|||
id : 'floating-box',
|
||||
className : 'floating-box-class',
|
||||
zIndex : 5000,
|
||||
beforeStart : function(){},
|
||||
beforeEnd : function(){},
|
||||
beforeStart : function() {},
|
||||
beforeEnd : function() {},
|
||||
afterStart: function() {},
|
||||
close : null,
|
||||
closeClass : 'close-floating-layer',
|
||||
outerClose : false,
|
||||
|
@ -207,6 +213,7 @@
|
|||
jQuery(ref.content).append(jQuery(elm).removeClass('hidden'));
|
||||
start_ovservers();
|
||||
jQuery(ref.container).removeClass('hidden').css({'display':'block'});
|
||||
config.afterStart(elm);
|
||||
|
||||
}
|
||||
//
|
||||
|
|
|
@ -46,3 +46,10 @@ if (!function_exists('__')) {
|
|||
|
||||
App.i18n.ARE_YOU_SURE = '<?php echo __('Are you sure?') ?>';
|
||||
App.Constants.UNLIM_TRANSLATED_VALUE = '<?php echo __('unlimited') ?>';
|
||||
|
||||
App.Constants.FM_DIRECTORY_NAME_CANNOT_BE_EMPTY = '<?php echo __('Directory name cannot be empty') ?>';
|
||||
App.Constants.FM_FILE_NAME_CANNOT_BE_EMPTY = '<?php echo __('File name cannot be empty') ?>';
|
||||
App.Constants.FM_NO_FILE_SELECTED = '<?php echo __('No file selected') ?>';
|
||||
App.Constants.FM_NO_FILE_OR_DIRECTORY_SELECTED = '<?php echo __('No file or folder selected') ?>';
|
||||
App.Constants.FM_FILE_TYPE_NOT_SUPPORTED = '<?php echo __('File type not supported') ?>';
|
||||
|
||||
|
|
|
@ -7,31 +7,65 @@ App.Templates.html = {
|
|||
hint: ['']
|
||||
},
|
||||
// file manager
|
||||
//
|
||||
|
||||
//<input id="check~!:index~!" class="ch-toggle2" type="checkbox" name="domain[]" value="~!:index3~!">\
|
||||
|
||||
FM: {
|
||||
entry_line: ['<li class="dir">\
|
||||
<span class="marker"></span>\
|
||||
<span class="marker">\
|
||||
</span>\
|
||||
<span class="icon ~!:ITEM_TYPE~!" ></span>\
|
||||
<input type="hidden" class="source" value=\'~!:SOURCE~!\'/>\
|
||||
<span class="filename ripple" ~!:CL_ACTION_1~!>~!:NAME~!</span>\
|
||||
<span class="mode">~!:PERMISSIONS~!</span>\
|
||||
<span class="owner">~!:OWNER~!</span>\
|
||||
<span class="size">~!:SIZE~!</span>\
|
||||
<span class="size-unit">~!:SIZE_UNIT~!</span>\
|
||||
<span class="size-value">~!:SIZE_VALUE~!</span>\
|
||||
<span class="date">~!:DATE~!</span>\
|
||||
<span class="time">~!:TIME~!</span>\
|
||||
<span class="subcontext-control ~!:SUBMENU_CLASS~!" onClick="FM.toggleSubContextMenu(this)">••• \
|
||||
<ul class="subcontext-menu subcontext-menu-hidden"><li onClick="FM.downloadFileFromSubcontext(this);">Download</li><li onClick="FM.editFileFromSubcontext(this);">Edit</li></ul>\
|
||||
</span>\
|
||||
</li>'],
|
||||
popup_alert: ['<div class="confirm-box alarm popup-box">\
|
||||
<div class="message">~!:TEXT~!</div>\
|
||||
<div class="controls">\
|
||||
<p class="ok" onClick="FM.popupClose();">close</p>\
|
||||
</div>\
|
||||
</div>'],
|
||||
popup_bulk: ['<div class="confirm-box alarm popup-box">\
|
||||
<div class="message">~!:ACTION~!: <br />~!:TEXT~!</div>\
|
||||
<div class="results"></div>\
|
||||
<div class="controls">\
|
||||
<!-- p class="ok" onClick="FM.popupClose();">close</p -->\
|
||||
<p><img src="/images/in_progress.gif"></p>\
|
||||
</div>\
|
||||
</div>'],
|
||||
popup_delete: ['<div class="confirm-box delete popup-box">\
|
||||
<div class="message">Are you sure you want to delete file <span class="title">"~!:FILENAME~!"</span>?</div>\
|
||||
<div class="message">Are you sure you want to delete <span class="title">"~!:FILENAME~!"</span>?</div>\
|
||||
<div class="controls">\
|
||||
<p class="cancel" onClick="FM.popupClose();">cancel</p>\
|
||||
<p class="ok" onClick="FM.confirmDelete();">delete</p>\
|
||||
</div>\
|
||||
</div>'],
|
||||
popup_rename_: ['<div class="confirm-box rename warning">\
|
||||
<div class="message">Rename file <span class="title">"~!:FILENAME~!"</span></div>\
|
||||
<!-- div class="warning">File <span class="title">"reading.txt"</span> already exists</div -->\
|
||||
<div class="warning"></div>\
|
||||
popup_copy: ['<div class="confirm-box copy popup-box">\
|
||||
<div class="message">Are you sure you want to copy <span class="title">"~!:SRC_FILENAME~!"</span> into:</div>\
|
||||
<div class="actions">\
|
||||
<input type="text" id="rename-title" class="new-title" />\
|
||||
<input type="text" id="copy_dest" value="~!:DST_FILENAME~!" class="new-title">\
|
||||
</div>\
|
||||
<div class="message">existing files will be replaced</div>\
|
||||
<div class="controls">\
|
||||
<p class="cancel" onClick="FM.popupClose();">cancel</p>\
|
||||
<p class="ok" onClick="FM.confirmCopyItems();">copy</p>\
|
||||
</div>\
|
||||
</div>'],
|
||||
popup_rename: ['<div class="confirm-box rename warning">\
|
||||
<div class="message">Original name: <span class="title">"~!:FILENAME~!"</span></div>\
|
||||
<!-- div class="warning">File <span class="title">"reading.txt"</span> already exists</div -->\
|
||||
<div class="warning warning-message"></div>\
|
||||
<div class="actions">\
|
||||
<input type="text" id="rename-title" class="new-title" value="~!:NEW_NAME~!" />\
|
||||
</div>\
|
||||
<div class="controls">\
|
||||
<p class="cancel" onClick="FM.popupClose();">cancel</p>\
|
||||
|
@ -43,15 +77,33 @@ App.Templates.html = {
|
|||
</div>\
|
||||
</div>'],
|
||||
|
||||
popup_rename: ['<div class="confirm-box unpack warning">\
|
||||
<div class="message">Extract archive <span class="title">"~!:FILENAME~!"</span> to <span class="title">"~!:DIRNAME~!"</span></div>\
|
||||
<div class="warning"></div>\
|
||||
popup_pack: ['<div class="confirm-box pack warning">\
|
||||
<div class="message">Pack <span class="title">"~!:FILENAME~!"</span> into:</div>\
|
||||
<div class="actions">\
|
||||
<label><input type="checkbox" name="overwrite" class="title" />Overwrite exising files</label>\
|
||||
<input type="text" id="pack-destination" class="new-title" value="~!:DST_DIRNAME~!">\
|
||||
</div>\
|
||||
<div class="warning warning-message"></div>\
|
||||
<!-- div class="actions">\
|
||||
<label><input type="checkbox" name="overwrite" class="title" />Overwrite exising files</label>\
|
||||
</div -->\
|
||||
<div class="controls">\
|
||||
<p class="cancel" onClick="FM.popupClose();">cancel</p>\
|
||||
<p class="ok" onClick="FM.confirmRename();">Extract</p>\
|
||||
<p class="ok" onClick="FM.confirmPackItem();">Pack</p>\
|
||||
</div>\
|
||||
</div>'],
|
||||
|
||||
popup_unpack: ['<div class="confirm-box unpack warning">\
|
||||
<div class="message">Extract archive <span class="title">"~!:FILENAME~!"</span> to:</div>\
|
||||
<div class="actions">\
|
||||
<input type="text" id="unpack-destination" class="new-title" value="~!:DST_DIRNAME~!">\
|
||||
</div>\
|
||||
<div class="warning warning-message"></div>\
|
||||
<!-- div class="actions">\
|
||||
<label><input type="checkbox" name="overwrite" class="title" />Overwrite exising files</label>\
|
||||
</div -->\
|
||||
<div class="controls">\
|
||||
<p class="cancel" onClick="FM.popupClose();">cancel</p>\
|
||||
<p class="ok" onClick="FM.confirmUnpackItem();">Extract</p>\
|
||||
</div>\
|
||||
</div>'],
|
||||
|
||||
|
@ -59,7 +111,7 @@ App.Templates.html = {
|
|||
popup_create_file: ['<div class="confirm-box rename warning">\
|
||||
<div class="message">Create file</div>\
|
||||
<!-- div class="warning">File <span class="title">"reading.txt"</span> already exists</div -->\
|
||||
<div class="warning"></div>\
|
||||
<div class="warning warning-message"></div>\
|
||||
<div class="actions">\
|
||||
<input type="text" id="rename-title" class="new-title" />\
|
||||
</div>\
|
||||
|
@ -71,7 +123,7 @@ App.Templates.html = {
|
|||
popup_create_dir: ['<div class="confirm-box rename warning">\
|
||||
<div class="message">Create directory</div>\
|
||||
<!-- div class="warning">File <span class="title">"reading.txt"</span> already exists</div -->\
|
||||
<div class="warning"></div>\
|
||||
<div class="warning warning-message"></div>\
|
||||
<div class="actions">\
|
||||
<input type="text" id="rename-title" class="new-title" />\
|
||||
</div>\
|
||||
|
@ -79,6 +131,12 @@ App.Templates.html = {
|
|||
<p class="cancel" onClick="FM.popupClose();">cancel</p>\
|
||||
<p class="ok" onClick="FM.confirmCreateDir();">create</p>\
|
||||
</div>\
|
||||
</div>'],
|
||||
popup_no_file_selected: ['<div class="confirm-box no-file-selected">\
|
||||
<div class="message">Please select a file</div>\
|
||||
<div class="controls">\
|
||||
<p class="ok" onClick="FM.confirmCreateDir();">ok</p>\
|
||||
</div>\
|
||||
</div>']
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue