Search box for folders in kolab_files (T162)
This commit is contained in:
parent
21130bf9e6
commit
5d19e08d9b
7 changed files with 105 additions and 23 deletions
|
@ -173,7 +173,7 @@ function kolab_directory_selector_dialog(id)
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
attach = attach.clone();
|
attach = attach.clone();
|
||||||
$('.attachment-size', attach).remove();
|
$('.attachment-size', attach).remove();
|
||||||
filename = attach.text();
|
filename = $.trim(attach.text());
|
||||||
}
|
}
|
||||||
|
|
||||||
form.show();
|
form.show();
|
||||||
|
@ -196,6 +196,9 @@ function kolab_directory_selector_dialog(id)
|
||||||
$('#foldercreatelink').attr('tabindex', 0);
|
$('#foldercreatelink').attr('tabindex', 0);
|
||||||
|
|
||||||
buttons[rcmail.gettext('kolab_files.save')] = function () {
|
buttons[rcmail.gettext('kolab_files.save')] = function () {
|
||||||
|
if (!file_api.env.folder)
|
||||||
|
return;
|
||||||
|
|
||||||
var lock = rcmail.set_busy(true, 'saving'),
|
var lock = rcmail.set_busy(true, 'saving'),
|
||||||
request = {
|
request = {
|
||||||
act: 'save-file',
|
act: 'save-file',
|
||||||
|
@ -231,7 +234,7 @@ function kolab_directory_selector_dialog(id)
|
||||||
button_classes: ['mainaction'],
|
button_classes: ['mainaction'],
|
||||||
minWidth: 250,
|
minWidth: 250,
|
||||||
minHeight: 300,
|
minHeight: 300,
|
||||||
height: 350,
|
height: 400,
|
||||||
width: 300
|
width: 300
|
||||||
}, fn);
|
}, fn);
|
||||||
|
|
||||||
|
@ -1171,15 +1174,18 @@ function kolab_files_ui()
|
||||||
if (!this.response(response))
|
if (!this.response(response))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var first, rows = [],
|
var first, body, rows = [],
|
||||||
elem = $('#files-folder-list'),
|
elem = $('#files-folder-list'),
|
||||||
|
searchbox = $('#foldersearch'),
|
||||||
list = $('<ul class="treelist listing folderlist"></ul>'),
|
list = $('<ul class="treelist listing folderlist"></ul>'),
|
||||||
collections = !rcmail.env.action.match(/^(preview|show)$/) ? ['audio', 'video', 'image', 'document'] : [];
|
collections = !rcmail.env.action.match(/^(preview|show)$/) ? ['audio', 'video', 'image', 'document'] : [];
|
||||||
|
|
||||||
// try parent window if the list element does not exist
|
// try parent window if the list element does not exist
|
||||||
// i.e. called from dialog in parent window
|
// i.e. called from dialog in parent window
|
||||||
if (!elem.length && window.parent && parent.rcmail) {
|
if (!elem.length && window.parent && parent.rcmail) {
|
||||||
elem = $('#files-folder-list', window.parent.document.body);
|
body = window.parent.document.body;
|
||||||
|
elem = $('#files-folder-list', body);
|
||||||
|
searchbox = $('#foldersearch', body);
|
||||||
}
|
}
|
||||||
|
|
||||||
elem.html('').append(list);
|
elem.html('').append(list);
|
||||||
|
@ -1212,6 +1218,7 @@ function kolab_files_ui()
|
||||||
selectable: true,
|
selectable: true,
|
||||||
id_prefix: 'rcmli',
|
id_prefix: 'rcmli',
|
||||||
parent_focus: true,
|
parent_focus: true,
|
||||||
|
searchbox: searchbox,
|
||||||
id_encode: rcmail.html_identifier_encode,
|
id_encode: rcmail.html_identifier_encode,
|
||||||
id_decode: rcmail.html_identifier_decode,
|
id_decode: rcmail.html_identifier_decode,
|
||||||
check_droptarget: function(node) {
|
check_droptarget: function(node) {
|
||||||
|
@ -1248,20 +1255,22 @@ function kolab_files_ui()
|
||||||
if (rcmail.busy)
|
if (rcmail.busy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var is_collection = folder.match(/^folder-collection-/);
|
var is_collection = folder.match(/^folder-collection-(.*)$/),
|
||||||
|
collection = RegExp.$1 || null;
|
||||||
|
|
||||||
|
if (is_collection)
|
||||||
|
folder = null;
|
||||||
|
|
||||||
|
// search-reset can re-select the same folder, skip
|
||||||
|
if (this.env.folder == folder && this.env.collection == collection)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.env.folder = folder;
|
||||||
|
this.env.collection = collection;
|
||||||
|
|
||||||
rcmail.enable_command('files-list', true);
|
rcmail.enable_command('files-list', true);
|
||||||
rcmail.enable_command('files-folder-delete', 'folder-rename', 'files-upload', !is_collection);
|
rcmail.enable_command('files-folder-delete', 'folder-rename', 'files-upload', !is_collection);
|
||||||
|
rcmail.command('files-list', is_collection ? {collection: collection} : {folder: folder});
|
||||||
if (is_collection) {
|
|
||||||
this.env.folder = null;
|
|
||||||
rcmail.command('files-list', {collection: folder.replace(/^folder-collection-/, '')});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.env.folder = folder;
|
|
||||||
this.env.collection = null;
|
|
||||||
rcmail.command('files-list', {folder: folder});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.quota();
|
this.quota();
|
||||||
};
|
};
|
||||||
|
|
|
@ -91,6 +91,7 @@ $labels['arialabelquicksearchbox'] = 'Search input';
|
||||||
$labels['arialabellistoptions'] = 'Files list options';
|
$labels['arialabellistoptions'] = 'Files list options';
|
||||||
$labels['arialabelfolderoptions'] = 'Folder actions';
|
$labels['arialabelfolderoptions'] = 'Folder actions';
|
||||||
$labels['arialabelfileeditform'] = 'File editing form';
|
$labels['arialabelfileeditform'] = 'File editing form';
|
||||||
|
$labels['arialabelfilelist'] = 'List of files';
|
||||||
$labels['arialabelfoldercreateform'] = 'Folder creation form';
|
$labels['arialabelfoldercreateform'] = 'Folder creation form';
|
||||||
$labels['arialabelfoldereditform'] = 'Folder editing form';
|
$labels['arialabelfoldereditform'] = 'Folder editing form';
|
||||||
$labels['arialabelfoldermountform'] = 'External storage form';
|
$labels['arialabelfoldermountform'] = 'External storage form';
|
||||||
|
|
|
@ -106,6 +106,19 @@
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#folderlistbox .scroller {
|
||||||
|
top: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#folderlistbox .boxtitle a.iconbutton.search {
|
||||||
|
background-position: -2px -317px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: absolute;
|
||||||
|
right: 8px;
|
||||||
|
top: 8px;
|
||||||
|
width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
#files-folder-list ul li span.name {
|
#files-folder-list ul li span.name {
|
||||||
background: url(../../../../skins/larry/images/listicons.png) 6px 3px no-repeat;
|
background: url(../../../../skins/larry/images/listicons.png) 6px 3px no-repeat;
|
||||||
padding: 6px 8px 6px 32px;
|
padding: 6px 8px 6px 32px;
|
||||||
|
@ -327,7 +340,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#files-dialog #folderlistbox {
|
#files-dialog #folderlistbox {
|
||||||
top: 5px;
|
top: 35px;
|
||||||
bottom: 5px;
|
bottom: 5px;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
@ -335,8 +348,20 @@
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#files-dialog #folderlistbox .scroller {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#files-dialog .listsearchbox {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#files-dialog.saveas #folderlistbox {
|
#files-dialog.saveas #folderlistbox {
|
||||||
top: 50px;
|
bottom: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#files-compose-dialog #filelistcontainer {
|
#files-compose-dialog #filelistcontainer {
|
||||||
|
@ -374,6 +399,11 @@ a.filesaveall {
|
||||||
#file-save-as {
|
#file-save-as {
|
||||||
height: 25px;
|
height: 25px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 8px;
|
||||||
|
left: 5px;
|
||||||
|
right: 5px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#file-save-as input {
|
#file-save-as input {
|
||||||
|
|
|
@ -10,11 +10,24 @@
|
||||||
|
|
||||||
<div id="folderlistbox" class="uibox listbox" role="navigation" aria-labelledby="aria-label-folderlist">
|
<div id="folderlistbox" class="uibox listbox" role="navigation" aria-labelledby="aria-label-folderlist">
|
||||||
<h3 id="aria-label-folderlist" class="voice"><roundcube:label name="kolab_files.arialabelfolderlist" /></h3>
|
<h3 id="aria-label-folderlist" class="voice"><roundcube:label name="kolab_files.arialabelfolderlist" /></h3>
|
||||||
|
<h3 id="folderslist-header" class="boxtitle">
|
||||||
|
<roundcube:label name="folders" />
|
||||||
|
<a href="#folders" class="iconbutton search" title="<roundcube:label name='findfolders' />" tabindex="0"><roundcube:label name='findfolders' /></a>
|
||||||
|
</h3>
|
||||||
|
<div class="listsearchbox">
|
||||||
|
<div class="searchbox" role="search" aria-labelledby="aria-label-foldersearchform">
|
||||||
|
<h4 id="aria-label-foldersearchform" class="voice"><roundcube:label name="arialabelfoldersearchform" /></h4>
|
||||||
|
<label for="foldersearch" class="voice"><roundcube:label name="arialabelsearchterms" /></label>
|
||||||
|
<input type="text" name="q" id="foldersearch" placeholder="<roundcube:label name='findfolders' />" />
|
||||||
|
<a class="iconbutton searchicon"></a>
|
||||||
|
<roundcube:button command="reset-foldersearch" id="folderlistsearch-reset" class="iconbutton reset" title="resetsearch" label="resetsearch" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="files-folder-list" class="scroller"></div>
|
<div id="files-folder-list" class="scroller"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="filelistcontainer" class="boxlistcontent uibox">
|
<div id="filelistcontainer" class="boxlistcontent uibox">
|
||||||
<h3 id="aria-label-filelist" class="voice"><roundcube:label name="arialabelfilelist" /></h3>
|
<h3 id="aria-label-filelist" class="voice"><roundcube:label name="kolab_files.arialabelfilelist" /></h3>
|
||||||
<roundcube:object name="filelist" id="filelist" class="records-table filelist sortheader fixedheader" aria-labelledby="aria-label-filelist" />
|
<roundcube:object name="filelist" id="filelist" class="records-table filelist sortheader fixedheader" aria-labelledby="aria-label-filelist" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,3 +43,9 @@
|
||||||
<h3 id="aria-label-folderauthform" class="voice"><roundcube:label name="kolab_files.arialabelfolderauthform" /></h3>
|
<h3 id="aria-label-folderauthform" class="voice"><roundcube:label name="kolab_files.arialabelfolderauthform" /></h3>
|
||||||
<roundcube:object name="folder-auth-options">
|
<roundcube:object name="folder-auth-options">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
UI.folder_search_init($('#folderlistbox'));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
|
@ -33,8 +33,20 @@
|
||||||
|
|
||||||
<div id="folderlistbox" class="uibox listbox" role="navigation" aria-labelledby="aria-label-folderlist">
|
<div id="folderlistbox" class="uibox listbox" role="navigation" aria-labelledby="aria-label-folderlist">
|
||||||
<h2 id="aria-label-folderlist" class="voice"><roundcube:label name="kolab_files.arialabelfolderlist" /></h2>
|
<h2 id="aria-label-folderlist" class="voice"><roundcube:label name="kolab_files.arialabelfolderlist" /></h2>
|
||||||
<div id="files-folder-list" class="scroller withfooter">
|
<h2 id="folderslist-header" class="boxtitle">
|
||||||
|
<roundcube:label name="folders" />
|
||||||
|
<a href="#folders" class="iconbutton search" title="<roundcube:label name='findfolders' />" tabindex="0"><roundcube:label name='findfolders' /></a>
|
||||||
|
</h2>
|
||||||
|
<div class="listsearchbox">
|
||||||
|
<div class="searchbox" role="search" aria-labelledby="aria-label-foldersearchform">
|
||||||
|
<h3 id="aria-label-foldersearchform" class="voice"><roundcube:label name="arialabelfoldersearchform" /></h3>
|
||||||
|
<label for="foldersearch" class="voice"><roundcube:label name="arialabelsearchterms" /></label>
|
||||||
|
<input type="text" name="q" id="foldersearch" placeholder="<roundcube:label name='findfolders' />" />
|
||||||
|
<a class="iconbutton searchicon"></a>
|
||||||
|
<roundcube:button command="reset-foldersearch" id="folderlistsearch-reset" class="iconbutton reset" title="resetsearch" label="resetsearch" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="files-folder-list" class="scroller withfooter"></div>
|
||||||
<div id="folderlist-footer" class="boxfooter">
|
<div id="folderlist-footer" class="boxfooter">
|
||||||
<roundcube:button command="folder-create" type="link" title="kolab_files.foldercreate" class="listbutton add" classAct="listbutton add" innerClass="inner" content="+" /><roundcube:button name="folderoptions" id="folderoptionslink" type="link" title="moreactions" class="listbutton groupactions" onclick="return UI.toggle_popup('folderoptions', event)" innerClass="inner" content="⚙" aria-haspopup="true" aria-expanded="false" aria-owns="folderoptionsmenu" />
|
<roundcube:button command="folder-create" type="link" title="kolab_files.foldercreate" class="listbutton add" classAct="listbutton add" innerClass="inner" content="+" /><roundcube:button name="folderoptions" id="folderoptionslink" type="link" title="moreactions" class="listbutton groupactions" onclick="return UI.toggle_popup('folderoptions', event)" innerClass="inner" content="⚙" aria-haspopup="true" aria-expanded="false" aria-owns="folderoptionsmenu" />
|
||||||
<roundcube:if condition="env:files_quota" />
|
<roundcube:if condition="env:files_quota" />
|
||||||
|
@ -45,7 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="filelistcontainer" class="uibox droptarget">
|
<div id="filelistcontainer" class="uibox droptarget">
|
||||||
<h2 id="aria-label-filelist" class="voice"><roundcube:label name="arialabelfilelist" /></h2>
|
<h2 id="aria-label-filelist" class="voice"><roundcube:label name="kolab_files.arialabelfilelist" /></h2>
|
||||||
<div id="filelistbox" class="boxlistcontent">
|
<div id="filelistbox" class="boxlistcontent">
|
||||||
<roundcube:object name="filelist" id="filelist" class="records-table filelist sortheader fixedheader" optionsmenuIcon="true" aria-labelledby="aria-label-filelist" />
|
<roundcube:object name="filelist" id="filelist" class="records-table filelist sortheader fixedheader" optionsmenuIcon="true" aria-labelledby="aria-label-filelist" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
<div id="files-dialog" class="uidialog" data-editable="true" role="dialog" aria-labelledby="aria-label-filesavedialog" aria-hidden="true">
|
<div id="files-dialog" class="uidialog" data-editable="true" role="dialog" aria-labelledby="aria-label-filesavedialog" aria-hidden="true">
|
||||||
<h3 id="aria-label-filesavedialog" class="voice"><roundcube:label name="kolab_files.arialabelfilesavedialog" /></h3>
|
<h3 id="aria-label-filesavedialog" class="voice"><roundcube:label name="kolab_files.arialabelfilesavedialog" /></h3>
|
||||||
<div id="file-save-as">
|
<div class="listsearchbox">
|
||||||
<label for="file-save-as-input"><roundcube:label name="kolab_files.saveas" /></label>
|
<div class="searchbox" role="search" aria-labelledby="aria-label-foldersearchform">
|
||||||
<input id="file-save-as-input" type="text" value="">
|
<h4 id="aria-label-foldersearchform" class="voice"><roundcube:label name="arialabelfoldersearchform" /></h4>
|
||||||
|
<label for="foldersearch" class="voice"><roundcube:label name="arialabelsearchterms" /></label>
|
||||||
|
<input type="text" name="q" id="foldersearch" placeholder="<roundcube:label name='findfolders' />" />
|
||||||
|
<a class="iconbutton searchicon"></a>
|
||||||
|
<roundcube:button command="reset-foldersearch" id="folderlistsearch-reset" class="iconbutton reset" title="resetsearch" label="resetsearch" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="folderlistbox" class="uibox listbox" role="navigation" aria-labelledby="aria-label-folderlist">
|
<div id="folderlistbox" class="uibox listbox" role="navigation" aria-labelledby="aria-label-folderlist">
|
||||||
<h3 id="aria-label-folderlist" class="voice"><roundcube:label name="kolab_files.arialabelfolderlist" /></h3>
|
<h3 id="aria-label-folderlist" class="voice"><roundcube:label name="kolab_files.arialabelfolderlist" /></h3>
|
||||||
|
@ -11,6 +16,10 @@
|
||||||
<roundcube:button command="folder-create" name="foldercreatelink" id="foldercreatelink" type="link" title="createfolder" class="listbutton add" classAct="listbutton add" innerClass="inner" content="+" />
|
<roundcube:button command="folder-create" name="foldercreatelink" id="foldercreatelink" type="link" title="createfolder" class="listbutton add" classAct="listbutton add" innerClass="inner" content="+" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="file-save-as">
|
||||||
|
<label for="file-save-as-input"><roundcube:label name="kolab_files.saveas" /></label>
|
||||||
|
<input id="file-save-as-input" type="text" value="">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="files-folder-create-dialog" role="dialog" aria-labelledby="aria-label-foldercreateform" aria-hidden="true">
|
<div id="files-folder-create-dialog" role="dialog" aria-labelledby="aria-label-foldercreateform" aria-hidden="true">
|
||||||
|
|
|
@ -26,6 +26,8 @@ function kolab_files_ui_init()
|
||||||
if (menu.length) {
|
if (menu.length) {
|
||||||
rcmail.gui_object('file_searchmenu', 'filesearchmenu');
|
rcmail.gui_object('file_searchmenu', 'filesearchmenu');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UI.folder_search_init($('#folderlistbox'));
|
||||||
});
|
});
|
||||||
|
|
||||||
kolab_files_upload_input('#filestoolbar a.upload');
|
kolab_files_upload_input('#filestoolbar a.upload');
|
||||||
|
|
Loading…
Add table
Reference in a new issue