From 3cce485fc8aad0ac75cf7da69ac32c96d6018fd8 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 5 Apr 2019 09:23:43 +0200 Subject: use webpack to compile handlebars for files_versions This removes the need to manually compile the templates every time they are changed Signed-off-by: Robin Appelman --- apps/files_versions/src/files_versions.js | 1 - apps/files_versions/src/templates.js | 56 ------------------------------ apps/files_versions/src/versionstabview.js | 7 ++-- 3 files changed, 5 insertions(+), 59 deletions(-) delete mode 100644 apps/files_versions/src/templates.js (limited to 'apps/files_versions/src') diff --git a/apps/files_versions/src/files_versions.js b/apps/files_versions/src/files_versions.js index e9504e03ed7..dfbb9ca0bf8 100644 --- a/apps/files_versions/src/files_versions.js +++ b/apps/files_versions/src/files_versions.js @@ -1,5 +1,4 @@ import './versionmodel' -import './templates' import './versioncollection' import './versionstabview' import './filesplugin' diff --git a/apps/files_versions/src/templates.js b/apps/files_versions/src/templates.js deleted file mode 100644 index cf2c236daca..00000000000 --- a/apps/files_versions/src/templates.js +++ /dev/null @@ -1,56 +0,0 @@ -(function() { - var template = Handlebars.template, templates = OCA.Versions.Templates = OCA.Versions.Templates || {}; -templates['item'] = template({"1":function(container,depth0,helpers,partials,data) { - var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
\n " - + alias4(((helper = (helper = helpers.humanReadableSize || (depth0 != null ? depth0.humanReadableSize : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"humanReadableSize","hash":{},"data":data}) : helper))) - + "\n
\n"; -},"3":function(container,depth0,helpers,partials,data) { - var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return " \n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=helpers.blockHelperMissing, buffer = - "
  • \n
    \n
    \n \n
    \n
    \n \n"; - stack1 = ((helper = (helper = helpers.hasDetails || (depth0 != null ? depth0.hasDetails : depth0)) != null ? helper : alias2),(options={"name":"hasDetails","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper)); - if (!helpers.hasDetails) { stack1 = alias5.call(depth0,stack1,options)} - if (stack1 != null) { buffer += stack1; } - buffer += "
    \n"; - stack1 = ((helper = (helper = helpers.canRevert || (depth0 != null ? depth0.canRevert : depth0)) != null ? helper : alias2),(options={"name":"canRevert","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data}),(typeof helper === alias3 ? helper.call(alias1,options) : helper)); - if (!helpers.canRevert) { stack1 = alias5.call(depth0,stack1,options)} - if (stack1 != null) { buffer += stack1; } - return buffer + "
    \n
  • \n"; -},"useData":true}); -templates['template'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "\n
    \n
    \n
    \n
    \n

    " - + alias4(((helper = (helper = helpers.emptyResultLabel || (depth0 != null ? depth0.emptyResultLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"emptyResultLabel","hash":{},"data":data}) : helper))) - + "

    \n
    \n
    \n\n
    \n"; -},"useData":true}); -})(); \ No newline at end of file diff --git a/apps/files_versions/src/versionstabview.js b/apps/files_versions/src/versionstabview.js index 12b493beec0..464ae549218 100644 --- a/apps/files_versions/src/versionstabview.js +++ b/apps/files_versions/src/versionstabview.js @@ -8,6 +8,9 @@ * */ +import ItemTemplate from './templates/item.handlebars'; +import Template from './templates/template.handlebars'; + (function() { /** * @memberof OCA.Versions @@ -128,11 +131,11 @@ }, template: function(data) { - return OCA.Versions.Templates['template'](data); + return Template(data); }, itemTemplate: function(data) { - return OCA.Versions.Templates['item'](data); + return ItemTemplate(data); }, setFileInfo: function(fileInfo) { -- cgit v1.2.3