mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-17 20:11:23 +02:00
Add new preference to control default action of editing a document (open with:Collabora|CollabEditor|Download)
This commit is contained in:
@@ -1525,7 +1525,7 @@ var et2_link_string = (function(){ "use strict"; return expose(et2_valueWidget.e
|
||||
.appendTo(this.list)
|
||||
.addClass("et2_link loading")
|
||||
.click( function(e){
|
||||
var fe = egw_get_file_editor_prefered_mimes();
|
||||
var fe = egw_get_file_editor_prefered_mimes(_link_data.type);
|
||||
if (self.options.expose_view && typeof _link_data.type !='undefined'
|
||||
&& _link_data.type.match(self.mime_regexp,'ig'))
|
||||
{
|
||||
@@ -1916,7 +1916,7 @@ var et2_link_list = (function(){ "use strict"; return et2_link_string.extend(
|
||||
if (_link_data && (typeof _link_data.download_url != 'undefined' || _link_data.app !='egw-data'))
|
||||
{
|
||||
$td.click( function(){
|
||||
var fe_mime = egw_get_file_editor_prefered_mimes();
|
||||
var fe_mime = egw_get_file_editor_prefered_mimes(_link_data.type);
|
||||
// Check if the link entry is mime with media type, in order to open it in expose view
|
||||
if (typeof _link_data.type != 'undefined' &&
|
||||
(_link_data.type.match(self.mime_regexp,'ig') || (fe_mime && fe_mime.mime[_link_data.type])))
|
||||
|
@@ -758,10 +758,20 @@ function addOption(id,label,value,do_onchange)
|
||||
if (selectBox.onchange && do_onchange) selectBox.onchange();
|
||||
}
|
||||
|
||||
function egw_get_file_editor_prefered_mimes(_data, _params)
|
||||
/**
|
||||
*
|
||||
* @param {string} _mime current mime type
|
||||
* @returns {object|null} returns object of filemanager editor hook
|
||||
*/
|
||||
function egw_get_file_editor_prefered_mimes(_mime)
|
||||
{
|
||||
var fe = jQuery.extend(true, {},egw.link_get_registry('filemanager-editor'));
|
||||
var ex_mimes = egw.preference('collab_excluded_mimes', 'filemanager');
|
||||
var dblclick_action = egw.preference('document_doubleclick_action', 'filemanager');
|
||||
if (dblclick_action == 'download' && typeof _mime === 'string')
|
||||
{
|
||||
ex_mimes = !ex_mimes ? _mime : ex_mimes+','+_mime;
|
||||
}
|
||||
if (fe && fe.mime && ex_mimes)
|
||||
{
|
||||
ex_mimes = ex_mimes.split(',');
|
||||
@@ -818,3 +828,6 @@ jQuery(function(){
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('head').append('<link rel="manifest" href="/egroupware/pixelegg/manifest.json">');
|
||||
})
|
Reference in New Issue
Block a user