mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-22 20:12:04 -06:00
[IMP] simplify code
This commit is contained in:
parent
5b02ff9aa8
commit
e92e6e79c0
@ -28,10 +28,10 @@ openerp.attachment_preview = function(instance)
|
|||||||
{
|
{
|
||||||
var url = (window.location.origin || '') +
|
var url = (window.location.origin || '') +
|
||||||
'/attachment_preview/static/lib/ViewerJS/index.html' +
|
'/attachment_preview/static/lib/ViewerJS/index.html' +
|
||||||
'&type=' + encodeURIComponent(attachment_extension) +
|
'?type=' + encodeURIComponent(attachment_extension) +
|
||||||
'#' +
|
|
||||||
attachment_url.replace(window.location.origin, '') +
|
|
||||||
'&title=' + encodeURIComponent(attachment_title) +
|
'&title=' + encodeURIComponent(attachment_title) +
|
||||||
|
'#' +
|
||||||
|
attachment_url.replace(window.location.origin, '')
|
||||||
window.open(url);
|
window.open(url);
|
||||||
};
|
};
|
||||||
openerp.attachment_preview.can_preview = function(extension)
|
openerp.attachment_preview.can_preview = function(extension)
|
||||||
|
@ -28,10 +28,5 @@ Viewer = function(plugin, parameters)
|
|||||||
{
|
{
|
||||||
alert('Unsupported file type');
|
alert('Unsupported file type');
|
||||||
}
|
}
|
||||||
var matches = (/&title=([^&]+)&/).exec(window.location.hash);
|
|
||||||
if(matches && matches.length > 1)
|
|
||||||
{
|
|
||||||
parameters.title = decodeURIComponent(matches[1]);
|
|
||||||
}
|
|
||||||
return original_Viewer(plugin, parameters);
|
return original_Viewer(plugin, parameters);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user