aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/php.yml12
-rw-r--r--README.md8
-rw-r--r--app/view/templates/edittabs.php29
-rw-r--r--src/edit.js2
4 files changed, 25 insertions, 26 deletions
diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml
index 039daca..6172685 100644
--- a/.github/workflows/php.yml
+++ b/.github/workflows/php.yml
@@ -45,12 +45,12 @@ jobs:
make test
echo "::remove-matcher owner=phpunit::"
- - name: Coveralls publish
- env:
- COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- composer require --quiet --no-interaction cedx/coveralls
- vendor/bin/coveralls build/phpunit/cov.xml
+ - name: Codecov upload
+ uses: codecov/codecov-action@v1
+ with:
+ file: ./build/phpunit/cov.xml
+ flags: php
+ name: php-${{ matrix.php-versions }}
lint:
name: lint
diff --git a/README.md b/README.md
index 58de3b7..4d0786e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# W-CMS
-[![checks][github]][action] ![style][codestyle] ![phpstan][phpstan] [![coverage][coverage]][coveralls]
+[![checks][github]][action] ![style][codestyle] ![phpstan][phpstan] [![coverage][coverage]][codecov]
W is a lightweight CMS tool, meant to help you design a website using a unique approach. It's targeting artists, or experimental projects.
@@ -183,9 +183,9 @@ Then, to make the release, run the following command:
To only build the release zip, simply run `make dist`. This will create a zip file in `dist/` of the current version.
-[github]: https://github.com/vincent-peugnet/wcms/workflows/checks/badge.svg
+[github]: https://img.shields.io/github/workflow/status/vincent-peugnet/wcms/checks/master?label=checks
[action]: https://github.com/vincent-peugnet/wcms/actions?query=branch%3Amaster+workflow%3Achecks
[codestyle]: https://img.shields.io/badge/code%20style-PSR12-brightgreen
[phpstan]: https://img.shields.io/badge/phpstan-level%205-green
-[coverage]: https://coveralls.io/repos/github/vincent-peugnet/wcms/badge.svg?branch=master
-[coveralls]: https://coveralls.io/github/vincent-peugnet/wcms?branch=master \ No newline at end of file
+[coverage]: https://img.shields.io/codecov/c/gh/vincent-peugnet/wcms
+[codecov]: https://codecov.io/gh/vincent-peugnet/wcms
diff --git a/app/view/templates/edittabs.php b/app/view/templates/edittabs.php
index c890677..cc7739f 100644
--- a/app/view/templates/edittabs.php
+++ b/app/view/templates/edittabs.php
@@ -1,25 +1,24 @@
<div class="tabs">
-<?php
-foreach ($tablist as $key => $value) {
- echo '<div class="tab">';
- ?>
+<?php foreach ($tablist as $key => $value) { ?>
+<div class="tab">
<input name="interface" type="radio" value="<?= $key ?>" id="tab<?= $key ?>" class="checkboxtab" <?= $key == $opentab ? 'checked' : '' ?> >
<label for="tab<?= $key ?>" <?= empty($templates[$key]) ? '' : 'title="template : '.$templates[$key].'" ' ?> class="<?= empty($templates[$key]) ? '' : 'template' ?> <?= empty($value) ? '' : 'edited' ?>"><?= $key ?> </label>
- <?php
+ <div class="content">
- echo '<div class="content">';
- if ($key == $opentab) {
- echo '<textarea name="' . $key . '" id="edit' . $key . '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus >' . $value . '</textarea>';
- } else {
- echo '<textarea name="' . $key . '" id="edit' . $key . '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">' . $value . '</textarea>';
- }
- echo '</div>';
- echo '</div>';
-}
-?>
+ <textarea name="<?= $key ?>"
+ id="edit<?= $key ?>"
+ autocomplete="off"
+ autocorrect="off"
+ autocapitalize="off"
+ spellcheck="false"
+ <?= $key == $opentab ? 'autofocus' : '' ?>
+ ><?= $this->e($value) ?></textarea>
+ </div>
+</div>
+<?php } ?>
</div> \ No newline at end of file
diff --git a/src/edit.js b/src/edit.js
index 86f24c2..b1613f3 100644
--- a/src/edit.js
+++ b/src/edit.js
@@ -93,7 +93,7 @@ let editors = [];
let unsavedChanges = false;
/** @type {InputEvent} */
-const inputEvent = new InputEvent('input');
+const inputEvent = new Event('input');
window.addEventListener('load', () => {
form = document.getElementById('update');