Skip to content

require at least NC14 #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ The Notes app is a distraction free notes taking app. It provides categories for
<repository type="git">https://github.com/nextcloud/notes.git</repository>
<screenshot small-thumbnail="https://github.com/raw/nextcloud/screenshots/master/apps/Notes/notes-thumbnail.jpg">https://github.com/raw/nextcloud/screenshots/master/apps/Notes/notes.png</screenshot>
<dependencies>
<nextcloud min-version="13" max-version="16" />
<nextcloud min-version="14" max-version="16" />
</dependencies>
</info>
41 changes: 0 additions & 41 deletions css/notes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
#app-navigation > ul > li.has-error a{
color: var(--color-error);
}
.app-content-list-button {
display: block;
margin: 10px auto;
padding: 10px;
}

#app-navigation li .nav-entry {
display: block;
Expand Down Expand Up @@ -56,22 +51,6 @@
}


/* new button from Nextcloud 14 -- can be removed if min-version is at least 14 */
#app-navigation .app-navigation-new {
display: block;
padding: 10px;
}
#app-navigation .app-navigation-new button {
display: inline-block;
width: 100%;
padding: 10px;
padding-left: 34px;
background-position: 10px center;
text-align: left;
margin: 0;
}


/* only display the delete button when the note is active */
#app-navigation .app-navigation-entry-utils-menu-button {
display: none;
Expand Down Expand Up @@ -101,26 +80,6 @@
display: inline-flex;
}

/* old style search (before NC14) */
.note-search span {
background-position: 0 center;
background-origin: content-box;
}

.note-search input {
width: 100%;
padding-left: 20px;
background-color: transparent;
border: none;
border-radius: 0;
}

.note-search input:active,
.note-search input:focus,
.note-search input:hover {
border-bottom: 1px solid grey;
}

.tooltip {
text-shadow: none;
text-transform: none;
Expand Down
6 changes: 2 additions & 4 deletions js/app/controllers/appcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ app.controller('AppController', function ($scope, $location, is) {

$scope.is = is;

$scope.init = function (lastViewedNote, errorMessage, useSearchAPI) {
$scope.init = function (lastViewedNote, errorMessage) {
$scope.defaultTitle = document.title;

if(lastViewedNote !== 0 && $location.path()==='') {
Expand All @@ -19,9 +19,7 @@ app.controller('AppController', function ($scope, $location, is) {
if(errorMessage) {
OC.Notification.showTemporary(errorMessage);
}
if(useSearchAPI) {
$scope.initSearch();
}
$scope.initSearch();
};

$scope.search = '';
Expand Down
2 changes: 1 addition & 1 deletion js/public/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/public/app.min.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,12 @@ public function index() {
$errorMessage = $this->l10n->t('The notes folder is not accessible: %s', $e->getMessage());
}

$useSearchAPI = \OCP\Util::getVersion()[0] >= 14;

$response = new TemplateResponse(
$this->appName,
'main',
[
'lastViewedNote' => $lastViewedNote,
'errorMessage' => $errorMessage,
'useSearchAPI' => $useSearchAPI ? 1 : 0
]
);

Expand Down
11 changes: 1 addition & 10 deletions templates/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
?>

<div id="app" ng-app="Notes" ng-controller="AppController"
ng-init="init('<?= $_['lastViewedNote'] ?>','<?= $_['errorMessage'] ?>', <?= $_['useSearchAPI'] ?>)" ng-cloak>
ng-init="init('<?= $_['lastViewedNote'] ?>','<?= $_['errorMessage'] ?>')" ng-cloak>

<script type="text/ng-template" id="note.html">
<?php print_unescaped($this->inc('note')); ?>
Expand All @@ -42,15 +42,6 @@

<ul class="with-icon">

<!-- old style search (before NC 14) -->
<?php if(!$_['useSearchAPI']) { ?>
<li class="note-search">
<span class="nav-entry icon-search">
<input type="text" ng-model="search" />
</span>
</li>
<?php } ?>

<!-- category selector -->
<li class="collapsible app-navigation-noclose separator-below" ng-class="{ open: folderSelectorOpen, 'current-category-item': !folderSelectorOpen && filterCategory!=null }" ng-show="notes.length>1">
<a class="nav-icon-files svg" ng-click="toggleFolderSelector()">{{!folderSelectorOpen && SelectedCategory ? SelectedCategory : '<?php p($l->t('Categories')); ?>' | categoryTitle}}</a>
Expand Down