diff --git a/apps/files_external/.l10nignore b/apps/files_external/.l10nignore new file mode 100644 index 0000000000..3179ed23dd --- /dev/null +++ b/apps/files_external/.l10nignore @@ -0,0 +1,2 @@ +# compiled handlebar templates +js/templates.js diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index b871fe2f74..2d49528152 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -10,58 +10,6 @@ (function(){ -// TODO: move to a separate file -var MOUNT_OPTIONS_DROPDOWN_TEMPLATE = - '
'; - /** * Returns the selection of applicable users in the given configuration row * @@ -514,14 +462,16 @@ MountOptionsDropdown.prototype = { MountOptionsDropdown._last.hide(); } - var template = MountOptionsDropdown._template; - if (!template) { - template = Handlebars.compile(MOUNT_OPTIONS_DROPDOWN_TEMPLATE); - MountOptionsDropdown._template = template; - } - - var $el = $(template({ - mountOptionsEncodingLabel: t('files_external', 'Compatibility with Mac NFD encoding (slow)') + var $el = $(OCA.External.Templates.mountOptionsDropDown({ + mountOptionsEncodingLabel: t('files_external', 'Compatibility with Mac NFD encoding (slow)'), + mountOptionsEncryptLabel: t('files_external', 'Enable encryption'), + mountOptionsPreviewsLabel: t('files_external', 'Enable previews'), + mountOptionsSharingLabel: t('files_external', 'Enable sharing'), + mountOptionsFilesystemCheckLabel: t('files_external', 'Check for changes'), + mountOptionsFilesystemCheckOnce: t('files_external', 'Never'), + mountOptionsFilesystemCheckDA: t('files_external', 'Once every direct access'), + mountOptionsReadOnlyLabel: t('files_external', 'Read only'), + deleteLabel: t('files_external', 'Delete') })); this.$el = $el; diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js index a65988353a..b8b5e1a936 100644 --- a/apps/files_external/js/statusmanager.js +++ b/apps/files_external/js/statusmanager.js @@ -392,8 +392,7 @@ OCA.External.StatusManager = { * @param mountData */ showCredentialsDialog: function (mountPoint, mountData) { - var template = Handlebars.compile(OCA.External.StatusManager.credentialsDialogTemplate); - var dialog = $(template({ + var dialog = $(OCA.External.Templates.credentialsDialog({ credentials_text: t('files_external', 'Please enter the credentials for the {mount} mount', { 'mount': mountPoint }), diff --git a/apps/files_external/js/templates.js b/apps/files_external/js/templates.js new file mode 100644 index 0000000000..067b3f5f5d --- /dev/null +++ b/apps/files_external/js/templates.js @@ -0,0 +1,37 @@ +(function() { + var template = Handlebars.template, templates = OCA.External.Templates = OCA.External.Templates || {}; +templates['credentialsDialog'] = 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 "