From ad5b4ff7b5abcff3ae7ae7291480c4aceb85619b Mon Sep 17 00:00:00 2001 From: Guillaume de Bure Date: Sat, 16 Aug 2014 18:18:57 +0200 Subject: [PATCH] Allow adding additional css files to the embedded html Useful for using, (for example) fontawesome icons for hotspots --- examples/example-video.htm | 1 + examples/example-video.json | 17 +++++++++++++---- src/js/pannellum.js | 3 +++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/examples/example-video.htm b/examples/example-video.htm index e099db2..24968ac 100644 --- a/examples/example-video.htm +++ b/examples/example-video.htm @@ -3,6 +3,7 @@ pannellum embed example + diff --git a/examples/example-video.json b/examples/example-video.json index 351bcfb..396e51a 100644 --- a/examples/example-video.json +++ b/examples/example-video.json @@ -2,7 +2,8 @@ "default": { "author": "Matthew Petroff", "firstScene": "pond", - "autoload": "yes" + "autoload": "yes", + "css": "/font-awesome/css/font-awesome.min.css" }, "scenes": { @@ -56,11 +57,19 @@ }, { "pitch":0, - "yaw": -120, - "text": "Video Test ", - "type": "info", + "yaw": 0, + "text": "Video Test", + "type": "fa fa-camera", "video": "../examples/big_buck_bunny_480p_h264.mov", "width":200 + }, + { + "pitch":0, + "yaw": 30, + "text": "Image Test", + "type": "fa fa-photo", + "image": "http://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/Jordan_Pond_Maine.JPG/1024px-Jordan_Pond_Maine.JPG", + "width":200 } ] } diff --git a/src/js/pannellum.js b/src/js/pannellum.js index 6192602..46adb13 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -667,6 +667,9 @@ function processOptions() { document.getElementById('author_box').innerHTML = 'by ' + config[key]; document.getElementById('panorama_info').style.display = 'inline'; break; + + case 'css': + document.head.innerHTML = document.head.innerHTML + '' case 'popout': if(config[key] == 'yes') {