Elastic: Add More actions menu with Copy/Move functionality for Files
This commit is contained in:
parent
931c7e594d
commit
f665dfcd6e
3 changed files with 58 additions and 7 deletions
|
@ -1709,18 +1709,59 @@ rcube_webmail.prototype.files_delete = function()
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
rcube_webmail.prototype.files_move = function(folder)
|
rcube_webmail.prototype.files_move = function(folder, obj, event, files)
|
||||||
{
|
{
|
||||||
var files = kolab_files_selected();
|
if (!files)
|
||||||
|
files = kolab_files_selected();
|
||||||
|
|
||||||
|
if (!folder) {
|
||||||
|
var ref = this;
|
||||||
|
return this.files_folder_selector(event, function(folder) {
|
||||||
|
ref.files_move(folder, null, event, files);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
file_api.file_move(files, folder);
|
file_api.file_move(files, folder);
|
||||||
};
|
};
|
||||||
|
|
||||||
rcube_webmail.prototype.files_copy = function(folder)
|
rcube_webmail.prototype.files_copy = function(folder, obj, event, files)
|
||||||
{
|
{
|
||||||
var files = kolab_files_selected();
|
if (!files)
|
||||||
|
files = kolab_files_selected();
|
||||||
|
|
||||||
|
if (!folder) {
|
||||||
|
var ref = this;
|
||||||
|
return this.files_folder_selector(event, function(folder) {
|
||||||
|
ref.files_copy(folder, null, event, files);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
file_api.file_copy(files, folder);
|
file_api.file_copy(files, folder);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// create folder selector popup
|
||||||
|
rcube_webmail.prototype.files_folder_selector = function(event, callback)
|
||||||
|
{
|
||||||
|
this.entity_selector('folder-selector', callback, file_api.env.folders, function(folder, a, folder_fullname) {
|
||||||
|
var n = folder.depth || 0,
|
||||||
|
id = folder.id,
|
||||||
|
row = $('<li>');
|
||||||
|
|
||||||
|
if (folder.virtual || folder.readonly)
|
||||||
|
a.addClass('virtual').attr({'aria-disabled': 'true', tabindex: '-1'});
|
||||||
|
else
|
||||||
|
a.addClass('active').data('id', folder_fullname);
|
||||||
|
|
||||||
|
a.css('padding-left', n ? (n * 16) + 'px' : 0);
|
||||||
|
|
||||||
|
// add folder name element
|
||||||
|
a.append($('<span>').text(folder.name));
|
||||||
|
|
||||||
|
return row.append(a);
|
||||||
|
}, event);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
rcube_webmail.prototype.files_upload = function(form)
|
rcube_webmail.prototype.files_upload = function(form)
|
||||||
{
|
{
|
||||||
if (form)
|
if (form)
|
||||||
|
|
|
@ -180,6 +180,7 @@ $labels['arialabelfilesessiondialog'] = 'Document editing session';
|
||||||
$labels['arialabelcollaborators'] = 'List of document editors';
|
$labels['arialabelcollaborators'] = 'List of document editors';
|
||||||
$labels['arialabelexportoptions'] = 'Export options';
|
$labels['arialabelexportoptions'] = 'Export options';
|
||||||
$labels['arialabeldoceditorsdialog'] = 'Document editors (invitations)';
|
$labels['arialabeldoceditorsdialog'] = 'Document editors (invitations)';
|
||||||
|
$labels['arialabelmorefileactions'] = 'More file actions';
|
||||||
|
|
||||||
$labels['type.plain'] = 'Plain Text Document';
|
$labels['type.plain'] = 'Plain Text Document';
|
||||||
$labels['type.vndoasisopendocumenttext'] = 'Text Document (ODF)';
|
$labels['type.vndoasisopendocumenttext'] = 'Text Document (ODF)';
|
||||||
|
|
|
@ -52,12 +52,12 @@
|
||||||
<roundcube:button command="files-create" type="link" data-fab="true"
|
<roundcube:button command="files-create" type="link" data-fab="true"
|
||||||
class="button create disabled" classAct="button create"
|
class="button create disabled" classAct="button create"
|
||||||
label="kolab_files.create" title="kolab_files.createfile" innerClass="inner "/>
|
label="kolab_files.create" title="kolab_files.createfile" innerClass="inner "/>
|
||||||
<roundcube:button command="files-rename" type="link"
|
|
||||||
class="button rename disabled" classAct="button rename"
|
|
||||||
label="kolab_files.rename" title="kolab_files.renamefile" innerClass="inner" />
|
|
||||||
<roundcube:button command="files-delete" type="link"
|
<roundcube:button command="files-delete" type="link"
|
||||||
class="button delete disabled" classAct="button delete"
|
class="button delete disabled" classAct="button delete"
|
||||||
label="delete" title="kolab_files.deletefile" innerClass="inner" />
|
label="delete" title="kolab_files.deletefile" innerClass="inner" />
|
||||||
|
<roundcube:button name="filemenulink" id="filemenulink" type="link"
|
||||||
|
class="button more" label="more" title="moreactions"
|
||||||
|
data-popup="file-menu" innerclass="inner" />
|
||||||
</div>
|
</div>
|
||||||
<roundcube:object name="file-search-form" id="searchform" wrapper="searchbar toolbar"
|
<roundcube:object name="file-search-form" id="searchform" wrapper="searchbar toolbar"
|
||||||
label="searchform" buttontitle="kolab_files.findfiles" label-domain="kolab_files"
|
label="searchform" buttontitle="kolab_files.findfiles" label-domain="kolab_files"
|
||||||
|
@ -203,6 +203,15 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="file-menu" class="popupmenu">
|
||||||
|
<h3 id="aria-label-message-menu" class="voice"><roundcube:label name="kolab_files.arialabelmorefileactions" /></h3>
|
||||||
|
<ul class="toolbarmenu listing" role="menu" aria-labelledby="aria-label-file-menu">
|
||||||
|
<roundcube:button type="link-menuitem" command="files-rename" label="kolab_files.rename" class="rename" classAct="rename active" />
|
||||||
|
<roundcube:button type="link-menuitem" command="files-move" label="moveto" class="move" classAct="move active" innerclass="folder-selector-link" aria-haspopup="true" />
|
||||||
|
<roundcube:button type="link-menuitem" command="files-copy" label="copyto" class="copy" classAct="copy active" innerclass="folder-selector-link" aria-haspopup="true" />
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script src="plugins/kolab_files/skins/elastic/ui.js" type="text/javascript"></script>
|
<script src="plugins/kolab_files/skins/elastic/ui.js" type="text/javascript"></script>
|
||||||
|
|
||||||
<roundcube:include file="includes/footer.html" />
|
<roundcube:include file="includes/footer.html" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue