Skip to content

Commit e8b5423

Browse files
authored
Switch to loading the 3DHOP libraries from an https server (#162)
* Switch to loading the 3DHOP libraries from an https server * Adding changes to CHANGELOG.md
1 parent d00186e commit e8b5423

File tree

2 files changed

+30
-33
lines changed

2 files changed

+30
-33
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2020
### Changed
2121
- `api/reports/storage/spaces` endpoint now accepts a space parameter for ID rather than requiring a space filter.
2222
- Datasets and collections in the trash are no longer indexed for discovery in search services.
23+
- Switched to loading the 3DHOP libraries used by `viewer_hop.js` from http://vcg.isti.cnr.it/3dhop/distribution to https://3dhop.net/distribution. The new server is a safer https server.
2324

2425
## 1.13.0 - 2020-12-02
2526

@@ -68,8 +69,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6869
- Track user_id with every extraction event. [#94](https://github.com/clowder-framework/clowder/issues/94)
6970
- Added a new storage report at `GET api/reports/storage/spaces/:id` for auditing user storage usage on a space basis.
7071
- The file and dataset metrics reports also have support for since and until ISO8601 date parameters.
71-
- Added `viewer_hop` a 3D models previewer for `*.ply` and `*.nxz` files. Added `mimetype.nxz=model/nxz` and
72-
`mimetype.NXZ=model/nxz` as new mimetypes in `conf/mimetypes.conf`
72+
- Added `viewer_hop` a 3D models previewer for `*.ply` and `*.nxz` files. Added `mimetype.nxz=model/nxz` and `mimetype.NXZ=model/nxz` as new mimetypes in `conf/mimetypes.conf`
7373

7474
### Fixed
7575
- Ignore the `update` field when posting to `/api/extractors`. [#89](https://github.com/clowder-framework/clowder/issues/89)

public/javascripts/previewers/viewer_hop/viewer_hop.js

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Loads the 3DHOP library and uses methods and functions to
55
load 3D models in point cloud (*.ply) and nexus (*.nxz) form
6-
into a clowder repository.
6+
into a clowder repository.
77
88
Language: JavaScript
99
@@ -13,19 +13,21 @@
1313
+ 09/14/20 (cc): Created.
1414
+ 10/14/20 (cc): Changing the source of the 3DHOP files
1515
and load them online
16+
+ 01/08/21 (cc): Loading libraries from https
1617
1718
****************************************************************/
1819

20+
1921
(function ($, Configuration) {
20-
var useTab = Configuration.tab;
21-
var referenceUrl = Configuration.url;
22-
var confId = Configuration.id;
23-
var fileId = Configuration.fileid;
24-
var previewer = Configuration.previewer;
22+
let useTab = Configuration.tab;
23+
let referenceUrl = Configuration.url;
24+
let confId = Configuration.id;
25+
let fileId = Configuration.fileid;
26+
let previewer = Configuration.previewer;
2527

26-
var fileName = $('#file-name-title').text().trim();
27-
var fileNameExtension = fileName.substr(fileName.length - 3);
28-
var fileType;
28+
let fileName = $('#file-name-title').text().trim();
29+
let fileNameExtension = fileName.substr(fileName.length - 3);
30+
let fileType;
2931

3032
if (fileNameExtension == "ply") {
3133
fileType = "ply";
@@ -34,11 +36,6 @@
3436
fileType = "nexus";
3537
}
3638

37-
//alert(fileName);
38-
//alert(typeof(fileName));
39-
//alert(fileNameExtension);
40-
//alert(fileType);
41-
4239
// print all attributes of Configuration object
4340

4441
/*for (const property in Configuration)
@@ -48,7 +45,7 @@
4845

4946
// add 3dhop.css to previewer
5047

51-
$(useTab).append('<link rel="stylesheet" type="text/css" href="http://vcg.isti.cnr.it/3dhop/distribution/stylesheet/3dhop.css">');
48+
$(useTab).append('<link rel="stylesheet" type="text/css" href = "https://3dhop.net/distribution/latest/stylesheet/3dhop.css">');
5249

5350
// load various 3dhop attributes (such as the background image) for 3dhop
5451

@@ -66,22 +63,22 @@
6663
id: 'toolbar'
6764
}));
6865

69-
$("#toolbar").append("<img id='home' title='Home' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/home.png'/><br/>");
66+
$("#toolbar").append("<img id='home' title='Home' src='https://3dhop.net/distribution/latest/skins/dark/home.png'/><br/>");
7067

71-
$("#toolbar").append("<img id='zoomin' title='Zoom In' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/zoomin.png'/><br/>");
72-
$("#toolbar").append("<img id='zoomout' title='Zoom Out' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/zoomout.png'/><br/>");
68+
$("#toolbar").append("<img id='zoomin' title='Zoom In' src='https://3dhop.net/distribution/latest/skins/dark/zoomin.png'/><br/>");
69+
$("#toolbar").append("<img id='zoomout' title='Zoom Out' src='https://3dhop.net/distribution/latest/skins/dark/zoomout.png'/><br/>");
7370

74-
$("#toolbar").append("<img id='light_on' title='Disable Light Control' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/lightcontrol_on.png' style='position:absolute; visibility:hidden;'/>");
75-
$("#toolbar").append("<img id='light' title='Enable Light Control' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/lightcontrol.png'/><br/>");
71+
$("#toolbar").append("<img id='light_on' title='Disable Light Control' src='https://3dhop.net/distribution/latest/skins/dark/lightcontrol_on.png' style='position:absolute; visibility:hidden;'/>");
72+
$("#toolbar").append("<img id='light' title='Enable Light Control' src='https://3dhop.net/distribution/latest/skins/dark/lightcontrol.png'/><br/>");
7673

77-
$("#toolbar").append("<img id='measure_on' title='Disable Measure Tool' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/measure_on.png' style='position:absolute; visibility:hidden;'/>");
78-
$("#toolbar").append("<img id='measure' title='Enable Measure Tool' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/measure.png'/><br/>");
74+
$("#toolbar").append("<img id='measure_on' title='Disable Measure Tool' src='https://3dhop.net/distribution/latest/skins/dark/measure_on.png' style='position:absolute; visibility:hidden;'/>");
75+
$("#toolbar").append("<img id='measure' title='Enable Measure Tool' src='https://3dhop.net/distribution/latest/skins/dark/measure.png'/><br/>");
7976

80-
$("#toolbar").append("<img id='pick_on' title='Disable PickPoint Mode' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/pick_on.png' style='position:absolute; visibility:hidden;'/>");
81-
$("#toolbar").append("<img id='pick' title='Enable PickPoint Mode' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/pick.png'/><br/>");
77+
$("#toolbar").append("<img id='pick_on' title='Disable PickPoint Mode' src='https://3dhop.net/distribution/latest/skins/dark/pick_on.png' style='position:absolute; visibility:hidden;'/>");
78+
$("#toolbar").append("<img id='pick' title='Enable PickPoint Mode' src='https://3dhop.net/distribution/latest/skins/dark/pick.png'/><br/>");
8279

83-
$("#toolbar").append("<img id='full_on' title='Exit Full Screen' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/full_on.png' style='position:absolute; visibility:hidden;'/>");
84-
$("#toolbar").append("<img id='full' title='Full Screen' src='http://vcg.isti.cnr.it/3dhop/distribution/skins/dark/full.png'/>");
80+
$("#toolbar").append("<img id='full_on' title='Exit Full Screen' src='https://3dhop.net/distribution/latest/skins/dark/full_on.png' style='position:absolute; visibility:hidden;'/>");
81+
$("#toolbar").append("<img id='full' title='Full Screen' src='https://3dhop.net/distribution/latest/skins/dark/full.png'/>");
8582

8683
$('#3dhop').append($('<div/>', {
8784
id: 'measure-box',
@@ -119,18 +116,18 @@
119116

120117
$("#3dhop").append($('<canvas/>', {
121118
id: 'draw-canvas',
122-
style: 'background-image: url("http://vcg.isti.cnr.it/3dhop/distribution/skins/backgrounds/dark.jpg")'
119+
style: 'background-image: url("https://3dhop.net/distribution/latest/skins/backgrounds/dark.jpg")'
123120
}));
124121

125122
// scripts holds all the 3dhop files
126123

127-
var scripts = ["spidergl.js", "nexus.js", "ply.js", "trackball_sphere.js",
124+
let scripts = ["spidergl.js", "nexus.js", "ply.js", "trackball_sphere.js",
128125
"trackball_turntable.js", "trackball_pantilt.js", "trackball_turntable_pan.js", "init.js", "presenter.js"];
129126

130127
// append the http address where the files are located
131128

132129
for (index = 0; index < scripts.length; index++) {
133-
scripts[index] = "http://vcg.isti.cnr.it/3dhop/distribution/js/" + scripts[index];
130+
scripts[index] = "https://3dhop.net/distribution/latest/js/" + scripts[index];
134131
}
135132

136133
// load 3dhop into the current tab (old version)
@@ -189,7 +186,7 @@
189186

190187
function getScripts(scripts, callback) {
191188

192-
var progress = 0;
189+
let progress = 0;
193190

194191
scripts.forEach(function (script) {
195192
//alert(script);
@@ -199,7 +196,7 @@ function getScripts(scripts, callback) {
199196
});
200197
}
201198

202-
var presenter = null;
199+
let presenter = null;
203200

204201
function setup3dhop(address, fileType) {
205202
presenter = new Presenter("draw-canvas");

0 commit comments

Comments
 (0)