Skip to content

Commit

Permalink
Merge pull request #83 from matiasdelellis/nc24
Browse files Browse the repository at this point in the history
Enable NC24 and update tests..
  • Loading branch information
matiasdelellis authored May 7, 2022
2 parents d245ce8 + a92e105 commit c0fae81
Show file tree
Hide file tree
Showing 15 changed files with 367 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0']
php-versions: ['7.3', '7.4', '8.0', '8.1']
name: php${{ matrix.php-versions }} lint
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: [ 'v21.0.0' ]
ocp-version: [ 'dev-stable24' ]
name: Nextcloud ${{ matrix.ocp-version }}
steps:
- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.7.6] 2022-05-07
- Enable NC24.
- Removes lot use of jQuery, that inexplicably failing in NC24. Issue #84

## [0.7.3] 2021-12-03
- Add where to translate into README. PR #71
- Add lint and static-analysis using github workflows.
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ deps:
cp node_modules/medium-editor/dist/css/medium-editor.css vendor/
cp node_modules/medium-editor-autolist/dist/autolist.js vendor/
cp node_modules/lozad/dist/lozad.js vendor/
wget https://raw.githubusercontent.com/philzet/ColorPick.js/master/src/colorPick.js -O vendor/colorPick.js
wget https://raw.githubusercontent.com/philzet/ColorPick.js/master/src/colorPick.css -O vendor/colorPick.css

depsmin:
mkdir -p vendor
Expand All @@ -78,8 +76,6 @@ depsmin:
cp node_modules/medium-editor/dist/css/medium-editor.min.css vendor/medium-editor.css
cp node_modules/medium-editor-autolist/dist/autolist.min.js vendor/autolist.js
cp node_modules/lozad/dist/lozad.min.js vendor/lozad.js
wget https://raw.githubusercontent.com/philzet/ColorPick.js/master/src/colorPick.js -O vendor/colorPick.js
wget https://raw.githubusercontent.com/philzet/ColorPick.js/master/src/colorPick.css -O vendor/colorPick.css

js-templates:
node_modules/handlebars/bin/handlebars js/templates -f js/templates.js
Expand Down
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<name>Quick notes</name>
<summary>Quick notes with a basic rich text</summary>
<description>Quick notes with a basic rich text</description>
<version>0.7.3</version>
<version>0.7.6</version>
<licence>agpl</licence>
<author>Matias De lellis</author>
<namespace>QuickNotes</namespace>
Expand All @@ -20,6 +20,6 @@
<screenshot>https://raw.githubusercontent.com/matiasdelellis/quicknotes/master/doc/quicknotes-attachments.jpeg</screenshot>
<screenshot>https://raw.githubusercontent.com/matiasdelellis/quicknotes/master/doc/quicknotes-shared-note.jpeg</screenshot>
<dependencies>
<nextcloud min-version="21" max-version="23"/>
<nextcloud min-version="24" max-version="24"/>
</dependencies>
</info>
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"require-dev": {
"psalm/phar": "^4.10",
"christophwurst/nextcloud": "^21.0",
"psr/container": "^2.0"
"christophwurst/nextcloud": "^22.0",
"psr/container": "^1.0"
},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
Expand Down
32 changes: 32 additions & 0 deletions css/qn-colorpick.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.colorPickWrapper {
position: relative;
width: 0;
height: 0;
}

#colorPick {
background: #fff;
-webkit-backdrop-filter: blur(15px);
position: absolute;
border-radius: 8px;
box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2);
padding: 10px;
width: auto;
box-sizing: content-box;
z-index: 2500;
display: flex;
}

.colorPickButton {
border-radius: 50%;
width: 24px;
height: 24px;
margin: 0px 3px;
cursor: pointer;
display: inline-block;
border: 1px solid rgba(0, 0, 0, 0.2);
}

.colorPickButton:hover {
transform: scale(1.1);
}
18 changes: 1 addition & 17 deletions css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -360,20 +360,4 @@ div.select2-container {
height: 32px;
padding: 0px !important;
border-radius: 50%;
}

/* Color Picker */

#colorPick {
border-radius: 8px;
padding: 12px;
background-color: var(--color-background-dark);
opacity: 1.0 !important;
z-index: 2500;
}

#colorPick span {
color: var(--color-main-text);
font-size: 13px;
text-transform: initial;
}
}
64 changes: 64 additions & 0 deletions js/qn-colorpick.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
function QnColorPick(parentSelector, onSelectColor) {

this._parentSelector = parentSelector;
this._onSelectColor = onSelectColor;

this._color = undefined;

this._template = '' +
'<div id="colorPickWrapper" class="colorPickWrapper">' +
'<div id="colorPick">' +
'<div class="colorPickButton" hexvalue="#F7EB96" style="background-color:#F7EB96"></div>' +
'<div class="colorPickButton" hexvalue="#88B7E3" style="background-color:#88B7E3"></div>' +
'<div class="colorPickButton" hexvalue="#C1ECB0" style="background-color:#C1ECB0"></div>' +
'<div class="colorPickButton" hexvalue="#BFA6E9" style="background-color:#BFA6E9"></div>' +
'<div class="colorPickButton" hexvalue="#DAF188" style="background-color:#DAF188"></div>' +
'<div class="colorPickButton" hexvalue="#FF96AC" style="background-color:#FF96AC"></div>' +
'<div class="colorPickButton" hexvalue="#FCF66F" style="background-color:#FCF66F"></div>' +
'<div class="colorPickButton" hexvalue="#F2F1EF" style="background-color:#F2F1EF"></div>' +
'<div class="colorPickButton" hexvalue="#C1D756" style="background-color:#C1D756"></div>' +
'<div class="colorPickButton" hexvalue="#CECECE" style="background-color:#CECECE"></div>' +
'</div>' +
'</div>';

this.select = function (hexcolor) {
this._color = hexcolor;
}

this.close = function () {
var picker = document.getElementById("colorPickWrapper");
picker.remove();
}

this.show = function (hexcolor) {
var self = this;

var parent = document.querySelector(this._parentSelector);
parent.innerHTML += this._template;

var colors = document.querySelectorAll(".colorPickButton");
colors.forEach (function(color) {
if (hexcolor == color.getAttribute("hexvalue")) {
color.classList.add("icon-checkmark");
}
color.addEventListener("click", function () {
self._color = color.getAttribute("hexvalue");
self._onSelectColor(self._color);
self.close ();
});
});
}

this.isVisible = function () {
var picker = document.getElementById("colorPickWrapper");
return picker != null;
};

this.toggle = function () {
if (this.isVisible()) {
this.close();
} else {
this.show(this._color);
}
};
}
Loading

0 comments on commit c0fae81

Please sign in to comment.