瀏覽代碼

Merge e0869d1dbe into 1eaccef60f

pull/573/merge
David von Oheimb 1 月之前
committed by GitHub
父節點
當前提交
2438ff9f49
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: B5690EEEBB952194
共有 3 個文件被更改,包括 35 次插入10 次删除
  1. +23
    -0
      pannellum.htm
  2. +1
    -1
      src/js/pannellum.js
  3. +11
    -9
      src/standalone/standalone.js

+ 23
- 0
pannellum.htm 查看文件

@@ -0,0 +1,23 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pannellum</title>
<link type="text/css" rel="Stylesheet" href="src/css/pannellum.css"/>
<link type="text/css" rel="Stylesheet" href="src/standalone/standalone.css"/>
</head>
<body>
<div id="container">
<noscript>
<div class="pnlm-info-box">
<p>Javascript is required to view this panorama.<br>(It could be worse; you could need a plugin.)</p>
</div>
</noscript>
</div>
<script type="text/javascript" src="src/js/libpannellum.js"></script>
<script type="text/javascript" src="src/js/RequestAnimationFrame.js"></script>
<script type="text/javascript" src="src/js/pannellum.js"></script>
<script type="text/javascript" src="src/standalone/standalone.js"></script>
</body>
</html>

+ 1
- 1
src/js/pannellum.js 查看文件

@@ -416,7 +416,7 @@ function init() {
xhr = new XMLHttpRequest();
xhr.onloadend = function() {
if (xhr.status != 200) {
if (xhr.status != 200 && xhr.status != 0) {
// Display error if image can't be loaded
var a = document.createElement('a');
a.href = p;


+ 11
- 9
src/standalone/standalone.js 查看文件

@@ -83,7 +83,7 @@ function parseURLParameters() {
// Get JSON configuration file
request = new XMLHttpRequest();
request.onload = function() {
if (request.status != 200) {
if (request.status != 200 && request.status != 0) {
// Display error if JSON can't be loaded
var a = document.createElement('a');
a.href = configFromURL.config;
@@ -114,6 +114,14 @@ function parseURLParameters() {
configFromURL.escapeHTML = true;
viewer = pannellum.viewer('container', configFromURL);
};
request.onerror = function(e) {
// Display error if opened from local file
if (window.location.protocol == 'file:')
anError('Due to browser security restrictions, loading Pannellum files from the local filesystem has been denied; ' +
'use the Chrome/Opera command-line option "--allow-file-access-from-files" or some sort of local web server.');
else
anError("Error loading "+configFromURL.config);
}
request.open('GET', configFromURL.config);
request.send();
return;
@@ -129,11 +137,5 @@ function parseURLParameters() {
viewer = pannellum.viewer('container', configFromURL);
}

// Display error if opened from local file
if (window.location.protocol == 'file:') {
anError('Due to browser security restrictions, Pannellum can\'t be run ' +
'from the local filesystem; some sort of web server must be used.');
} else {
// Initialize viewer
parseURLParameters();
}
// Initialize viewer
parseURLParameters();

Loading…
取消
儲存