',
].join('');
n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
s.isMobile() ||
$('[rel=tiletip]').tooltip({
placement: 'bottom',
delay: {
show: 50,
hide: 0,
},
trigger: 'hover',
viewport: {
selector: 'body',
padding: 10,
},
});
}
function o() {
var e = s.isMobile()
? ''
: '' +
h.ERROR_GENERIC_ACTIONS_2 +
'' +
h.ERROR_GENERIC_ACTIONS_3,
t = [h.ERROR_GENERIC_ACTIONS_1, e].join('');
n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, '', t),
s.isMobile() ||
$('.install-browser').on('click touchstart', function (e) {
e.preventDefault(), e.stopPropagation(), r(' ');
});
}
function a(e) {
if (
($('head title').text(c.pageTitle),
$('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
$('#gui-loading').fadeOut(250),
$('#quick-blackout').hide(),
l.track('showcase_error', {
error_key: e,
}),
h.locale || h.init(),
'webgl-unsupported' === e)
)
s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
else if ('webgl-ios' === e)
n(
h.ERROR_WEBGL_IOS_PROBLEM,
h.ERROR_WEBGL_IOS_SOLUTION,
'',
h.ERROR_WEBGL_IOS_ACTIONS_1 +
'' +
h.ERROR_WEBGL_IOS_ACTIONS_2 +
'.'
);
else if ('webgl-safari' === e)
n(
h.ERROR_WEBGL_SAFARI_PROBLEM,
'',
'',
h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
'' +
h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
'. ' +
h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
'' +
h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
'.'
);
else if ('webgl-generic' === e) o();
else if ('missing-urls' === e)
n(h.ERROR_MISSING_URLS_PROBLEM, '', h.ERROR_MISSING_URLS_EXPLANATION);
else if ('loading-failed' === e)
n(
h.ERROR_LOADING_FAILED_PROBLEM,
'',
'',
h.ERROR_LOADING_FAILED_ACTIONS_1 +
'' +
h.ERROR_LOADING_FAILED_ACTIONS_2 +
'.'
);
else {
if ('loading-failed-maintenance' !== e) return void d.error('Unhandled error: ' + e);
n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION);
}
}
var s = e('./../util/browser'),
l = e('./../analytics'),
c = e('./../settings'),
h = e('../localization/localize'),
u = e('./../util/logger'),
d = new u(i),
p = '"https://support.port.com/hc/articles/208220058"';
t.exports.error = a;
}.call(this, '/js/gui/error.js'));
},
{
'../localization/localize': 108,
'./../analytics': 4,
'./../settings': 166,
'./../util/browser': 182,
'./../util/logger': 189,
},
],
65: [
function (e, t, i) {
(function (i) {
'use strict';
function n() {
(Ue = []),
je.floors.visible && Ue.push('.gui-floor', '.gui-floor-title'),
Ue.push('.hideTarget', '.pinTop.right');
}
function r() {
for (var e in je)
if (je.hasOwnProperty(e)) {
var t = je[e];
if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide();
}
je.highlight.visible && $('.pinBottom').addClass('highlightExists'),
je.tourControls.visible === !1 && $('#drawer').addClass('fullWidth'),
n();
}
function o(e, t) {
var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
$('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i);
}
function a() {
c(),
$('.pinBottom').toggleClass('open'),
$('#drawer').toggleClass('open'),
$('.footer').toggleClass('open'),
$('#drawer').hasClass('open')
? ($('#pullTab .icon').attr('data-original-title', Re.CLOSE_HIGHLIGHTS),
Ze('highlights'))
: ($('#pullTab .icon').attr('data-original-title', Re.OPEN_HIGHLIGHTS),
ie.resetDrawer()),
setTimeout(
function () {
$('#pullTab').toggleClass('opened');
},
$('#drawer').hasClass('open') ? 0 : Q.highlightAnimationDuration
),
$('.pinBottom').hasClass('open') &&
s($('.vr-popup')) &&
$('.vr-popup').is(':visible') &&
Ae.dismiss();
}
function s(e) {
var t;
'none' !== e.css('display')
? (t = e.position().top + e.outerHeight())
: (e.attr('style', 'visibility: hidden'),
(t = e.position().top + e.outerHeight()),
e.attr('style', 'display: none'));
var i = $('#player').outerHeight(),
n = i - 130;
return n < t + 25;
}
function l(e) {
'touchstart' === e.type && e.preventDefault(), e.stopPropagation();
}
function c() {
W && (W.reload(), W.init());
}
function h(e) {
ne.show(e), r();
}
function u(e) {
ne.progress(e);
}
function d(e, t, i) {
var n = t.player;
$('#gui-thumb').fadeOut(2500),
ne.hide(function () {
Ge = !1;
}),
me.init(e, i),
de.finishSetup(Object.keys(e.tags).length),
i.on(Te.IMAGE_OPENED, Ze.bind(this, 'tag'));
var s = function () {
i.dismissExaminedTag(), i.disableHovering();
};
Ae.on(ye.OPENED, s), Ce.on(Me.OPENED, s), he.on(ue.OPENED, s), fe.on(ge.OPENED, s);
var l = i.enableHovering.bind(i);
if (
(Ae.on(ye.CLOSED, l),
Ce.on(Me.CLOSED, l),
he.on(ue.CLOSED, l),
fe.on(ge.CLOSED, l),
Q.labels.enabled && Object.keys(e.labels).length,
e.floors.length <= 1 || !je.floors.visible
? (je.floors.visible = !1)
: (y(e, t), C(e.currentFloor, n.mode)),
getQueryVariable('m') === '372' && ((je.floors.visible = 1), y(e, t)),
r(),
o(t, t.player),
$('#gui').fadeIn(1500),
je.highlight.visible &&
(2 !== Q.startHighlights || e.has360Views) &&
setTimeout(function () {
a(),
((!e.has360Views && 1 !== Q.startHighlights) ||
(e.has360Views && 0 === Q.startHighlights)) &&
setTimeout(a, 2e3);
}, 2e3),
!K.isMobile())
)
for (
var c = [
'a',
'#title-toggle',
'.next-button',
'.prev-button',
'.gui-floor',
'.meta-toggle',
'.thumbImg',
'logo-button',
],
h = 0;
h < c.length;
h++
)
$(c[h]).addClass('hasHover');
O(e), de.setupToggling();
//xzw:
window.editHotPanel && editHotPanel();
//czj
navBorderRadius(e);
//czj 编辑界面
//window.EditingInterface && new EditingInterface(n.sceneRenderer);
window.EditTools && new EditTools(n.sceneRenderer);
}
function navBorderRadius(e) {
var pullTab = $('#pullTab'),
mobileRadius = {
bottom: {
'border-bottom-left-radius': '10px',
'border-bottom-right-radius': '10px',
},
top: { 'border-top-left-radius': '10px', 'border-top-right-radius': '10px' },
},
topRadius = {
bottom: { 'border-top-right-radius': '10px', 'border-bottom-right-radius': '10px' },
top: { 'border-bottom-left-radius': '10px', 'border-top-left-radius': '10px' },
};
function BorderRadius(bottom, top) {
$('#gui-modes-map > div:visible:last').css(bottom);
if (pullTab.is(':visible')) {
$('.viewContainer > div:visible:first').css(top);
} else {
$('#gui-modes-map > div:visible:first').css(top);
}
}
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
BorderRadius(mobileRadius.bottom, mobileRadius.top);
} else {
BorderRadius(topRadius.bottom, topRadius.top);
}
//判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
if (window.DATA.model.special || window.DATA.special) {
window.specialScene && specialScene.special().afterImplement();
}
}
function p(e) {
e || (e = 0),
(We = !1),
window.setTimeout(
function () {
We || ((ze = !0), $('#gui-spinner').stop(!0, !0).show());
}.bind(this),
e
);
}
function f() {
$('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), (We = !0), (ze = !1);
}
function g(e, t) {
var i = e.mode,
n = t || e.currentPano;
$('#gui-modes-dollhouse').toggleClass('active', i === _e.DOLLHOUSE),
$('#gui-modes-floorplan').toggleClass('active', i === _e.FLOORPLAN),
$('#gui-modes-inside').toggleClass('active', i === _e.PANORAMA),
i === _e.PANORAMA
? ($('#view-controllers').slideUp(500),
Q.show360Views.enabled && !n.isAligned()
? ($('.gui-floor').addClass('hidden'),
$('#gui-modes-outside').addClass('desktop-only'))
: ($('.gui-floor').removeClass('hidden'),
$('#gui-modes-outside').removeClass('desktop-only')),
$('#gui-modes-outside').removeClass('hidden'))
: i !== _e.TRANSITIONING &&
(f(),
(Be = i),
$('#gui-modes-outside').addClass('hidden'),
e.model.has360Views && $('.gui-floor').removeClass('hidden'),
$('#view-controllers').is(':visible') ||
$('#view-controllers').slideDown(Q.guiAnimationSpeed));
}
function m(e, t) {
var i = t.player;
$('#gui-modes-inside').on('mousedown touchstart', function (e) {
l(e),
J.updateInteraction(Se.InteractionGui, 'inside-button'),
J.track('USER', {
event_type: 'showcase_gui',
gui_action: 'click_inside_mode_button',
}),
t.changeMode(_e.PANORAMA);
}),
$('#gui-modes-outside')
.find('a')
.on('click', function (e) {
l(e),
J.track('showcase_gui', {
gui_action: 'click_outside_mode_button',
}),
t.changeMode(Be);
}),
$('#gui-modes-floorplan').on('click', function (e) {
l(e),
i.mode !== _e.FLOORPLAN &&
(J.track('showcase_gui', {
gui_action: 'click_floorplan_mode_button',
}),
t.changeMode(_e.FLOORPLAN));
}),
$('#gui-modes-dollhouse').on('click', function (e) {
l(e),
i.mode !== _e.DOLLHOUSE &&
(J.track('showcase_gui', {
gui_action: 'click_dollhouse_mode_button',
}),
t.changeMode(_e.DOLLHOUSE));
});
}
function v(e, t) {
function i() {
document.getElementById('vr').classList.remove('hidden'),
Q.vr.allowWebVR
? K.getVRDisplay().then(
function (e) {
K.supportsFullscreen()
? n(e)
: (De.warn('Unable to use WebVR when full screen is not supported'),
$('.improper-embed').toggleClass('hidden', !1),
r());
},
function (e) {
r();
}
)
: r();
}
function n(i) {
De.info(i.displayName + ' detected, VR button activates WebVR experience'),
Ie.init(e.data, t, i, q),
Ie.on(Ee.OPENED, Ze.bind(gui, 'vr')),
Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe));
}
function r() {
De.info('WebVR support not found, VR button activates native app VR modal'),
Ae.init(e.data, q),
Ae.on(
ye.OPENED,
(function () {
var e = document.getElementById('vr-modal');
return function () {
Ze('vr'), le.open(e);
};
})()
),
Ae.on(ye.CLOSED, le.reset);
}
if (Q.vr.enabled && e.supportsVR && !K.valueFromHash('mls', 0)) {
/*********************** 方奕卓 VR功能事件监听 ********************/
K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
switch (Q.vr.option) {
case Pe.CONTEXTUAL:
i();
break;
case Pe.ANDROID:
K.detectAndroid() && i();
break;
case Pe.NONE:
}
}
}
function A(e, t) {
$('#play').on('mousedown touchstart', function (e) {
l(e);
Ze('tour');
ve.play();
J.trackAlways('showcase_gui', {
gui_action: 'play_highlights',
});
}),
(window.startAndPlay = function (e) {
// l(e);
Ze('tour');
ve.play();
J.trackAlways('showcase_gui', {
gui_action: 'play_highlights',
});
});
$('#pause').on('mousedown touchstart', function (e) {
l(e),
ve.pause(),
J.trackAlways('showcase_gui', {
gui_action: 'pause_highlights',
});
}),
$('#gui-zoomin')
.find('a')
.on('click', function (e) {
l(e), t.player.zoomInIncrementally();
}),
$('#gui-zoomout')
.find('a')
.on('click', function (e) {
l(e), t.player.zoomOutIncrementally();
});
}
function y(e, t) {
for (var i = $('.gui-floor'), n = 0; n < e.floors.length; n++) {
if (getQueryVariable('m') === '372') continue;
var r = $('').text(
e.floors.get(n).name
);
$('.gui-floor').find('.container').prepend(r);
//cxz 本来一开始是prepend 后来改了append 按顺序插入
}
i
.find('.container')
.prepend(
'
' +
Re.FLOOR_ALL +
'
'
),
i.on('click', function (e) {
l(e), Ze('floor'), i.toggleClass('open');
}),
$('.floorChoice').on('click', function (e) {
l(e);
var n = $(this).data('index');
'all' !== n
? (J.updateInteraction(Se.InteractionGui, 'floor-control'),
t.player.gotoFloor(n),
J.track('showcase_gui', {
gui_action: 'click_floor_select_button',
interaction_source: 'gui',
}))
: (J.updateInteraction(Se.InteractionGui, 'floor-control'),
Ze('move'),
t.allFloors(),
J.track('showcase_gui', {
gui_action: 'click_toggle_all_floors_button',
interaction_source: 'gui',
})),
i.removeClass('open');
});
}
function C(e, t) {
e &&
(t === _e.DOLLHOUSE || t === _e.FLOORPLAN
? ($('.allFloorBtn').show(),
$('.gui-floor-icon').hide(),
$('.gui-floor-title').show())
: ($('.allFloorBtn').hide(),
$('.gui-floor-icon').show(),
$('.gui-floor-title').hide()),
e.model.allFloorsVisible
? ($('.gui-floor-title').text(Re.FLOOR_ALL),
$('.gui-floor-number').text(Re.FLOOR_ALL),
$('.floorChoice').removeClass('active'),
$('.floorChoice[data-index="all"]').addClass('active'))
: ($('.gui-floor-title').text(e.name),
$('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
$('.floorChoice').removeClass('active'),
$('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')));
}
function I(e) {
return e.describe().inTransition;
}
function b(e, t, i) {
Fe = e.heroLocations.length;
var n = '
',
r = 100 / Fe + '%',
o = $('#thumb-container'),
a = $('#progressBar');
$('#status').find('.totalSteps').text(Fe);
for (var s = 0; s < Fe; s++) {
var c = e.heroLocations[s],
h = $(n);
var thumbUrl;
if (c.heroLocations) {
//有子项,选第一张截图
thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl); //.replace('https://','').replace('http://','')
} else {
thumbUrl = manage.dealURL(c.thumbUrl); //.replace('https://','').replace('http://','')
}
h.attr('data-index', s);
je.highlight.visible && h.find('img').attr('src', thumbUrl);
if (c.name) {
var u = $('').text(c.name);
h.prepend(u);
}
if (e.has360Views && c.cameraMode === _e.PANORAMA) {
var d = e.panos.get(c.panoId),
p = d && !d.isAligned(),
f = p
? '
'
: '
';
h.prepend(f);
}
o.append(h),
a.append('');
}
(j = 144 * Fe),
(Y = 111 * Fe),
$('.thumbImg').on('mouseover', function () {
I(t) || i.showPathToHeroLocation([$(this).data('index'), 0]); //改
}),
$('.thumbImg').on('mouseout', function () {
t.clearPath();
}),
$('.thumbImg').on('click', function (e) {
l(e);
var i = $(this);
J.updateInteraction(Se.InteractionGui, 'thumbnail'),
J.trackAlways('showcase_gui', {
gui_action: 'click_highlight',
}),
t.goToHighlight([i.data('index'), 0]); //改
}),
$('.previous')
.find('a')
.on('click', function (e) {
l(e),
J.trackAlways('showcase_gui', {
gui_action: 'prev_highlight',
}),
t.prevHighlight();
}),
$('.next')
.find('a')
.on('click', function (e) {
l(e),
J.trackAlways('showcase_gui', {
gui_action: 'next_highlight',
}),
t.nextHighlight();
}),
$('#drawer').on('mouseleave', function (e) {
l(e);
var t;
try {
t = new MouseEvent('mouseup', {
clientX: e.clientX,
clientY: e.clientY,
screenX: e.screenX,
screenY: e.screenY,
});
} catch (i) {
(t = document.createEvent('MouseEvents')),
t.initMouseEvent(
'mouseup',
e.bubbles,
e.cancelable,
e.view,
e.detail,
e.screenX,
e.screenY,
e.clientX,
e.clientY,
e.ctrlKey,
e.altKey,
e.shiftKey,
e.metaKey,
e.button,
e.relatedTarget
);
}
document.dispatchEvent(t);
}),
(W = new Sly($('#scrollFrame'), {
horizontal: !0,
itemNav: 'centered',
smart: !0,
scrollTrap: !0,
scrollBy: 1,
mouseDragging: !0,
touchDragging: !0,
speed: 300,
dragHandle: !0,
dynamicHandle: !0,
clickBar: !0,
scrollBar: $('#scroller'),
activateOn: null,
}).init()),
W.on('active', function (e, t) {
(Ve = t),
Ze('tour'),
$('.step').removeClass('active'),
$('#status')
.find('.curIdx')
.text(t + 1);
for (var i = 0; i <= t; i++)
$('#progressBar')
.find("[data-idx='" + i + "']")
.addClass('active');
}),
w();
//add :
let scrollFrame = $(W.frame);
scrollFrame.on('wheel.sly', function () {
lastMoveScrollTime = Date.now();
});
let dragstart;
/* scrollFrame.on("pointerdown", function() {
dragstart = true
})
scrollFrame.on("pointerup", function() {
dragstart = false
}) */
scrollFrame.on('pointermove', function () {
//if(dragstart){
lastMoveScrollTime = Date.now();
//}
});
}
function w() {
var e = $('#player').width() - 20,
t = $('#scroller'),
i = $('#drawer'),
n = $('.pinBottom');
if ($('#player').width() < 488 || $('#player').height() < 488)
t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll');
else {
var r = j > e,
o = !i.hasClass('noScroll'),
a = r !== o;
a && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'));
}
}
function _(e) {
je.tourControls.visible = true; //e.tour_buttons && K.valueFromHash("gt", 1),
(je.coBrand.visible =
e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash('mls', !1)),
(je.highlight.visible =
/* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights);
}
function T(e) {
function t(t, i) {
return !!e.player_options[t] && e[i || t];
}
$('.model-title').text(e.name);
var i = Q.pageTitle;
// 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
2 !== K.valueFromHash('mls', 0) && e.name && (i = e.name),
(document.title = i),
K.isMobile()
? $('#gui-fullscreen').css('display', 'none')
: ($('[rel=tooltip]').tooltip({
delay: {
show: 50,
hide: 0,
},
trigger: 'hover',
html: !1,
viewport: {
selector: 'body',
padding: 10,
},
}),
K.inIframe() &&
document
.getElementsByClassName('pinBottom-container')[0]
.classList.add('embed')),
// t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
de.populate({
name: t('model_name', 'name'),
coBrand: t('presented_by'),
description: t('model_summary', 'summary') || '暂无内容',
contactName: t('contact_name'),
address: t('address'),
phone: t('contact_phone'),
formattedPhone: e.formatted_contact_phone,
email: t('contact_email'),
url: t('external_url'),
socialSharing: e.enable_social_sharing && e.is_public,
});
}
function x(e, t, i, n, r, o) {
function a() {
o.setLoadingStartTime(),
H(),
r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l);
}
var s = $.Deferred(),
l = s.resolve.bind(s);
return (
(Ge = !0),
O(e),
e.data.player_options && _(e.data.player_options),
1 === Q.specialEdition && $('body').addClass('specialEdition'),
Re.localizeGUI(),
T(e.data),
r || $('.quick').addClass('hidden'),
//e.data.image && !r && E(e.data.image),
n ? (J.impression(), a()) : (o.setWaitingStartTime(), oe.show(r, a)),
s
);
}
function S(e, t, i, n, r, a, s) {
(q = s),
e.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
e.supportedModes[_e.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
ae.init(),
re.init(e, a),
Oe.init(e, t, n),
$('.icon').on('mouseover', function () {
t.player && t.player.reticule.hide();
}),
m(e, t),
A(e, t),
e.data.enable_social_sharing &&
e.data.is_public &&
Q.share.enabled &&
(Ce.init(window.DATA.name /* e.data.name */),
Ce.on(
Me.OPENED,
(function () {
var e = document.getElementById('share-modal');
return function () {
Ze('share'), le.open(e);
};
})()
),
Ce.on(Me.CLOSED, le.reset)),
e.heroLocations.length > 0
? b(e, t, i)
: ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
de.on(pe.OPEN_INFO, Ze.bind(this, 'info')),
z(),
g(i),
v(e, r),
e.on('floor.changed', C),
e.on('waiting', R.bind(this, e)),
e.on('waiting-done', P.bind(this, e)),
i.on(xe.ModeChanged, function (e, n) {
g(i),
o(t, i),
n === _e.PANORAMA &&
i.currentPano &&
!i.currentPano.isAligned() &&
(n = _e.OUTDOOR),
he.updateMode(n);
}),
n.on(Se.Move, Ze.bind(this, 'move')),
i.on(xe.Ready, function () {
ie.init(n, i, i.tagManager, t),
i.on(xe.ModeChanged, function (e, t) {
e !== t && $('.vr-popup').is(':visible') && Ae.dismiss();
});
}),
i.on(xe.PanoChosen, function (e, t) {
g(i, t), he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA);
}),
le.on(ce.CLOSE, function (e) {
switch (e) {
case 'vr-modal':
Ae.dismiss();
break;
case 'share-modal':
Ce.hide();
break;
case 'terms-modal':
fe.hide();
}
});
var l = $('#play').eq(0),
c = $('#pause').eq(0),
h = $('.pinBottom').toArray(),
u = $('#drawer').eq(0),
d = $('#playHead').eq(0),
p = $('#progressBar').eq(0),
f = $('#thumb-container').eq(0),
y = f.children(),
I = p.children();
t.on('update.controls', function () {
//导览控制
var n = t.describe();
n.tourIsPlaying || i.isWarping()
? (je.tourControls.visible && (l.hide(), c.show()),
n.tourInProgress &&
(h.forEach(function (e) {
e.classList.add('playing');
}),
u.addClass('playing'),
d.addClass('playing')))
: (je.tourControls.visible && (l.show(), c.hide()),
n.tourInProgress ||
(ve.stopTour(),
h.forEach(function (e) {
e.classList.remove('playing');
}),
u.removeClass('playing'),
d.removeClass('playing')));
var r, a, s;
if (null !== n.currentItem) {
var p, f;
$('#status')
.find('.curIdx')
.text(n.currentItem[0] + 1),
n.onTheBus ? ((p = 'active'), (f = 'recent')) : ((f = 'active'), (p = 'recent'));
var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
/* for (r = 0; r < e.heroLocations.length; r += 1)
s = y.eq(r),
a = I.eq(r),
s.removeClass(f),
a.removeClass(f),
n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
a.addClass(p),
W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
a.addClass(p)) : (s.removeClass(p),
a.removeClass(p)) */
for (r = 0; r < e.heroLocations.length; r += 1) {
(s = y.eq(r)), (a = I.eq(r)), s.removeClass(f), a.removeClass(f);
if (n.onTheBus && r === n.destinationItem[0]) {
s.addClass(p);
a.addClass(p);
if (Date.now() - lastMoveScrollTime > 2000) {
//add 如果一段时间内用户不操作scrollbar,才focus回这个item
W.activate(r); // scrollbar slide to this
}
} else {
n.onTheBus && g && r === n.currentItem[0]
? (s.addClass(p), a.addClass(p))
: (s.removeClass(p), a.removeClass(p));
}
}
} else for (r = 0; r < e.heroLocations.length; r += 1) (s = y.eq(r)), (a = I.eq(r)), s.removeClass('active recent'), a.removeClass('active recent');
o(t, i);
}),
document.addEventListener(
'keydown',
function (n) {
switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
case we.ZERO:
Q.debug && e.toggleAlpha();
break;
case we.NINE:
Q.debug && se.toggle();
break;
case we.ONE:
i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
break;
case we.TWO:
e.outsideAllowed() &&
!i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) &&
t.changeMode(_e.DOLLHOUSE);
break;
case we.THREE:
e.outsideAllowed() &&
!i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) &&
t.changeMode(_e.FLOORPLAN);
break;
case we.FOUR:
i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
break;
case we.SPACE:
je.tourControls.visible && ($('#playHead').hasClass('playing') || Ze('tour'));
break;
case we.RETURN:
Q.debug && e.toggleExplodeUp();
break;
case we.P:
k();
break;
case we.U:
B();
break;
case we.X:
Q.debug && e.toggleExplode();
break;
case we.PLUSEQUALS:
t.player.activatePersistentZooming(!0), ie.hideUi();
break;
case we.DASHUNDERSCORE:
t.player.activatePersistentZooming(!1), ie.hideUi();
break;
case we.SEVEN:
De.info('Zoom level: ' + t.player.zoomLevel + ', FOV: ' + t.player.zoomFov);
break;
case we.EIGHT:
t.player.decreaseZoomSpeed();
break;
case we.NINE:
t.player.increaseZoomSpeed();
}
return i && i.reticule.hide(), !0;
}.bind(this)
),
document.addEventListener(
'keyup',
function (e) {
switch (e.which) {
case we.PLUSEQUALS:
t.player.deactivatePersistentZooming();
break;
case we.DASHUNDERSCORE:
t.player.deactivatePersistentZooming();
}
}.bind(this)
),
F(e),
L(e, t.player),
M(i),
te.setAutoPlay(e.heroCount()),
he.init(i, a.mode),
he.on(ue.OPENED, Ze.bind(this, 'help')),
fe.init(),
fe.on(
ge.OPENED,
(function () {
var e = document.getElementById('terms-modal');
return function () {
Ze('terms'), le.open(e);
};
})()
),
fe.on(ge.CLOSED, le.reset),
Q.quickstart.enabled ||
re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
(Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
Q.profiling.enabled && se.show(),
ve.init(t);
}
function M(e) {
var t = function (e, t) {
$(e)
.find('a')
.each(function (e, i) {
t
? $(i).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled')
: $(i).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
(i.style.pointerEvents = t ? 'auto' : 'none');
});
},
i = function () {
e.zoomLevel >= Q.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0),
e.zoomLevel <= Q.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0);
};
e.on(Ne.ZoomMax, function () {
t('#gui-zoomin', !1), t('#gui-zoomout', !0);
}),
e.on(Ne.ZoomMin, function () {
t('#gui-zoomin', !0), t('#gui-zoomout', !1);
}),
e.on(Ne.ZoomIn, function () {
t('#gui-zoomout', !0);
}),
e.on(Ne.ZoomOut, function () {
t('#gui-zoomin', !0);
}),
i();
}
function R(e) {
O(e);
}
function P(e) {
O(e);
}
function O(e) {
var t = e.waitQueue.length;
t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay);
}
function L(e, t) {
He = {
gui: null,
visible: !1,
model: e,
player: t,
};
}
function D(e, t) {
function i() {
var i = t.toJSON();
(n.linkToLocation =
window.location.protocol +
'//' +
window.location.host +
window.location.pathname +
'?m=' +
e.sid +
'&start=' +
be.serialize(i)),
t.tagManager.activeTag &&
(n.linkToLocation += '&tag=' + t.tagManager.activeTag.sid);
}
var n = {},
r = new Le.GUI({
autoPlace: !0,
width: '60%',
});
i(),
t.on(xe.ViewChanged, i),
r.add(n, 'linkToLocation').name(Re.LINK_TO_LOCATION).listen(),
(r.domElement.id = 'datLinks');
var o = [].slice.call(r.domElement.querySelectorAll('.property-name'));
return (
o.forEach(function (e) {
if (!K.detectSafari()) {
var t = document.createElement('button');
t.classList.add('btn-deep-link'),
(t.innerText = Re.MENU_COPY),
e.nextSibling.appendChild(t);
var i = function () {
alert(Re.LINK_ALERT_COPY), t.hide();
};
t.addEventListener('click', function (e) {
try {
var t = e.target.parentNode.childNodes[0];
t.select();
var n = document.execCommand('copy');
t.blur(), n || i();
} catch (e) {
i();
}
});
}
}),
$(r.__closeButton).hide(),
r
);
}
function N(e) {
He.gui || (He.gui = D(He.model, He.player)),
(He.visible = e),
e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide();
}
function B() {
N(!He.visible);
}
function F(e) {
ke = {
gui: null,
visible: !1,
model: e,
};
}
function V(e) {
var t = new Le.GUI();
return (
t
.add(Q, 'showSweeps')
.name('Show sweeps')
.onFinishChange(function () {
e.setSweepVisibility(Q.showSweeps);
}),
t.add(Q, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
t
.add(Q.transition, 'flyTime', 0, 5e3)
.name('Transition time')
.onFinishChange(function () {
(Q.transition.flySpeed = 0),
t.__controllers.forEach(function (e) {
e.updateDisplay();
});
}),
t.add(Q.path, 'opacity', 0, 1).name('Path opacity'),
$(t.__closeButton).hide(),
t
);
}
function U(e) {
ke.gui || (ke.gui = V(ke.model)),
(ke.visible = e),
e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide();
}
function k() {
U(!ke.visible);
}
function H() {
function e(e) {
e.target === t ||
$.contains(t, e.target) ||
e.target === i ||
$.contains(i, e.target) ||
e.target === n ||
$.contains(n, e.target); /* || e.preventDefault()*/
}
$('body').css('touch-action', 'none'),
$('#gui-parent')
.find('*:not(#tag-billboards)')
.on('touchmove', function (e) {
// e.preventDefault()
});
var t = document.getElementById('terms-text'),
i = document.getElementById('more-help-wrapper'),
n =
(document.getElementById('navigation-help-wrapper'),
document.getElementById('help-dialog'),
document.getElementById('tag-billboards'));
Q.useWheel &&
(document.body.addEventListener('mousewheel', e, { passive: false }),
document.body.addEventListener('DOMMouseScroll', e)),
$('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
.off('touchmove')
.on('touchmove', function (e) {
e.stopPropagation();
});
}
function G(e, t) {
for (var i = []; e; ) i.push(e), (e = e.parentNode);
for (; t && i.indexOf(t) === -1; ) t = t.parentNode;
return t;
}
function z() {
var e,
t = function (t) {
e = 0 === t.button || 1 === t.which ? t.target : null;
},
i = function (t) {
e !== t.target && (e = G(e, t.target));
var i = document.getElementById('gui-parent');
if ((G(i, e) !== i && (e = null), e)) {
var n;
try {
n = new MouseEvent('click', t);
} catch (e) {
(n = document.createEvent('MouseEvents')),
n.initMouseEvent(
'click',
t.bubbles,
t.cancelable,
t.view,
t.detail,
t.screenX,
t.screenY,
t.clientX,
t.clientY,
t.ctrlKey,
t.altKey,
t.shiftKey,
t.metaKey,
t.button,
t.relatedTarget
);
}
(n.syntheticClick = !0), e.dispatchEvent(n), (e = null);
}
};
document.body.addEventListener('mousedown', t, !0),
document.body.addEventListener('mouseup', i, !0),
document.getElementById('gui-parent').addEventListener(
'click',
function (e) {
e.syntheticClick ||
(e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault());
},
!0
);
}
var lastMoveScrollTime = 0; //add
var W,
j,
Y,
X,
Z,
q,
K = (e('three'), e('../util/ajax'), e('../util/browser')),
Q = e('../settings'),
J = e('../analytics'),
ee = (e('../util/transitions'), e('../util/camera'), e('../util/logger')),
te = (e('../objects/Snapshot'), e('./helpManager')),
ie = e('./immersiveMode'),
ne = e('./loadingScreen'),
re = e('./landingScreen'),
oe = e('./playButton'),
ae = e('./populateModal'),
se = e('./memoryUsage'),
le = e('./closer/modalCloser'),
ce = e('./closer/ModalCloserEvent'),
he = e('./help/help'),
ue = e('./help/HelpEvent'),
de = e('./title/titleBar'),
pe = e('./title/TitleEvents'),
fe = e('./terms/terms'),
ge = e('./terms/TermsEvent'),
me = e('./title/tagToggle'),
ve = e('./tourInteraction'),
Ae = e('./vr/vrModal'),
ye = e('./vr/vrEvent'),
Ce = e('./sharing/modal'),
Ie = e('./webvr/webVRgui'),
Ee = e('./webvr/WebVrEvent'),
be = e('../controls/serializer'),
we = e('../enum/Keys'),
_e = e('../enum/Viewmode'),
Te = (e('../enum/BlackoutStyle'), e('../tag/Media/MediaEvent')),
xe =
(e('../enum/PathDiscardMode'),
e('../enum/PathDisplayMode'),
e('../enum/DirectorEvents'),
e('../enum/PlayerEvents')),
Se = e('../enum/ControlEvents'),
Me = e('./sharing/ShareEvents'),
Re = e('../localization/localize'),
Pe =
(e('../enum/Vectors'),
e('../enum/WarpStyle'),
e('../enum/AlignmentType'),
e('../enum/VROption')),
Oe = e('./konami'),
Le = e('../lib/dat.gui'),
De = new ee(i),
Ne = (e('../util/showcase'), e('../enum/ZoomEvents')),
Be = _e.DOLLHOUSE,
Fe = 0,
Ve = 0,
Ue = ['.hideTarget'],
ke = null,
He = null,
Ge = !1,
ze = !1,
We = !1,
je = {
coBrand: {
visible: !0,
elements: ['.co-brand', '#loaderCoBrand'],
},
help: {
visible: !0,
elements: ['.nav-help', '#nav-help'],
},
tourControls: {
visible: !0,
elements: ['.next', '.previous', '#play'],
},
highlight: {
visible: !0,
elements: ['#drawer', '#pullTab'],
},
share: {
visible: !0,
elements: ['.socialButton', '#share'],
},
fullScreen: {
visible: !0,
elements: ['#gui-fullscreen'],
},
floors: {
visible: !0,
elements: ['.gui-floor'],
},
},
Ye = (function () {
var e = document.getElementById('drawer');
return function () {
$('#player').height() < 400 && e.classList.contains('open') && a();
};
})(),
Xe = (function () {
var e = document.getElementById('meta-info');
return function () {
$('#player').height() < 400 && e.classList.contains('expand') && de.toggleMeta(!0);
};
})(),
Ze = (function (e) {
function t() {
u.classList.contains('expand') && de.toggleMeta(!0);
}
function i() {
fe.hide();
}
function n() {
he.close();
}
function r() {
Ae.dismiss();
}
function o() {
p.hasClass('open') && a(!0);
}
function l() {
Ce.hide();
}
function c() {
f.hasClass('open') && f.removeClass('open');
}
function h() {
d.classList.contains('fadeIn') &&
(d.classList.contains('landing')
? re.dismissModal()
: d.classList.contains('tour') && ve.dismissModal());
}
var u = document.getElementById('meta-info'),
d = document.getElementById('interaction-modal'),
p = $('#drawer').eq(0),
f = $('.gui-floor').eq(0),
g = $('.vr-popup').eq(0);
return function (e) {
switch (e) {
case 'info':
i(), n(), Ye(), l(), c(), r(), h();
break;
case 'terms':
t(), n(), o(), l(), c(), r(), h();
break;
case 'help':
t(), i(), l(), c(), r(), h();
break;
case 'vr':
t(), i(), l(), c(), n(), h(), s(g) && o();
break;
case 'highlights':
Xe(), i(), l(), c();
break;
case 'share':
t(), i(), n(), c(), r(), h();
break;
case 'floor':
i(), l(), r();
break;
case 'view':
c(), l(), i(), r();
break;
case 'tour':
i(), l(), c(), r();
break;
case 'move':
i(), l(), c(), r();
break;
case 'resize':
t(), Ye(), c();
break;
case 'tag':
i(), n(), l(), c(), r();
}
};
})();
$(document).on(
'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
function (e) {
$('#gui-fullscreen').toggle(!K.isFullscreen()),
$('#gui-fullscreen-exit').toggle(!!K.isFullscreen()),
setTimeout(function () {
$('.icon:visible').hide().show(0);
}, 100);
}
),
$('#gui-fullscreen')
.find('a')
.on('click', function (e) {
l(e),
K.requestFullscreen($('body')[0]),
J.track('showcase_gui', {
gui_action: 'click_enter_fullscreen',
interaction_source: 'gui',
});
//czj
//W.reload()
}),
$('#gui-fullscreen-exit')
.find('a')
.on('click', function (e) {
l(e),
K.exitFullscreen(),
J.track('showcase_gui', {
gui_action: 'click_exit_fullscreen',
interaction_source: 'gui',
});
});
$(window)
.on('resize', function (e) {
var t = e.target.innerHeight,
i = e.target.innerWidth;
(t === X && i === Z) ||
(je.highlight.visible && w(),
Ze('resize'),
$('.pinTop.right').removeClass('hideUnderMeta'),
c(),
(X = t),
(Z = i));
})
.resize(),
K.supportsFullscreen() || $('#gui-fullscreen').hide(),
$('#pullTab').on('click', function (e) {
l(e),
$('#drawer').hasClass('open')
? (J.trackAlways('showcase_gui', {
gui_action: 'hide_highlight_reel',
}),
$(this).addClass('open').children('img').attr('src', 'images/auto.png'))
: (J.trackAlways('showcase_gui', {
gui_action: 'show_highlight_reel',
}),
$(this)
.removeClass('open')
.children('img')
.attr('src', 'images/auto-suspend.png'));
a();
});
/***********************方奕卓 热点列表事件监听 ************************/
if (window.DATA.showHotListSta) {
$('#hotList').css('display', '');
$('#hotList').on('click', function (e) {
l(e);
var hotList = $('#hotListWrap')[0];
var isActive = hotList.classList.contains('hotListActive');
if (isActive) {
hotList.classList.remove('hotListActive');
this.classList.remove('active');
} else {
hotList.classList.add('hotListActive');
this.classList.add('active');
}
}),
// $('#hotListContent ul').on('mouseover', function (e) {
// l(e);
// var target = e.target;
// var hotList = document.getElementById('hotListWrap');
// if (target.tagName === 'SPAN') {
// var targetParent = target.parentElement.parentElement;
// if (target.offsetWidth + 116 >= targetParent.clientWidth) {
// hotList.style.width = target.offsetWidth + 116 + 'px';
// } else {
// hotList.style.width = '';
// }
// } else if (target.tagName === 'LI') {
// var targetParent = target.parentElement;
// if (target.children[0].offsetWidth + 116 >= targetParent.clientWidth) {
// hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
// } else {
// hotList.style.width = '';
// }
// } else {
// hotList.style.width = '';
// }
// });
$('#hotListContent ul').on('click', function (e) {
l(e);
this.preElem && this.preElem.classList.remove('active');
if (e.target.tagName === 'SPAN') {
e.target.parentElement.classList.add('active');
e.target.parentElement.hot &&
e.target.parentElement.hot.examine(window.player, true); // 打开热点
this.preElem = e.target.parentElement;
} else {
e.target.classList.add('active');
e.target.hot && e.target.hot.examine(window.player, true); // 打开热点
this.preElem = e.target;
}
});
$('#hotListClose').on('click', function (e) {
l(e);
var hotList = $('#hotListWrap')[0];
hotList.classList.remove('hotListActive');
$('#hotListContent ul .active').removeClass('active');
$('#hotList')[0].classList.remove('active');
});
}
/*****************************************************************/
$('#more-menu-button').on('click', function (e) {
l(e);
var t = $('#more-menu');
t.toggleClass('open');
}),
(t.exports.init = S),
(t.exports.startLoading = x),
(t.exports.endLoading = d),
(t.exports.onProgress = u);
}.call(this, '/js/gui/gui.js'));
},
{
'../analytics': 4,
'../controls/serializer': 14,
'../enum/AlignmentType': 17,
'../enum/BlackoutStyle': 18,
'../enum/ControlEvents': 21,
'../enum/DirectorEvents': 23,
'../enum/Keys': 30,
'../enum/PathDiscardMode': 38,
'../enum/PathDisplayMode': 39,
'../enum/PlayerEvents': 40,
'../enum/VROption': 47,
'../enum/Vectors': 50,
'../enum/Viewmode': 51,
'../enum/WarpStyle': 52,
'../enum/ZoomEvents': 53,
'../lib/dat.gui': 93,
'../localization/localize': 108,
'../tag/Media/MediaEvent': 131,
'../objects/Snapshot': 153,
'../settings': 166,
'../util/ajax': 181,
'../util/browser': 182,
'../util/camera': 183,
'../util/logger': 189,
'../util/showcase': 193,
'../util/transitions': 195,
'./closer/ModalCloserEvent': 61,
'./closer/modalCloser': 62,
'./help/HelpEvent': 66,
'./help/help': 67,
'./helpManager': 68,
'./immersiveMode': 69,
'./konami': 70,
'./landingScreen': 71,
'./loadingScreen': 72,
'./memoryUsage': 73,
'./playButton': 74,
'./populateModal': 75,
'./sharing/ShareEvents': 76,
'./sharing/modal': 77,
'./terms/TermsEvent': 78,
'./terms/terms': 79,
'./title/TitleEvents': 80,
'./title/tagToggle': 81,
'./title/titleBar': 82,
'./tourInteraction': 84,
'./vr/vrEvent': 85,
'./vr/vrModal': 87,
'./webvr/WebVrEvent': 88,
'./webvr/webVRgui': 89,
three: 217,
},
],
66: [
function (e, t, i) {
'use strict';
t.exports = Object.freeze({
OPENED: 'help.opened',
CLOSED: 'help.closed',
});
},
{},
],
67: [
function (e, t, i) {
'use strict';
function n() {
g.on('click', function (e) {
if (S && S !== l.TRANSITIONING) {
var t = window.getComputedStyle(y).getPropertyValue('opacity') > 0;
t && !M ? R.close() : r();
}
}),
w.on('click', function (e) {
R.close();
}),
E.on('click', function (e) {
S && S !== l.TRANSITIONING && (s(), o());
}),
b.on('click', function (e) {
s(), a();
});
}
function r() {
S &&
S !== l.TRANSITIONING &&
((M = !0),
setTimeout(function () {
M = !1;
}, d.help.modalStayDuration),
R.emit(h.OPENED),
m.addClass('open ' + S),
g.addClass('open'),
s(),
o(),
y.style.removeProperty
? y.style.removeProperty('display')
: y.style.removeAttribute('display'),
y.classList.add('fadeIn'));
}
function o() {
E.addClass('underline-tab'), u.fill(_, c.NAVIGATION, S), m.addClass(S);
}
function a() {
b.addClass('underline-tab'), u.fill(T, c.MORE_HELP), m.addClass('more-help');
}
function s(e, t) {
m.removeClass(
'more-help ' + l.PANORAMA + ' ' + l.DOLLHOUSE + ' ' + l.FLOORPLAN + ' ' + l.OUTDOOR
),
I.forEach(function (e) {
e.classList.remove('underline-tab');
});
}
var l = e('../../enum/Viewmode'),
c = e('../../enum/HelpModalType'),
h = e('./HelpEvent'),
u = (e('../helpManager'), e('./../populateModal')),
d = e('../../settings'),
p = e('../../util/common'),
f = e('events').EventEmitter,
g = $('.footer-help').eq(0),
m = $('#help-dialog').eq(0),
v = document.querySelector('#quick-logo'),
A = document.querySelector('#loaderCoBrand'),
y = document.querySelector('#help-dialog'),
C = document.querySelector('.footer'),
I = $('.help-tabs').children().toArray(),
E = $('.navigation-tab').eq(0),
b = $('.more-help-tab').eq(0),
w =
($('#interaction-modal').eq(0).find('.interaction').toArray(), m.find('.close').eq(0)),
_ = m.find('.interactions').toArray(),
T = m.find('.ui-instructions').toArray(),
x = l.PANORAMA,
S = l.PANORAMA,
M = !1,
R = {
init: function (e, t) {
(S = t),
(x = t),
[y, A, v, C].forEach(function (e) {
e.classList.add(u.deviceType);
}),
n();
},
close: function () {
if (
m.hasClass('open') &&
(this.emit(h.CLOSED),
g.removeClass('open'),
m.removeClass('open'),
y.classList.contains('fadeIn'))
) {
y.classList.remove('fadeIn');
var e = S === l.TRANSITIONING ? x : S;
u.clear(_, c.NAVIGATION, e);
}
},
updateMode: function (e) {
(x = S), (S = e);
},
};
p.extendObject(R, f.prototype), (t.exports = R);
},
{
'../../enum/HelpModalType': 28,
'../../enum/Viewmode': 51,
'../../settings': 166,
'../../util/common': 185,
'../helpManager': 68,
'./../populateModal': 75,
'./HelpEvent': 66,
events: 202,
},
],
68: [
function (e, t, i) {
(function (i) {
'use strict';
var n = e('../util/browser'),
r = e('./../util/logger'),
o = e('./../settings'),
a = new r(i),
s = (function () {
var e;
try {
return (
(e = window.localStorage.getItem('visitCount') || '0'),
(e = (parseFloat(e) + 1).toString()),
window.localStorage.setItem('visitCount', e),
a.debug('visitCount = ' + e),
e
);
} catch (t) {
(e = '1'), a.debug("couldn't set local storage");
}
})(),
l = !1;
t.exports = {
isHelpDisabled: function () {
return '0' === n.valueFromHash('help', null) || l;
},
isLargeHelpEnabled: function () {
return ('1' === s || '1' === n.valueFromHash('help', null)) && !this.isHelpDisabled();
},
isSmallHelpEnabled: function () {
return '2' === n.valueFromHash('help', null) && !this.isHelpDisabled();
},
isHelpEnabled: function () {
return this.isLargeHelpEnabled() || this.isSmallHelpEnabled();
},
setAutoPlay: function (e) {
l = o.warp.auto >= 0 && e > 1;
},
};
}.call(this, '/js/gui/helpManager.js'));
},
{
'../util/browser': 182,
'./../settings': 166,
'./../util/logger': 189,
},
],
69: [
function (e, t, i) {
'use strict';
function n(e, t, i, n) {
(F = n), r(e, t, i, F), o(), (N = t.mode);
}
function r(e, t, i, n) {
[C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c);
}),
M.on('mousewheel DOMMouseScroll', a),
i.on(m.TagActivated, a),
i.on(m.TagNavigation, a),
t.on(A.FlyingEnded, s),
t.on(A.ModeChanging, function (e, t) {
B = t !== C.PANORAMA && e !== C.PANORAMA;
}),
t.on(A.ModeChanged, function (e, i) {
(N = t.mode), i !== C.TRANSITIONING ? l() : a('modeChange');
}),
n.on(y.TourStart, function () {
(L = !0), a();
}),
n.on(y.TourEnd, function () {
(L = !1), l();
}),
n.on(y.ActionInterrupted, function () {
L = !1;
}),
R.addEventListener(
'touchend',
function () {
$('#pullTab').hasClass('opened') && !L && l();
},
!0
);
}
function o() {
p.isMobile()
? (b.forEach(function (e) {
e.classList.add('mobile');
}),
w.click(l))
: (b.forEach(function (e) {
e.addEventListener(
'mouseleave',
function () {
!M.is(':hover') && b[0].classList.contains('detectHover') && l();
},
!0
);
}),
M.mouseleave(function () {
b[0].classList.contains('detectHover') && l();
}));
}
function a(e) {
D ||
(d(e) && _.hasClass('playing')) ||
(clearTimeout(O),
(P = !0),
g.close(),
h(e),
N !== C.DOLLHOUSE &&
N !== C.FLOORPLAN &&
((x.hasClass('expand') && !S.hasClass('closed')) || 2 === p.valueFromHash('title', 1),
_.hasClass('playing') ||
(b.forEach(function (e) {
e.classList.add('detectHover');
}),
(O = setTimeout(l, f.immersive.timeToShowAgain)))));
}
function s() {
_.hasClass('playing') ||
(clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)));
}
function l() {
clearTimeout(O),
(P = !1),
I.forEach(function (e) {
e.classList.remove('drawerOpen');
}),
L ||
E.forEach(function (e) {
e.classList.remove('duringTour');
}),
b.forEach(function (e) {
e.classList.remove('detectHover');
});
}
function c() {
P ? l() : a(),
(D = !0),
setTimeout(function () {
D = !1;
}, f.immersive.uiStayDuration);
}
function h(e) {
!d(e) && L
? E.forEach(function (e) {
e.classList.remove('drawerOpen'), e.classList.add('duringTour');
})
: _.hasClass('open')
? E.forEach(function (e) {
e.classList.remove('duringTour'), e.classList.add('drawerOpen');
})
: B ||
N === C.FLOORPLAN ||
N === C.DOLLHOUSE ||
E.forEach(function (e) {
e.classList.add('fadeOut');
});
}
function u() {
T.hasClass('duringTour') || ((L = !1), a('gui'), l());
}
function d(e) {
return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e;
}
var p = e('../util/browser'),
f = e('../settings'),
g = e('./help/help'),
m = e('../enum/tagEvents'),
v = e('../enum/ControlEvents'),
A = e('../enum/PlayerEvents'),
y = e('../enum/DirectorEvents'),
A = e('../enum/PlayerEvents'),
C = e('../enum/Viewmode'),
I = $(
'.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer'
).toArray(),
E = $('.pinBottom-container, #drawer-container, .footer').toArray(),
b = $('#hover-bottom, #hover-top').toArray(),
w = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
_ = $('#drawer').eq(0),
T = $('#drawer-container').eq(0),
x = $('#meta-info').eq(0),
S = $('.pinTop.left').eq(0),
M = $('#player').eq(0),
R = document.getElementById('pullTab'),
P = !1,
O = null,
L = !1,
D = !1,
N = null,
B = !1,
F = null;
(t.exports.init = n), (t.exports.hideUi = a), (t.exports.resetDrawer = u);
},
{
'../enum/ControlEvents': 21,
'../enum/DirectorEvents': 23,
'../enum/tagEvents': 32,
'../enum/PlayerEvents': 40,
'../enum/Viewmode': 51,
'../settings': 166,
'../util/browser': 182,
'./help/help': 67,
},
],
70: [
function (e, t, i) {
(function (i) {
'use strict';
function n(e, t, i) {
l.debug('konami has the modelInstance');
var n = [];
$(window).on('keydown', function (e) {
n.push(e.which),
n.length > o.secretPanelWord.length && n.shift(),
s.equalLists(n, o.secretPanelWord) &&
(l.debug('Developer mode active.'), (o.debug = !0));
}),
$(window).on('keydown', function n(r) {
o.debug &&
72 === r.which &&
(e && i
? (a.toggle(e, t, i), $(window).off('keydown', n))
: console.warn("sorry we're not ready yet"));
});
}
var r = e('./../util/logger'),
o = e('./../settings'),
a = e('./debug'),
s = e('./../util/common'),
l = (e('./gui'), new r(i));
o.console && $('body').append(''), (t.exports.init = n);
}.call(this, '/js/gui/konami.js'));
},
{
'./../settings': 166,
'./../util/common': 185,
'./../util/logger': 189,
'./debug': 63,
'./gui': 65,
},
],
71: [
function (e, t, i) {
'use strict';
function n(e, t) {
E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode;
}
function r(e) {
var t = $.Deferred();
e || t.resolve();
var i = c.startupFlyinDelay;
return (
e === p.PANORAMA && (i += c.dollhouse.transitionTime),
setTimeout(t.resolve.bind(t), i),
t
);
}
function o(e, t, i) {
var n = 0;
c.quickstart.enabled &&
(a(i), (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay));
var r = function () {
e.once(g.Move, l), t.once(f.TourStart, l);
};
s(n, r);
}
function a(e) {
return; /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
v.before(y),
A = $(".quick-brand").toArray()),*/
m.addClass('fadeOut'),
setTimeout(function () {
A.forEach(function (e) {
e.classList.add('fadeIn');
});
}, c.quickstart.showTextDelay),
setTimeout(function () {
A.forEach(function (e) {
e.classList.add('fadeOut');
});
}, c.quickstart.fadeOutDelay),
!0;
}
function s(e, t) {
setTimeout(function () {
if (h.isHelpEnabled()) {
if (
(t(),
u.init(),
C.addClass('fadeIn landing ' + u.deviceType),
h.isSmallHelpEnabled())
)
return void C.addClass('small');
u.fill(I, d.LANDING[E]), C.addClass(E);
}
}, e);
//csz 用户引导界面
var helpData = {
pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png'],
};
var navIcon = $('.nav-icon .icon');
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
navIcon.attr('src', helpData.mobile[0]);
function paging(id) {
id.on('click', function () {
var navPage = null;
$(this).attr('data-id') == 'plus'
? (navPage = +navIcon.attr('data-page') + 1)
: (navPage = +navIcon.attr('data-page') - 1);
if (navPage > helpData.length || navPage < 1) return false;
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
navIcon.attr({ 'data-page': navPage, src: helpData.mobile[navPage - 1] });
} else {
navIcon.attr({ 'data-page': navPage, src: helpData.pc[navPage - 1] });
}
});
}
paging($('.next-button'));
paging($('.prev-button'));
}
function l() {
u.clear(I, d.LANDING[E]), C.removeClass('fadeIn');
}
var c = e('../settings'),
h = (e('./help/help'), e('./helpManager')),
u = e('./populateModal'),
d = e('../enum/HelpModalType'),
p = e('../enum/Viewmode'),
f = e('../enum/DirectorEvents'),
g = e('../enum/PlayerEvents'),
m = $('#quick-blackout').eq(0),
v = $('#quick-logo').eq(0),
A = $('.quick-brand').toArray(),
y = $('#loaderCoBrand').eq(0),
C = $('#interaction-modal').eq(0),
I = C.find('.interaction').toArray(),
E =
($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
'');
(t.exports.delayLanding = r),
(t.exports.showMessage = o),
(t.exports.init = n),
(t.exports.dismissModal = l);
},
{
'../enum/DirectorEvents': 23,
'../enum/HelpModalType': 28,
'../enum/PlayerEvents': 40,
'../enum/Viewmode': 51,
'../settings': 166,
'./help/help': 67,
'./helpManager': 68,
'./populateModal': 75,
},
],
72: [
function (e, t, i) {
'use strict';
var n = e('./circleLoader').circleLoader;
t.exports = {
element: $('#gui-loading'),
hide: function (e) {
n.done(), this.element.fadeOut(1500, e);
},
show: function (e) {
this.element.fadeIn(
500,
function () {
this.element.css('display', 'table'), e && e();
}.bind(this)
);
},
progress: function (e) {
n.set(e);
},
};
},
{
'./circleLoader': 60,
},
],
73: [
function (e, t, i) {
'use strict';
var n = e('../settings'),
r = $('#memory-info'),
o = r.find('#memory-gpu'),
a = !1;
t.exports = {
show: function () {
n.profiling.enabled && (r.show(), (a = !0));
},
hide: function () {
r.hide(), (a = !1);
},
toggle: function () {
a ? this.hide() : this.show();
},
update: function (e) {
n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB');
},
};
},
{
'../settings': 166,
},
],
74: [
function (e, t, i) {
'use strict';
var n = e('../util/browser'),
r = e('../analytics');
e('../settings');
t.exports = {
show: function (e, t) {
$('#gui-message').fadeOut(500, function () {
t();
});
},
};
},
{
'../analytics': 4,
'../settings': 166,
'../util/browser': 182,
},
],
75: [
function (e, t, i) {
'use strict';
function n(e, t, i, n) {
function r(e) {
return e.classList.contains(a);
}
var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
//for (var a in o) {
//var s = e.find(r);
//for (var l in o[a]) {
//var c = o[a][l];
//if ("top-info" === l || "bottom-info" === l) {
//var h = n ? c : "";
//czj 注释掉第一次打开的用户引导
//s.querySelector("." + l).textContent = h
//} else {
//var u = n ? c : "";
//, d = s.querySelector("." + l);
//d.src = u,
//n ? d.classList.remove("hidden") : d.classList.add("hidden")
//}
//}
//}
//var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
// p.forEach(function(e) {
// n ? e.classList.remove("hidden") : e.classList.add("hidden")
// })
}
var r = e('../util/browser'),
o = e('../localization/localize'),
a = e('../enum/HelpModalType'),
s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'));
t.exports = {
init: function () {
if (!this.hasInitialized) {
(this.hasInitialized = !0),
(this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
(this.assets = {}),
(this.assets[a.LANDING[s.PANORAMA]] = {
desktop: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_left_right.png',
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_mouse_click.png',
keyboard: 'images/nav_help_keyboard_up_down.png',
},
right: {
'top-info': o.ZOOM,
'big-image': 'images/nav_help_mouse_zoom.png',
keyboard: 'images/nav_help_zoom_keys.png',
},
},
mobile: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_gesture_drag.png',
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_gesture_tap.png',
},
right: {
'top-info': o.ZOOM,
'big-image': 'images/nav_help_gesture_pinch.png',
},
},
}),
(this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(
JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])
)),
(this.assets[a.LANDING[s.DOLLHOUSE]] = {
desktop: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_left_right.png',
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_mouse_position_right.png',
},
},
mobile: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_gesture_drag.png',
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_gesture_position_two_finger.png',
},
},
}),
(this.assets[a.LANDING[s.FLOORPLAN]] = {
desktop: {
left: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_mouse_position_left.png',
},
middle: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_mouse_drag_right.png',
keyboard: 'images/nav_help_keyboard_left_right.png',
},
},
mobile: {
left: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_gesture_position.png',
},
middle: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_gesture_drag_two_finger.png',
},
},
});
var e = {
'top-info': o.INSIDE,
'big-image': 'images/nav_help_click_inside.png',
keyboard: 'images/nav_help_inside_key.png',
};
(this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e),
(this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e),
(this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e);
var t = {
'top-info': o.INSIDE,
'big-image': 'images/nav_help_tap_inside.png',
};
(this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
(this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
(this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
(this.assets[a.NAVIGATION] = {}),
(this.assets[a.NAVIGATION][s.PANORAMA] = {
desktop: {
left: {
'top-info': o.HELP_DESKTOP_PANORAMA_1A,
'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_left_right.png',
},
middle: {
'top-info': o.HELP_DESKTOP_PANORAMA_2A,
'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
'big-image': 'images/nav_help_mouse_click.png',
keyboard: 'images/nav_help_keyboard_up_down.png',
},
right: {
'top-info': o.HELP_DESKTOP_PANORAMA_3A,
'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
'big-image': 'images/nav_help_mouse_zoom.png',
keyboard: 'images/nav_help_zoom_keys.png',
},
},
mobile: {
left: {
'top-info': o.HELP_MOBILE_PANORAMA_1,
'big-image': 'images/nav_help_gesture_drag.png',
},
middle: {
'top-info': o.HELP_MOBILE_PANORAMA_2,
'big-image': 'images/nav_help_gesture_tap.png',
},
right: {
'top-info': o.HELP_MOBILE_3,
'big-image': 'images/nav_help_gesture_pinch.png',
},
},
}),
(this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
desktop: {
left: {
'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_all.png',
},
middle: {
'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
'big-image': 'images/nav_help_mouse_position_right.png',
},
right: {
'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
'big-image': 'images/nav_help_mouse_zoom.png',
},
},
mobile: {
left: {
'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
'big-image': 'images/nav_help_gesture_drag.png',
},
middle: {
'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
'big-image': 'images/nav_help_gesture_position_two_finger.png',
},
right: {
'top-info': o.HELP_MOBILE_3,
'big-image': 'images/nav_help_gesture_pinch.png',
},
},
}),
(this.assets[a.NAVIGATION][s.FLOORPLAN] = {
desktop: {
left: {
'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
'big-image': 'images/nav_help_mouse_position_left.png',
},
middle: {
'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
'big-image': 'images/nav_help_mouse_drag_right.png',
keyboard: 'images/nav_help_keyboard_left_right.png',
},
right: {
'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
'big-image': 'images/nav_help_mouse_zoom.png',
keyboard: 'images/nav_help_keyboard_up_down.png',
},
},
mobile: {
left: {
'top-info': o.HELP_MOBILE_FLOORPLAN_1,
'big-image': 'images/nav_help_gesture_position.png',
},
middle: {
'top-info': o.HELP_MOBILE_FLOORPLAN_2,
'big-image': 'images/nav_help_gesture_drag_two_finger.png',
},
right: {
'top-info': o.HELP_MOBILE_3,
'big-image': 'images/nav_help_gesture_pinch.png',
},
},
}),
(this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(
JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])
)),
(this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
'top-info': o.HELP_DESKTOP_360_2A,
'bottom-info': o.HELP_DESKTOP_360_2B,
'big-image': 'images/nav_help_click_inside.png',
keyboard: 'images/nav_help_inside_key.png',
}),
(this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
'top-info': o.HELP_MOBILE_360_2,
'big-image': 'images/nav_help_tap_inside.png',
}),
(this.assets[a.MORE_HELP] = {
desktop: {
'more-help-hlr': {
'top-info': o.HELP_MORE_HLR_A,
'big-image': 'images/nav_help_expand.svg',
'bottom-info': o.HELP_DESKTOP_MORE_HLR_B,
},
'more-help-dollhouse': {
'top-info': o.HELP_MORE_DOLLHOUSE_A,
'big-image': 'images/nav_help_dollhouse.svg',
'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B,
},
'more-help-floors': {
'top-info': o.HELP_MORE_FLOORS_A,
'big-image': 'images/nav_help_floor picker.svg',
'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B,
},
'more-help-tag': {
'top-info': o.HELP_MORE_TAG_A,
'big-image': 'images/nav_help_tag.svg',
'bottom-info': o.HELP_DESKTOP_MORE_TAG_B,
},
'more-help-zoom': {
'top-info': o.HELP_MORE_ZOOM_A,
'big-image': 'images/nav_help_zoom.svg',
'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B,
},
'more-help-tour': {
'top-info': o.HELP_MORE_TOUR_A,
'big-image': 'images/nav_help_play.png',
'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B,
},
'more-help-inside': {
'top-info': o.HELP_MORE_INSIDE_A,
'big-image': 'images/nav_help_inside.svg',
'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B,
},
'more-help-vr': {
'top-info': o.HELP_MORE_VR_A,
'big-image': 'images/nav_help_vr.svg',
'bottom-info': o.HELP_DESKTOP_MORE_VR_B,
},
'more-help-360': {
'top-info': o.HELP_MORE_360_A,
'big-image': 'images/nav_help_360.svg',
'bottom-info': o.HELP_DESKTOP_MORE_360_B,
},
'more-help-fullscreen': {
'top-info': o.HELP_MORE_FULLSCREEN_A,
'big-image': 'images/nav_help_fullscreen.svg',
'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B,
},
},
mobile: {
'more-help-hlr': {
'top-info': o.HELP_MORE_HLR_A,
'big-image': 'images/nav_help_expand.svg',
'bottom-info': o.HELP_DESKTOP_MORE_HLR_B,
},
'more-help-dollhouse': {
'top-info': o.HELP_MORE_DOLLHOUSE_A,
'big-image': 'images/nav_help_dollhouse.svg',
'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B,
},
'more-help-floors': {
'top-info': o.HELP_MORE_FLOORS_A,
'big-image': 'images/nav_help_floor picker.svg',
'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B,
},
'more-help-tag': {
'top-info': o.HELP_MORE_TAG_A,
'big-image': 'images/nav_help_tag.svg',
'bottom-info': o.HELP_MOBILE_MORE_TAG_B,
},
'more-help-tour': {
'top-info': o.HELP_MORE_TOUR_A,
'big-image': 'images/nav_help_play.png',
'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B,
},
'more-help-inside': {
'top-info': o.HELP_MORE_INSIDE_A,
'big-image': 'images/nav_help_inside.svg',
'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B,
},
'more-help-vr': {
'top-info': o.HELP_MORE_VR_A,
'big-image': 'images/webvr.svg',
'bottom-info': o.HELP_MOBILE_MORE_VR_B,
},
'more-help-360': {
'top-info': o.HELP_MORE_360_A,
'big-image': 'images/nav_help_360.svg',
'bottom-info': o.HELP_MOBILE_MORE_360_B,
},
},
}),
(this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
desktop: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_left_right.png',
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_mouse_click.png',
keyboard: 'images/nav_help_keyboard_up_down.png',
},
right: {
'top-info': o.PLAY,
'big-image': 'images/Desktop-help-play-button.svg',
keyboard: 'images/Desktop-help-spacebar-2.svg',
},
},
mobile: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_gesture_drag.png',
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_gesture_tap.png',
},
right: {
'top-info': o.PLAY,
'big-image': 'images/mobile-help-play-button.svg',
},
},
}),
(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(
JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])
)),
(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle =
this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle =
this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
(this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(
JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])
)),
(this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left =
this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
(this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left =
this.assets[a.LANDING[s.FLOORPLAN]].mobile.left);
}
},
fill: function (e, t, i) {
n.call(this, e, t, i, !0);
},
clear: function (e, t, i) {
n.call(this, e, t, i, !1);
},
};
},
{
'../enum/HelpModalSize': 27,
'../enum/HelpModalType': 28,
'../enum/Viewmode': 51,
'../localization/localize': 108,
'../util/browser': 182,
},
],
76: [
function (e, t, i) {
'use strict';
t.exports = Object.freeze({
OPENED: 'share.open',
CLOSED: 'share.closed',
LINK_CLICKED: 'share.linked',
});
},
{},
],
77: [
function (e, t, i) {
'use strict';
function n(e) {
function t(t, i) {
var n = window.screenY + ($('#player').height() - i) / 2,
r = window.screenX + ($('#player').width() - t) / 2,
o = 'top=' + n + ',left=' + r + ',width=' + t + ',height=' + i;
I.emit(l.LINK_CLICKED, {
channel: e,
}),
window.open(C[e], 'shareWindow', o);
}
switch (e) {
case y.FACEBOOK:
t(580, 420);
break;
case y.TWITTER:
t(550, 440);
break;
case y.MAIL:
I.emit(l.LINK_CLICKED, {
channel: 'email',
}),
window.open(C[e], '_blank');
break;
case y.LINKEDIN:
}
}
function r(e) {
I.emit(l.LINK_CLICKED, {
channel: 'copylink',
});
var t = document.createRange();
t.selectNodeContents(v);
var i = window.getSelection();
i.removeAllRanges(),
i.addRange(t),
document.execCommand('copy'),
A.classList.remove('hidden'),
v.classList.add('highlighted');
}
function o(e) {
(e && (e.stopPropagation(), e.target === v)) ||
(window.getSelection().removeAllRanges(),
v.classList.remove('highlighted'),
A.classList.add('hidden'));
}
var a = e('../../util/browser'),
s = e('../../localization/localize'),
l = e('./ShareEvents'),
c = e('../../util/common'),
h = e('events').EventEmitter,
u = document.getElementById('sharing'),
d = document.getElementById('share-modal'),
p = document.getElementById('share-close'),
f = document.getElementById('facebook-share'),
g = document.getElementById('twitter-share'),
m = document.getElementById('mail-share'),
v = document.getElementById('share-url-text'),
A = document.getElementById('copy-success'),
y = Object.freeze({
FACEBOOK: 'facebook',
TWITTER: 'twitter',
MAIL: 'mail',
LINKEDIN: 'linkedin',
}),
C = {};
(C[y.FACEBOOK] =
'http://www.facebook.com/sharer.php?u=' +
encodeURIComponent(window.location.href + '&utm_source=1') +
'&t='),
(C[y.TWITTER] = 'http://twitter.com/intent/tweet?text='),
(C[y.MAIL] = 'mailto:?subject=');
var I = {
init: function (e) {
var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ');
(C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
(C[y.TWITTER] +=
t +
encodeURIComponent(
window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port'
)),
(C[y.MAIL] +=
encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) +
'&body=' +
t +
encodeURIComponent(window.location.href + '&utm_source=3')),
u.addEventListener('click', this.toggle.bind(this)),
p.addEventListener('click', this.hide.bind(this)),
v.addEventListener('click', r),
d.addEventListener('click', o),
f.addEventListener('click', n.bind(this, y.FACEBOOK)),
g.addEventListener('click', n.bind(this, y.TWITTER)),
m.addEventListener('click', n.bind(this, y.MAIL)),
(v.textContent = window.location.href + '&utm_source=4'),
d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
u.classList.remove('hidden');
},
show: function () {
this.emit(l.OPENED), d.classList.add('fadeIn');
},
hide: function () {
d.classList.contains('fadeIn') &&
(this.emit(l.CLOSED),
document.selection && document.selection.empty(),
window.getSelection().removeAllRanges(),
o(),
d.classList.remove('fadeIn'));
},
toggle: function () {
d.classList.contains('fadeIn') ? this.hide() : this.show();
},
};
c.extendObject(I, h.prototype), (t.exports = I);
},
{
'../../localization/localize': 108,
'../../util/browser': 182,
'../../util/common': 185,
'./ShareEvents': 76,
events: 202,
},
],
78: [
function (e, t, i) {
'use strict';
t.exports = Object.freeze({
OPENED: 'terms.opened',
CLOSED: 'terms.closed',
});
},
{},
],
79: [
function (e, t, i) {
'use strict';
var n = e('./TermsEvent'),
r = e('../../localization/localize'),
o = e('../../analytics'),
a = e('../../util/ajax'),
s = e('../../util/common'),
l = e('events').EventEmitter,
c = document.getElementById('terms-modal'),
h = {
init: function () {
$('.footer-terms').on(
'click',
function (e) {
e.preventDefault(), this.show();
}.bind(this)
),
$('#terms-modal .close').on('click', this.hide.bind(this));
},
show: function () {
this.emit(n.OPENED),
a
.get('static/' + r.TERMS_TEXT_FILE)
.done(function (e) {
var t = $('#terms-text').html(e);
o.track('showcase_gui', {
gui_action: 'click_terms_button',
interaction_source: 'gui',
}),
t.find('a').attr('target', '_blank');
})
.fail(function () {
$('#terms-text').html('
' + r.TERMS_OF_USE + '
' + r.TERMS_FAIL);
}),
c.classList.add('fadeIn');
},
hide: function (e) {
e && e.preventDefault(),
c.classList.contains('fadeIn') && this.emit(n.CLOSED),
c.classList.remove('fadeIn');
},
};
s.extendObject(h, l.prototype), (t.exports = h);
},
{
'../../analytics': 4,
'../../localization/localize': 108,
'../../util/ajax': 181,
'../../util/common': 185,
'./TermsEvent': 78,
events: 202,
},
],
80: [
function (e, t, i) {
'use strict';
t.exports = Object.freeze({
OPEN_INFO: 'title.open.info',
CLOSE_INFO: 'title.close.info',
SHOW_INFO: 'title.show.info',
HIDE_INFO: 'title.hide.info',
LINK_CLICKED: 'title.link.click',
CONTACT_LINK_CLICKED: 'title.contact.click',
ORIGIN_LINK_CLICKED: 'title.origin.click',
});
},
{},
],
81: [
function (e, t, i) {
'use strict';
function n(e, t) {
o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t);
}
function r(e, t) {
function i(i) {
(e.shouldShowtags = 'show' === this.value),
e.shouldShowtags
? t.showAlltags(o.tags.startup.fadeInDuration)
: t.hideAlltags(o.tags.startup.fadeInDuration);
}
document.getElementById('tag-toggles').classList.remove('hidden'),
(document.getElementById('radio-tag-show').checked = !0);
for (
var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0;
r < n.length;
r++
)
n[r].addEventListener('change', i);
}
var o = e('../../settings');
t.exports.init = n;
},
{
'../../settings': 166,
},
],
82: [
function (e, t, i) {
(function (i) {
'use strict';
function n(e, t) {
return e && u.valueFromHash('title', 1) && 2 !== u.valueFromHash('mls', 0)
? ((document.getElementsByClassName('titleText')[0].innerText = e),
(g_weixinObj.title = e),
e.length > g.minTooltipCharacters &&
I.parentElement.setAttribute('data-original-title', e),
t && 1 !== m.specialEdition && m.brand && !m.mls
? (document.getElementById('cobrandTitle').innerText = t)
: (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
document.getElementById('gui-name').classList.add('noCoBrand'),
document.getElementById('cobrandTitle').classList.add('hidden')),
!0)
: (document.getElementById('model-title').classList.add('hidden'), !1);
}
function r(e) {
return e ? ((L = !0), void (_.innerHTML = e)) : void _.classList.add('hidden');
}
function o(e, t, i, n) {
if ((!e && !t && !i) || !m.brand || u.valueFromHash('mls', !1))
return void T.classList.add('hidden');
L = !0;
var r = [],
o = c(r, ' ');
if ((e && o('' + e + ''), t)) {
var a = n || t,
s = u.isMobile()
? '' + a + ''
: '' + a + '';
o(s);
}
i && o('' + i + ''),
(r[0] = ''),
(x.innerHTML = r.join(''));
}
function a(e) {
if ('string' == typeof e)
try {
e = JSON.parse(e);
} catch (e) {
return (
y.warn('Unable to parse address data'),
void S.parentElement.classList.add('hidden')
);
}
if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
return void S.parentElement.classList.add('hidden');
L = !0;
var t = [],
i = c(t, ' ');
e.address_1 && i(e.address_1),
e.address_2 && i(e.address_2),
e.city && i(e.city, ', '),
e.state && i(e.state, ', '),
e.zip && i(e.zip, e.state ? ' ' : ', '),
(t[0] = ''),
(S.innerText = t.join(''));
}
function s(e) {
var t = document.createElement('a');
return (
(t.id = 'url'),
(t.target = '_blank'),
(t.href = e),
(t.innerText = e),
t.addEventListener('click', N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
t
);
}
function l(e) {
return (
!(!e || (u.inIframe() && document.referrer === e)) &&
(R.classList.remove('hidden'),
(P.innerHTML = f.WEBVR_LEARN_MORE + ': '),
P.appendChild(s(e)),
O.forEach(function (e) {
e.classList.add('share-link');
}),
!0)
);
}
function c(e, t) {
var i = e,
n = t;
return function (e, t) {
i.push(t || n, e);
};
}
function h() {
document
.getElementById('title-toggle')
.addEventListener('click', N.toggleTitle.bind(N)),
L && I.addEventListener('click', N.toggleMeta.bind(N, !1));
var e = [].slice.call(_.querySelectorAll('a'));
e.forEach(function (e) {
e.addEventListener('click', N.emit.bind(N, v.LINK_CLICKED));
});
var t = [].slice.call(T.querySelectorAll('a'));
t.forEach(function (e) {
e.addEventListener(
'click',
N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
contact_type: e.getAttribute('id'),
})
);
});
}
var u = e('../../util/browser'),
d = e('../../util/common'),
p = e('../../util/logger'),
f = e('../../localization/localize'),
g = e('./titleBarSettings'),
m = e('../../settings'),
v = e('./TitleEvents'),
A = e('events').EventEmitter,
y = new p(i),
C = document.querySelector('.pinTop.left'),
I = document.getElementsByClassName('title-container')[0],
E = document.getElementById('title-toggle').querySelector('i'),
b = document.getElementById('meta-info-wrapper'),
w = document.getElementById('meta-info'),
_ = document.getElementById('meta-description'),
T = document.getElementsByClassName('contact-info')[0],
x = document.getElementById('contact-data'),
S = document.getElementById('addressTxt'),
M = document.getElementById('tag-toggles'),
R = document.getElementById('share-origin'),
P = document.getElementById('share-link-wrapper'),
O = [w, b, I],
L = !1,
D = !1,
N = {
populate: function (e) {
if (n(window.DATA.name, e.coBrand)) {
if (
(r(e.description),
o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
a(e.address),
L)
) {
var t = document.createElement('br');
M.insertBefore(t, M.firstElementChild);
}
e.socialSharing && m.share.enabled && (D = l(e.url));
}
},
finishSetup: function (e) {
(L = L || !!e),
h(),
L || (D ? I.classList.add('share-only') : I.classList.add('no-meta'));
},
toggleMeta: function (e, t) {
var title = document.getElementById('model-title');
t && t.preventDefault();
var i = w.classList.contains('expand');
(e && !i) ||
(i
? (O.forEach(function (e) {
e.classList.remove('expand');
}),
this.emit(v.CLOSE_INFO),
title.classList.remove('expand'))
: (O.forEach(function (e) {
e.classList.add('expand');
}),
title.classList.add('expand'),
this.emit(v.OPEN_INFO)));
},
setupToggling: function () {
(b.style.height = w.offsetHeight + 'px'),
w.addEventListener('transitionend', function () {
b.style.height = w.offsetHeight + 'px';
});
},
toggleTitle: function (e) {
e && e.preventDefault(),
C.classList.contains('closed')
? (C.classList.add('open'),
E.classList.remove('icon-dpad-right'),
E.classList.add('icon-dpad-left'),
this.emit(v.SHOW_INFO),
setTimeout(function () {
C.classList.remove('closed'), C.classList.remove('open');
}, g.removeAnimationClasses))
: (C.classList.add('closed'),
E.classList.remove('icon-dpad-left'),
E.classList.add('icon-dpad-right'),
this.emit(v.HIDE_INFO));
},
};
d.extendObject(N, A.prototype), (t.exports = N);
}.call(this, '/js/gui/title/titleBar.js'));
},
{
'../../localization/localize': 108,
'../../settings': 166,
'../../util/browser': 182,
'../../util/common': 185,
'../../util/logger': 189,
'./TitleEvents': 80,
'./titleBarSettings': 83,
events: 202,
},
],
83: [
function (e, t, i) {
'use strict';
t.exports = Object.freeze({
minTooltipCharacters: 19,
removeAnimationClasses: 500,
});
},
{},
],
84: [
function (e, t, i) {
'use strict';
function n(e) {
(C = e),
P.forEach(function (e) {
b.addEventListener(e, u.bind(this, !1), !0),
w.addEventListener(e, u.bind(this, !0), !0),
E.addEventListener(e, o, !0);
S.forEach(function (t) {
//会触发导览停止
t.addEventListener(e, a, !0);
});
$('#drawer img').on(e, a);
});
document.addEventListener('keydown', u.bind(this, !1), !0);
C.on(v.TourStart, function () {
E.classList.add('playing');
});
}
function r() {
// C.playTour(),
C.playTourNearBy(), I && clearTimeout(I), d(), _.removeClass('fadeIn');
}
function o() {
E.classList.contains('playing') &&
(C.stopTour(),
_.addClass('fadeIn'),
setTimeout(function () {
_.removeClass('fadeIn');
}, p.tourInteraction.showPauseButton),
O || (clearTimeout(I), (I = setTimeout(h, p.tourInteraction.showModal))),
setTimeout(function () {
E.classList.remove('playing');
}, p.tourInteraction.allowNextClick));
}
function a() {
C.tourInProgress && (C.stopTour(), C.endTourProgress(), E.classList.remove('playing'));
}
function s() {
T.is(':visible') ? r() : o();
}
function l() {
x.hasClass('playing') &&
(clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass('fadeIn'));
}
function c() {
E.classList.remove('playing'), h();
}
function h() {
//去掉导览结束时的提示
/* if (!p.tourInteraction.disabled) {
M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
M.addClass("fadeIn tour " + m.deviceType);
var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
if (!p.tourInteraction.smallModal) {
var t;
t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
m.fill(R, A.TOUR_INTERACTION[t]),
M.addClass(t)
}
M.addClass(e)
} */
}
function u(e, t) {
if (t) {
var i = 'keydown' === t.type,
n = t.which === f.SPACE || C.tourIsPlaying;
(i && n) || e || (O = !0),
C.atEndOfTour() && d(),
!C.tourIsPlaying &&
C.tourInProgress &&
(_.removeClass('fadeIn'), d(), t.which !== f.SPACE && a()),
i && n && s();
}
}
function d() {
M.removeClass('fadeIn');
}
var p = (e('../util/browser'), e('../settings')),
f = e('../enum/Keys'),
g = e('../enum/Viewmode'),
m = (e('./helpManager'), e('./populateModal')),
v = e('../enum/DirectorEvents'),
A = e('../enum/HelpModalType'),
y = e('../enum/HelpModalSize'),
C = null,
I = null,
E = document.getElementById('pause-overlay'),
b = document.getElementById('player'),
w = document.getElementById('gui'),
_ = $('#pause-icon').eq(0),
T = $('#play').eq(0),
x = $('#playHead').eq(0),
S = $(
'.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan'
).toArray(),
M = $('#interaction-modal').eq(0),
R = $('#interaction-modal .interaction').toArray(),
P = ['touchstart', 'mousedown', 'pointerdown'],
O = !1;
(t.exports.init = n),
(t.exports.play = r),
(t.exports.pause = o),
(t.exports.pauseWithoutCTA = a),
(t.exports.togglePlay = s),
(t.exports.stopTour = l),
(t.exports.dismissModal = d);
},
{
'../enum/DirectorEvents': 23,
'../enum/HelpModalSize': 27,
'../enum/HelpModalType': 28,
'../enum/Keys': 30,
'../enum/Viewmode': 51,
'../settings': 166,
'../util/browser': 182,
'./helpManager': 68,
'./populateModal': 75,
},
],
85: [
function (e, t, i) {
'use strict';
t.exports = Object.freeze({
OPENED: 'vr.modal.opened',
LAUNCH: 'vr.modal.launch',
CLOSED: 'vr.modal.closed',
NEXT: 'vr.modal.next',
PREV: 'vr.modal.prev',
STORE: 'vr.modal.store',
falseICECHOSEN: 'vr.modal.device',
});
},
{},
],
86: [
function (e, t, i) {
'use strict';
function n(e, t, i) {
function n(e, t, n, r) {
function o() {
return p + '&m=' + t + '&display=' + e;
}
function s() {
var e = '&utm_medium=' + (a.inIframe() ? 'embed' : 'direct'),
t = '&utm_source=' + u,
n = '&utm_showcase_session_id=' + i;
return e + t + n;
}
function l() {
return (
d +
'&sids=' +
t +
'&lsid=' +
t +
'&ln=' +
encodeURIComponent(n) +
'&ld=' +
encodeURIComponent(r) +
'&display=' +
e
);
}
return a.valueFromHash('vrcoll', !1) ? l() + s() : o() + s();
}
function r(e, t, i, r) {
var o = 'https://api.branch.io/v1/url',
a = n(e, t, i, r),
s = {
responseType: 'json',
data: {
branch_key: h.appConfig.branch_key,
data: {
m: t,
full_url: a,
$desktop_url: m,
$og_app_id: '331853976762864119',
$og_title: i,
$og_description: r,
$og_image_url: location.origin + '/api/v1/player/models/' + t + '/thumb',
$canonical_url: window.location.href,
},
},
};
c.post(o, s)
.done(function (t) {
f[e] = t.url;
})
.fail(
function (t) {
f[e] = t;
}.bind(this, a)
);
}
function o(e, t, i) {
for (var r in s) {
var o = s[r],
a = n(o, e, t, i);
f[o] = a;
}
}
var u = a.inIframe()
? encodeURIComponent(document.referrer)
: encodeURIComponent(window.location.href),
d = g + '/vr/dlist/?ret=' + u,
p = g + '/vr/show/?ret=' + u,
m = '';
switch (e) {
case l.IOS:
r(s.CardboardIOS, t.sid, t.name, t.summary);
break;
default:
o(t.sid, t.name, t.summary);
}
}
function r(e) {
var t = f[e];
window.open(t, '_blank');
}
function o(e) {
var t = u[e];
window.open(t, '_blank');
}
var a = e('../../util/browser'),
s = e('../../enum/VRApps'),
l = e('../../enum/VRPlatforms'),
c = e('../../util/ajax'),
h = e('../../settings'),
u = {};
(u[s.CardboardAndroid] =
'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
(u[s.CardboardIOS] =
'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
(u[s.GearVR] =
'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=');
for (var d in s) {
var p = s[d];
u[p] += encodeURIComponent(document.referrer + '&display=' + p);
}
var f = {},
g = (function () {
var e = window.location.host;
return (
e.indexOf('.port.com') === -1 && e.indexOf('localhost') === -1 && (e = 'my.port.com'),
'https://' + e
);
})();
(t.exports.init = n), (t.exports.launch = r), (t.exports.launchStore = o);
},
{
'../../enum/VRApps': 46,
'../../enum/VRPlatforms': 49,
'../../settings': 166,
'../../util/ajax': 181,
'../../util/browser': 182,
},
],
87: [
function (e, t, i) {
'use strict';
function n(e) {
var t;
switch (e) {
case m.IOS:
return (t = p.iosVersion()), t.major > 9 || (9 === t.major && t.minor >= 1);
case m.Android:
return (
(t = p.androidVersion()),
t.major > 4 ||
(4 === t.major && t.minor > 4) ||
(4 === t.major && 4 === t.minor && t.patch >= 4)
);
}
return !1;
}
function r(e, t) {
function i(e) {
K.emit(A.STORE, {
type: e,
}),
f.launchStore(e);
}
function r(e) {
switch ((e !== _.pageCount && (a(e), N.text(e + 1 + ' / ' + _.pageCount)), e)) {
case _.Title:
O.css('display', 'none'), L.text(u[e]), o(s);
break;
case _.Cardboard:
O.css('display', 'block'),
L.text(u[e]),
M.filter('.cardboard').off(),
M.filter('.gearvr').off(),
c(e, s),
h(H, X, Z);
break;
case _.Gear:
L.text(u[e]), c(e, s), T.addClass('lastPage'), h(G, X, Z);
break;
case _.pageCount:
T.removeClass('fadeIn'), K.emit(A.CLOSED);
}
B.filter("[src='']").hide();
}
var s = (function () {
return p.detectAndroid()
? p.detectAndroidMobile() && n(m.Android)
? (T.addClass('supported'), (w = '.show-supported'), m.Android)
: (T.addClass('unsupported'), (w = '.show-unsupported'), m.UnsupportedAndroid)
: p.detectIPhone() || p.detectIPod()
? (T.addClass('ios'), (w = '.show-ios'), (_ = v.ios), m.IOS)
: (T.addClass('desktop'), (w = '.show-desktop'), m.Desktop);
})();
f.init(s, e, t), s !== m.Desktop && T.addClass('mobile');
var l = function (e) {
K.emit(A.LAUNCH, {
vr_platform: s,
vr_app: e,
}),
f.launch(e);
};
(q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
(q.gear = l.bind(this, g.GearVR)),
(q.cardboardIOS = l.bind(this, g.CardboardIOS)),
d(),
$('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
$(w).show();
var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
y = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done'];
s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
$('#vr').on('click', function (e) {
e.preventDefault();
player.FlyToMode('panorama', () => {
if (!window.vrEnabled) {
// 开启VR
window.vrEnabled = true;
this.classList.add('active');
$('#gui div').not('#vrOff').addClass('vrHide');
$('#vrOffImg').css({ display: 'inline-block' });
} else {
}
});
});
let exitVR = function () {
$('#gui div').not('#vrOff').removeClass('vrHide');
$('#vrOffImg').css({ display: 'none' });
$('#player canvas').css({ width: '', height: '' }); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
$('#vr').removeClass('active'); // 清除vr按钮的激活样式
};
$('#vrOff').on('click', function () {
window.vrEnabled = false;
exitVR();
});
window.bus.addEventListener('exitWebXR', (e) => {
exitVR();
});
var I = 'https://my.port.com/vr/show/?m=' + e.sid;
s === m.IOS
? $('.cardboardLink').on('click', i.bind(this, g.CardboardIOS))
: $('.cardboardLink').on('click', i.bind(this, g.CardboardAndroid)),
$('.gearLink').on('click', i.bind(this, g.GearVR)),
$('span.modelLink').text(I),
O.on('click', function (e) {
K.emit(A.PREV), b--, r(b);
}),
L.on('click', function (e) {
L.text();
K.emit(A.NEXT, {
nextAction: y[b],
}),
b++,
r(b);
}),
T.find('.close').on('click', K.dismiss);
}
function o(e) {
switch (e) {
case m.Android:
M.filter('.cardboard').off().on('click', q.cardboardAndroid),
M.filter('.gearvr').off().on('click', q.gear),
s(H, G, 'logo-button', 'same-line');
break;
case m.UnsupportedAndroid:
s('', z, '', '');
break;
case m.IOS:
M.filter('.cardboard').off().on('click', q.cardboardIOS), s(H, '', 'logo-button', '');
break;
case m.Desktop:
M.filter('.cardboard').off().on('click', l.bind(this, null, F, U)),
M.filter('.gearvr').off().on('click', l.bind(this, G, V, null)),
s(H, G, 'logo-button', 'same-line'),
Q.cardboard();
}
}
function a(e) {
$('.p1, .p2, .p3').hide(),
x.insertAfter(S),
T.removeClass('front-page'),
T.removeClass('details-page'),
T.removeClass('lastPage'),
M.removeClass('logo-button'),
M.removeClass('same-line'),
S.removeClass('headsetOptions'),
R.attr('src', ''),
R.filter('.second').removeClass('gear'),
R.css('display', 'inline-block'),
R.off(),
P.filter('.second').css('display', ''),
D.css('display', 'none'),
$('.p' + (e + 1) + w).show(),
R.filter('.third').insertBefore(P.filter('.third'));
}
function s(e, t, i, n) {
T.addClass('front-page'),
R.filter('.first').attr('src', e),
R.filter('.second').attr('src', t),
M.filter('.first').addClass(i),
M.filter('.second').addClass(i),
M.addClass(n),
'.show-desktop' === w && S.insertAfter(x);
}
function l(e, t, i) {
S.addClass('headsetOptions'),
M.off(),
R.filter('.second').attr('src', t),
D.css('display', 'block'),
P.filter('.second').css('display', 'none'),
D.on('click', function () {
a(_.Title), o(m.Desktop);
}),
e &&
(K.emit(A.falseICECHOSEN, {
name: g.GearVR,
}),
R.filter('.first').attr('src', e),
R.filter('.second').addClass('gear'),
R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
Q.gearvr()),
i &&
(K.emit(A.falseICECHOSEN, {
name: g.Cardboard,
}),
R.filter('.third').attr('src', i),
R.filter('.third').show(),
R.filter('.third').insertAfter(R.filter('.second')),
R.filter('.third').addClass('link'),
R.filter('.second').addClass('link'),
R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)),
Q.cardboard());
}
function c(e, t) {
switch (t) {
case m.IOS:
(X = Y), (Z = j);
break;
case m.Desktop:
e === _.Cardboard
? ((X = F),
(Z = U),
R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)))
: ((X = V),
R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
(Z = ''));
break;
default:
e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W));
}
}
function h(e, t, i) {
T.find('.inner').addClass('details-page'),
T.addClass('details-page'),
R.filter('.first').attr('src', e),
R.filter('.second').attr('src', t),
R.filter('.third').attr('src', i);
}
function u() {
T.hasClass('fadeIn') && (T.removeClass('fadeIn'), K.emit(A.CLOSED));
}
function d() {
var e = p.aspectRatio() > 1 && p.isMobile();
T.toggleClass('landscape', e).toggleClass('portrait', !e),
T.toggleClass('tiny', $('#player').height() <= y.narrowLandscapeHeight),
T.toggleClass('tinier', $('#player').height() <= y.reallyNarrowLandscapeHeight);
}
var p = e('../../util/browser'),
f = e('./vrLink'),
g = e('../../enum/VRApps'),
m = e('../../enum/VRPlatforms'),
v = e('../../enum/VRPages'),
A = e('./vrEvent'),
y = (e('../../settings'), e('../../constants')),
C = e('../../localization/localize'),
I = e('../../util/common'),
E = e('events').EventEmitter,
b = 0,
w = null,
_ = v.standard,
T = $('.vr-popup'),
x = T.find('.vr-popup-body'),
S = T.find('.vr-images'),
M = T.find('.img-container'),
R = T.find('.vr-sm-image'),
P = M.find('.vr-img-caption'),
O = $('.vr-buttons').find('.prev-button'),
L = $('.vr-buttons').find('.next-button'),
D = S.find('.front-close'),
N = $('.vr-page'),
B = T.find('img'),
F = 'images/apple-store.png',
V = 'images/badge-oculus.png',
U = 'images/badge-cardboard.png',
k = 'images/logo-samsung.png',
H = 'images/headset-cardboard.png',
G = 'images/headset-gearvr.png',
z = 'images/ico-android-robot.png',
W = 'images/ico-gearvr.png',
j = 'images/ico-vr.png',
Y = 'images/apple-logo-white.svg',
X = null,
Z = null,
q = {},
K = {
init: r,
dismiss: u,
isDeviceSupported: n,
};
I.extendObject(K, E.prototype), $(window).resize(d);
var Q = (function () {
var e = P.filter('.first').find('.cardboard'),
t = P.filter('.first').find('.gearvr');
return {
cardboard: function () {
t.addClass('hidden'), e.removeClass('hidden');
},
gearvr: function () {
e.addClass('hidden'), t.removeClass('hidden');
},
};
})();
t.exports = K;
},
{
'../../constants': 8,
'../../enum/VRApps': 46,
'../../enum/VRPages': 48,
'../../enum/VRPlatforms': 49,
'../../localization/localize': 108,
'../../settings': 166,
'../../util/browser': 182,
'../../util/common': 185,
'./vrEvent': 85,
'./vrLink': 86,
events: 202,
},
],
88: [
function (e, t, i) {
'use strict';
t.exports = Object.freeze({
OPENED: 'webvr.modal.opened',
SHOW_TERMS: 'webvr.footer.show.terms',
});
},
{},
],
89: [
function (e, t, i) {
(function (i) {
'use strict';
function n(e, t, i, n) {
function r(e) {
e.preventDefault(), a(e.currentTarget.id);
}
function a(e) {
ne[e](),
Object.keys(ne).map(function (t, i) {
$('#' + t).toggleClass('tabs-underlined', t === e);
});
}
(y = i), (v = t), w.init(E.Android, e, n), m();
var l = new RegExp('daydream', 'i'),
c = l.test(y.displayName);
c
? (a('tabdaydream'),
B.filter('.device-headset-side').attr('src', H),
D.find('.title').text(x.localizeText('WEBVR_FOR_DAYDREAM')))
: (a('tabcardboard'),
B.filter('.device-headset-side').attr('src', Y),
D.find('.title').text(x.localizeText('WEBVR_FOR_CARDBOARD'))),
$('#vr').on('click', function (e) {
e.preventDefault(),
g('click_webvr_button'),
L.is(':hidden') && (ie.emit(_.OPENED), o());
}),
$('.webvr-popup .close').on('click', function (e) {
e.preventDefault(), D.hasClass('hidden') ? (g('webvr_help_close'), p()) : s();
}),
$('#tabcardboard').on('click', r),
$('#tabdaydream').on('click', r),
$('#tabnative').on('click', r),
$('.webvr-popup .open-with-app').on('click', function (e) {
e.preventDefault(), g('webvr_learn_more'), a('tabnative'), p();
}),
$('.webvr-popup .help').on('click', function (e) {
e.preventDefault(),
g(D.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'),
p();
}),
$('.webvr-popup .terms').on('click', function (e) {
e.preventDefault(), g('webvr_click_terms'), s(), ie.emit(_.SHOW_TERMS);
}),
F.on('click', function (e) {
e.preventDefault(), g(ee), window.open(J, '_blank');
}),
V.on('click', function (e) {
e.preventDefault(), g('webvr_phone_link'), window.open(te, '_blank');
}),
$('.webvr-popup .badge-cardboard').on('click', function (e) {
e.preventDefault(), g('webvr_cardboard_link'), w.launch(b.CardboardAndroid);
}),
$('.webvr-popup .badge-oculus').on('click', function (e) {
e.preventDefault(), g('webvr_oculus_link'), w.launch(b.GearVR);
});
}
function r() {
function e() {
y.isPresenting || (f(), window.removeEventListener('vrdisplaypresentchange', e));
}
R.info('Headset mounted'), v.suspend();
var t = document.createElement('canvas');
for (
t.getContext('webgl'),
t.className = 'webvr-canvas',
document.bgColor = '#000',
document.body.style.backgroundColor = '#000';
document.body.firstChild;
)
document.body.removeChild(document.body.firstChild);
document.body.appendChild(t),
g('webvr_enter_app'),
y
.requestPresent([
{
source: t,
predistorted: !0,
},
])
.catch(function (t) {
R.error('Failed to present: ' + t), g('webvr_exit_calibrate'), e();
}),
A.then(function () {
window.dispatchEvent(new Event('vrapp-start'));
}),
window.addEventListener('vrdisplaypresentchange', e);
}
function o() {
O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a();
}
function a() {
if (!A) {
var e = C.valueFromHash('webvr') || I.appConfig.webvr_version,
t = 'https://static.port.com/webvr/' + e + '/js/main.js';
A = new Promise(function (e, i) {
var n = document.createElement('script');
(n.type = 'text/javascript'),
(n.src = t),
(n.onload = e),
document.head.appendChild(n);
});
}
D.find('.enter-button').on('click', r);
}
function s() {
g('webvr_modal_close'),
D.find('.enter-button').off('click', r),
L.fadeOut(I.guiAnimationSpeed, function () {
D.toggleClass('hidden', !1), N.toggleClass('hidden', !0), C.exitFullscreen();
}),
O.fadeIn(I.guiAnimationSpeed);
}
function l() {
k.toggleClass('hidden', !1), U.toggleClass('hidden', !0);
}
function c() {
k.toggleClass('hidden', !0), U.toggleClass('hidden', !1);
}
function h() {
B.filter('.device-headset').attr('src', G),
B.filter('.device-phone').attr('src', z),
(J = Z),
(ee = K),
F.text(x.localizeText('WEBVR_DAYDREAM_VIEW')),
V.text(x.localizeText('VR_NEED_DAYDREAM_PHONE')),
$('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
c();
}
function u() {
B.filter('.badge-cardboard').attr('src', j),
B.filter('.badge-oculus').attr('src', X),
l();
}
function d() {
B.filter('.device-headset').attr('src', Y),
B.filter('.device-phone').attr('src', W),
(J = q),
(ee = Q),
F.text(x.localizeText('VR_GOOGLE_CARDBOARD')),
V.text(x.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
$('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
c();
}
function p() {
D.toggleClass('hidden'), N.toggleClass('hidden');
}
function f() {
R.info('exiting webVR'),
g('webvr_exit_app'),
window.location.search.indexOf('&qs=1') === -1
? (window.location = window.location + '&qs=1')
: (window.location = window.location);
}
function g(e) {
var t = C.isLandscape() ? 'landscape' : 'portrait';
T.trackAlways('showcase_gui', {
gui_action: e,
orientation: t,
});
}
function m() {
var e = C.isLandscape();
L.toggleClass('landscape', e).toggleClass('portrait', !e);
}
var v,
A,
y,
C = e('../../util/browser'),
I = e('../../settings'),
E = (e('./../gui'), e('../../enum/VRPlatforms')),
b = e('../../enum/VRApps'),
w = e('./../vr/vrLink'),
_ = e('./WebVrEvent'),
T = e('../../analytics'),
x = (e('../../constants'), e('../../localization/localize')),
S = e('../../util/common'),
M = e('../../util/logger'),
R = new M(i),
P = e('events').EventEmitter,
O = $('#gui'),
L = $('.webvr-popup'),
D = $('.webvr-popup .page.p1'),
N = $('.webvr-popup .page.p2'),
B = L.find('.image'),
F = $('.webvr-popup .detail.headset'),
V = $('.webvr-popup .detail.phone'),
U = $('.webvr-popup .tab-content.webvr'),
k = $('.webvr-popup .tab-content.native'),
H = 'images/device-daydream-side.png',
G = 'images/device-daydream.png',
z = 'images/device-pixel.png',
W = 'images/ico-android-robot.png',
j = 'images/badge-cardboard.png',
Y = 'images/headset-cardboard.png',
X = 'images/badge-oculus.png',
Z = 'https://madeby.google.com/vr/',
q = 'https://vr.google.com/cardboard/get-cardboard/',
K = 'webvr_daydream_link',
Q = 'webvr_cardboard_link',
J = Z,
ee = K,
te = 'https://vr.google.com/daydream/phones/',
ie = {
init: n,
},
ne = {
tabcardboard: d,
tabdaydream: h,
tabnative: u,
};
S.extendObject(ie, P.prototype), $(window).resize(m), (t.exports = ie);
}.call(this, '/js/gui/webvr/webVRgui.js'));
},
{
'../../analytics': 4,
'../../constants': 8,
'../../enum/VRApps': 46,
'../../enum/VRPlatforms': 49,
'../../localization/localize': 108,
'../../settings': 166,
'../../util/browser': 182,
'../../util/common': 185,
'../../util/logger': 189,
'./../gui': 65,
'./../vr/vrLink': 86,
'./WebVrEvent': 88,
events: 202,
},
],
90: [
function (e, t, i) {
'use strict';
function n(e, t, i, n, o) {
n || 0 === n ? (this.floorId = n) : (this.floorId = -1),
(this.roomId = o || ''),
(this.labelId = e),
(this.position = new r.Vector3().copy(t)),
(this.text = i);
}
var r = e('three'),
o = e('../util/browser');
(n.prototype.build = function () {
var e = window.document.createElement('div');
o.isMobile()
? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile')
: e.setAttribute('class', 'gui-floorplan-label');
var t = window.document.createElement('div');
t.setAttribute('class', 'gui-floorplan-label-text');
var i = window.document.createTextNode(this.text);
t.appendChild(i),
e.appendChild(t),
window.document.body.appendChild(e),
(this.labelGui = e),
(this.textBlock = t),
$(this.labelGui).hide();
var n = window.getComputedStyle(this.labelGui);
this.initialTransform = n.transform || n.webkitTransform;
}),
(t.exports = n);
},
{
'../util/browser': 182,
three: 217,
},
],
91: [
function (e, t, i) {
'use strict';
function n() {
(this.player = null), (this.modelManager = null), (this.container = null);
}
var r = e('three'),
o = (e('../util/common'), e('../enum/PlayerEvents')),
a = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
s = e('../settings'),
l = e('../enum/Viewmode'),
c =
(e('../enum/WarpStyle'),
e('../util/transitions'),
e('../util/lerp'),
e('../util/browser'));
//场景初始化
(n.prototype.init = function (e, t, i) {
(this.player = e),
(this.modelManager = t),
(this.container = i),
this.updateModel(),
this.bindEvents();
}),
(n.prototype.bindEvents = function () {
this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
this.player.on(o.StartInside, this.handleStartInside.bind(this)),
this.player.on(o.StartOutside, this.handleStartOutside.bind(this));
}),
(n.prototype.updateModel = function () {
this.model = this.modelManager.getActiveModel();
}),
(n.prototype.handlePlayerViewChanged = function () {
this.updateLabelVisibility(), this.updateLabelDisplay();
}),
(n.prototype.getLabelsForFloor = function (e, t) {
return (
(t = t || []),
(t.length = 0),
this.model.labels.forEach(
function (i) {
this.labelVisibleForFloor(i, e) && t.push(i);
}.bind(this)
),
t
);
}),
(n.prototype.getLabelsForCurrentFloor = function (e) {
return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e);
}),
(n.prototype.labelVisibleForFloor = function (e, t) {
var i =
(c.isMobile() &&
this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile) ||
(!c.isMobile() &&
this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop);
if (!this.model.showingLabels || !e.labelGui || !i) return !1;
var n = e.floorId === this.model.floors.size() - 1;
return this.model.allFloorsVisible ? n : e.floorId === t;
}),
(n.prototype.updateLabelVisibility = function (e) {
this.model.labels.forEach(
function (e) {
this.supportedMode() &&
this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration)
: this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration);
}.bind(this)
);
}),
(n.prototype.showAllLabels = function (e, t) {
this.model.labels.forEach(
function (i) {
this.showLabel(i, e, t);
}.bind(this)
);
}),
(n.prototype.hideAllLabels = function (e, t) {
this.model.labels.forEach(
function (i) {
this.hideLabel(i, e, t);
}.bind(this)
);
}),
(n.prototype.showLabel = function (e, t, i) {
this.model.showingLabels &&
(e.visible ||
((e.visible = !0),
(e.labelGui.style.display = 'block'),
(e.labelGui.style.opacity = 0),
$(e.labelGui).delay(t).fadeTo(i, 1)));
}),
(n.prototype.hideLabel = function (e, t, i) {
e.visible &&
((e.visible = !1),
c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i));
}),
(n.prototype.supportedMode = function () {
return this.player.mode === l.FLOORPLAN;
}),
(n.prototype.updateLabelDisplay = (function () {
var e = (new r.Vector3(), new r.Vector3(), []);
return function () {
var t = this.player.getLabelScaleFactor(),
i = 0.6,
n = 1.2,
r = (1 - t) * n + i,
o = c.isMobile()
? s.labels.zoomTruncateThreshhold.mobile
: s.labels.zoomTruncateThreshhold.desktop;
this.getLabelsForCurrentFloor(e);
for (var a = 0; a < e.length; a++) {
var l = e[a];
this.supportedMode() &&
l.labelGui &&
(this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
t >= o && l.text.length >= s.labels.minLengthForTruncate
? (l.textBlock.innerText =
l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix)
: (l.textBlock.innerText = l.text));
}
};
})()),
(n.prototype.updateProjectedGuiElement = (function () {
var e = new r.Vector3();
new r.Vector3();
return function (t, i, n, r, o) {
i.style.fontSize = 100 * o + '%';
var a = $('#player').width(),
s = $('#player').height(),
l = 0.5 * a,
c = 0.5 * s;
e.copy(n), e.project(this.player.camera);
var h = e.x * l + l,
u = -(e.y * c) + c;
(h -= t.offsetWidth / 2),
(u -= t.offsetHeight / 2),
(t.style.left = h + 'px'),
(t.style.top = u + 'px');
};
})()),
(n.prototype.handleStartInside = function (e) {
this.updateLabelVisibility();
}),
(n.prototype.handleStartOutside = function () {
this.updateLabelVisibility();
}),
(t.exports = n);
},
{
'../enum/DirectorEvents': 23,
'../enum/ModelManagerEvents': 33,
'../enum/PlayerEvents': 40,
'../enum/Viewmode': 51,
'../enum/WarpStyle': 52,
'../settings': 166,
'../util/browser': 182,
'../util/common': 185,
'../util/lerp': 188,
'../util/transitions': 195,
three: 217,
},
],
92: [
function (e, t, i) {
'use strict';
Array.prototype.findIndex ||
(Array.prototype.findIndex = function (e) {
if (null == this)
throw new TypeError('Array.prototype.findIndex called on null or undefined');
if ('function' != typeof e) throw new TypeError('predicate must be a function');
for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
if (((t = i[o]), e.call(r, t, o, i))) return o;
return -1;
}),
Array.prototype.find ||
Object.defineProperty(Array.prototype, 'find', {
value: function (e) {
if (null == this) throw new TypeError('"this" is null or not defined');
var t = Object(this),
i = t.length >>> 0;
if ('function' != typeof e) throw new TypeError('predicate must be a function');
for (var n = arguments[1], r = 0; r < i; ) {
var o = t[r];
if (e.call(n, o, r, t)) return o;
r++;
}
},
});
},
{},
],
93: [
function (e, t, i) {
'use strict';
var n = n || {};
(t.exports = n),
(n.gui = n.gui || {}),
(n.utils = n.utils || {}),
(n.controllers = n.controllers || {}),
(n.dom = n.dom || {}),
(n.color = n.color || {}),
(n.utils.css = (function () {
return {
load: function (e, t) {
t = t || document;
var i = t.createElement('link');
(i.type = 'text/css'),
(i.rel = 'stylesheet'),
(i.href = e),
t.getElementsByTagName('head')[0].appendChild(i);
},
inject: function (e, t) {
t = t || document;
var i = document.createElement('style');
(i.type = 'text/css'),
(i.innerHTML = e),
t.getElementsByTagName('head')[0].appendChild(i);
},
};
})()),
(n.utils.common = (function () {
var e = Array.prototype.forEach,
t = Array.prototype.slice;
return {
BREAK: {},
extend: function (e) {
return (
this.each(
t.call(arguments, 1),
function (t) {
for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i]);
},
this
),
e
);
},
defaults: function (e) {
return (
this.each(
t.call(arguments, 1),
function (t) {
for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i]);
},
this
),
e
);
},
compose: function () {
var e = t.call(arguments);
return function () {
for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
i = [e[n].apply(this, i)];
return i[0];
};
},
each: function (t, i, n) {
if (t)
if (e && t.forEach && t.forEach === e) t.forEach(i, n);
else if (t.length === t.length + 0) {
for (var r = 0, o = t.length; r < o; r++)
if (r in t && i.call(n, t[r], r) === this.BREAK) return;
} else for (var r in t) if (i.call(n, t[r], r) === this.BREAK) return;
},
defer: function (e) {
setTimeout(e, 0);
},
toArray: function (e) {
return e.toArray ? e.toArray() : t.call(e);
},
isUndefined: function (e) {
return void 0 === e;
},
isNull: function (e) {
return null === e;
},
isNaN: function (e) {
return e !== e;
},
isArray:
Array.isArray ||
function (e) {
return e.constructor === Array;
},
isObject: function (e) {
return e === Object(e);
},
isNumber: function (e) {
return e === e + 0;
},
isString: function (e) {
return e === e + '';
},
isBoolean: function (e) {
return e === !1 || e === !0;
},
isFunction: function (e) {
return '[object Function]' === Object.prototype.toString.call(e);
},
};
})()),
(n.controllers.Controller = (function (e) {
var t = function (e, t) {
(this.initialValue = e[t]),
(this.domElement = document.createElement('div')),
(this.object = e),
(this.property = t),
(this.__onChange = void 0),
(this.__onFinishChange = void 0);
};
return (
e.extend(t.prototype, {
onChange: function (e) {
return (this.__onChange = e), this;
},
onFinishChange: function (e) {
return (this.__onFinishChange = e), this;
},
setValue: function (e) {
return (
(this.object[this.property] = e),
this.__onChange && this.__onChange.call(this, e),
this.updateDisplay(),
this
);
},
getValue: function () {
return this.object[this.property];
},
updateDisplay: function () {
return this;
},
isModified: function () {
return this.initialValue !== this.getValue();
},
}),
t
);
})(n.utils.common)),
(n.dom.dom = (function (e) {
function t(t) {
if ('0' === t || e.isUndefined(t)) return 0;
var i = t.match(r);
return e.isNull(i) ? 0 : parseFloat(i[1]);
}
var i = {
HTMLEvents: ['change'],
MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
KeyboardEvents: ['keydown'],
},
n = {};
e.each(i, function (t, i) {
e.each(t, function (e) {
n[e] = i;
});
});
var r = /(\d+(\.\d+)?)px/,
o = {
makeSelectable: function (e, t) {
void 0 !== e &&
void 0 !== e.style &&
((e.onselectstart = t
? function () {
return !1;
}
: function () {}),
(e.style.MozUserSelect = t ? 'auto' : 'none'),
(e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
(e.unselectable = t ? 'on' : 'off'));
},
makeFullscreen: function (t, i, n) {
e.isUndefined(i) && (i = !0),
e.isUndefined(n) && (n = !0),
(t.style.position = 'absolute'),
i && ((t.style.left = 0), (t.style.right = 0)),
n && ((t.style.top = 0), (t.style.bottom = 0));
},
fakeEvent: function (t, i, r, o) {
r = r || {};
var a = n[i];
if (!a) throw new Error('Event type ' + i + ' not supported.');
var s = document.createEvent(a);
switch (a) {
case 'MouseEvents':
var l = r.x || r.clientX || 0,
c = r.y || r.clientY || 0;
s.initMouseEvent(
i,
r.bubbles || !1,
r.cancelable || !0,
window,
r.clickCount || 1,
0,
0,
l,
c,
!1,
!1,
!1,
!1,
0,
null
);
break;
case 'KeyboardEvents':
var h = s.initKeyboardEvent || s.initKeyEvent;
e.defaults(r, {
cancelable: !0,
ctrlKey: !1,
altKey: !1,
shiftKey: !1,
metaKey: !1,
keyCode: void 0,
charCode: void 0,
}),
h(
i,
r.bubbles || !1,
r.cancelable,
window,
r.ctrlKey,
r.altKey,
r.shiftKey,
r.metaKey,
r.keyCode,
r.charCode
);
break;
default:
s.initEvent(i, r.bubbles || !1, r.cancelable || !0);
}
e.defaults(s, o), t.dispatchEvent(s);
},
bind: function (e, t, i, n) {
return (
(n = n || !1),
e.addEventListener
? e.addEventListener(t, i, n)
: e.attachEvent && e.attachEvent('on' + t, i),
o
);
},
unbind: function (e, t, i, n) {
return (
(n = n || !1),
e.removeEventListener
? e.removeEventListener(t, i, n)
: e.detachEvent && e.detachEvent('on' + t, i),
o
);
},
addClass: function (e, t) {
if (void 0 === e.className) e.className = t;
else if (e.className !== t) {
var i = e.className.split(/ +/);
i.indexOf(t) == -1 &&
(i.push(t),
(e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')));
}
return o;
},
removeClass: function (e, t) {
if (t)
if (void 0 === e.className);
else if (e.className === t) e.removeAttribute('class');
else {
var i = e.className.split(/ +/),
n = i.indexOf(t);
n != -1 && (i.splice(n, 1), (e.className = i.join(' ')));
}
else e.className = void 0;
return o;
},
hasClass: function (e, t) {
return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1;
},
getWidth: function (e) {
var i = getComputedStyle(e);
return (
t(i['border-left-width']) +
t(i['border-right-width']) +
t(i['padding-left']) +
t(i['padding-right']) +
t(i.width)
);
},
getHeight: function (e) {
var i = getComputedStyle(e);
return (
t(i['border-top-width']) +
t(i['border-bottom-width']) +
t(i['padding-top']) +
t(i['padding-bottom']) +
t(i.height)
);
},
getOffset: function (e) {
var t = {
left: 0,
top: 0,
};
if (e.offsetParent)
do (t.left += e.offsetLeft), (t.top += e.offsetTop);
while ((e = e.offsetParent));
return t;
},
isActive: function (e) {
return e === document.activeElement && (e.type || e.href);
},
};
return o;
})(n.utils.common)),
(n.controllers.OptionController = (function (e, t, i) {
var n = function (e, r, o) {
n.superclass.call(this, e, r);
var a = this;
if (((this.__select = document.createElement('select')), i.isArray(o))) {
var s = {};
i.each(o, function (e) {
s[e] = e;
}),
(o = s);
}
i.each(o, function (e, t) {
var i = document.createElement('option');
(i.innerHTML = t), i.setAttribute('value', e), a.__select.appendChild(i);
}),
this.updateDisplay(),
t.bind(this.__select, 'change', function () {
var e = this.options[this.selectedIndex].value;
a.setValue(e);
}),
this.domElement.appendChild(this.__select);
};
return (
(n.superclass = e),
i.extend(n.prototype, e.prototype, {
setValue: function (e) {
var t = n.superclass.prototype.setValue.call(this, e);
return (
this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
);
},
updateDisplay: function () {
return (
(this.__select.value = this.getValue()),
n.superclass.prototype.updateDisplay.call(this)
);
},
}),
n
);
})(n.controllers.Controller, n.dom.dom, n.utils.common)),
(n.controllers.NumberController = (function (e, t) {
function i(e) {
return (e = e.toString()), e.indexOf('.') > -1 ? e.length - e.indexOf('.') - 1 : 0;
}
var n = function (e, r, o) {
n.superclass.call(this, e, r),
(o = o || {}),
(this.__min = o.min),
(this.__max = o.max),
(this.__step = o.step),
t.isUndefined(this.__step)
? 0 == this.initialValue
? (this.__impliedStep = 1)
: (this.__impliedStep =
Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
: (this.__impliedStep = this.__step),
(this.__precision = i(this.__impliedStep));
};
return (
(n.superclass = e),
t.extend(n.prototype, e.prototype, {
setValue: function (e) {
return (
void 0 !== this.__min && e < this.__min
? (e = this.__min)
: void 0 !== this.__max && e > this.__max && (e = this.__max),
void 0 !== this.__step &&
e % this.__step != 0 &&
(e = Math.round(e / this.__step) * this.__step),
n.superclass.prototype.setValue.call(this, e)
);
},
min: function (e) {
return (this.__min = e), this;
},
max: function (e) {
return (this.__max = e), this;
},
step: function (e) {
return (
(this.__step = e), (this.__impliedStep = e), (this.__precision = i(e)), this
);
},
}),
n
);
})(n.controllers.Controller, n.utils.common)),
(n.controllers.NumberControllerBox = (function (e, t, i) {
function n(e, t) {
var i = Math.pow(10, t);
return Math.round(e * i) / i;
}
var r = function (e, n, o) {
function a() {
var e = parseFloat(d.__input.value);
i.isNaN(e) || d.setValue(e);
}
function s() {
a(), d.__onFinishChange && d.__onFinishChange.call(d, d.getValue());
}
function l(e) {
t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), (u = e.clientY);
}
function c(e) {
var t = u - e.clientY;
d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY);
}
function h() {
t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h);
}
(this.__truncationSuspended = !1), r.superclass.call(this, e, n, o);
var u,
d = this;
(this.__input = document.createElement('input')),
this.__input.setAttribute('type', 'text'),
t.bind(this.__input, 'change', a),
t.bind(this.__input, 'blur', s),
t.bind(this.__input, 'mousedown', l),
t.bind(this.__input, 'keydown', function (e) {
13 === e.keyCode &&
((d.__truncationSuspended = !0), this.blur(), (d.__truncationSuspended = !1));
}),
this.updateDisplay(),
this.domElement.appendChild(this.__input);
};
return (
(r.superclass = e),
i.extend(r.prototype, e.prototype, {
updateDisplay: function () {
return (
(this.__input.value = this.__truncationSuspended
? this.getValue()
: n(this.getValue(), this.__precision)),
r.superclass.prototype.updateDisplay.call(this)
);
},
}),
r
);
})(n.controllers.NumberController, n.dom.dom, n.utils.common)),
(n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
function o(e, t, i, n, r) {
return n + (r - n) * ((e - t) / (i - t));
}
var a = function (e, i, n, r, s) {
function l(e) {
t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), c(e);
}
function c(e) {
e.preventDefault();
var i = t.getOffset(u.__background),
n = t.getWidth(u.__background);
return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)), !1;
}
function h() {
t.unbind(window, 'mousemove', c),
t.unbind(window, 'mouseup', h),
u.__onFinishChange && u.__onFinishChange.call(u, u.getValue());
}
a.superclass.call(this, e, i, {
min: n,
max: r,
step: s,
});
var u = this;
(this.__background = document.createElement('div')),
(this.__foreground = document.createElement('div')),
t.bind(this.__background, 'mousedown', l),
t.addClass(this.__background, 'slider'),
t.addClass(this.__foreground, 'slider-fg'),
this.updateDisplay(),
this.__background.appendChild(this.__foreground),
this.domElement.appendChild(this.__background);
};
return (
(a.superclass = e),
(a.useDefaultStyles = function () {
i.inject(r);
}),
n.extend(a.prototype, e.prototype, {
updateDisplay: function () {
var e = (this.getValue() - this.__min) / (this.__max - this.__min);
return (
(this.__foreground.style.width = 100 * e + '%'),
a.superclass.prototype.updateDisplay.call(this)
);
},
}),
a
);
})(
n.controllers.NumberController,
n.dom.dom,
n.utils.css,
n.utils.common,
'/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: \'\';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}'
)),
(n.controllers.FunctionController = (function (e, t, i) {
var n = function (e, i, r) {
n.superclass.call(this, e, i);
var o = this;
(this.__button = document.createElement('div')),
(this.__button.innerHTML = void 0 === r ? 'Fire' : r),
t.bind(this.__button, 'click', function (e) {
return e.preventDefault(), o.fire(), !1;
}),
t.addClass(this.__button, 'button'),
this.domElement.appendChild(this.__button);
};
return (
(n.superclass = e),
i.extend(n.prototype, e.prototype, {
fire: function () {
this.__onChange && this.__onChange.call(this),
this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
this.getValue().call(this.object);
},
}),
n
);
})(n.controllers.Controller, n.dom.dom, n.utils.common)),
(n.controllers.BooleanController = (function (e, t, i) {
var n = function (e, i) {
function r() {
o.setValue(!o.__prev);
}
n.superclass.call(this, e, i);
var o = this;
(this.__prev = this.getValue()),
(this.__checkbox = document.createElement('input')),
this.__checkbox.setAttribute('type', 'checkbox'),
t.bind(this.__checkbox, 'change', r, !1),
this.domElement.appendChild(this.__checkbox),
this.updateDisplay();
};
return (
(n.superclass = e),
i.extend(n.prototype, e.prototype, {
setValue: function (e) {
var t = n.superclass.prototype.setValue.call(this, e);
return (
this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
(this.__prev = this.getValue()),
t
);
},
updateDisplay: function () {
return (
this.getValue() === !0
? (this.__checkbox.setAttribute('checked', 'checked'),
(this.__checkbox.checked = !0))
: (this.__checkbox.checked = !1),
n.superclass.prototype.updateDisplay.call(this)
);
},
}),
n
);
})(n.controllers.Controller, n.dom.dom, n.utils.common)),
(n.color.toString = (function (e) {
return function (t) {
if (1 == t.a || e.isUndefined(t.a)) {
for (var i = t.hex.toString(16); i.length < 6; ) i = '0' + i;
return '#' + i;
}
return (
'rgba(' +
Math.round(t.r) +
',' +
Math.round(t.g) +
',' +
Math.round(t.b) +
',' +
t.a +
')'
);
};
})(n.utils.common)),
(n.color.interpret = (function (e, t) {
var i,
n,
r = function () {
n = !1;
var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
return (
t.each(o, function (r) {
if (r.litmus(e))
return (
t.each(r.conversions, function (r, o) {
if (((i = r.read(e)), n === !1 && i !== !1))
return (n = i), (i.conversionName = o), (i.conversion = r), t.BREAK;
}),
t.BREAK
);
}),
n
);
},
o = [
{
litmus: t.isString,
conversions: {
THREE_CHAR_HEX: {
read: function (e) {
var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
return (
null !== t && {
space: 'HEX',
hex: parseInt(
'0x' +
t[1].toString() +
t[1].toString() +
t[2].toString() +
t[2].toString() +
t[3].toString() +
t[3].toString()
),
}
);
},
write: e,
},
SIX_CHAR_HEX: {
read: function (e) {
var t = e.match(/^#([A-F0-9]{6})$/i);
return (
null !== t && {
space: 'HEX',
hex: parseInt('0x' + t[1].toString()),
}
);
},
write: e,
},
CSS_RGB: {
read: function (e) {
var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
return (
null !== t && {
space: 'RGB',
r: parseFloat(t[1]),
g: parseFloat(t[2]),
b: parseFloat(t[3]),
}
);
},
write: e,
},
CSS_RGBA: {
read: function (e) {
var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
return (
null !== t && {
space: 'RGB',
r: parseFloat(t[1]),
g: parseFloat(t[2]),
b: parseFloat(t[3]),
a: parseFloat(t[4]),
}
);
},
write: e,
},
},
},
{
litmus: t.isNumber,
conversions: {
HEX: {
read: function (e) {
return {
space: 'HEX',
hex: e,
conversionName: 'HEX',
};
},
write: function (e) {
return e.hex;
},
},
},
},
{
litmus: t.isArray,
conversions: {
RGB_ARRAY: {
read: function (e) {
return (
3 == e.length && {
space: 'RGB',
r: e[0],
g: e[1],
b: e[2],
}
);
},
write: function (e) {
return [e.r, e.g, e.b];
},
},
RGBA_ARRAY: {
read: function (e) {
return (
4 == e.length && {
space: 'RGB',
r: e[0],
g: e[1],
b: e[2],
a: e[3],
}
);
},
write: function (e) {
return [e.r, e.g, e.b, e.a];
},
},
},
},
{
litmus: t.isObject,
conversions: {
RGBA_OBJ: {
read: function (e) {
return (
!!(
t.isNumber(e.r) &&
t.isNumber(e.g) &&
t.isNumber(e.b) &&
t.isNumber(e.a)
) && {
space: 'RGB',
r: e.r,
g: e.g,
b: e.b,
a: e.a,
}
);
},
write: function (e) {
return {
r: e.r,
g: e.g,
b: e.b,
a: e.a,
};
},
},
RGB_OBJ: {
read: function (e) {
return (
!!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
space: 'RGB',
r: e.r,
g: e.g,
b: e.b,
}
);
},
write: function (e) {
return {
r: e.r,
g: e.g,
b: e.b,
};
},
},
HSVA_OBJ: {
read: function (e) {
return (
!!(
t.isNumber(e.h) &&
t.isNumber(e.s) &&
t.isNumber(e.v) &&
t.isNumber(e.a)
) && {
space: 'HSV',
h: e.h,
s: e.s,
v: e.v,
a: e.a,
}
);
},
write: function (e) {
return {
h: e.h,
s: e.s,
v: e.v,
a: e.a,
};
},
},
HSV_OBJ: {
read: function (e) {
return (
!!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
space: 'HSV',
h: e.h,
s: e.s,
v: e.v,
}
);
},
write: function (e) {
return {
h: e.h,
s: e.s,
v: e.v,
};
},
},
},
},
];
return r;
})(n.color.toString, n.utils.common)),
(n.GUI = n.gui.GUI =
(function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
function g(e, t, i, o) {
if (void 0 === t[i])
throw new Error('Object ' + t + ' has no property "' + i + '"');
var a;
if (o.color) a = new h(t, i);
else {
var s = [t, i].concat(o.factoryArgs);
a = n.apply(e, s);
}
o.before instanceof r && (o.before = o.before.__li),
A(e, a),
p.addClass(a.domElement, 'c');
var l = document.createElement('span');
p.addClass(l, 'property-name'), (l.innerHTML = a.property);
var c = document.createElement('div');
c.appendChild(l), c.appendChild(a.domElement);
var u = m(e, c, o.before);
return (
p.addClass(u, V.CLASS_CONTROLLER_ROW),
p.addClass(u, typeof a.getValue()),
v(e, u, a),
e.__controllers.push(a),
a
);
}
function m(e, t, i) {
var n = document.createElement('li');
return (
t && n.appendChild(t),
i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
e.onResize(),
n
);
}
function v(e, t, i) {
if (
((i.__li = t),
(i.__gui = e),
f.extend(i, {
options: function (t) {
return arguments.length > 1
? (i.remove(),
g(e, i.object, i.property, {
before: i.__li.nextElementSibling,
factoryArgs: [f.toArray(arguments)],
}))
: f.isArray(t) || f.isObject(t)
? (i.remove(),
g(e, i.object, i.property, {
before: i.__li.nextElementSibling,
factoryArgs: [t],
}))
: void 0;
},
name: function (e) {
return (i.__li.firstElementChild.firstElementChild.innerHTML = e), i;
},
listen: function () {
return i.__gui.listen(i), i;
},
remove: function () {
return i.__gui.remove(i), i;
},
}),
i instanceof l)
) {
var n = new s(i.object, i.property, {
min: i.__min,
max: i.__max,
step: i.__step,
});
f.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
var t = i[e],
r = n[e];
i[e] = n[e] = function () {
var e = Array.prototype.slice.call(arguments);
return t.apply(i, e), r.apply(n, e);
};
}),
p.addClass(t, 'has-slider'),
i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild);
} else if (i instanceof s) {
var r = function (t) {
return f.isNumber(i.__min) && f.isNumber(i.__max)
? (i.remove(),
g(e, i.object, i.property, {
before: i.__li.nextElementSibling,
factoryArgs: [i.__min, i.__max, i.__step],
}))
: t;
};
(i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max));
} else
i instanceof o
? (p.bind(t, 'click', function () {
p.fakeEvent(i.__checkbox, 'click');
}),
p.bind(i.__checkbox, 'click', function (e) {
e.stopPropagation();
}))
: i instanceof a
? (p.bind(t, 'click', function () {
p.fakeEvent(i.__button, 'click');
}),
p.bind(t, 'mouseover', function () {
p.addClass(i.__button, 'hover');
}),
p.bind(t, 'mouseout', function () {
p.removeClass(i.__button, 'hover');
}))
: i instanceof h &&
(p.addClass(t, 'color'),
(i.updateDisplay = f.compose(function (e) {
return (t.style.borderLeftColor = i.__color.toString()), e;
}, i.updateDisplay)),
i.updateDisplay());
i.setValue = f.compose(function (t) {
return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0), t;
}, i.setValue);
}
function A(e, t) {
var i = e.getRoot(),
n = i.__rememberedObjects.indexOf(t.object);
if (n != -1) {
var r = i.__rememberedObjectIndecesToControllers[n];
if (
(void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)),
(r[t.property] = t),
i.load && i.load.remembered)
) {
var o,
a = i.load.remembered;
if (a[e.preset]) o = a[e.preset];
else {
if (!a[L]) return;
o = a[L];
}
if (o[n] && void 0 !== o[n][t.property]) {
var s = o[n][t.property];
(t.initialValue = s), t.setValue(s);
}
}
}
}
function y(e, t) {
return document.location.href + '.' + t;
}
function C(e) {
var t = (e.__save_row = document.createElement('li'));
p.addClass(e.domElement, 'has-save'),
e.__ul.insertBefore(t, e.__ul.firstChild),
p.addClass(t, 'save-row');
var i = document.createElement('span');
(i.innerHTML = ' '), p.addClass(i, 'button gears');
var n = document.createElement('span');
(n.innerHTML = 'Save'), p.addClass(n, 'button'), p.addClass(n, 'save');
var r = document.createElement('span');
(r.innerHTML = 'New'), p.addClass(r, 'button'), p.addClass(r, 'save-as');
var o = document.createElement('span');
(o.innerHTML = 'Revert'), p.addClass(o, 'button'), p.addClass(o, 'revert');
var a = (e.__preset_select = document.createElement('select'));
if (
(e.load && e.load.remembered
? f.each(e.load.remembered, function (t, i) {
w(e, i, i == e.preset);
})
: w(e, L, !1),
p.bind(a, 'change', function () {
for (var t = 0; t < e.__preset_select.length; t++)
e.__preset_select[t].innerHTML = e.__preset_select[t].value;
e.preset = this.value;
}),
t.appendChild(a),
t.appendChild(i),
t.appendChild(n),
t.appendChild(r),
t.appendChild(o),
D)
) {
var s = document.getElementById('dg-save-locally'),
l = document.getElementById('dg-local-explain');
s.style.display = 'block';
var c = document.getElementById('dg-local-storage');
'true' === localStorage.getItem(y(e, 'isLocal')) &&
c.setAttribute('checked', 'checked');
var h = function () {
l.style.display = e.useLocalStorage ? 'block' : 'none';
};
h(),
p.bind(c, 'change', function () {
(e.useLocalStorage = !e.useLocalStorage), h();
});
}
var u = document.getElementById('dg-new-constructor');
p.bind(u, 'keydown', function (e) {
!e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide();
}),
p.bind(i, 'click', function () {
(u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2)),
S.show(),
u.focus(),
u.select();
}),
p.bind(n, 'click', function () {
e.save();
}),
p.bind(r, 'click', function () {
var t = prompt('Enter a new preset name.');
t && e.saveAs(t);
}),
p.bind(o, 'click', function () {
e.revert();
});
}
function I(e) {
function t(t) {
return (
t.preventDefault(),
(r = t.clientX),
p.addClass(e.__closeButton, V.CLASS_DRAG),
p.bind(window, 'mousemove', i),
p.bind(window, 'mouseup', n),
!1
);
}
function i(t) {
return (
t.preventDefault(),
(e.width += r - t.clientX),
e.onResize(),
(r = t.clientX),
!1
);
}
function n() {
p.removeClass(e.__closeButton, V.CLASS_DRAG),
p.unbind(window, 'mousemove', i),
p.unbind(window, 'mouseup', n);
}
(e.__resize_handle = document.createElement('div')),
f.extend(e.__resize_handle.style, {
width: '6px',
marginLeft: '-3px',
height: '200px',
cursor: 'ew-resize',
position: 'absolute',
});
var r;
p.bind(e.__resize_handle, 'mousedown', t),
p.bind(e.__closeButton, 'mousedown', t),
e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild);
}
function E(e, t) {
(e.domElement.style.width = t + 'px'),
e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'),
e.__closeButton && (e.__closeButton.style.width = t + 'px');
}
function b(e, t) {
var i = {};
return (
f.each(e.__rememberedObjects, function (n, r) {
var o = {},
a = e.__rememberedObjectIndecesToControllers[r];
f.each(a, function (e, i) {
o[i] = t ? e.initialValue : e.getValue();
}),
(i[r] = o);
}),
i
);
}
function w(e, t, i) {
var n = document.createElement('option');
(n.innerHTML = t),
(n.value = t),
e.__preset_select.appendChild(n),
i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1);
}
function _(e) {
for (var t = 0; t < e.__preset_select.length; t++)
e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t);
}
function T(e, t) {
var i = e.__preset_select[e.__preset_select.selectedIndex];
t ? (i.innerHTML = i.value + '*') : (i.innerHTML = i.value);
}
function x(e) {
0 != e.length &&
u(function () {
x(e);
}),
f.each(e, function (e) {
e.updateDisplay();
});
}
e.inject(i);
var S,
M,
R = 'dg',
P = 72,
O = 20,
L = 'Default',
D = (function () {
try {
return 'localStorage' in window && null !== window.localStorage;
} catch (e) {
return !1;
}
})(),
N = !0,
B = !1,
F = [],
V = function (e) {
function t() {
var e = i.getRoot();
(e.width += 1),
f.defer(function () {
e.width -= 1;
});
}
var i = this;
(this.domElement = document.createElement('div')),
(this.__ul = document.createElement('ul')),
this.domElement.appendChild(this.__ul),
p.addClass(this.domElement, R),
(this.__folders = {}),
(this.__controllers = []),
(this.__rememberedObjects = []),
(this.__rememberedObjectIndecesToControllers = []),
(this.__listening = []),
(e = e || {}),
(e = f.defaults(e, {
autoPlace: !0,
width: V.DEFAULT_WIDTH,
})),
(e = f.defaults(e, {
resizable: e.autoPlace,
hideable: e.autoPlace,
})),
f.isUndefined(e.load)
? (e.load = {
preset: L,
})
: e.preset && (e.load.preset = e.preset),
f.isUndefined(e.parent) && e.hideable && F.push(this),
(e.resizable = f.isUndefined(e.parent) && e.resizable),
e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
var n,
r = D && 'true' === localStorage.getItem(y(this, 'isLocal'));
if (
(Object.defineProperties(this, {
parent: {
get: function () {
return e.parent;
},
},
scrollable: {
get: function () {
return e.scrollable;
},
},
autoPlace: {
get: function () {
return e.autoPlace;
},
},
preset: {
get: function () {
return i.parent ? i.getRoot().preset : e.load.preset;
},
set: function (t) {
i.parent ? (i.getRoot().preset = t) : (e.load.preset = t),
_(this),
i.revert();
},
},
width: {
get: function () {
return e.width;
},
set: function (t) {
(e.width = t), E(i, t);
},
},
name: {
get: function () {
return e.name;
},
set: function (t) {
(e.name = t), a && (a.innerHTML = e.name);
},
},
closed: {
get: function () {
return e.closed;
},
set: function (t) {
(e.closed = t),
e.closed
? p.addClass(i.__ul, V.CLASS_CLOSED)
: p.removeClass(i.__ul, V.CLASS_CLOSED),
this.onResize(),
i.__closeButton &&
(i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED);
},
},
load: {
get: function () {
return e.load;
},
},
useLocalStorage: {
get: function () {
return r;
},
set: function (e) {
D &&
((r = e),
e ? p.bind(window, 'unload', n) : p.unbind(window, 'unload', n),
localStorage.setItem(y(i, 'isLocal'), e));
},
},
}),
f.isUndefined(e.parent))
) {
if (
((e.closed = !1),
p.addClass(this.domElement, V.CLASS_MAIN),
p.makeSelectable(this.domElement, !1),
D && r)
) {
i.useLocalStorage = !0;
var o = localStorage.getItem(y(this, 'gui'));
o && (e.load = JSON.parse(o));
}
(this.__closeButton = document.createElement('div')),
(this.__closeButton.innerHTML = V.TEXT_CLOSED),
p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
this.domElement.appendChild(this.__closeButton),
p.bind(this.__closeButton, 'click', function () {
i.closed = !i.closed;
});
} else {
void 0 === e.closed && (e.closed = !0);
var a = document.createTextNode(e.name);
p.addClass(a, 'controller-name');
var s = m(i, a),
l = function (e) {
return e.preventDefault(), (i.closed = !i.closed), !1;
};
p.addClass(this.__ul, V.CLASS_CLOSED),
p.addClass(s, 'title'),
p.bind(s, 'click', l),
e.closed || (this.closed = !1);
}
e.autoPlace &&
(f.isUndefined(e.parent) &&
(N &&
((M = document.createElement('div')),
p.addClass(M, R),
p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
document.body.appendChild(M),
(N = !1)),
M.appendChild(this.domElement),
p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
this.parent || E(i, e.width)),
p.bind(window, 'resize', function () {
i.onResize();
}),
p.bind(this.__ul, 'webkitTransitionEnd', function () {
i.onResize();
}),
p.bind(this.__ul, 'transitionend', function () {
i.onResize();
}),
p.bind(this.__ul, 'oTransitionEnd', function () {
i.onResize();
}),
this.onResize(),
e.resizable && I(this),
(n = function () {
D &&
'true' === localStorage.getItem(y(i, 'isLocal')) &&
localStorage.setItem(y(i, 'gui'), JSON.stringify(i.getSaveObject()));
}),
(this.saveToLocalStorageIfPossible = n);
i.getRoot();
e.parent || t();
};
return (
(V.toggleHide = function () {
(B = !B),
f.each(F, function (e) {
(e.domElement.style.zIndex = B ? -999 : 999),
(e.domElement.style.opacity = B ? 0 : 1);
});
}),
(V.CLASS_AUTO_PLACE = 'a'),
(V.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
(V.CLASS_MAIN = 'main'),
(V.CLASS_CONTROLLER_ROW = 'cr'),
(V.CLASS_TOO_TALL = 'taller-than-window'),
(V.CLASS_CLOSED = 'closed'),
(V.CLASS_CLOSE_BUTTON = 'close-button'),
(V.CLASS_DRAG = 'drag'),
(V.DEFAULT_WIDTH = 245),
(V.TEXT_CLOSED = 'Close Controls'),
(V.TEXT_OPEN = 'Open Controls'),
p.bind(
window,
'keydown',
function (e) {
'text' === document.activeElement.type ||
(e.which !== P && e.keyCode != P) ||
V.toggleHide();
},
!1
),
f.extend(V.prototype, {
add: function (e, t) {
return g(this, e, t, {
factoryArgs: Array.prototype.slice.call(arguments, 2),
});
},
addColor: function (e, t) {
return g(this, e, t, {
color: !0,
});
},
remove: function (e) {
this.__ul.removeChild(e.__li),
this.__controllers.slice(this.__controllers.indexOf(e), 1);
var t = this;
f.defer(function () {
t.onResize();
});
},
destroy: function () {
this.autoPlace && M.removeChild(this.domElement);
},
addFolder: function (e) {
if (void 0 !== this.__folders[e])
throw new Error(
'You already have a folder in this GUI by the name "' + e + '"'
);
var t = {
name: e,
parent: this,
};
(t.autoPlace = this.autoPlace),
this.load &&
this.load.folders &&
this.load.folders[e] &&
((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]));
var i = new V(t);
this.__folders[e] = i;
var n = m(this, i.domElement);
return p.addClass(n, 'folder'), i;
},
open: function () {
this.closed = !1;
},
close: function () {
this.closed = !0;
},
onResize: function () {
var e = this.getRoot();
if (e.scrollable) {
var t = p.getOffset(e.__ul).top,
i = 0;
f.each(e.__ul.childNodes, function (t) {
(e.autoPlace && t === e.__save_row) || (i += p.getHeight(t));
}),
$('#player').height() - t - O < i
? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
(e.__ul.style.height = $('#player').height() - t - O + 'px'))
: (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
(e.__ul.style.height = 'auto'));
}
e.__resize_handle &&
f.defer(function () {
e.__resize_handle.style.height = e.__ul.offsetHeight + 'px';
}),
e.__closeButton && (e.__closeButton.style.width = e.width + 'px');
},
remember: function () {
if (
(f.isUndefined(S) && ((S = new d()), (S.domElement.innerHTML = t)),
this.parent)
)
throw new Error('You can only call remember on a top level GUI.');
var e = this;
f.each(Array.prototype.slice.call(arguments), function (t) {
0 == e.__rememberedObjects.length && C(e),
e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t);
}),
this.autoPlace && E(this, this.width);
},
getRoot: function () {
for (var e = this; e.parent; ) e = e.parent;
return e;
},
getSaveObject: function () {
var e = this.load;
return (
(e.closed = this.closed),
this.__rememberedObjects.length > 0 &&
((e.preset = this.preset),
e.remembered || (e.remembered = {}),
(e.remembered[this.preset] = b(this))),
(e.folders = {}),
f.each(this.__folders, function (t, i) {
e.folders[i] = t.getSaveObject();
}),
e
);
},
save: function () {
this.load.remembered || (this.load.remembered = {}),
(this.load.remembered[this.preset] = b(this)),
T(this, !1),
this.saveToLocalStorageIfPossible();
},
saveAs: function (e) {
this.load.remembered ||
((this.load.remembered = {}), (this.load.remembered[L] = b(this, !0))),
(this.load.remembered[e] = b(this)),
(this.preset = e),
w(this, e, !0),
this.saveToLocalStorageIfPossible();
},
revert: function (e) {
f.each(
this.__controllers,
function (t) {
this.getRoot().load.remembered
? A(e || this.getRoot(), t)
: t.setValue(t.initialValue);
},
this
),
f.each(this.__folders, function (e) {
e.revert(e);
}),
e || T(this.getRoot(), !1);
},
listen: function (e) {
var t = 0 == this.__listening.length;
this.__listening.push(e), t && x(this.__listening);
},
}),
V
);
})(
n.utils.css,
'
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n