From 9cf8d8fd3291f96069738585e3fcdd4c7cad680b Mon Sep 17 00:00:00 2001 From: rstefko Date: Sat, 21 Jan 2023 11:33:47 +0100 Subject: [PATCH 1/9] fixes #439: Added styles for code-block --- css/notes.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/css/notes.css b/css/notes.css index 0ff92022..8f7f787d 100644 --- a/css/notes.css +++ b/css/notes.css @@ -141,6 +141,12 @@ z-index: -1; border-top: 1px solid rgba(120, 120, 120, 0.5); } +.mdedit .code-block { + background: rgba(120, 120, 120, 0.1); + padding: 0 0.5em; + margin: 0.5em 0; + display: block; +} /* hanging punctuation */ From 1227d899457fdc7d85c213c4832dea7c4db7793a Mon Sep 17 00:00:00 2001 From: rstefko Date: Sat, 21 Jan 2023 21:46:58 +0100 Subject: [PATCH 2/9] fixes #368 and #176: Added fulltext search to notes --- .gitignore | 3 ++ js/app/controllers/notescontroller.js | 43 ++++++++++++++++++++++++++- js/app/filters/noteFilter.js | 10 +++++++ templates/main.php | 5 +++- 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 js/app/filters/noteFilter.js diff --git a/.gitignore b/.gitignore index c5a0fb1d..c1a2a1fd 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,6 @@ nbproject # Generated from .drone.star .drone.yml +js/package-lock.json +js/public/app.min.js +js/public/app.min.js.map diff --git a/js/app/controllers/notescontroller.js b/js/app/controllers/notescontroller.js index d180e04b..25817d4d 100644 --- a/js/app/controllers/notescontroller.js +++ b/js/app/controllers/notescontroller.js @@ -43,4 +43,45 @@ app.controller('NotesController', function($routeParams, $scope, $location, }); }; -}); + var searchform = $('.searchbox'); + var searchbox = $('#searchbox'); + + initSearch(); + + function initSearch() { + $scope.queryString = searchbox.val().trim(); + + /** Conduct the search when there is a pause in typing in text */ + var checkQueryChange = _.debounce(function() { + if ($scope.queryString != searchbox.val().trim()) { + onEnterSearchString(); + } + }, 250); + searchbox.bind('propertychange change keyup input paste', checkQueryChange); + + /** Handle clearing the searchbox. This has to be registered to the parent form + * of the #searchbox element. + */ + searchform.on('reset', function() { + setQueryString(''); + }); + + /** Run search when enter pressed within the searchbox */ + searchbox.bind('keydown', function (event) { + if (event.which === 13) { + onEnterSearchString(); + } + }); + } + + function onEnterSearchString() { + setQueryString(searchbox.val().trim()); + } + + function setQueryString(query) { + $scope.$apply(() => { + $scope.queryString = query; + }); + } + +}); \ No newline at end of file diff --git a/js/app/filters/noteFilter.js b/js/app/filters/noteFilter.js new file mode 100644 index 00000000..54e5cd9f --- /dev/null +++ b/js/app/filters/noteFilter.js @@ -0,0 +1,10 @@ +app.filter('noteFilter', function() { + 'use strict'; + return function (items, searchString) { + if (!searchString || searchString.length == 0) + return items; + + var regex = new RegExp(searchString, 'i'); + return items.filter(x => x.title.match(regex) || x.content.match(regex)); + }; +}); \ No newline at end of file diff --git a/templates/main.php b/templates/main.php index 2baf6daf..d81f2e6c 100644 --- a/templates/main.php +++ b/templates/main.php @@ -41,7 +41,7 @@ + t('New note')); ?> -
  • {{ note.title | noteTitle }} @@ -67,4 +67,7 @@
    + + + From da93f15954eae932a53a36a99b44b5354524da15 Mon Sep 17 00:00:00 2001 From: rstefko Date: Sun, 22 Jan 2023 18:07:54 +0100 Subject: [PATCH 3/9] When token expires reload page --- js/config/app.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/config/app.js b/js/config/app.js index 1164a709..778eab24 100644 --- a/js/config/app.js +++ b/js/config/app.js @@ -38,9 +38,16 @@ config(function($provide, $routeProvider, RestangularProvider, $httpProvider, Restangular.one('notes', noteId).get().then(function (note) { is.loading = false; deferred.resolve(note); - }, function () { + }, function (response) { is.loading = false; - deferred.reject(); + + // Token expired + if (response.status == 412) { + OC.reload(); + } + else { + deferred.reject(); + } }); return deferred.promise; From a9417dcf5fd9d722fdc00c286678bfc08d3ec942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20=C5=A0tefko?= Date: Sun, 2 Jul 2023 08:26:27 +0200 Subject: [PATCH 4/9] refs #368: Use custom search box --- css/notes.css | 6 ++++++ js/app/controllers/notescontroller.js | 10 +--------- templates/main.php | 7 ++++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/css/notes.css b/css/notes.css index 8f7f787d..2beb46a3 100644 --- a/css/notes.css +++ b/css/notes.css @@ -173,3 +173,9 @@ padding-left: 90px; } } + +#searchnotes { + width: 100%; + border-left: 0px; + padding-left: 12px; +} \ No newline at end of file diff --git a/js/app/controllers/notescontroller.js b/js/app/controllers/notescontroller.js index 25817d4d..3291c7f5 100644 --- a/js/app/controllers/notescontroller.js +++ b/js/app/controllers/notescontroller.js @@ -43,8 +43,7 @@ app.controller('NotesController', function($routeParams, $scope, $location, }); }; - var searchform = $('.searchbox'); - var searchbox = $('#searchbox'); + var searchbox = $('#searchnotes'); initSearch(); @@ -59,13 +58,6 @@ app.controller('NotesController', function($routeParams, $scope, $location, }, 250); searchbox.bind('propertychange change keyup input paste', checkQueryChange); - /** Handle clearing the searchbox. This has to be registered to the parent form - * of the #searchbox element. - */ - searchform.on('reset', function() { - setQueryString(''); - }); - /** Run search when enter pressed within the searchbox */ searchbox.bind('keydown', function (event) { if (event.which === 13) { diff --git a/templates/main.php b/templates/main.php index d81f2e6c..17135fb8 100644 --- a/templates/main.php +++ b/templates/main.php @@ -40,6 +40,10 @@ oc-click-focus="{ selector: '#app-content textarea' }">
    + t('New note')); ?>
  • + +
  • + +
  • @@ -67,7 +71,4 @@
    - - - From 710cd9eefa64f6aa0d44db8b7cf13b838f695e28 Mon Sep 17 00:00:00 2001 From: korelstar Date: Sun, 22 Jan 2017 10:56:27 +0100 Subject: [PATCH 5/9] Fix navigation sidebar toggle --- templates/note.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/note.php b/templates/note.php index 901a3f2b..623b91a0 100644 --- a/templates/note.php +++ b/templates/note.php @@ -1,4 +1,2 @@ -
    {{note.content}}
    {{note.content | wordCount}}
    - From 6d54cdad7e289902c47765dc7da8677363ae52f8 Mon Sep 17 00:00:00 2001 From: Konstantin Gorodinskii Date: Sat, 28 Dec 2019 13:07:20 +0100 Subject: [PATCH 6/9] add manifest.json Signed-off-by: Konstantin Gorodinskii --- img/manifest.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 img/manifest.json diff --git a/img/manifest.json b/img/manifest.json new file mode 100644 index 00000000..43cd5cc6 --- /dev/null +++ b/img/manifest.json @@ -0,0 +1,17 @@ +{ + "name": "Notes", + "start_url": "/apps/notes/", + "icons": [ + { + "src": "/apps/notes/img/favicon-touch.png", + "type": "image/png", + "sizes": "128x128" + }, + { + "src": "/apps/notes/img/favicon-touch.svg", + "type": "image/svg+xml", + "sizes": "16x16" + } + ], + "display": "standalone" +} From 780319c14168fafe54c067564fcc40d2b2fc9132 Mon Sep 17 00:00:00 2001 From: Konstantin Gorodinskii Date: Sun, 29 Dec 2019 16:05:33 +0100 Subject: [PATCH 7/9] fix paths Signed-off-by: Konstantin Gorodinskii --- img/manifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/img/manifest.json b/img/manifest.json index 43cd5cc6..64da2ddd 100644 --- a/img/manifest.json +++ b/img/manifest.json @@ -1,14 +1,14 @@ { "name": "Notes", - "start_url": "/apps/notes/", + "start_url": "../../../apps/notes", "icons": [ { - "src": "/apps/notes/img/favicon-touch.png", + "src": "./favicon-touch.png", "type": "image/png", "sizes": "128x128" }, { - "src": "/apps/notes/img/favicon-touch.svg", + "src": "./favicon-touch.svg", "type": "image/svg+xml", "sizes": "16x16" } From 2db5953e2c8e5a86705d81e662df6be5148bd439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20=C5=A0tefko?= Date: Sat, 14 Oct 2023 17:48:47 +0200 Subject: [PATCH 8/9] Better manifest.json to support new Install as app feature in Android --- img/manifest.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/img/manifest.json b/img/manifest.json index 64da2ddd..0ec36235 100644 --- a/img/manifest.json +++ b/img/manifest.json @@ -10,8 +10,10 @@ { "src": "./favicon-touch.svg", "type": "image/svg+xml", - "sizes": "16x16" + "sizes": "any" } ], - "display": "standalone" -} + "display": "standalone", + "theme_color": "#041e42", + "background_color": "#ffffff" +} \ No newline at end of file From 70fa5cf12b0c47961a1a5343dc1e634320e23605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20=C5=A0tefko?= Date: Sun, 15 Oct 2023 11:45:45 +0200 Subject: [PATCH 9/9] Fixed URL to be able to have multiple apps on the same domain --- img/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img/manifest.json b/img/manifest.json index 0ec36235..65ddda65 100644 --- a/img/manifest.json +++ b/img/manifest.json @@ -1,6 +1,6 @@ { "name": "Notes", - "start_url": "../../../apps/notes", + "start_url": "../../../apps/notes/#/", "icons": [ { "src": "./favicon-touch.png",