mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
A more or less big rewrite... Cleaner and more animations...
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* @copyright 2019 Matias De lellis <mati86dl@gmail.com>
|
* @copyright 2019-2020 Matias De lellis <mati86dl@gmail.com>
|
||||||
*
|
*
|
||||||
* @author 2019 Matias De lellis <mati86dl@gmail.com>
|
* @author 2019 Matias De lellis <mati86dl@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -49,9 +49,10 @@ const QnDialogs = {
|
|||||||
multiple: false,
|
multiple: false,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
toggleSelect: true,
|
toggleSelect: true,
|
||||||
tags : function () {
|
tags: function () {
|
||||||
var data = [];
|
var data = [];
|
||||||
currentTags.forEach(function (item, index) {
|
currentTags.forEach(function (item, index) {
|
||||||
|
// Select2 expect text instead of name
|
||||||
data.push({id: item.id, text: item.name});
|
data.push({id: item.id, text: item.name});
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
@@ -94,7 +95,13 @@ const QnDialogs = {
|
|||||||
click: function () {
|
click: function () {
|
||||||
input.select2('close');
|
input.select2('close');
|
||||||
if (callback !== undefined) {
|
if (callback !== undefined) {
|
||||||
callback(true, input.select2("data"));
|
// Quicknotes use name instead text of selecd
|
||||||
|
newTags = input.select2("data");
|
||||||
|
newTags.forEach(function (item, index, tArray) {
|
||||||
|
item['name'] = item.text;
|
||||||
|
tArray[index] = item;
|
||||||
|
});
|
||||||
|
callback(true, newTags);
|
||||||
}
|
}
|
||||||
$(dialogId).ocdialog('close');
|
$(dialogId).ocdialog('close');
|
||||||
},
|
},
|
||||||
|
|||||||
821
js/script.js
821
js/script.js
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,11 @@
|
|||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div>
|
<div>
|
||||||
|
{{#if ispinned}}
|
||||||
|
<div class="icon-header-note icon-pinned fixed-header-icon" title="{{t "quicknotes" "Unpin note"}}"></div>
|
||||||
|
{{else}}
|
||||||
<div class="icon-header-note icon-pin hide-header-icon" title="{{t "quicknotes" "Pin note"}}"></div>
|
<div class="icon-header-note icon-pin hide-header-icon" title="{{t "quicknotes" "Pin note"}}"></div>
|
||||||
|
{{/if}}
|
||||||
<div class="icon-header-note icon-delete hide-header-icon icon-delete-note" title="{{t "quicknotes" "Delete note"}}"></div>
|
<div class="icon-header-note icon-delete hide-header-icon icon-delete-note" title="{{t "quicknotes" "Delete note"}}"></div>
|
||||||
<!--
|
<!--
|
||||||
{{#if sharedwith}}
|
{{#if sharedwith}}
|
||||||
|
|||||||
5
js/templates/tags.handlebars
Normal file
5
js/templates/tags.handlebars
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<div class='note-tags'>
|
||||||
|
{{#each tags}}
|
||||||
|
<div class="icon-tag slim-tag" tag-id="{{ id }}">{{{ name }}}</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
@@ -1,12 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/*
|
||||||
* ownCloud - quicknotes
|
* @copyright 2016-2020 Matias De lellis <mati86dl@gmail.com>
|
||||||
*
|
*
|
||||||
* This file is licensed under the Affero General Public License version 3 or
|
* @author 2016 Matias De lellis <mati86dl@gmail.com>
|
||||||
* later. See the COPYING file.
|
|
||||||
*
|
*
|
||||||
* @author Matias De lellis <mati86dl@gmail.com>
|
* @license GNU AGPL version 3 or any later version
|
||||||
* @copyright Matias De lellis 2016
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\QuickNotes\Controller;
|
namespace OCA\QuickNotes\Controller;
|
||||||
@@ -134,16 +145,21 @@ class NoteController extends Controller {
|
|||||||
|
|
||||||
// Create note and insert it
|
// Create note and insert it
|
||||||
$note = new Note();
|
$note = new Note();
|
||||||
|
|
||||||
$note->setTitle($title);
|
$note->setTitle($title);
|
||||||
$note->setContent($content);
|
$note->setContent($content);
|
||||||
$note->setTimestamp(time());
|
$note->setTimestamp(time());
|
||||||
$note->setColorId($hcolor->id);
|
$note->setColorId($hcolor->id);
|
||||||
$note->setUserId($this->userId);
|
$note->setUserId($this->userId);
|
||||||
|
|
||||||
// Insert true color to response
|
$newNote = $this->notemapper->insert($note);
|
||||||
$note->setColor($hcolor->getColor());
|
|
||||||
|
|
||||||
return new DataResponse($this->notemapper->insert($note));
|
// Insert true color pin and tags to response
|
||||||
|
$newNote->setColor($hcolor->getColor());
|
||||||
|
$newNote->setIsPinned(false);
|
||||||
|
$newNote->setTags([]);
|
||||||
|
|
||||||
|
return new DataResponse($newNote);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -218,13 +234,13 @@ class NoteController extends Controller {
|
|||||||
$note->setTimestamp(time());
|
$note->setTimestamp(time());
|
||||||
$note->setColorId($hcolor->id);
|
$note->setColorId($hcolor->id);
|
||||||
|
|
||||||
// Insert true color to response
|
|
||||||
$note->setColor($hcolor->getColor());
|
|
||||||
$note->setIsPinned($note->getPinned() ? true : false);
|
|
||||||
|
|
||||||
// Update note.
|
// Update note.
|
||||||
$newnote = $this->notemapper->update($note);
|
$newnote = $this->notemapper->update($note);
|
||||||
|
|
||||||
|
// Insert true color and pin to response
|
||||||
|
$newnote->setColor($hcolor->getColor());
|
||||||
|
$newnote->setIsPinned($note->getPinned() ? true : false);
|
||||||
|
|
||||||
// Fill new tags
|
// Fill new tags
|
||||||
$newnote->setTags($this->tagmapper->getTagsForNote($this->userId, $newnote->getId()));
|
$newnote->setTags($this->tagmapper->getTagsForNote($this->userId, $newnote->getId()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user