Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/editor/extensions/ext-tactile-render/ext-tactile-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ var graphicTitle = ""
var graphicId = ""
var secretKey = ""
var graphic = ""
var coords = ""
var placeId = ""

const loadExtensionTranslation = async function (svgEditor) {
let translationModule
Expand Down Expand Up @@ -95,7 +97,16 @@ const updateStorage = async function (channelTitle, channelId, secret) {
channelId = await encryptData(svgEditor, channelId);
secret = await encryptData(svgEditor, secret);
const store = {"channelId": channelId, "graphicTitle": channelTitle,
"secretKey": secret, "graphicBlob": graphic}
"secretKey": secret}
if (graphic != ""){
store.graphicBlob = graphic
}
if (placeId != ""){
store.placeID = placeId
}
if (coords != ""){
store.coordinates = coords
}
svgEditor.storage.setItem('tat-storage-data', JSON.stringify(store));
let messageObj = { "messageFrom": "AuthoringTool", "storageData": JSON.stringify(store) };
window.postMessage(messageObj, "*");
Expand Down Expand Up @@ -334,6 +345,12 @@ connectedCallback () {
if (graphic != ""){
resp.graphicBlob = graphic
}
if (placeId != ""){
resp.placeID = placeId
}
if (coords != ""){
resp.coordinates = coords
}
if (graphicId != ""){
resp.secret = secretKey
}
Expand Down Expand Up @@ -415,6 +432,8 @@ export default {
graphicTitle = info.graphicTitle ? await svgEditor.svgCanvas.runExtensions('decryptData', info.graphicTitle) : ""
secretKey = info.secretKey ? await svgEditor.svgCanvas.runExtensions('decryptData', info.secretKey) : ""
graphic = info.graphicBlob ? info.graphicBlob : ""
placeId = info.placeID ? info.placeID : ""
coords = info.coordinates ? info.coordinates : ""
}
},
async encryptDataVal(data){
Expand Down Expand Up @@ -467,6 +486,8 @@ export default {
graphicTitle = info.graphicTitle ? await svgEditor.svgCanvas.runExtensions('decryptData', info.graphicTitle) : ""
secretKey = info.secretKey ? await svgEditor.svgCanvas.runExtensions('decryptData', info.secretKey): ""
graphic = info.graphicBlob ? info.graphicBlob : ""
placeId = info.placeID ? info.placeID : ""
coords = info.coordinates ? info.coordinates : ""
}})
}
}
Expand Down