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 ad96699
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']

Check failure on line 200 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 200 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
loc = encodeURIComponent(loc)

Check failure on line 201 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 201 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
loc = loc.replaceAll("%2F", "/")

Check failure on line 202 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Strings must use singlequote

Check failure on line 202 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Strings must use singlequote

Check failure on line 202 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check failure on line 202 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Strings must use singlequote

Check failure on line 202 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Strings must use singlequote

Check failure on line 202 in core/CaMic.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing semicolon
// 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 ad96699

Please sign in to comment.