From 8cda85ad758d036a51303257fb56e1dd01f0803b Mon Sep 17 00:00:00 2001 From: Mathias Markl Date: Mon, 24 Jul 2017 13:53:31 +0200 Subject: [PATCH] Update Version --- muk_web_preview/__manifest__.py | 2 +- .../static/src/js/preview_generator.js | 36 +- .../static/src/js/preview_handler.js | 43 +- .../static/src/less/preview_content.less | 107 + muk_web_preview_attachment/__manifest__.py | 12 +- muk_web_preview_audio/__manifest__.py | 2 +- .../static/src/js/preview_generator.js | 31 +- .../static/src/js/preview_handler.js | 61 + muk_web_preview_audio/template/assets.xml | 1 + muk_web_preview_csv/LICENSE | 619 + muk_web_preview_csv/README.md | 5 + muk_web_preview_csv/__init__.py | 20 + muk_web_preview_csv/__manifest__.py | 59 + .../static/description/banner.png | Bin 0 -> 42066 bytes .../static/description/icon.png | Bin 0 -> 9596 bytes .../static/description/index.html | 38 + .../static/description/logo.png | Bin 0 -> 38064 bytes .../static/description/screenshot.png | Bin 0 -> 51339 bytes .../static/lib/PapaParse/papaparse.js | 1569 + .../static/lib/handsontable/handsontable.css | 1491 + .../static/lib/handsontable/handsontable.js | 55988 ++++++++++++++++ .../static/src/js/preview_generator.js | 40 + .../static/src/js/preview_handler.js | 66 + .../static/src/less/preview_content.less | 33 + .../static/src/xml/preview_content.xml | 33 + muk_web_preview_csv/template/assets.xml | 33 + .../static/src/js/preview_generator.js | 29 +- .../static/src/js/preview_handler.js | 59 + muk_web_preview_image/template/assets.xml | 1 + muk_web_preview_mail/__manifest__.py | 2 +- muk_web_preview_mail/controllers/main.py | 13 +- .../static/src/js/preview_generator.js | 100 +- .../static/src/js/preview_handler.js | 131 + .../static/src/less/preview_content.less | 112 +- .../static/src/xml/preview_content.xml | 2 +- muk_web_preview_mail/template/assets.xml | 1 + muk_web_preview_msoffice/LICENSE | 619 + muk_web_preview_msoffice/README.md | 7 + muk_web_preview_msoffice/__init__.py | 22 + muk_web_preview_msoffice/__manifest__.py | 65 + .../controllers/__init__.py | 22 + muk_web_preview_msoffice/controllers/main.py | 127 + .../static/description/banner.png | Bin 0 -> 107974 bytes .../static/description/icon.png | Bin 0 -> 24502 bytes .../static/description/index.html | 41 + .../static/description/logo.png | Bin 0 -> 38064 bytes .../static/description/screenshot.png | Bin 0 -> 40851 bytes .../static/lib/SheetJS/xlsx.js | 19 + .../static/lib/handsontable/handsontable.css | 1491 + .../static/lib/handsontable/handsontable.js | 55988 ++++++++++++++++ .../jquery-binarytransport.js | 52 + .../static/src/js/preview_generator.js | 40 + .../static/src/js/preview_handler.js | 108 + .../static/src/less/preview_content.less | 107 + .../static/src/xml/preview_content.xml | 38 + muk_web_preview_msoffice/template/assets.xml | 34 + muk_web_preview_text/__manifest__.py | 2 +- .../static/src/js/preview_generator.js | 81 +- .../static/src/js/preview_handler.js | 111 + .../static/src/less/preview_content.less | 108 - .../static/src/xml/preview_content.xml | 2 +- muk_web_preview_text/template/assets.xml | 1 + muk_web_preview_vector/__manifest__.py | 2 +- .../static/lib/svg-pan-zoom/svg-pan-zoom.js | 2375 +- .../static/src/js/preview_generator.js | 37 +- .../static/src/js/preview_handler.js | 81 + .../static/src/less/preview_content.less | 120 +- .../static/src/xml/preview_content.xml | 20 +- muk_web_preview_vector/template/assets.xml | 1 + muk_web_preview_video/.gitignore | 52 - muk_web_preview_video/__manifest__.py | 2 +- .../static/src/js/preview_generator.js | 30 +- .../static/src/js/preview_handler.js | 60 + muk_web_preview_video/template/assets.xml | 1 + 74 files changed, 120058 insertions(+), 2547 deletions(-) create mode 100644 muk_web_preview_audio/static/src/js/preview_handler.js create mode 100644 muk_web_preview_csv/LICENSE create mode 100644 muk_web_preview_csv/README.md create mode 100644 muk_web_preview_csv/__init__.py create mode 100644 muk_web_preview_csv/__manifest__.py create mode 100644 muk_web_preview_csv/static/description/banner.png create mode 100644 muk_web_preview_csv/static/description/icon.png create mode 100644 muk_web_preview_csv/static/description/index.html create mode 100644 muk_web_preview_csv/static/description/logo.png create mode 100644 muk_web_preview_csv/static/description/screenshot.png create mode 100644 muk_web_preview_csv/static/lib/PapaParse/papaparse.js create mode 100644 muk_web_preview_csv/static/lib/handsontable/handsontable.css create mode 100644 muk_web_preview_csv/static/lib/handsontable/handsontable.js create mode 100644 muk_web_preview_csv/static/src/js/preview_generator.js create mode 100644 muk_web_preview_csv/static/src/js/preview_handler.js create mode 100644 muk_web_preview_csv/static/src/less/preview_content.less create mode 100644 muk_web_preview_csv/static/src/xml/preview_content.xml create mode 100644 muk_web_preview_csv/template/assets.xml create mode 100644 muk_web_preview_image/static/src/js/preview_handler.js create mode 100644 muk_web_preview_mail/static/src/js/preview_handler.js create mode 100644 muk_web_preview_msoffice/LICENSE create mode 100644 muk_web_preview_msoffice/README.md create mode 100644 muk_web_preview_msoffice/__init__.py create mode 100644 muk_web_preview_msoffice/__manifest__.py create mode 100644 muk_web_preview_msoffice/controllers/__init__.py create mode 100644 muk_web_preview_msoffice/controllers/main.py create mode 100644 muk_web_preview_msoffice/static/description/banner.png create mode 100644 muk_web_preview_msoffice/static/description/icon.png create mode 100644 muk_web_preview_msoffice/static/description/index.html create mode 100644 muk_web_preview_msoffice/static/description/logo.png create mode 100644 muk_web_preview_msoffice/static/description/screenshot.png create mode 100644 muk_web_preview_msoffice/static/lib/SheetJS/xlsx.js create mode 100644 muk_web_preview_msoffice/static/lib/handsontable/handsontable.css create mode 100644 muk_web_preview_msoffice/static/lib/handsontable/handsontable.js create mode 100644 muk_web_preview_msoffice/static/lib/jQueryBinaryTransport/jquery-binarytransport.js create mode 100644 muk_web_preview_msoffice/static/src/js/preview_generator.js create mode 100644 muk_web_preview_msoffice/static/src/js/preview_handler.js create mode 100644 muk_web_preview_msoffice/static/src/less/preview_content.less create mode 100644 muk_web_preview_msoffice/static/src/xml/preview_content.xml create mode 100644 muk_web_preview_msoffice/template/assets.xml create mode 100644 muk_web_preview_text/static/src/js/preview_handler.js create mode 100644 muk_web_preview_vector/static/src/js/preview_handler.js delete mode 100644 muk_web_preview_video/.gitignore create mode 100644 muk_web_preview_video/static/src/js/preview_handler.js diff --git a/muk_web_preview/__manifest__.py b/muk_web_preview/__manifest__.py index 206587a..1e13dfd 100644 --- a/muk_web_preview/__manifest__.py +++ b/muk_web_preview/__manifest__.py @@ -29,7 +29,7 @@ - Portable Document Format (.pdf) - Open Document (.odt, .odp, .ods, .otp) """, - "version": "10.0.1.0.1", + "version": "10.0.1.0.2", "category": "Extra Tools", "license": "AGPL-3", "website": "http://www.mukit.at", diff --git a/muk_web_preview/static/src/js/preview_generator.js b/muk_web_preview/static/src/js/preview_generator.js index 2b4b944..a56375e 100644 --- a/muk_web_preview/static/src/js/preview_generator.js +++ b/muk_web_preview/static/src/js/preview_generator.js @@ -27,45 +27,13 @@ var PreviewHandler = require('muk_preview.PreviewHandler'); var QWeb = core.qweb; var _t = core._t; -var PDFHandler = PreviewHandler.extend({ - checkExtension: function(extension) { - return ['.pdf', 'pdf'].includes(extension); - }, - checkType: function(mimetype) { - return ['application/pdf'].includes(mimetype); - }, - createHtml: function(url, mimetype, extension, title) { - var result = $.Deferred(); - var viewerUrlTempalte = _.template('/muk_web_preview/static/lib/ViewerJS/index.html#<%= url %>'); - result.resolve($(QWeb.render('ViewerJSFrame', {url: viewerUrlTempalte({url})}))); - return $.when(result); - }, -}); - -var OpenOfficeHandler = PreviewHandler.extend({ - checkExtension: function(extension) { - return ['.odt', '.odp', '.ods', '.fodt', '.ott', '.fodp', '.otp', '.fods', '.ots', - 'odt', 'odp', 'ods', 'fodt', 'ott', 'fodp', 'otp', 'fods', 'ots'].includes(extension); - }, - checkType: function(mimetype) { - return ['application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.presentation', - 'application/vnd.oasis.opendocument.spreadsheet'].includes(mimetype); - }, - createHtml: function(url, mimetype, extension, title) { - var result = $.Deferred(); - var viewerUrlTempalte = _.template('/muk_web_preview/static/lib/ViewerJS/index.html#<%= url %>'); - result.resolve($(QWeb.render('ViewerJSFrame', {url: viewerUrlTempalte({url})}))); - return $.when(result); - }, -}); - var PreviewGenerator = core.Class.extend({ handler: {}, init: function(widget, additional_handler) { this.widget = widget; this.handler = _.extend(this.handler, { - "PDFHandler": new PDFHandler(widget), - "OpenOfficeHandler": new OpenOfficeHandler(widget) + "PDFHandler": new PreviewHandler.PDFHandler(widget), + "OpenOfficeHandler": new PreviewHandler.OpenOfficeHandler(widget) }); this.handler = _.extend(this.handler, additional_handler); }, diff --git a/muk_web_preview/static/src/js/preview_handler.js b/muk_web_preview/static/src/js/preview_handler.js index c6d0d0f..05af3c8 100644 --- a/muk_web_preview/static/src/js/preview_handler.js +++ b/muk_web_preview/static/src/js/preview_handler.js @@ -22,7 +22,10 @@ odoo.define('muk_preview.PreviewHandler', function (require) { var core = require('web.core'); -var Handler = core.Class.extend({ +var QWeb = core.qweb; +var _t = core._t; + +var BaseHandler = core.Class.extend({ init: function(widget) { this.widget = widget; }, @@ -37,6 +40,42 @@ var Handler = core.Class.extend({ }, }); -return Handler; +var PDFHandler = BaseHandler.extend({ + checkExtension: function(extension) { + return ['.pdf', 'pdf'].includes(extension); + }, + checkType: function(mimetype) { + return ['application/pdf'].includes(mimetype); + }, + createHtml: function(url, mimetype, extension, title) { + var result = $.Deferred(); + var viewerUrlTempalte = _.template('/muk_web_preview/static/lib/ViewerJS/index.html#<%= url %>'); + result.resolve($(QWeb.render('ViewerJSFrame', {url: viewerUrlTempalte({url})}))); + return $.when(result); + }, +}); + +var OpenOfficeHandler = BaseHandler.extend({ + checkExtension: function(extension) { + return ['.odt', '.odp', '.ods', '.fodt', '.ott', '.fodp', '.otp', '.fods', '.ots', + 'odt', 'odp', 'ods', 'fodt', 'ott', 'fodp', 'otp', 'fods', 'ots'].includes(extension); + }, + checkType: function(mimetype) { + return ['application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.presentation', + 'application/vnd.oasis.opendocument.spreadsheet'].includes(mimetype); + }, + createHtml: function(url, mimetype, extension, title) { + var result = $.Deferred(); + var viewerUrlTempalte = _.template('/muk_web_preview/static/lib/ViewerJS/index.html#<%= url %>'); + result.resolve($(QWeb.render('ViewerJSFrame', {url: viewerUrlTempalte({url})}))); + return $.when(result); + }, +}); + +return { + BaseHandler: BaseHandler, + PDFHandler: PDFHandler, + OpenOfficeHandler: OpenOfficeHandler, +} }); \ No newline at end of file diff --git a/muk_web_preview/static/src/less/preview_content.less b/muk_web_preview/static/src/less/preview_content.less index f6577b1..d3cadf7 100644 --- a/muk_web_preview/static/src/less/preview_content.less +++ b/muk_web_preview/static/src/less/preview_content.less @@ -56,3 +56,110 @@ } } +/* Based on a CodePen Snippet by Dave McCarthy */ +.loader { + height: 20px; + width: 250px; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + + .loader--dot { + animation-name: loader; + animation-timing-function: ease-in-out; + animation-duration: 3s; + animation-iteration-count: infinite; + height: 20px; + width: 20px; + border-radius: 100%; + background-color: black; + position: absolute; + border: 2px solid white; + } + + .loader--dot:first-child { + background-color: #8cc759; + animation-delay: 0.5s; + } + + .loader--dot:nth-child(2) { + background-color: #8c6daf; + animation-delay: 0.4s; + } + + .loader--dot:nth-child(3) { + background-color: #ef5d74; + animation-delay: 0.3s; + } + + .loader--dot:nth-child(4) { + background-color: #f9a74b; + animation-delay: 0.2s; + } + + .loader--dot:nth-child(5) { + background-color: #60beeb; + animation-delay: 0.1s; + } + + .loader--dot:nth-child(6) { + background-color: #fbef5a; + animation-delay: 0s; + } + + .loader--text { + position: absolute; + top: 200%; + left: 0; + right: 0; + width: 4rem; + margin: auto; + } + + .loader--text:after { + content: "Loading"; + font-weight: bold; + animation-name: loading-text; + animation-duration: 3s; + animation-iteration-count: infinite; + } + + @keyframes loader { + 15% { + transform: translateX(0); + } + + 45% { + transform: translateX(230px); + } + + 65% { + transform: translateX(230px); + } + + 95% { + transform: translateX(0); + } + } + + @keyframes loading-text { + 0% { + content: "Loading"; + } + + 25% { + content: "Loading."; + } + + 50% { + content: "Loading.."; + } + + 75% { + content: "Loading..."; + } + } +} diff --git a/muk_web_preview_attachment/__manifest__.py b/muk_web_preview_attachment/__manifest__.py index a3c477f..6d07240 100644 --- a/muk_web_preview_attachment/__manifest__.py +++ b/muk_web_preview_attachment/__manifest__.py @@ -26,7 +26,7 @@ Adds a button to the Attachment Sidebar to preview the content directly in the browser.. """, - "version": "10.0.1.0.0", + "version": "10.0.1.0.1", "category": "Extra Tools", "license": "AGPL-3", "website": "http://www.mukit.at", @@ -36,6 +36,14 @@ ], "depends": [ "muk_web_preview", + "muk_web_preview_audio", + "muk_web_preview_csv", + "muk_web_preview_image", + "muk_web_preview_mail", + "muk_web_preview_msoffice", + "muk_web_preview_text", + "muk_web_preview_vector", + "muk_web_preview_video", ], "data": [ "template/assets.xml", @@ -55,4 +63,4 @@ "application": False, "installable": True, -} +} \ No newline at end of file diff --git a/muk_web_preview_audio/__manifest__.py b/muk_web_preview_audio/__manifest__.py index dfb2b63..4734cbc 100644 --- a/muk_web_preview_audio/__manifest__.py +++ b/muk_web_preview_audio/__manifest__.py @@ -29,7 +29,7 @@ - Ogg Theora Vorbis (*.ogg, audio/ogg) - MP3 (*.mp3, audio/mpeg) """, - "version": "10.0.1.0.1", + "version": "10.0.1.0.2", "category": "Extra Tools", "license": "AGPL-3", "website": "http://www.mukit.at", diff --git a/muk_web_preview_audio/static/src/js/preview_generator.js b/muk_web_preview_audio/static/src/js/preview_generator.js index d9bdba1..f0c9a4b 100644 --- a/muk_web_preview_audio/static/src/js/preview_generator.js +++ b/muk_web_preview_audio/static/src/js/preview_generator.js @@ -22,44 +22,17 @@ odoo.define('muk_preview_audio.PreviewGenerator', function (require) { var core = require('web.core'); -var PreviewHandler = require('muk_preview.PreviewHandler'); var PreviewGenerator = require('muk_preview.PreviewGenerator'); +var PreviewHandler = require('muk_preview_audio.PreviewHandler'); var QWeb = core.qweb; var _t = core._t; -var AudioHandler = PreviewHandler.extend({ - mimetypeMap: { - '.wav': 'audio/wav', - '.ogg': 'audio/ogg', - '.mp3': 'audio/mpeg', - 'wav': 'audio/wav', - 'ogg': 'audio/ogg', - 'mp3': 'audio/mpeg', - }, - checkExtension: function(extension) { - return ['.wav', '.ogg', '.mp3', 'wav', 'ogg', 'mp3'].includes(extension); - }, - checkType: function(mimetype) { - return ['audio/wav', ' audio/ogg', 'audio/mpeg'].includes(mimetype); - }, - createHtml: function(url, mimetype, extension, title) { - var result = $.Deferred(); - if(!mimetype || mimetype === 'application/octet-stream') { - mimetype = this.mimetypeMap[extension]; - } - var $content = $(QWeb.render('AudioHTMLContent', {url: url, type: mimetype, title: title})); - var visualizer = new Visualizer($content.find('audio'), $content.find('.visualizer'), $content.find('canvas')); - result.resolve($content); - return $.when(result); - }, -}); - PreviewGenerator.include({ init: function(widget, additional_handler) { this._super(widget, additional_handler); this.handler = _.extend(this.handler, { - "AudioHandler": new AudioHandler(widget), + "AudioHandler": new PreviewHandler.AudioHandler(widget), }); }, }); diff --git a/muk_web_preview_audio/static/src/js/preview_handler.js b/muk_web_preview_audio/static/src/js/preview_handler.js new file mode 100644 index 0000000..bf98de2 --- /dev/null +++ b/muk_web_preview_audio/static/src/js/preview_handler.js @@ -0,0 +1,61 @@ +/********************************************************************************** +* +* Copyright (C) 2017 MuK IT GmbH +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as +* published by the Free Software Foundation, either version 3 of the +* License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see . +* +**********************************************************************************/ + +odoo.define('muk_preview_audio.PreviewHandler', function (require) { +"use strict"; + +var core = require('web.core'); + +var PreviewHandler = require('muk_preview.PreviewHandler'); + +var QWeb = core.qweb; +var _t = core._t; + +var AudioHandler = PreviewHandler.BaseHandler.extend({ + mimetypeMap: { + '.wav': 'audio/wav', + '.ogg': 'audio/ogg', + '.mp3': 'audio/mpeg', + 'wav': 'audio/wav', + 'ogg': 'audio/ogg', + 'mp3': 'audio/mpeg', + }, + checkExtension: function(extension) { + return ['.wav', '.ogg', '.mp3', 'wav', 'ogg', 'mp3'].includes(extension); + }, + checkType: function(mimetype) { + return ['audio/wav', ' audio/ogg', 'audio/mpeg'].includes(mimetype); + }, + createHtml: function(url, mimetype, extension, title) { + var result = $.Deferred(); + if(!mimetype || mimetype === 'application/octet-stream') { + mimetype = this.mimetypeMap[extension]; + } + var $content = $(QWeb.render('AudioHTMLContent', {url: url, type: mimetype, title: title})); + var visualizer = new Visualizer($content.find('audio'), $content.find('.visualizer'), $content.find('canvas')); + result.resolve($content); + return $.when(result); + }, +}); + +return { + AudioHandler: AudioHandler, +} + +}); \ No newline at end of file diff --git a/muk_web_preview_audio/template/assets.xml b/muk_web_preview_audio/template/assets.xml index fc691be..8014ad0 100644 --- a/muk_web_preview_audio/template/assets.xml +++ b/muk_web_preview_audio/template/assets.xml @@ -23,6 +23,7 @@