Skip to content

Commit e71adba

Browse files
Fix: implement some proposed changes by validators
1 parent 179d379 commit e71adba

File tree

5 files changed

+24
-21
lines changed

5 files changed

+24
-21
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

3-
For a _much_ more detailed version, see the [commit history] on GitHub.
3+
For a _much_ more detailed version, see the [commit history](https://github.com/GwynethLlewelyn/post-local-storage/commits/master/) on GitHub.
4+
5+
## 1.0.5
6+
- Renamed `custom_functions.js` to `postlocalstorage_functions.js` as per validation suggestion
7+
- Fix bad JSON indentation on `version_check.json` which prevented version checking from working at all
48

59
## 1.0.4
610

gwynethllewelyn/postlocalstorage/composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"type": "phpbb-extension",
44
"description": "A very simple phpBB3 extension to locally store the content of a post being written, to avoid losing everything after a crash or session expiration.",
55
"homepage": "https://github.com/GwynethLlewelyn/post-local-storage",
6-
"version": "1.0.4",
7-
"time": "2024-04-14",
6+
"version": "1.0.5",
7+
"time": "2024-04-15",
88
"license": "GPL-2.0-only",
99
"keywords": [
1010
"phpbb",
@@ -31,13 +31,12 @@
3131
"display-name": "Post Local Storage",
3232
"soft-require": {
3333
"phpbb/phpbb": ">=3.3"
34+
},
35+
"version-check": {
36+
"host": "raw.githubusercontent.com",
37+
"directory": "/GwynethLlewelyn/post-local-storage/master",
38+
"filename": "version_check.json",
39+
"ssl": true
3440
}
35-
},
36-
"version-check":
37-
{
38-
"host": "raw.githubusercontent.com",
39-
"directory": "/GwynethLlewelyn/post-local-storage/master",
40-
"filename": "version_check.json",
41-
"ssl": true
4241
}
4342
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% INCLUDEJS '@gwynethllewelyn_postlocalstorage/custom_functions.js' %}
1+
{% INCLUDEJS '@gwynethllewelyn_postlocalstorage/postlocalstorage_functions.js' %}

gwynethllewelyn/postlocalstorage/styles/all/template/custom_functions.js renamed to gwynethllewelyn/postlocalstorage/styles/all/template/postlocalstorage_functions.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
88

9-
(function (message, doc) {
9+
(function(message, doc) {
1010
// If there is no localStorage support, give up
1111
if (!message.localStorage) return;
1212
// phpBB3 uses a textarea with id and name 'message'
@@ -17,12 +17,13 @@
1717
var key = message.location.href;
1818
// Firefox seems to have an odd bug which affects clicking backspace in quick succession.
1919
// Kudos to @gvp9000 and for the fix below. (gwyneth 20240414)
20-
// @see
20+
// @see https://www.phpbb.com/customise/db/extension/postlocalstorage/support/topic/246616?p=877324#p877324
2121
var count_hash_num = key.split("#").length - 1;
2222
for (let i = 0; i < count_hash_num - 1; i++) {
2323
key = key.substring(0, key.lastIndexOf('#'));
2424
}
25-
var item = null; var item = null;
25+
var item = null;
26+
var item = null;
2627
// Use the 'pagehide' event in modern browsers or 'beforeunload' in older browsers.
2728
var unloadEvent;
2829
if ("onpagehide" in message) {
@@ -50,15 +51,14 @@
5051
// When the user presses a key just *once* inside the textarea, run the storage function when the page is unloaded.
5152
textarea.addEventListener(
5253
"keyup",
53-
function () {
54+
function() {
5455
message.addEventListener(unloadEvent, updateStorage);
5556
message.setInterval(updateStorage, 10000);
56-
},
57-
{ once: true }
57+
}, { once: true }
5858
);
5959
// When the form is submitted, delete the localStorage key/value pair.
60-
textarea.form.addEventListener("submit", function () {
60+
textarea.form.addEventListener("submit", function() {
6161
message.localStorage.removeItem(key);
6262
message.removeEventListener(unloadEvent, updateStorage);
6363
});
64-
})(this, this.document);
64+
})(this, this.document);

version_check.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"stable": {
33
"1.0": {
4-
"current": "1.0.4",
5-
"download": "https:\/\/github.com\/GwynethLlewelyn\/post-local-storage\/releases\/download\/v1.0.4\/postlocalstorage.zip",
4+
"current": "1.0.5",
5+
"download": "https:\/\/github.com\/GwynethLlewelyn\/post-local-storage\/releases\/download\/v1.0.5\/postlocalstorage.zip",
66
"announcement": "https:\/\/www.phpbb.com\/customise\/db\/extension\/postlocalstorage\/",
77
"eol": null,
88
"security": false

0 commit comments

Comments
 (0)