Skip to content

Commit

Permalink
decode some special characters before passing to iip
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Jan 11, 2024
1 parent 0108ac2 commit 1fef0ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/CaMic.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,14 @@ class CaMic {
this.slideId = data['_id']['$oid'];

this.slideName = data['name'];
// encode special characters but not dir slashes
let loc = data['location'];
loc = encodeURIComponent(loc);
loc = loc.replaceAll('%2F', '/');
// insert token if present
let iipSrvUrl = '../../img/IIP/raw/?DeepZoom='+ data['location'] + '.dzi';
let iipSrvUrl = '../../img/IIP/raw/?DeepZoom='+ loc + '.dzi';
if (getCookie('token')) {
iipSrvUrl = '../../img/IIP/raw/?token=' + getCookie('token') + '&DeepZoom='+ data['location'] + '.dzi';
iipSrvUrl = '../../img/IIP/raw/?token=' + getCookie('token') + '&DeepZoom='+ loc + '.dzi';
}
this.viewer.open(iipSrvUrl);
// set mpp
Expand Down

0 comments on commit 1fef0ee

Please sign in to comment.