mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Sync Sandstorm URL and page title with the inner Wekan grain
The page title synchronization required implementing reactivity in the kadira:dochead package, see https://github.com/kadirahq/meteor-dochead/pull/25 Closes #403.
This commit is contained in:
parent
875cf0ad56
commit
827663f255
3 changed files with 21 additions and 5 deletions
|
|
@ -63,7 +63,7 @@ id-map@1.0.4
|
||||||
idmontie:migrations@1.0.1
|
idmontie:migrations@1.0.1
|
||||||
jquery@1.11.4
|
jquery@1.11.4
|
||||||
kadira:blaze-layout@2.2.0
|
kadira:blaze-layout@2.2.0
|
||||||
kadira:dochead@1.3.2
|
kadira:dochead@1.4.0
|
||||||
kadira:flow-router@2.9.0
|
kadira:flow-router@2.9.0
|
||||||
kenton:accounts-sandstorm@0.1.8
|
kenton:accounts-sandstorm@0.1.8
|
||||||
launch-screen@1.0.4
|
launch-screen@1.0.4
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ This release features:
|
||||||
response instead of waiting for the DDP connection to open;
|
response instead of waiting for the DDP connection to open;
|
||||||
* Support images attachments copy pasting.
|
* Support images attachments copy pasting.
|
||||||
|
|
||||||
Thanks to GitHub users AlexanderS, fisle, floatinghotpot, FuzzyWuzzie, ndarilek,
|
Thanks to GitHub users AlexanderS, fisle, floatinghotpot, FuzzyWuzzie, mnutt,
|
||||||
SirCmpwn, and xavierpriour for their contributions.
|
ndarilek, SirCmpwn, and xavierpriour for their contributions.
|
||||||
|
|
||||||
# v0.9
|
# v0.9
|
||||||
|
|
||||||
|
|
|
||||||
20
sandstorm.js
20
sandstorm.js
|
|
@ -54,10 +54,10 @@ if (isSandstorm && Meteor.isServer) {
|
||||||
// XXX If this routing scheme changes, this will break. We should generate
|
// XXX If this routing scheme changes, this will break. We should generate
|
||||||
// the location URL using the router, but at the time of writing, the
|
// the location URL using the router, but at the time of writing, the
|
||||||
// it is only accessible on the client.
|
// it is only accessible on the client.
|
||||||
const path = `/boards/${sandstormBoard._id}/${sandstormBoard.slug}`;
|
const boardPath = `/b/${sandstormBoard._id}/${sandstormBoard.slug}`;
|
||||||
|
|
||||||
res.writeHead(301, {
|
res.writeHead(301, {
|
||||||
Location: base + path,
|
Location: base + boardPath,
|
||||||
});
|
});
|
||||||
res.end();
|
res.end();
|
||||||
|
|
||||||
|
|
@ -126,6 +126,22 @@ if (isSandstorm && Meteor.isServer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSandstorm && Meteor.isClient) {
|
if (isSandstorm && Meteor.isClient) {
|
||||||
|
// Since the Sandstorm grain is displayed in an iframe of the Sandstorm shell,
|
||||||
|
// we need to explicitly expose meta data like the page title or the URL path
|
||||||
|
// so that they could appear in the browser window.
|
||||||
|
// See https://docs.sandstorm.io/en/latest/developing/path/
|
||||||
|
function updateSandstormMetaData(msg) {
|
||||||
|
return window.parent.postMessage(msg, '*');
|
||||||
|
}
|
||||||
|
|
||||||
|
FlowRouter.triggers.enter([({ path }) => {
|
||||||
|
updateSandstormMetaData({ setPath: path });
|
||||||
|
}]);
|
||||||
|
|
||||||
|
Tracker.autorun(() => {
|
||||||
|
updateSandstormMetaData({ setTitle: DocHead.getTitle() });
|
||||||
|
});
|
||||||
|
|
||||||
// XXX Hack. `Meteor.absoluteUrl` doesn't work in Sandstorm, since every
|
// XXX Hack. `Meteor.absoluteUrl` doesn't work in Sandstorm, since every
|
||||||
// session has a different URL whereas Meteor computes absoluteUrl based on
|
// session has a different URL whereas Meteor computes absoluteUrl based on
|
||||||
// the ROOT_URL environment variable. So we overwrite this function on a
|
// the ROOT_URL environment variable. So we overwrite this function on a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue