Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Tour-360/tour-player into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
BorodinDK committed Oct 26, 2018
2 parents cf15b95 + 3d38b67 commit 3c793ca
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 40 deletions.
2 changes: 1 addition & 1 deletion example/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// specification: https://github.com/Tour-360/tour-player/wiki/Формат-файла-Data.json
{
"_specification": "https://github.com/Tour-360/tour-player/wiki/Формат-файла-Data.json",
"title": "Avant SHOP",
"start": 1,
"backgroundImage": "data:image/gif;base64,R0lGODdhCAAGAPIAAOjt86O4sp2np0tbTJKNi46gqLyyvcHK0iwAAAAACAAGAAADGhgGdxwiyFDEGaIckQ0mhtENhEBsFqFajJEAADs=",
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
"name": "tour-player",
"version": "2.0.0",
"description": "",
"repository": {},
"repository": {
"type": "git",
"url": "https://github.com/Tour-360/tour-player"
},
"scripts": {
"postinstall": "./node_modules/bower/bin/bower i && ./node_modules/gulp/bin/gulp.js build",
"start": "node index.js",
"test": "gulp lint"
},
"repository": {
"type": "git",
"url": "https://github.com/Tour-360/tour-player"
},
"keywords": [
"tour",
"virtual",
Expand All @@ -23,13 +22,14 @@
"author": "Maxim Borodin <[email protected]> (http://maximborodin.ru)",
"contributors": [
{
"name" : "Maxim Borodin",
"email" : "[email protected]",
"url" : "http://maximborodin.ru"
},{
"name" : "Denis Borodin",
"email" : "[email protected]",
"url" : "http://denisborodin.ru"
"name": "Maxim Borodin",
"email": "[email protected]",
"url": "http://maximborodin.ru"
},
{
"name": "Denis Borodin",
"email": "[email protected]",
"url": "http://denisborodin.ru"
}
],
"license": "MIT",
Expand Down
1 change: 0 additions & 1 deletion src/js/Tour/addEventListeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ Tour.addEventListeners = function() {
window.addEventListener('resize', this.resize.bind(this));

window.addEventListener('popstate', Tour.history.onpopstate);
window.addEventListener('error', Tour.report);
};
3 changes: 3 additions & 0 deletions src/js/Tour/defaultOption.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Tour.defaultOption = {
touchScroll: false,
scaleControl: true,
autorotationAlign: true,
sentry: {
dsn: 'https://[email protected]/1309149'
},
limit: {
fov: { min: 20, max: 90},
lat: { min: -85, max: 85},
Expand Down
7 changes: 7 additions & 0 deletions src/js/Tour/dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,12 @@ Tour.dictionary = {
'uk': 'Помилка завантаження віртуального туру',
'de': 'Fehler beim Laden Virtuelle Tour',
'zh': '错误加载虚拟旅游'
},
'notification.error-load-tour-protocol': {
'en': 'Loading error. Use the http or https protocol for correct tour operation',
'ru': 'Ошибка загрузки. Используйте протокол http или https для корректной работы тура',
'uk': 'Помилка завантаження. Використовуйте протокол http або https для коректної роботи туру',
'de': 'Ladefehler. Verwenden Sie das http- oder https-Protokoll für den korrekten Tour-Vorgang',
'zh': '加载错误。 使用http或https协议进行正确的巡视操作'
}
};
11 changes: 9 additions & 2 deletions src/js/Tour/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ Tour.load = function(data, callback) {
return;
}
if (xhr.status != 200) {
UI.notification.show(Lang.get('notification.error-load-tour'), false);
var errorText
if(xhr.status == 0 || window.location.protocol == 'file:'){
errorText = Lang.get('notification.error-load-tour-protocol');
}else{
errorText = Lang.get('notification.error-load-tour');
}
UI.notification.show(errorText, false);
} else {
try {
Tour.data = JSON.parse(xhr.responseText);
var json = xhr.responseText.replace(/\/\*[\s\S]*?\*\/|([^:]|^)\/\/.*$/mg, '');
Tour.data = JSON.parse(json);
callback(Tour.data);
Tour.emmit('load', Tour.data);
} catch (e) {
Expand Down
24 changes: 0 additions & 24 deletions src/js/Tour/report.js

This file was deleted.

12 changes: 12 additions & 0 deletions src/js/Tour/sentry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* globals Tour */

Tour.sentry = function() {
var script = document.createElement('script');
script.src = 'https://browser.sentry-cdn.com/4.2.2/bundle.min.js';
script.crossorigin = "anonymous";
document.getElementsByTagName('head')[0].appendChild(script);

script.onload = function() {
Sentry.init(Tour.options.sentry);
}
};

0 comments on commit 3c793ca

Please sign in to comment.