Skip to content
Snippets Groups Projects
Commit 17dc66cc authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'sc-update-2.29.0' into 'pregmod-master'

Update SugarCube to 2.29.0

Closes #877

See merge request pregmodfan/fc-pregmod!4972
parents e23f7fec cc446c6c
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
diff -r df721eb4cd55 src/lib/jquery-plugins.js
--- a/src/lib/jquery-plugins.js Sun Dec 16 04:39:00 2018 -0600
+++ b/src/lib/jquery-plugins.js Fri Jan 25 00:54:01 2019 +0100
@@ -43,14 +43,9 @@
return function () {
const $this = jQuery(this);
- // Exit if the element is disabled.
- //
- // NOTE: This should only be necessary for elements which are not disableable
- // per the HTML specification as disableable elements should be made inert
- // automatically.
- if ($this.ariaIsDisabled()) {
- return;
- }
+ const dataPassage = $this.attr('data-passage');
+ const initialDataPassage = window && window.SugarCube && window.SugarCube.State && window.SugarCube.State.passage;
+ const savedYOffset = window.pageYOffset;
// Toggle "aria-pressed" status, if the attribute exists.
if ($this.is('[aria-pressed]')) {
@@ -59,6 +54,11 @@
// Call the true handler.
fn.apply(this, arguments);
+
+ const doJump = function(){ window.scrollTo(0, savedYOffset); }
+ if ( dataPassage && (window.lastDataPassageLink === dataPassage || initialDataPassage === dataPassage))
+ doJump();
+ window.lastDataPassageLink = dataPassage;
};
}
diff -r df721eb4cd55 src/lib/simplestore/adapters/webstorage.js
--- a/src/lib/simplestore/adapters/webstorage.js Sun Dec 16 04:39:00 2018 -0600
+++ b/src/lib/simplestore/adapters/webstorage.js Fri Jan 25 00:54:01 2019 +0100
@@ -189,11 +189,11 @@
}
static _serialize(obj) {
- return LZString.compressToUTF16(JSON.stringify(obj));
+ return JSON.stringify(obj);
}
static _deserialize(str) {
- return JSON.parse(LZString.decompressFromUTF16(str));
+ return JSON.parse((!str || str[0] == "{") ? str : LZString.decompressFromUTF16(str));
}
}
diff -r df721eb4cd55 src/state.js
--- a/src/state.js Sun Dec 16 04:39:00 2018 -0600
+++ b/src/state.js Fri Jan 25 00:54:01 2019 +0100
@@ -104,7 +104,7 @@
}
if (_expired.length > 0) {
- stateObj.expired = [..._expired];
+ stateObj.expired = [];
}
if (_prng !== null) {
diff -r df721eb4cd55 src/ui.js
--- a/src/ui.js Sun Dec 16 04:39:00 2018 -0600
+++ b/src/ui.js Fri Jan 25 00:54:01 2019 +0100
@@ -334,6 +334,7 @@
if (saves.slots[i]) {
// Add the load button.
$tdLoad.append(
+ createButton('save', 'ui-close', L10n.get('savesLabelSave'), i, Save.slots.save),
createButton('load', 'ui-close', L10n.get('savesLabelLoad'), i, slot => {
jQuery(document).one(':dialogclose', () => Save.slots.load(slot));
})
diff -r df721eb4cd55 src/lib/jquery-plugins.js
--- a/src/lib/jquery-plugins.js Sun Dec 16 04:39:00 2018 -0600
+++ b/src/lib/jquery-plugins.js Fri Jan 25 00:54:01 2019 +0100
diff -r 3892fa22d6fa src/lib/jquery-plugins.js
--- a/src/lib/jquery-plugins.js Thu Jun 27 16:10:07 2019 -0500
+++ b/src/lib/jquery-plugins.js Sun Jul 07 22:52:13 2019 +0200
@@ -43,14 +43,9 @@
return function () {
const $this = jQuery(this);
return function () {
const $this = jQuery(this);
- // Exit if the element is disabled.
- //
- // NOTE: This should only be necessary for elements which are not disableable
......@@ -16,58 +16,58 @@ diff -r df721eb4cd55 src/lib/jquery-plugins.js
+ const dataPassage = $this.attr('data-passage');
+ const initialDataPassage = window && window.SugarCube && window.SugarCube.State && window.SugarCube.State.passage;
+ const savedYOffset = window.pageYOffset;
// Toggle "aria-pressed" status, if the attribute exists.
if ($this.is('[aria-pressed]')) {
// Toggle "aria-pressed" status, if the attribute exists.
if ($this.is('[aria-pressed]')) {
@@ -59,6 +54,11 @@
// Call the true handler.
fn.apply(this, arguments);
// Call the true handler.
fn.apply(this, arguments);
+
+ const doJump = function(){ window.scrollTo(0, savedYOffset); }
+ if ( dataPassage && (window.lastDataPassageLink === dataPassage || initialDataPassage === dataPassage))
+ doJump();
+ window.lastDataPassageLink = dataPassage;
};
}
diff -r df721eb4cd55 src/lib/simplestore/adapters/webstorage.js
--- a/src/lib/simplestore/adapters/webstorage.js Sun Dec 16 04:39:00 2018 -0600
+++ b/src/lib/simplestore/adapters/webstorage.js Fri Jan 25 00:54:01 2019 +0100
};
}
diff -r 3892fa22d6fa src/lib/simplestore/adapters/webstorage.js
--- a/src/lib/simplestore/adapters/webstorage.js Thu Jun 27 16:10:07 2019 -0500
+++ b/src/lib/simplestore/adapters/webstorage.js Sun Jul 07 22:52:13 2019 +0200
@@ -189,11 +189,11 @@
}
static _serialize(obj) {
}
static _serialize(obj) {
- return LZString.compressToUTF16(JSON.stringify(obj));
+ return JSON.stringify(obj);
}
static _deserialize(str) {
}
static _deserialize(str) {
- return JSON.parse(LZString.decompressFromUTF16(str));
+ return JSON.parse((!str || str[0] == "{") ? str : LZString.decompressFromUTF16(str));
}
}
diff -r df721eb4cd55 src/state.js
--- a/src/state.js Sun Dec 16 04:39:00 2018 -0600
+++ b/src/state.js Fri Jan 25 00:54:01 2019 +0100
}
}
diff -r 3892fa22d6fa src/state.js
--- a/src/state.js Thu Jun 27 16:10:07 2019 -0500
+++ b/src/state.js Sun Jul 07 22:52:13 2019 +0200
@@ -104,7 +104,7 @@
}
if (_expired.length > 0) {
}
if (_expired.length > 0) {
- stateObj.expired = [..._expired];
+ stateObj.expired = [];
}
if (_prng !== null) {
diff -r df721eb4cd55 src/ui.js
--- a/src/ui.js Sun Dec 16 04:39:00 2018 -0600
+++ b/src/ui.js Fri Jan 25 00:54:01 2019 +0100
}
if (_prng !== null) {
diff -r 3892fa22d6fa src/ui.js
--- a/src/ui.js Thu Jun 27 16:10:07 2019 -0500
+++ b/src/ui.js Sun Jul 07 22:52:13 2019 +0200
@@ -334,6 +334,7 @@
if (saves.slots[i]) {
// Add the load button.
$tdLoad.append(
if (saves.slots[i]) {
// Add the load button.
$tdLoad.append(
+ createButton('save', 'ui-close', L10n.get('savesLabelSave'), i, Save.slots.save),
createButton('load', 'ui-close', L10n.get('savesLabelLoad'), i, slot => {
jQuery(document).one(':dialogclose', () => Save.slots.load(slot));
})
createButton('load', 'ui-close', L10n.get('savesLabelLoad'), i, slot => {
jQuery(document).one(':dialogclosed', () => Save.slots.load(slot));
})
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment