Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-10-28 23:05:47 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2018-12-20 09:38:45 +0300
commit22e9cd758120ea570e5d9793a3906975e8376d51 (patch)
tree140195d520e8f776cd260d243896255311a339b8
parente4abb156516f4a7f956352ae344e45efd7cd6f14 (diff)
Use empty template
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--js/viewer/viewer.js4
-rw-r--r--lib/TemplateManager.php10
-rw-r--r--templates/templatePicker.html7
3 files changed, 5 insertions, 16 deletions
diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js
index 8fdad39f..22e6af6a 100644
--- a/js/viewer/viewer.js
+++ b/js/viewer/viewer.js
@@ -285,12 +285,8 @@ var odfViewer = {
var $dlg = $tmpl.octemplate({
dialog_name: 'template-picker',
dialog_title: t('richdocuments','Select template'),
- default_name: t('richdocuments','Empty file')
});
- $dlg[0].querySelector('.default').onclick = function() {
- $dlg[0].dataset.templateId = undefined;
- };
// create templates list
var templates = _.values(data)
templates.forEach(function(template) {
diff --git a/lib/TemplateManager.php b/lib/TemplateManager.php
index 87150a7a..d97af4f9 100644
--- a/lib/TemplateManager.php
+++ b/lib/TemplateManager.php
@@ -169,13 +169,13 @@ class TemplateManager {
* @param File[] $templates
* @return File[]
*/
- private function filterTemplates($templates, $type) {
+ private function filterTemplates($templates, $type = null) {
return array_filter($templates, function (Node $templateFile) use ($type) {
if (!($templateFile instanceof File)) {
return false;
}
- if (!in_array($templateFile->getMimeType(), self::$tplTypes[$type])) {
+ if ($type !== null && !in_array($templateFile->getMimeType(), self::$tplTypes[$type])) {
return false;
}
@@ -185,7 +185,7 @@ class TemplateManager {
});
}
- private function getEmpty($type) {
+ private function getEmpty($type = null) {
$folder = $this->getEmptyTemplateDir();
$templateFiles = $folder->getDirectoryListing();
@@ -213,7 +213,7 @@ class TemplateManager {
*
* @return File[]
*/
- public function getSystem($type) {
+ public function getSystem($type = null) {
$folder = $this->getSystemTemplateDir();
$templateFiles = $folder->getDirectoryListing();
@@ -243,7 +243,7 @@ class TemplateManager {
*
* @return File[]
*/
- public function getUser($type) {
+ public function getUser($type = null) {
try {
$templateDir = $this->getUserTemplateDir();
$templateFiles = $templateDir->getDirectoryListing();
diff --git a/templates/templatePicker.html b/templates/templatePicker.html
index 74c1b8be..492e77bc 100644
--- a/templates/templatePicker.html
+++ b/templates/templatePicker.html
@@ -6,12 +6,5 @@
<h2></h2>
</span>
</a>
- <a class="default" href="#">
- <span>
- <span class="icon-add-white"></span>
- <h2>{default_name}</h2>
- </span>
- </a>
</div>
</div>
- \ No newline at end of file