/* 许钟文修改的 标记 xzw 有的加了”改“字 另外 所有"matter"字样已被我删除 原因:删除matterport信息 几乎所有window.innerWidth、innerHeight都变成 $('#player').width()、 height() 原因:1编辑页面canvas显示区域非全屏 2为了放大显示时不会模糊 */ !function() { "use strict"; function t(t, i) { return typeof t === i } function i(t, i) { return t instanceof i } function n(t) { return t && t.nodeType } function e(t) { return n(t) ? t : i(t, g) ? t[0] : void 0 } function o(t, i, n) { return g.each(t, function(t, e) { n = i.call(e, n, t, e) }), n } function r(t, i, n) { var e, o, r; if (t === i) return !0; if (!t || !i || t.constructor !== i.constructor) return !1; for (e = 0, o = n.length; o > e; e += 1) { if (r = n[e], t[r] && y(t[r].equals) && !t[r].equals(i[r])) return !1; if (t[r] !== i[r]) return !1 } return !0 } function s(t, i, n, e) { this.left = E(t), this.top = E(i), this.width = E(n), this.height = E(e), this.right = this.left + this.width, this.bottom = this.top + this.height } function h(t, i, n, e) { this.visible = t || 0, this.viewport = i || 0, this.possible = n || 0, this.rects = e && T({}, e) || null } function l(t, i) { this.els = t, this.viewport = i } function c(t, i, n) { var e; return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)), e ? e[n] : 0 } function u(t, i) { return t.val - i.val } function a(t, i) { return i.val - t.val } function f(t) { var i = s.ofContent(t, !0) , n = s.ofViewport(t, !0) , e = i.width - n.width , o = i.height - n.height; this.content = i, this.viewport = n, this.width = 0 >= e ? null : n.left / e, this.height = 0 >= o ? null : n.top / o, this.left = n.left, this.top = n.top, this.right = i.right - n.right, this.bottom = i.bottom - n.bottom } function p(t) { this.el = t || window } function d(t, i) { this.context = t, this.viewport = i, this.init() } function v(t, i, n, e) { this.context = new l(t,i), this.property = n, this.descending = e, this.init() } function w(t) { t && t !== window && t !== document ? (this.context = t, this.$autoTarget = g(t)) : this.context = window, this.init() } var g = jQuery , m = g(window) , b = g(document) , T = g.extend , y = g.isFunction , k = Math.max , V = Math.min , E = Math.round , x = function() { var t = {} , i = 1; return function(n) { return n ? (t[n] || (t[n] = i, i += 1), t[n]) : 0 } }(); T(s.prototype, { equals: function(t) { return r(this, t, ["left", "top", "width", "height"]) }, area: function() { return this.width * this.height }, relativeTo: function(t) { return new s(this.left - t.left,this.top - t.top,this.width,this.height) }, intersection: function(t) { if (!i(t, s)) return null; var n = k(this.left, t.left) , e = V(this.right, t.right) , o = k(this.top, t.top) , r = V(this.bottom, t.bottom) , h = e - n , l = r - o; return h >= 0 && l >= 0 ? new s(n,o,h,l) : null }, envelope: function(t) { if (!i(t, s)) return this; var n = V(this.left, t.left) , e = k(this.right, t.right) , o = V(this.top, t.top) , r = k(this.bottom, t.bottom) , h = e - n , l = r - o; return new s(n,o,h,l) } }), T(s, { ofContent: function(t, i) { return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height()) }, ofViewport: function(t, i) { return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height()) }, ofElement: function(t) { var i = g(t); if (!i.is(":visible")) return null; var n = i.offset(); return new s(n.left,n.top,i.outerWidth(),i.outerHeight()) } }), T(h.prototype, { equals: function(t) { return this.fracsEqual(t) && this.rectsEqual(t) }, fracsEqual: function(t) { return r(this, t, ["visible", "viewport", "possible"]) }, rectsEqual: function(t) { return r(this.rects, t.rects, ["document", "element", "viewport"]) } }), T(h, { of: function(t, i) { var e, o, r; return t = n(t) && s.ofElement(t) || t, i = n(i) && s.ofViewport(i) || i || s.ofViewport(), t instanceof s && (e = t.intersection(i)) ? (o = e.area(), r = V(t.width, i.width) * V(t.height, i.height), new h(o / t.area(),o / i.area(),o / r,{ document: e, element: e.relativeTo(t), viewport: e.relativeTo(i) })) : new h } }); var q = ["width", "height", "left", "right", "top", "bottom"] , S = ["possible", "visible", "viewport"]; T(l.prototype, { sorted: function(t, i) { var n = this.viewport; return g.map(this.els, function(i) { return { el: i, val: c(i, n, t) } }).sort(i ? a : u) }, best: function(t, i) { return this.els.length ? this.sorted(t, i)[0] : null } }), T(f.prototype, { equals: function(t) { return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"]) } }), T(p.prototype, { equals: function(t) { return r(this, t, ["el"]) }, scrollState: function() { return new f(this.el) }, scrollTo: function(t, i, n) { var e = g(this.el === window ? "html,body" : this.el); t = t || 0, i = i || 0, n = isNaN(n) ? 1e3 : n, e.stop(!0).animate({ scrollLeft: t, scrollTop: i }, n) }, scroll: function(t, i, n) { var e = this.el === window ? m : g(this.el); t = t || 0, i = i || 0, this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n) }, scrollToRect: function(t, i, n, e) { i = i || 0, n = n || 0, this.scrollTo(t.left - i, t.top - n, e) }, scrollToElement: function(t, i, n, e) { var o = s.ofElement(t).relativeTo(s.ofContent(this.el)); this.scrollToRect(o, i, n, e) } }); var C = { init: function() { this.callbacks = g.Callbacks("memory unique"), this.currVal = null, this.prevVal = null, this.checkProxy = g.proxy(this.check, this), this.autoCheck() }, bind: function(t) { this.callbacks.add(t) }, unbind: function(t) { t ? this.callbacks.remove(t) : this.callbacks.empty() }, trigger: function() { this.callbacks.fireWith(this.context, [this.currVal, this.prevVal]) }, check: function(t) { var i = this.updatedValue(t); return void 0 !== i && (this.prevVal = this.currVal, this.currVal = i, this.trigger(), !0) }, $autoTarget: m, autoEvents: "load resize scroll", autoCheck: function(t) { this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy) } }; T(d.prototype, C, { updatedValue: function() { var t = h.of(this.context, this.viewport); return this.currVal && this.currVal.equals(t) ? void 0 : t } }), T(v.prototype, C, { updatedValue: function() { var t = this.context.best(this.property, this.descending); return t && (t = t.val > 0 ? t.el : null, this.currVal !== t) ? t : void 0 } }), T(w.prototype, C, { updatedValue: function() { var t = new f(this.context); return this.currVal && this.currVal.equals(t) ? void 0 : t } }); var L = function(t, i) { var n = [].slice , e = jQuery , o = e.extend , r = e.isFunction , s = o({}, i) , h = function(i, n, o, s) { return o = r(o) ? o.apply(i, n) : o, r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t) } , l = function() { return h(this, n.call(arguments), s.defaultStatic, l) } , c = function(t) { return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c) } , u = function(t) { t && (o(l, t.statics), o(c, t.methods)), l.modplug = u }; u.prev = { statics: e[t], methods: e.fn[t] }, u(i), e[t] = l, e.fn[t] = c } , M = "fracs"; L(M, { statics: { version: "0.15.0", Rect: s, Fractions: h, Group: l, ScrollState: f, Viewport: p, FracsCallbacks: d, GroupCallbacks: v, ScrollStateCallbacks: w, fracs: function(t, i) { return h.of(t, i) } }, methods: { content: function(t) { return this.length ? s.ofContent(this[0], t) : null }, envelope: function() { return o(this, function(t) { var i = s.ofElement(this); return t ? t.envelope(i) : i }) }, fracs: function(i, n, o) { t(i, "string") || (o = n, n = i, i = null), y(n) || (o = n, n = null), o = e(o); var r = M + ".fracs." + x(o); return "unbind" === i ? this.each(function() { var t = g(this).data(r); t && t.unbind(n) }) : "check" === i ? this.each(function() { var t = g(this).data(r); t && t.check() }) : y(n) ? this.each(function() { var t = g(this) , i = t.data(r); i || (i = new d(this,o), t.data(r, i)), i.bind(n) }) : this.length ? h.of(this[0], o) : null }, intersection: function() { return o(this, function(t) { var i = s.ofElement(this); return t ? t.intersection(i) : i }) }, max: function(t, i, n) { return y(i) || (n = i, i = null), n = e(n), i ? (new v(this,n,t,!0).bind(i), this) : this.pushStack(new l(this,n).best(t, !0).el) }, min: function(t, i, n) { return y(i) || (n = i, i = null), n = e(n), i ? (new v(this,n,t).bind(i), this) : this.pushStack(new l(this,n).best(t).el) }, rect: function() { return this.length ? s.ofElement(this[0]) : null }, scrollState: function(i, n) { var e = M + ".scrollState"; return t(i, "string") || (n = i, i = null), "unbind" === i ? this.each(function() { var t = g(this).data(e); t && t.unbind(n) }) : "check" === i ? this.each(function() { var t = g(this).data(e); t && t.check() }) : y(n) ? this.each(function() { var t = g(this) , i = t.data(e); i || (i = new w(this), t.data(e, i)), i.bind(n) }) : this.length ? new f(this[0]) : null }, scroll: function(t, i, n) { return this.each(function() { new p(this).scroll(t, i, n) }) }, scrollTo: function(t, i, n, o) { return g.isNumeric(t) && (o = n, n = i, i = t, t = null), t = e(t), this.each(function() { t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o) }) }, scrollToThis: function(t, i, n, o) { return o = new p(e(o)), o.scrollToElement(this[0], t, i, n), this }, softLink: function(t, i, n, o) { return o = new p(e(o)), this.filter("a[href^=#]").each(function() { var e = g(this); e.on("click", function() { o.scrollToElement(g(e.attr("href"))[0], t, i, n) }) }) }, sort: function(i, n, o) { return t(n, "boolean") || (o = n, n = null), o = e(o), this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) { return t.el })) }, viewport: function(t) { return this.length ? s.ofViewport(this[0], t) : null } }, defaultStatic: "fracs", defaultMethod: "fracs" }) }(); if ("undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); +function(t) { "use strict"; function e(e) { return this.each(function() { var o = t(this) , s = o.data("bs.tooltip") , n = "object" == typeof e && e; (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)), "string" == typeof e && s[e]()) }) } var i = function(t, e) { this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null, this.init("tooltip", t, e) }; i.VERSION = "3.2.0", i.DEFAULTS = { animation: !0, placement: "top", selector: !1, template: '
" + 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) {//"./title/TitleEvents"
"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) {//"./title/tagToggle"
"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) {//"./gui/title/titleBar"
(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,
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 (_.innerText = 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(e.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) {
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)) : (O.forEach(function(e) {
e.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) {//"./titleBarSettings"
"use strict";
t.exports = Object.freeze({
minTooltipCharacters: 19,
removeAnimationClasses: 500
})
}
, {}],
84: [function(e, t, i) {//"./tourInteraction"
"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), //----MP
document.addEventListener("keydown", function(e){ //xzw 为了判断keyCon
if(window.keyCon == false)return;
u(!1,e);
}.bind(this), !0),
C.on(v.TourStart, function() {
E.classList.add("playing")
})
}
function r() {
C.playTour(),
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) {//"./gui/vr/vrEvent"
"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) {//"./../vr/vrLink"
"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 = "https://support.port.com/hc/en-us/articles/224728887-What-do-I-need-for-Virtual-Reality";
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) {//"./vr/vrModal"
"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(),
T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
r(b),
T.addClass("fadeIn"),
K.emit(A.OPENED))
});
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", window.innerHeight <= y.narrowLandscapeHeight),
T.toggleClass("tinier", window.innerHeight <= 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) {//"./webvr/WebVrEvent"
"use strict";
t.exports = Object.freeze({
OPENED: "webvr.modal.opened",
SHOW_TERMS: "webvr.footer.show.terms"
})
}
, {}],
89: [function(e, t, i) {///js/gui/webvr/webVRgui.js
(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) {//"../label/Label"
"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) {//"./label/LabelDisplayController"
"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 = .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 = .5 * a
, c = .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) {//"./lib/array-polyfill"
"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) {//"../lib/dat.gui"
"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) {
if(window.keyCon == false)return;
"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))
}),
window.innerHeight - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
e.__ul.style.height = window.innerHeight - 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 //xzw 下面debug样式改了点
}(n.utils.css, '
GUI
\'s constructor:\n\n \n\n localStorage
on exit.\n\n 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 /ig,function(){ if(!pFlag){ pFlag = true; } else{ len += 8; } }) html.replace(/>([\s\S\r\n\.]*?)/ig,function(d){ bodyFlag = true; d = d.replace(/<[^>]+>/gi,function(c){ var aF = //.test(c); if( aF || c == ''){ c = c } else{ c = ''; } return c; }) move += d; }) if(!bodyFlag){ content = content.replace(/<[^>]+>/gi,function(c){ var aF = //.test(c); if( aF || c == ''){ c = c } else{ c = ''; } return c; }) move += content; } move = move.replace(/\s+/g,''); return move } //修改复制内容 editor1.customConfig.onchange = function (htmlZ) { var html = ""; var pNum = 0; var pFlag = false; htmlZ.replace(/
([\s\S\r\n\.]*?)<\/p>/gi,function(c){ if(pNum < 1){ html += c; } else{ /* html = html.substring(0,html.length-4); c = c.substring(3,c.length-4); */ html += c // + "
"; } pNum ++; pFlag =true; }); if(!pFlag){ html = '' + htmlZ + '
'; editor1.txt.html(html); } /* if(pNum > 1){ editor1.txt.html(html); } html = html.replace(/
<\/p>|
/ig,'');*/
html = html.replace(/style="([\s\S\r\n\.]*?)"/ig,'');
var len = checkLen.editor1(html);
if(len < 0){
editor1Enter = false;
var span = document.getElementById("project-intro1");
span.setAttribute("data-size","超出字数限制");
span.classList.add("sizeWaring");
var now = 0;
var clear = false;
var nowHtml = "";
var pFlag = true;
html.replace(/
/gi,function(){ if(pFlag){ pFlag =false; } else{ now += 8; } }) html = html.replace(/>([\s\S\r\n\.]*?) 200){ var spilth = now - 200; c = c.substring(0,c.length - spilth); }//拼凑的内容大于100时取里面 }else{ c = ""; } return '>'+c+'<'; }) } else{ editor1Enter = true; var span = document.getElementById("project-intro1"); span.classList.remove("sizeWaring"); } //document.getElementsByClassName("dsc")[0].innerHTML = html; if(html == '
/ig,function(){ if(!pFlag){ pFlag = true; } else{ len += 8; } }) html.replace(/>([\s\S\r\n\.]*?)/ig,function(){ if(!pFlag){ pFlag = true; } else{ len += 8; } }) html.replace(/>([\s\S\r\n\.]*?)div",function(ev){ if(ev.keyCode == 13){ $(this).blur(); } }) */ var editor2Enter = true; var editor2 = new window.wangEditor('#forEdit2','#edit2'); editor2.customConfig.menus = ['link']; var editor2_dsc = document.getElementById("edit2").getAttribute("data-more") || ""; editor2.customConfig.pasteIgnoreImg = true; editor2.customConfig.pasteTextHandle = function (content) { var move = '',bodyFlag = false,timeFlag = true; content.replace(/
/ig,function(d){ bodyFlag = true; d = d.replace(/<[^>]+>/gi,function(c){ var aF = //.test(c); if( aF || c == ''){ c = c } else{ c = ''; } return c; }) move += d; }) if(!bodyFlag){ content = content.replace(/<[^>]+>/gi,function(c){ var aF = //.test(c); if( aF || c == ''){ c = c } else{ c = ''; } return c; }) move += content; } move = move.replace(/\s+/g,''); return move } //修改复制内容 editor2.customConfig.onchange = function (html) { var pNum = 0; var pFlag = false; html.replace(/([\s\S\r\n\.]*?)<\/p>/gi,function(c){
/* var html = ""; if(pNum < 1){
html += c;
} else{
html = html.substring(0,html.length-4);
c = '
' + c.substring(3,c.length-4);
html += c + "
' + htmlZ + '
'; editor2.txt.html(html); } html = html.replace(/style="([\s\S\r\n\.]*?)"/ig,''); var len = checkLen.editor2(html); if(len < 0){ editor2Enter = false; var span = document.getElementById("project-intro2"); span.setAttribute("data-size","超出字数限制"); span.classList.add("sizeWaring"); var now = 0; var clear = false; var nowHtml = ""; var pFlag = true; html.replace(//gi,function(){
if(pFlag){ pFlag =false; }
else{
now += 8;
}
})
html = html.replace(/>([\s\S\r\n\.]*?) 200){
var spilth = now - 200;
c = c.substring(0,c.length - spilth);
}//拼凑的内容大于100时取里面
}else{
c = "";
}
return '>'+c+'<';
})
}else{
editor2Enter = true;
var span = document.getElementById("project-intro2");
span.classList.remove("sizeWaring");
}
document.getElementsByClassName("introduce-detail")[0].getElementsByTagName("span")[0].innerHTML = html;
}; //实时监听
editor2.create();
editor2.txt.html(editor2_dsc);
$("#edit2").on("keydown",">div",function(ev){
if(ev.keyCode == 13 && !editor2Enter){
$(this).blur();
}
})
$("#edit1>div").on("focus",function(){
$("#edit1").css("border","1px solid #09e1c0");
})
$("#edit1>div").on("blur",function(){
$("#edit1").css("border","1px solid white");
})
$("#edit2>div").on("focus",function(){
$("#edit2").css("border","1px solid #09e1c0");
})
$("#edit2>div").on("blur",function(){
$("#edit2").css("border","1px solid white");
})
$(".project-name input").on("input",function(){
checkLen.project_name1();
});
$("#pjtName").on("input",function(){
checkLen.project_name2();
});
$("#edit2Box,#edit1Box").on("input",".addLink_input",function(){
var len = $(this).val().length;
$("#addLink-maxSize").text( 40 - len);
})
//----------输入框的输入时keydown不会触发player移动控制----
var allInputs = [];
allInputs.push($('.editor #pjtName')) //项目标题
allInputs.push($("#edit2>div")) //项目描述
allInputs.push($(".editor .hotPoint-titleInput")) //热点标题
allInputs.push($("#edit1>div")) //热点描述
allInputs.push($("#scenePSD input")) //密钥
//allInputs.push($('#edit2Box .w-e-panel-container input')) //链接输入写在控件js里
allInputs.push($(".slider input")) //滑动条输入
for(var i=0; i /ig,function(){
if(!pFlag){ pFlag = true; }
else{ len += 8; }
})
html.replace(/>([\s\S\r\n\.]*?)/ig,function(){
if(!pFlag){ pFlag = true; }
else{ len += 8; }
})
html.replace(/>([\s\S\r\n\.]*?)您没有登录,请登录后再编辑');
error_dialog_double('提示','您没有登录,请登录后再编辑',function(){
window.open(CONSTANT.MAINURL,"blank")
});
y.endLoading("forceQuit");//进度条等消失
//t.reject();
}
},
error: function (msg) {
//editor.showMsgBox("提示",'"+o+ "",{btns:["确定"]});}
function(o){
if(o instanceof Function)
o();
else
error_dialog("提示",o);
$('.waiting').removeClass('showloading');
}
);
}
editor.getDesignImg = function() {//获取保存墙面图
//this.fullScreen();
var canvas = document.getElementById('dynamiccanvas2d');
if(!autodraw)
{
return null;
}
// 图片导出为 png 格式
var type = 'png';
var imgData = canvas.toDataURL(type);
//上传到服务器
return imgData;
};
//window.location.href = 'show.html?m='+number;
//不知道提前写会不会防止markspot加载背景图延迟
var markspotImg = new Image;
markspotImg.src = "images/markspotAll.png";
}
editor.changeSnapState = function(state){//热点采集数量显示变化
//CONSTANT.MAX_SPOT_COUNT = 2;
var count = function(){
if(editor.player.tagManager.tagDiscs.length>=CONSTANT.MAX_SPOT_COUNT){
editor.snap
dom.addClass(editor.snap,"unable");
$(editor.snap).find("span").text("已满"+ CONSTANT.MAX_SPOT_COUNT +"个")
}else{
$(editor.snap).find("span").text("新增热点")
if(state!=false)dom.removeClass(editor.snap,"unable");
}
}
if(state){
dom.removeClass(editor.snap,"unable");
count();
}else if(state == false){
dom.addClass(editor.snap,"unable");
//count();
}else if(state == void 0){
count();
}
}
editor.finish = function(){//热点采集结束 收尾 归位
this.setMarkspotDisplayNum(1);
this.pointsElem[0].style.display = "none";
this.pointsElem[1].style.display = "none";
this.player.markspot = null;
this.player.posGets = {};
//this.select.style.display = "none";
//this.snap.style.color = "";
this.changeSnapState(true);//dom.removeClass(this.snap,"unable");
this.player.reticule.visible = true;
//dom.removeClass(this.player.domElement,"grab");
this.ok.style.display = "";
this.player.cancelPanoDisable();
}
editor.clearCollect = function(){//放弃选点 清除
if(this.player.startGetPos){
this.player.startGetPos = false; this.player.domElement.style.cursor = ""; dom.addClass(this.pointsElem[0],'chosen');
}
if(!this.player.markspot) return;
this.player.markspot.elem.parentNode.removeChild(this.player.markspot.elem);
this.player.allHotspots.pop();
this.finish();
}
editor.global.enablePanel = function(){// 初始飞入后解禁
dom.removeClass($(".pinBottom.left")[0],"unable");
/* dom.removeClass($(".hotPointBox")[0],"unable");
dom.removeClass($(".informationBox")[0],"unable");
dom.removeClass($(".toolBox")[0],"unable"); */
dom.removeClass($(".editor")[0],"unable");
dom.removeClass($(".toolTop")[0],"unable");
}
var a = document.getElementsByTagName('input');
for(var i=0; i
请选择 信息 —— 类别!',{btns:["返回选择"]})
error_dialog("提示","请完善项目信息!");
$("#information").click();
$(".selection").addClass("empty_warn");
}else if(player.chosenSpot && player.chosenSpot.billboard.label == ""){
//editor.showMsgBox("提示",'
请填写 热点 —— 标题!',{btns:["返回填写"],funcs:[]})
error_dialog("提示","请填写热点标题!");
$("#hotPoint").click();
dom.addClass(editor.metaTitle.parentElement, "warn");
}else if(editor.modes.psd.getMode() == 1 && $("#scenePSD .word input")[0].value.length!=4){
//editor.showMsgBox("提示",'
信息 —— 密码要4位字符!',{btns:["设为公开,并保存","返回设置"]
// ,funcs:[function(){$("#scenePSD .MenuOptions>*")[0].click(); saveFuc(publishFuc); }]})
error_dialog("提示","场景密码必须4位!");
$("#information").click();
}
//else if(!editor.player.thumbImg && Data.thumbImg){
//editor.showMsgBox("提示",'
初始画面未设置。',{btns:["确定"]});
//}
else{
if(publishFuc instanceof Function) window.newOpen_link = window.open('loading.html');
editor.save(publishFuc);
}
}
var publishFuc = function(){
$('.waiting').addClass('showloading');
$.ajax({
url:"edit/publishScene",
type: 'POST',
dataType: "json",
data : {sceneNum: window.number,childName: Data.CAMERA_ID},
success: function (data) {
if(data && (data==1 || data=="1")){
error_dialog("提示",'发布成功!');
if(newOpen_link)newOpen_link.location.href = 'show.html?m='+number;
else console.log('窗口为空,被拦截?')
}else{
error_dialog("提示",'发布失败!');
setTimeout(function(){
if(newOpen_link)newOpen_link.close();
},500)
}
$('.waiting').removeClass('showloading');
},
error: function (msg) {
console.log('发布失败');
if(newOpen_link)newOpen_link.close();
$('.waiting').removeClass('showloading');
}
});
}
$("#toolTop_save").click(saveFuc);
$("#toolTop_publish").click(function(){
//saveFuc(publishFuc);
success_dialog_double('确定发布','是否确定发布?',function(){saveFuc(publishFuc)});
});
$("#toolTop_exit").click(function(){
//editor.showMsgBox("退出提示","是否保存场景?",{btns:["确定"],funcs:
success_dialog_double('退出','是否确定退出?',function(){window.location.href = 'index.html'; });
})
$(function () {
$(".function li").click(function(){
$("#draw_Tools li").find("a").removeClass("draw_Tools-a");
});
$("#draw_Tools li").click(function(){
$("#draw_Tools li").find("a").removeClass("draw_Tools-a");
$(this).find("a").addClass("draw_Tools-a");//画墙一栏选中状态
})
/* $(".function li:eq(0) img,.function li:eq(0) span").click(function () {
$(".noteBox").css("display", "block");
setTimeout(function () {
$(".noteBox").css("opacity", "1");
}, 0);
});
$(".noteBox a").click(function () {
$(".noteBox").css("opacity", "0");
setTimeout(function () {
//$(".noteBox").css("display", "none");
var textid = $("#noteInput_text")[0].dirName;
if(textid!=null)
{
layer.deleteVector(textid);
layer.control.refreshCanvas = true;
}
}, 1000);
}) //标签属性框 */
})
$(function(){
/* $(".prompt-popup a").click(function(){
$(".prompt-popupBox").css("display","none");
}) */
var order;
$('#information_file').click(function(){
$(".myAccount-cutAvatar-main>div:last").css("display","none");
$(".myAccount-cutAvatar-main>div:first").removeClass("logo-cutAvatar");
$(".myAccount-cutAvatar-top>span").text("裁剪缩略图");
initCropper($('#myAccount-cutAvatar-img'),$('#information_file'),16/8);
order = 1;
})
$('#information_logo_file').click(function(){
$(".myAccount-cutAvatar-main>div:last").css("display","block");
$(".myAccount-cutAvatar-main>div:first").addClass("logo-cutAvatar");
$(".myAccount-cutAvatar-top>span").text("裁剪地面标志");
initCropper($('#myAccount-cutAvatar-img'),$('#information_logo_file'),1);
order = 2;
})
$('#myAccount-cutAvatar-submit').click(function(){
if(order == 1){order =1}else if(order == 2){order = 2};
$('.myAccount-cutAvatar').css("display","none");crop(order);
})
//裁剪框
$(".myAccount-cutAvatar-top a").click(function(){
$('.myAccount-cutAvatar').css("display","none");
})
})
var initCropper = function (img, input,Ratio){
var radius;if(Ratio == 1){radius = '50%'} else {radius = '0px'};
var $image = img;
var options = {
aspectRatio: Ratio, // 纵横比
viewMode: 0,
preview: '.myAccount-cutAvatar-img-preview' // 预览图的class名
};
$image.cropper(options);
var $inputImage = input;
var uploadedImageURL;
if (URL) {
// 给input添加监听
$inputImage.change(function () {
editor.finishSetEntry();
var files = this.files;
var file;
if (!$image.data('cropper')) {
return;
}
if (files && files.length) {
file = files[0];
// 判断是否是图像文件
if (/^image\/\w+$/.test(file.type)) {
// 如果URL已存在就先释放
if (uploadedImageURL) {
URL.revokeObjectURL(uploadedImageURL);
}
uploadedImageURL = URL.createObjectURL(file);
// 销毁cropper后更改src属性再重新创建cropper
$image.cropper('destroy').attr('src', uploadedImageURL).cropper(options);
$inputImage.val('');
$(".myAccount-cutAvatar").css("display","block");
} else {
//editor.showMsgBox("提示",'
请选择一个图像文件!');
error_dialog("提示","请选择一个图像文件!");
}
var T = setInterval(function(){
var flag = $(".myAccount-cutAvatar-main span:first").hasClass("cropper-view-box");
if(flag){
$(".cropper-view-box").css("borderRadius",radius);clearInterval(T);
}
},5)
}
});
} else {
$inputImage.prop('disabled', true).addClass('disabled');
}
}
function dataURLtoBlob(dataurl) {
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while(n--){
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], {type:mime});
}
var scaleImg = t("scaleImg");
var crop = function(order){
if(order == 1){id = $('#showInformation')}
else {id = $('#showInformationLogo')};
var $image = $('#myAccount-cutAvatar-img');
var $target = id;
var canvas = $image.cropper('getCroppedCanvas');
var size = order==1 ? 160 : 512;
var png = scaleImg(size/canvas.width, canvas,'jpeg');
png.base64Src = png.src;
var blob = dataURLtoBlob(png.src);
png.src = window.URL.createObjectURL(blob);
$target.css('background-image', "url('"+png.src+"')");
$target.css("display","block");
if(order == 1){
player.thumbImg = png.base64Src;
player.thumbNeedSave = true;
}else{
player.floorLogoImg = png.base64Src;
player.fLogoNeedSave = true;
png.onload = function(){
player.model.changeFloorLogo({"image":this});
/* var t = new THREE.Texture(png);
t.needsUpdate=!0;
player.model.floorLogo.material.uniforms.map.value = t;
player.model.floorLogo.material.needsUpdate=!0;
*/
}
}
return png;
};
}
}, {
"dom": "dom",
"scaleImg":"scaleImg"
}
],
116: [function(e, t, i) {///js/main.js
(function(t) {
"use strict";
var editor = e("Editor");
var dom = e("dom");
//layer && (layer.editor = editor);
window.Data || (window.Data = {})
Data.imgRoot = "images/images" + number + "/"; //+'/hot/';
//Data.imgRoot2 = "http://4dkk.4dage.com/FDKKIMG/";
Data.imgRoot2 = "images/"; //+'/hot/';
window.ifTest = window.location.href.substring(window.location.href.indexOf("?")+1).indexOf('test')>-1;
window.keyCon = true;//当编辑输入框被focus时不能keydown控制相机
//Data.spotImgRoot = prefix + "images/images" + number + "/"; //+'/hot/'; //到底是要读7牛的还是本地的呢 伤脑筋哦
Data.spotImgRoot = "images/images" + number + "/"; //+'/hot/';
var checkLen = { //HB
project_name1:function(val){
var project_name1 = $("#project-name1");
var len = $(".project-name input").val().length;
project_name1.attr("data-size",15 - len);
return len;
},
project_name2:function(val){
var project_name2 = $("#project-name2");
var len = $("#pjtName").val().length;
project_name2.attr("data-size",15 - len);
return len;
},
editor2:function(html){
var all = 200;
var len = 0;
var pFlag = false;
html.replace(/
您没有登录,请登录后再编辑');
error_dialog_double('提示','您没有登录,请登录后再编辑',function(){
window.open(CONSTANT.MAINURL,"blank")
});
y.endLoading("forceQuit");
//t.reject();
}
});
return t.promise();
}
function getFirstData(){//首次编辑的数据是拍摄时的数据 要比getData前加载 //加 xzw
var t = $.Deferred();
$.ajax({
url:"scene/getInfo",
type: 'POST',
dataType: "json",
data : {num: window.number},
success: function (data) {
if(data && data!="0"){
window.Data = $.extend(Data,data);
if(parseInt(Data.status) == 0){
window.location.href = "404.html?m=wait"+"&m="+window.number;//模型正在计算
return;
}else if(parseInt(Data.status) == -1) {
window.location.href = "404.html?m=404";//无
return;
}//1 or undefine都继续执行
Data.version = parseInt(data.version || 0);
var createTime = Data.createTime;
$(".model-title").text(Data.sceneName || '四维看看');
$(".model-title2").text(Data.sceneName || '四维看看');
$("#pjtName")[0].value = Data.sceneName || '';
$('.introduce-detail span')[0].innerHTML = Data.sceneDec;//直接text()会得不到这类HTML文字
$(".show_count").text(Data.shootCount);
$(".show_data").text(createTime);
$("#edit2").attr('data-more',Data.sceneDec || '');
Data.sceneType = parseInt(Data.sceneType);
if(layer.editor.selectList["type"]){//有的话说明selectList["type"]先于Data.SCENETYPE
var typeIndex = [1,2,3,4,5,0];//0标定为其他 以后若有增加就从6开始,删除的类型继续保留数字
//var typeName = ["文博","地产","电商","餐饮","家居","其他"];
var type = CONSTANT.SCENETYPE[typeIndex.indexOf(Data.sceneType)];
if(type) layer.editor.selectList["type"].selectFromOutSide(type);
}
t.resolve();
}else{
//editor.showMsgBox("提示",'
数据加载失败 错误代码firstData');
console.log("数据1加载失败");
t.reject();
}
},
error: function (msg) {
console.log("数据1加载失败");
t.reject();
}
});
return t.promise();
}
function getData(){//加 xzw 场景名称等数据加载
var t = $.Deferred();
$.ajax(ifTest?"data/scene.json?m="+(new Date()).getTime() : "data/data"+number+"/scene.json?m="+(new Date()).getTime(), {
//return $.ajax(prefix+"data/data"+number+"/floor.json?m="+(new Date()).getTime(), {
crossDomain: !0,
dataType: "json",
beforeSend: function(t) {
v.token && t.setRequestHeader("Authorization", "Token " + v.token)
}
}).done(function(e) {
this.baseUrl = "images/images"+number+"/{{filename}}";
window.Data = $.extend(Data,e);
Data.sceneName = e.sceneName; //覆盖firstData
Data.sceneDec = e.sceneDec; //覆盖firstData
Data.sceneType = e.sceneType;
Data.floorLogo = (e.floorLogo=="1" || e.floorLogo == 1) ? 1 : 0;
Data.thumbImg = (e.thumbImg=="1" || e.thumbImg == 1) ? 1 : 0;
Data.entry = e.entry;
Data.version = parseInt(e.version || 0);
Data.floorLogoSize = parseInt(Data.floorLogoSize || 100);
if(Data.sceneName != undefined){
$(".model-title").text(Data.sceneName || '四维看看');
$(".model-title2").text(Data.sceneName || '四维看看');
$("#pjtName")[0].value = Data.sceneName || '';
}
$('.introduce-detail span')[0].innerHTML = Data.sceneDec;//直接text()会得不到这类HTML文字
$("#edit2").attr('data-more',Data.sceneDec || '');
Data.sceneType = parseInt(Data.sceneType);
if(layer.editor.selectList["type"]){//有的话说明selectList["type"]先于Data.SCENETYPE
var typeIndex = [1,2,3,4,5,0];//0标定为其他 以后若有增加就从6开始,删除的类型继续保留数字
//var typeName = ["文博","地产","电商","餐饮","家居","其他"];
var type = CONSTANT.SCENETYPE[typeIndex.indexOf(Data.sceneType)];
if(type) layer.editor.selectList["type"].selectFromOutSide(type);
}
if(Data.sceneDec!=null&&typeof(Data.sceneDec)!='undefined')
{
checkLen.editor2(Data.sceneDec);
//checkLen.project_name2();
if(layer.editor.inputAreas.sceneDec) layer.editor.inputAreas.sceneDec.check();
}
t.resolve();
}.bind(this)).fail(function() {
(parseInt(Data.version) > 1) && console.log("数据2加载失败");
t.resolve();
//getData();
});
return t.promise();
}
function GetThumbImg(){//加 xzw 缩略图
var t = $.Deferred();
var img = new Image;
checkLen.project_name2();
$("#gui-loading .bg").css({"display": "none"});
img.src = Data.thumbImg ? Data.imgRoot +CONSTANT.LOADPIC +"?"+"m="+Data.version : "http://scene3d.4dage.com/loading/pc.jpg";
img.onload = function(){
$("#gui-loading .bg").css({"background-image": "url("+img.src+")"});
$("#gui-loading .bg").fadeIn(120);
//t.resolve();
}
return t.resolve().promise();
}
function infoGuiBind(){
$(".introduce-button").click(function(e){
if( $(".introduce-detailBox").hasClass("hide")){
$(".introduce-detailBox").removeClass("hide");
setTimeout(function(){
$(".introduce-top").addClass("open");
},50)
}else{
close();
}
})
var close = function(e){
if(e && ( dom.findParent(e.target,$(".introduce-button")[0]) || dom.findParent(e.target, $(".introduce-detailBox")[0] ))) return;
if( !$(".introduce-detailBox").hasClass("hide")){
$(".introduce-top").removeClass("open");
setTimeout(function(){
$(".introduce-detailBox").addClass("hide");
},350)
}
}
$("#player").on("touchstart",close);
$("#player").on("mousedown",close);
}
function n(e) {
ce.update(e)
}
function r(e) {
de.info("Version", "2.25.6-0-gd87e5b1"),
q.defaultMaxListeners = 1e3,
a(e),
s()
}
function o() {
return document.getElementById("player")
}
function a(e) {
e.addEventListener("dragenter", T, !1),
e.addEventListener("dragover", T, !1)
}
function s() {
F.valueFromHash("title", !0) || $(document).ready(function() {
var e = $(".model-title");
e.hide()
})
}
function l() {
return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
}
function c() {
return {
panoElementsToLoad: 6,
modelElementsToLoad: 0,
totalElementsLoaded: 0,
totalElementsToLoad: 0,
totalPercentageLoaded: 0,
progressCallback: null
}
}
function h(e) {
return K.loadFeatureFlags(e).done(function(e) {
K.updateDependentSettings(e, V)
})
}
function u(e) {
return Q.get(e.urlBase + "/api/v1/config/showcase", {
responseType: "json",
prefetchFrom: "config"
}).then(function(e) {
return e ? void j.extendObject(V.appConfig, e) : {}
}, function(e) {
return de.warn("Failed loading runtime config, using defaults."),
$.when({})
})
}
function d(e, t) {
var i = B.getModel({
url: t,
floors: F.valueFromHash("f", !0),
autoload: !1
})
, n = u({
urlBase: e.urlBase
});
return $.when(i, n).then(null, function(e) {
return this
})
}
function p(e, t, i, n, r) {
de.info("Model data loaded"),
de.debug("UUID: " + e.data.job.uuid),
J.init(K.getFlags()),
i && H.initKeen({
token: i,
appId: n
}),
H.initSegment({
model: e.sid,
version: "2.25.6-0-gd87e5b1",
startSource: r.startSource,
token: t,
autoplay: r.autoplay,
quickstart: r.quickstart
})
}
function f(e, t, i, n, r) {
return r.progressCallback = t,
H.sessionStart(),
e.load(n).progress(g.bind(this, r))
}
function g(e, t) {
e.modelElementsToLoad = t[1],
v(e),
m(e)
}
function m(e) {
e.totalElementsLoaded++,
e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
}
function v(e) {
e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
}
function A(e) {
var t = new x.PerspectiveCamera;
t.layers.enable(he.PANOMARKERS),
t.layers.enable(he.RETICULE),
t.layers.enable(he.TAG);
var i = new x.Scene
, n = new x.AmbientLight(16777215);
i.add(n),
i.skybox = new W,
i.add(i.skybox),
i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
side: x.DoubleSide
})),
i.plane.position.y = 0,
i.plane.rotateX(-Math.PI / 2),
i.plane.material.visible = !1,
i.add(i.plane),
i.updateMatrixWorld(),
V.showScreenshotLocations && e.data.images.forEach(function(e) {
if (e.metadata && e.metadata.camera_position) {
var t = e.metadata.camera_position
, n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
n.position = t.clone(),
i.add(n);
var r = e.metadata.camera_quaternion
, o = new x.Vector3(0,0,-1).applyQuaternion(r);
i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
}
}),
V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
var r = new te(i,t,z);
return r
}
function y(e, t) {
var i = e ? 1 : 1e3
, n = J.tilegen || J.imgopt ? 6 : 2;
n = F.valueFromHash("tileconc", n);
var r = new ne
, o = new ae({
concurrentDownloads: n
})
, a = new se
, s = new P
, l = new M
, c = new S(t)
, h = new R
, u = new O(i)
, d = new L
, p = new oe;
return {
qualityManager: r,
panoRenderer: a,
tileDownloader: o,
player: c,
director: l,
modelManager: s,
tagManager: p,
displayController: u,
labelDisplayController: d,
controls: h
}
}
function C(e, t, i, n) {
var r = i.controls
, o = i.qualityManager
, a = i.panoRenderer
, s = i.tileDownloader
, l = i.modelManager;
r.init(n, l),
ee.init(i.director, r, i.player, l, t),
o.init(l),
s.init(o),
a.init(t, s, o),
l.init(s, a, o),
l.addModel(e),
t.addComponent(G)
}
function I(e, t, i, n) {
var r = i.qualityManager
, o = i.panoRenderer
, a = i.tileDownloader
, s = i.modelManager
, l = i.player
, c = i.director
, h = i.tagManager
, u = i.displayController
, d = i.labelDisplayController
, p = i.controls;
t.scene.add(e),
t.qualityManager = r;
var f = {
camera: t.camera,
director: c,
modelManager: s,
tileDownloader: a,
panoRenderer: o,
qualityManager: r,
tagManager: h,
container: n,
controls: p
};
l.init(f),
l.setScene(t.scene),
h.init(s, l),
c.init(l, s),
u.init(c, l, s, h, n),
d.init(l, s, n),
z.bindEvents(l);
t.addComponent(h);
t.addComponent(l);
t.addComponent(o)
l.sceneRenderer = t; //xzw add 方便resize
}
function E(e, t, i, n) {
return de.info("Starting player in " + i.mode),
H.report(t.sid, "started-playing", n, i.quickstart),
e.start(i)
}
function b(e, t) {
de.error(t),
k.error(t),
H.report(e, "error-" + t)
}
function w(e) {
var t = F.details();
t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
H.report(e, "error-webgl-generic"))
}
function _(e, t, i) {
try {
e.start(t)
} catch (e) {
throw de.warn(e.message),
w(i.sid),
e
}
}
function T(e) {
e.stopPropagation(),
e.preventDefault()
}
e("./lib/three75-shim"),
e("./lib/array-polyfill"),
e("./lib/performance-polyfill"),
e("./lib/shaders/CopyShader.js"),
e("./lib/shaders/HorizontalBlurShader.js"),
e("./lib/shaders/VerticalBlurShader.js"),
e("./lib/postprocessing/EffectComposer.js"),
e("./lib/postprocessing/RenderPass.js"),
e("./lib/postprocessing/MaskPass.js"),
e("./lib/postprocessing/ShaderPass.js"),
window.Promise || (window.Promise = e("promise-polyfill"));
var x = e("three")
, S = (e("./util/sentry"),
e("./player"))
, M = e("./director")
, R = e("./controls/CameraControls")
, P = e("./model/ModelManager")
, O = e("./DisplayController")
, L = e("./label/LabelDisplayController")
, D = e("./enum/Viewmode")
, N = e("./util/logger")
, B = e("./showcase")
, F = e("./util/browser")
, V = e("./settings")
, U = e("./gui/gui")
, k = e("./gui/error")
, H = e("./analytics")
, G = e("./util/transitions")
, z = e("./effects")
, W = e("./objects/Skybox")
, j = e("./util/common")
, Y = (e("./util/PanoramaCollection"),
e("./util/math"),
e("./util/showcase"))
, X = e("./util/camera")
, Z = (e("./objects/Panorama"),
e("./cameras/PanoramaCamera"),
e("./preloaders"))
, q = e("events").EventEmitter
, K = e("./featureflags")
, Q = (e("./util/lerp"),
e("./util/ajax"))
, J = e("./ab")
, ee = e("./sdk/automation.js")
, te = e("./scene/SceneRenderer")
, ie = e("./scene/QuickstartManager")
, ne = e("./tile/QualityManager.js")
, re = e("./localization/localize")
, oe = e("./tag/tagManager")
, ae = e("./tile/TileDownloader")
, se = e("./tile/PanoRenderer")
, le = (e("./enum/PanoSizeClass"),
e("./enum/PanoramaEvents"),
e("./enum/SceneRendererEvents"))
, ce = e("./gui/memoryUsage")
, he = e("./enum/RenderLayers")
, ue = e("./TimingData")
, de = new N(t);
N.level = V.logLevel,
N.consoleEnabled = V.console,
i()
}
).call(this, "/js/main.js")
}
, {
"./DisplayController": 1,
"./TimingData": 2,
"./ab": 3,
"./analytics": 4,
"./cameras/PanoramaCamera": 7,
"./controls/CameraControls": 9,
"./director": 15,
"./effects": 16,
"./enum/PanoSizeClass": 36,
"./enum/PanoramaEvents": 37,
"./enum/RenderLayers": 41,
"./enum/SceneRendererEvents": 43,
"./enum/Viewmode": 51,
"./featureflags": 59,
"./gui/error": 64,
"./gui/gui": 65,
"./gui/memoryUsage": 73,
"./label/LabelDisplayController": 91,
"./lib/array-polyfill": 92,
"./lib/performance-polyfill": 95,
"./lib/postprocessing/EffectComposer.js": 96,
"./lib/postprocessing/MaskPass.js": 97,
"./lib/postprocessing/RenderPass.js": 98,
"./lib/postprocessing/ShaderPass.js": 99,
"./lib/shaders/CopyShader.js": 100,
"./lib/shaders/HorizontalBlurShader.js": 101,
"./lib/shaders/VerticalBlurShader.js": 102,
"./lib/three75-shim": 103,
"./localization/localize": 108,
"./tag/tagManager": 124,
"./model/ModelManager": 140,
"./objects/Panorama": 148,
"./objects/Skybox": 152,
"./player": 155,
"./preloaders": 156,
"./scene/QuickstartManager": 157,
"./scene/SceneRenderer": 158,
"./sdk/automation.js": 164,
"./settings": 166,
"./showcase": 168,
"./tile/PanoRenderer": 169,
"./tile/QualityManager.js": 170,
"./tile/TileDownloader": 171,
"./util/PanoramaCollection": 178,
"./util/ajax": 181,
"./util/browser": 182,
"./util/camera": 183,
"./util/common": 185,
"./util/lerp": 188,
"./util/logger": 189,
"./util/math": 190,
"./util/sentry": 192,
"./util/showcase": 193,
"./util/transitions": 195,
events: 202,
"promise-polyfill": 213,
three: 217,
"Editor" : "Editor",
"dom" : "dom"
}],
117: [function(e, t, i) {//"../materials/CubemapMaterial"
"use strict";
function n(e) {
e = e || {},
r.RawShaderMaterial.call(this, a.extendObject({
fragmentShader: o.cube.fragmentShader,
vertexShader: o.cube.vertexShader,
uniforms: r.UniformsUtils.clone(o.cube.uniforms),
name: "CubemapMaterial"
}, e))
}
var r = e("three")
, o = e("../shaders")
, a = e("../util/common");
n.prototype = Object.create(r.RawShaderMaterial.prototype),
n.prototype.constructor = n,
t.exports = n
}
, {
"../shaders": 167,
"../util/common": 185,
three: 217
}],
118: [function(e, t, i) {//"../materials/ModelTextureMaterial"
"use strict";
function n(e) {
e = e || {},
r.RawShaderMaterial.call(this, a.extendObject({
fragmentShader: o.model.fragmentShader,
vertexShader: o.model.vertexShader,
uniforms: r.UniformsUtils.clone(o.model.uniforms),
name: "ModelTextureMaterial"
}, e))
}
var r = e("three")
, o = e("../shaders")
, a = e("../util/common");
n.prototype = Object.create(r.RawShaderMaterial.prototype),
n.prototype.constructor = n,
n.prototype.setProjectedPanos = function(e, t, i) {
i && (this.uniforms.progress.value = 0),
e.ensureSkyboxReadyForRender(),
this.uniforms.pano0Map.value = e.getSkyboxTexture(),
this.uniforms.pano0Position.value.copy(e.position),
this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
t.ensureSkyboxReadyForRender(),
this.uniforms.pano1Map.value = t.getSkyboxTexture(),
this.uniforms.pano1Position.value.copy(t.position),
this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
}
,
t.exports = n
}
, {
"../shaders": 167,
"../util/common": 185,
three: 217
}],
119: [function(e, t, i) {///js/tag/Billboard/Billboard.js
(function(i) {
"use strict";
function n(e, t, i, n) {
this.div = null,
this.body = null,
this.label = e,
this.description = t,
this.parsedDescription = [],
this.media = i || {
type: null
},
this.loadingSpinner = null,
this.parser = new r({
supportLinks: !u.valueFromHash("mls"),
keepLinkLabels: !0
}),
this.state = I.CLOSED,
this.orientation = "",
this.initialTransform = "",
this.hovering = !1,
this.openTransition = null,
this.closeTransition = null,
this.openPromise = null,
this.closePromise = null,
this.animationTransition = null,
this.animationScale = 0
}
var r = e("../Parser/DescriptionParser")
, o = e("../Media/Link")
, a = e("../Media/Image")
, s = e("../Media/EmbedlyPlayer")
, l = e("../Media/EmbedlyEmbed")
, c = e("../../util/transitions")
, h = e("../../util/lerp")
, u = e("../../util/browser")
, d = e("./BillboardEvent")
, p = e("../Media/MediaEvent")
, f = e("../Parser/DescriptionChunkType")
, g = e("events").EventEmitter
, m = e("./billboardSettings")
, v = e("./overlaySettings")
, A = e("../../util/logger")
, y = new A(i)
, C = document.getElementById("tag-billboards");
C.addEventListener("touchend", function(e) {
C.style.pointerEvents = "none"
}),
C.addEventListener("touchcancel", function(e) {
C.style.pointerEvents = "none"
});
var I = {
CLOSED: "closed",
OPENING: "opening",
OPEN: "open",
CLOSING: "closing",
ACTIVE: "active"
};
n.prototype = Object.create(g.prototype),
n.prototype.build = function(e) {//xzw
//this.parsedDescription = this.parser.parse(this.description);
var t = document.createElement("div");
t.className = "tag-container has-hotzone",
this.div = t,
this.body = document.createElement("div"),
this.body.className = "tag-body";
var i = document.createElement("div");
i.classList.add("tag-content");
var n = document.createElement("div");
n.classList.add("tag-text-content");
var r = document.createElement("div");
r.className = "tag-label",//label
r.textContent = this.label || "请于右侧编辑您新的热点",//改
n.appendChild(r);
var o = document.createElement("div");
o.className = "tag-desc",//description
n.appendChild(o),
i.appendChild(n),
this.body.appendChild(i),
//this.appendDescriptionElements(this.parsedDescription, o),
this.appendMedia(),
t.appendChild(this.body),
C.appendChild(t),
this.changeDesc(this.description);//add
this.bindEvents(t, this.body)
}
,
//xzw: add
n.prototype.changeLabel = function(title){//换标题
var container = $(this.div).find('.tag-label')[0];
container.innerHTML = "";
this.label = title;
container.textContent = this.label;
this.applyOrientation(this.orientation)//更新面板位置
}
,
n.prototype.changeDesc = function(desc){//换摘要
var container = $(this.div).find('.tag-desc')[0];
container.innerHTML = "";
this.description = desc;
if(desc != "") $(container).addClass("hasText")
else $(container).removeClass("hasText")
this.parsedDescription = this.parser.parse(this.description);
this.appendDescriptionElements(this.parsedDescription, container);
this.applyOrientation(this.orientation)
}
,
n.prototype.changeImg = function(img){//暂时只支持换image
var has;
if(this.media.type == "photo") has = true;
this.media = {"img":img,"type":"photo"};
has ? this.changeMedia() : this.appendMedia()
this.applyOrientation(this.orientation)
},
n.prototype.changeMedia = function() {//暂时只支持image
if (this.media && this.media.type && "error" !== this.media.type && (/* !u.valueFromHash("mls", 0) || */this.media.type === f.IMAGE)) {
this.appendLoadingSpinner();
var e = $(this.body).find(".tag-media-content")[0];
e.innerHTML = "";
e.appendChild(this.createImageElement(this.media, this.body));
}
}
//xzw-------end
n.prototype.bindEvents = function(e, t) {
var i = function(e) {
return function(t) {
if (!this.div.classList.contains("overlay")) {
var i, n = document.getElementById("player");
try {
i = new MouseEvent(e,t)
} catch (n) {
i = document.createEvent("MouseEvents"),
i.initMouseEvent(e, 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.dispatchEvent(i)
}
}
};
t.addEventListener("mousedown", function(e) {
e.stopPropagation()
}),
t.addEventListener("mouseup", function(e) {
e.stopPropagation()
}),
e.addEventListener("touchstart", function(e) {
C.style.pointerEvents = "auto"
}),
e.addEventListener("mousedown", i("mousedown").bind(this)),
e.addEventListener("mouseup", i("mouseup").bind(this)),
t.addEventListener("mouseover", function(t) {
this.state === I.OPEN && e.classList.remove("has-hotzone")
}
.bind(this)),
e.addEventListener("mouseenter", function(e) {
this.state !== I.CLOSING && (this.hovering = !0,
this.emit(d.ENTER))
}
.bind(this)),
e.addEventListener("mouseleave", function(e) {
this.hovering = !1,
this.emit(d.LEAVE)
}
.bind(this)),
e.addEventListener("gesturestart", function(e) {
e.preventDefault()
});
var n = e.querySelector(".tag-text-content")
, r = 0;
n.addEventListener("touchstart", function(e) {
r = e.changedTouches[0].clientY
}),
n.addEventListener("touchmove", function(t) {
function i(e) {
e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
}
return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
}),
e.addEventListener("touchmove", function(e) {
0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
})
}
,
n.prototype.appendDescriptionElements = function(e, t) {
e.length > 0 && this.div.classList.add("has-text"),
e.forEach(function(e, i) {
switch (e.type) {
case f.TEXT:
//t.appendChild(this.createTextElement(e.text)); //---MP
t.innerHTML = e.text; //xzw 这样等标签不会变成文字显示
break;
case f.LINK:
t.appendChild(this.createLinkElement(e.link))
}
}
.bind(this))
}
,
/* n.prototype.appendLoadingSpinner = function() {----MP
this.loadingSpinner = document.createElement("div"),
this.loadingSpinner.classList.add("loading-spinner");
var e = document.createElement("div");
e.classList.add("gui-spinner-icon"),
this.loadingSpinner.appendChild(e),
this.body.appendChild(this.loadingSpinner)
} */
n.prototype.appendLoadingSpinner = function() {//---not by xzw
this.loadingSpinner = document.createElement("div"),
this.loadingSpinner.classList.add("loading-spinner");
var e = document.createElement("div");
e.classList.add("gui-spinner-icon");
var d = document.createElement("div");
d.classList.add("loadingPic");
var z = document.createElement("div");
z.classList.add("loadingPic-inner");
d.appendChild(z);
this.loadingSpinner.appendChild(e),
this.loadingSpinner.appendChild(d),
this.body.appendChild(this.loadingSpinner)
}
,
n.prototype.onMediaLoadFinished = function() {
this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
this.applyOrientation(this.orientation),
this.loadingSpinner = null)
}
,
n.prototype.appendMedia = function() {
if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
this.appendLoadingSpinner();
var e = document.createElement("div");
e.classList.add("tag-media-content");
var t = document.createElement("i");
["icon", "icon-close-thin", "close"].forEach(function(e) {
t.classList.add(e)
}),
this.body.appendChild(t),
this.body.appendChild(e);
switch (this.media.type) {
case f.IMAGE:
e.appendChild(this.createImageElement(this.media, this.body));
break;
case f.VIDEO:
e.appendChild(this.createVideoElement(this.media, this.body));
break;
case f.RICH:
e.appendChild(this.createEmbedElement(this.media, this.body))
}
}
}
,
n.prototype.createTextElement = function(e) {
var t = document.createElement("span");
return t.textContent = e,
t
}
;
n.prototype.createLinkElement = function(e) {
var t = new o(e);
return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
t.createDomElement()
}
,
n.prototype.createImageElement = function(e, t) {
function i() {
function e() {
m || (r.classList.remove("view-image"),
c.classList.add("overlay"),
i(),
window.addEventListener("resize", b),
c.addEventListener("click", a),
g.addEventListener("click", l),
f.addEventListener("click", s),
m = !0,
o.emit(p.IMAGE_OPENED))
}
function i() {
t.classList.add("show-info"),
h.classList.remove("collapsible"),
h.style.height = "";
/* var e = parseFloat(getComputedStyle(I).lineHeight) -----MP
, i = y + e
, r = c.clientWidth - 2 * v.boundaryWidth - C
, a = c.clientHeight - 2 * v.boundaryHeight - C - i
, s = a
, l = s * n.aspect;
l > r && (l = r,
s = l / n.aspect),
s > a && (s = a,
l = s * n.aspect),
l += C,
s += C + i,
t.style.width = l + "px",
t.style.height = s + "px",
u.style.paddingTop = e + C + "px",
o.description.length > 0 && (h.classList.add("collapsible"),
h.style.height = h.clientHeight + 12 + "px",
E.style.height = "calc(100% - " + I.clientHeight + "px)") */
//by ?:
o.description.length > 0 && (h.classList.add("collapsible"));
return $.when(this);
}
function a(e) {
e.target === c && s()
}
function s() {
m && (m = !1,
r.classList.add("view-image"),
c.classList.remove("overlay"),
h.style.height = "",
u.style.paddingTop = "",
t.style.width = "",
t.style.height = "",
window.removeEventListener("resize", b),
c.removeEventListener("click", a),
g.removeEventListener("click", l),
f.removeEventListener("click", s),
o.emit(p.IMAGE_CLOSED),
o.close(!0))
}
function l(e) {
t.classList.toggle("show-info")
}
var c = o.div
, h = c.getElementsByClassName("tag-content")[0]
, u = c.getElementsByClassName("tag-media-content")[0]
, f = t.getElementsByClassName("close")[0]
, g = h.getElementsByClassName("tag-label")[0];
c.classList.add("has-image"),
r.classList.add("view-image"),
c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
o.applyOrientation(o.orientation);
var m = !1
, A = getComputedStyle(h)
, y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
, C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
, I = h.querySelector(".tag-label")
, E = h.querySelector(".tag-desc")
, b = function() {
var e, t, n = 0;
return function() {
clearInterval(e),
clearTimeout(t),
e = setInterval(function() {
var e = c.clientHeight;
n !== e && (i(),
n = e)
}, 100),
t = setTimeout(clearInterval.bind(this, e), 1e3)
}
}();
n.on(p.IMAGE_OPENING, e);
// o.on(d.ACTIVATE, e),//加了这个再点击热点时就会变大图
o.on(p.IMAGE_CLOSED, n.onClosed.bind(n));
// o.on(d.CLOSING, s)
}
/* var n = new a -----MP
, r = n.createDomElement();
this.once(d.OPENED, function() {
n.load(e.src).then(i).catch(function(t) {
y.warn("Failed to load image:", e.src),
y.warn("with error:", t)
}).then(this.onMediaLoadFinished.bind(this))
});
var o = this; */
//xzw:
var n = new a
,r = n.createDomElement()
,o = this;
if(e.img){ //如果是编辑页面添加的将是个img
n.load(e.img, this.div).then(i).fail(function(t) {
y.warn("Failed to load image:", e.src),
y.warn("with error:", t)
}).then(this.onMediaLoadFinished.bind(this))
}else{
if(!e.src) e.src = Data.spotImgRoot + "hot" +this.tag.sid + '.jpg?m=' + Data.version;
this.once(d.OPENED, function() {
n.load(e.src, this.div).then(i).fail(function(t) {
y.warn("Failed to load image:", e.src),
y.warn("with error:", t)
}).then(this.onMediaLoadFinished.bind(this))
});
}
return r
}
,
n.prototype.createVideoElement = function(e, t) {
var i = new s({
autoPlay: !0,
autoResume: !0,
startMuted: !1,
loop: !1
})
, n = i.createDomElement();
return this.once(d.OPENED, function() {
i.load(e.src).then(function() {
this.div.classList.add("has-video"),
this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
i.play()),
this.on(d.OPENING, i.show.bind(i)),
this.on(d.OPENED, i.play.bind(i)),
this.on(d.CLOSING, i.pause.bind(i)),
this.on(d.CLOSED, i.hide.bind(i))
}
.bind(this)).catch(function(t) {
y.warn("Failed to embed video:", e.src),
y.warn("with error:", t)
}).then(this.onMediaLoadFinished.bind(this))
}
.bind(this)),
n
}
,
n.prototype.createEmbedElement = function(e, t) {
var i = new l
, n = i.createDomElement();
return this.once(d.OPENED, function() {
i.load(e.src).then(function() {
this.div.classList.add("has-embed"),
this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
this.applyOrientation(this.orientation),
this.on(d.OPENING, i.show.bind(i)),
this.on(d.CLOSED, i.hide.bind(i))
}
.bind(this)).catch(function(t) {
y.warn("Failed to embed:", e.src),
y.warn("with error:", t)
}).then(this.onMediaLoadFinished.bind(this))
}
.bind(this)),
n
}
,
n.prototype.open = function(e) {
return this.openPromise = $.Deferred(),
this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
this.state !== I.OPEN && (this.emit(d.OPENING),
e && this.emit(d.ACTIVATING),
this.state = I.OPENING,
this.animateOpen(function() {
e && this.setActiveState(),
this.openPromise.resolve()
}
.bind(this)))
}
.bind(this), m.animation.openDelay),
c.cancel(this.closeTransition),
this.closePromise && this.closePromise.reject(),
this.closeTransition = void 0,
this.openPromise.promise())
}
,
n.prototype.close = function(e) {
console.log('close')
return this.closePromise = $.Deferred(),
!e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
this.state !== I.CLOSED && (this.emit(d.CLOSING),
this.state = I.CLOSING,
this.animateClose())
}
.bind(this), m.animation.closeDelay)),
c.cancel(this.openTransition),
this.openPromise && this.openPromise.reject(),
this.openTransition = void 0,
this.closePromise.resolve(),
this.closePromise.promise())
}
,
n.prototype.setActiveState = function() {
this.state !== I.CLOSED && (this.state = I.ACTIVE,
this.emit(d.ACTIVATE),
this.div.classList.remove("has-hotzone"))
}
,
n.prototype.animateOpen = function(e) {
if (this.state === I.OPENING) {
if (c.cancel(this.animationTransition),
u.detectSamsungNative())
return this.boardOrientation = null,
this.div.style.visibility = "visible",
this.emit(d.OPENED),
this.state = I.OPEN,
void (e && e());
this.div.style.webkitTransform = "scale(0)",
this.div.style.transform = "scale(0)",
this.div.style.visibility = "visible",
this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
this.emit(d.OPENED),
this.state = I.OPEN,
e && e()
}
.bind(this))
}
}
,
n.prototype.animateClose = function(e) {
this.state === I.CLOSING && (c.cancel(this.animationTransition),
this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
this.emit(d.CLOSED),
this.state = I.CLOSED,
this.div.style.visibility = "hidden",
this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
e && e()
}
.bind(this)))
}
,
n.prototype.needsUpdate = function() {
return this.state !== I.CLOSED
}
,
n.prototype.update = function(e, t) {
if (this.needsUpdate()) {
var i = (this.updateOrientation(e),
this.calcScale(t))
, n = {
x: (e.x + 1) * $('#player').width() / 2,
y: (e.y + 1) * $('#player').height() / 2
};
this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
this.div.style.webkitTransform = this.div.screenTransform,
this.div.style.transform = this.div.screenTransform
}
}
,
n.prototype.getDimensions = function() {
return this.div.getBoundingClientRect()
}
,
n.prototype.ifOutOfScreen = function() {//xzw add
var t = this.getDimensions();
var pad = 8;
return t.left<0-pad || t.right> $("#player").width()+pad || t.top<0-pad || t.bottom>$("#player").height()+pad;
}
,
n.prototype.calcScale = function(e) {
return Math.sqrt(e / 40) * m.boardToDiscRatio
}
,
n.prototype.updateOrientation = function(e) {
if (this.state !== I.ACTIVE) {
var t = 1 / 3
, i = e.y < -t ? 0 : e.y < t ? 1 : 2
, n = e.x < -t ? 0 : e.x < t ? 1 : 2
, r = "";
r += 0 === n ? "right" : 2 === n ? "left" : "",
r += 0 === i ? "-down" : 2 === i ? "-up" : "",
1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
1 === i && (r = $('#player').width()>$('#player').height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
}
}
,
n.prototype.applyOrientation = function(e) {
this.div.style.transform = this.div.style.webkitTransform = "",
this.div.classList.remove("tag-container-" + this.orientation),
this.div.classList.add("tag-container-" + e);
var t = window.getComputedStyle(this.div);
this.initialTransform = t.transform || t.webkitTransform,
"none" === this.initialTransform && (this.initialTransform = "");
var i = t.transform.slice(7, -1).split(",")
, n = -i[4]
, r = -i[5];
this.div.style.webkitTransformOrigin = n + "px " + r + "px",
this.div.style.transformOrigin = n + "px " + r + "px",
this.orientation = e
}
,
t.exports = n
}
).call(this, "/js/tag/Billboard/Billboard.js")
}
, {
"../../util/browser": 182,
"../../util/lerp": 188,
"../../util/logger": 189,
"../../util/transitions": 195,
"../Media/EmbedlyEmbed": 125,
"../Media/EmbedlyPlayer": 126,
"../Media/Image": 128,
"../Media/Link": 129,
"../Media/MediaEvent": 131,
"../Parser/DescriptionChunkType": 133,
"../Parser/DescriptionParser": 134,
"./BillboardEvent": 120,
"./billboardSettings": 121,
"./overlaySettings": 122,
events: 202
}],
120: [function(e, t, i) {//"./tag/Billboard/BillboardEvent"
"use strict";
t.exports = Object.freeze({
ENTER: "billboard.enter",
LEAVE: "billboard.leave",
OPENING: "billboard.opening",
OPENED: "billboard.open",
CLOSING: "billboard.closing",
CLOSED: "billboard.closed",
ACTIVATING: "billboard.activating",
ACTIVATE: "billboard.activate"
})
}
, {}],
121: [function(e, t, i) {//"./billboardSettings"
"use strict";
t.exports = Object.freeze({
animation: Object.freeze({
hoverOnClosing: !1,
openDelay: 100,
closeDelay: 50,
openDuration: 200,
closeDuration: 100
}),
boardToDiscRatio: 1.2
})
}
, {}],
122: [function(e, t, i) {//"./overlaySettings
"use strict";
t.exports = Object.freeze({
boundaryWidth: 30,
boundaryHeight: 0
})
}
, {}],
123: [function(e, t, i) {//js/tag/tag.js
(function(i) {
"use strict";
function n(e, t, i) {
var n = i.version || "0";
"0" !== n && I.info("tag defined using version " + n),
this.model = e,
this.sid = t,
this.color = (new r.Color).set(i.color || l.tagDefault),
this.hoverColor = l._darken(this.color, .2),
this.floor = null,
this.floorIndex = i.floor,
this.mode = s.PANORAMA,
i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
this.obj3d = null,
this.disc = null,
this.materials = {
disc: null,
pole: null
},
this.position = (new r.Vector3).copy(i.position),
//this.discPosition = (new r.Vector3).copy(i.stem.direction), //--MP xzw不要需要了
this.discWorldPosition = null,
this.discScale = .05,
//this.poleEnabled = i.stem.enabled,
this.billboard = new o(i.label,i.description,i.media,this),
this.visibleTransition = null,
this.hoveringDisc = !1;
//xzw:
if(i.posGets)this.setPosGets(i.posGets);
this.type = i.type || "note";
}
var r = e("three")
, o = e("./Billboard/Billboard")
, a = e("../settings")
, s = e("../enum/Viewmode")
, l = e("../enum/Colors")
, c = e("../enum/RenderLayers")
, h = e("../enum/RenderOrder")
, u = (e("../util/common"),
e("../util/math"))
, d = e("../util/texture")
, p = e("../objects/Panorama")
, f = e("../shaders")
, g = e("../util/transitions")
, m = e("../util/lerp")
, v = e("../util/easing")
, A = e("./Billboard/BillboardEvent")
, y = e("events").EventEmitter
, C = e("../util/logger")
, uu = e('../util/texture')//xzw add
, I = new C(i)
, E = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg==")
, b = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC")
, w = new r.PlaneBufferGeometry(1,1);
n.prototype = Object.create(y.prototype),
n.raycaster = new r.Raycaster,
n.prototype.bindEvents = function() {
this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
}
,
n.prototype.unbindEvent = function(){ //add by xzw
this.billboard.removeListener(A.ENTER, this.setHoverState.bind(this)),
this.billboard.removeListener(A.LEAVE, this.setFreeState.bind(this))
}
,
n.prototype.remove = function(){ //add by xzw
this.unbindEvent();
this.obj3d.remove(this.disc);
this.floor.remove(this.obj3d);
this.billboard.div.parentElement.removeChild(this.billboard.div);
delete this.model.tags[this.sid];
this.tagManager.removeTag(this);
}
,
n.prototype.rePos = function(pos){ //add by xzw 重新定位置
this.position.copy(pos);
this.obj3d.position.copy(pos);
}
,
n.prototype.setPosGets = function(posGets){ //add by xzw 热点采集的两个点
if(posGets.list){
this.posGets = posGets;
return;
}
this.posGets = {list:[],length:2};
for(var i in posGets){
this.posGets[i] = new THREE.Vector3().fromArray(posGets[i]);
this.posGets.list.push(i);
}
}
n.prototype.TypeToChinese = function(){ //add by xzw
switch(this.type){
case "hotpoint": return "热点"; break;
case "photo": return "快照"; break;
case "note": return "注释"; break;
case "loading": return "加载"; break;
}
},
n.prototype.setElemType = function(type){ //add by xzw
this.type = type;
this.disc.material.uniforms.mask.value = uu.load("images/spots/tagFG-"+this.type+".png")
}
,
n.prototype.build = function() {
return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
this.floor && (this.billboard.build(this.model.sid),
this.obj3d = this.buildObject3D(),
this.floor.add(this.obj3d)),
this
}
,
n.prototype.buildObject3D = function() {//xzw
var e = new r.Object3D;
e.position.copy(this.position);
var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
t.bg.value = b,
t.mask.value = E,
t.color.value.copy(this.color),
this.materials.disc = new r.RawShaderMaterial({
transparent: !0,
vertexShader: f.tagDisc.vertexShader,
fragmentShader: f.tagDisc.fragmentShader,
uniforms: t
}),
this.disc = new r.Mesh(w,this.materials.disc),
this.disc.layers.set(c.TAG),
//this.disc.position.copy(this.discPosition),
this.disc.renderOrder = h.tagDisc,
this.disc.tag = this;
/* var i = this.buildPole(); //--MP
return i.layers.set(c.TAG),
i.renderOrder = h.tagStem,
e.add(i),
e.layers.set(c.TAG),
e.add(this.disc) */
e.add(this.disc) //去掉pole
e.name = "tagGroup";
return e
}
,
n.prototype.buildPole = function() {//没用了
var e = new r.BufferGeometry
, t = new Float32Array(6);
return t[0] = t[1] = t[2] = 0,
t[3] = this.discPosition.x,
t[4] = this.discPosition.y,
t[5] = this.discPosition.z,
e.addAttribute("position", new r.BufferAttribute(t,3)),
this.materials.pole = new r.LineBasicMaterial({
linewidth: a.tags.pole.width,
color: a.tags.pole.color,
opacity: 0,
visible: this.poleEnabled,
transparent: !0,
depthWrite: !1
}),
new r.Line(e,this.materials.pole)
}
,
n.prototype.setFreeState = function(e) {
!e && this.hoveringDisc || this.billboard.close(e).then(function() {
this.materials.disc.uniforms.color.value = this.color
}
.bind(this))
}
,
n.prototype.setHoverState = function(e) {
this.billboard.open(e),
this.materials.disc.uniforms.color.value = this.hoverColor
}
,
n.prototype.hide = function(e, t) {//xzw 热点的线pole不需要
var i = $.Deferred();
if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
return i.resolve().promise();
e = e || 0,
t = t || 0,
g.cancel(this.visibleTransition);
var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
, r = t + e
, o = t / r;
return this.visibleTransition = g.start(function(e) {
var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
// , i = m.property(e.materials.pole, "opacity", 0);
return function(n) {
t(n)
// e.materials.pole && i(n)
}
}(this), r * n, function() {
i.resolve()
}, o, v[a.warp.blendEasing]),
i.promise()
}
,
n.prototype.show = function(e, t) {
var i = $.Deferred();
if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
return i.resolve().promise();
e = e || 0,
t = t || 0,
g.cancel(this.visibleTransition);
var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
, r = t + e
, o = t / r;
return this.visibleTransition = g.start(function(e) {
var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
// , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
return function(n) {
t(n)
// e.materials.pole && i(n)
}
}(this), r * n, function() {
i.resolve()
}, o, v[a.warp.blendEasing]),
i.promise()
}
,
/* n.prototype.closestPanoTowardTag = function(e, t) {// ---MP
var i = []
, o = []
, l = this.disc.getWorldPosition();
if (e === s.PANORAMA) {
var c = .5
, h = t.position.clone().sub(l).normalize();
i.push(p.filters.isPanoAligned()),
i.push(p.filters.inPanoDirection(l, h, c)),
i.push(p.filters.isNeighbourPanoTo(t)),
o.push(p.scoreFunctions.direction(l, h))
}
var u = new r.Vector3
, d = function(e) {
u.copy(l).sub(e.position);
var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
, i = a.tags.navigate.tiltTolerance;
return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
}
, f = function(e) {
return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
};
i.push(f, d),
o.push(p.scoreFunctions.distanceSquared(this, -2));
var g = this.model.panos.sortByScore(i, o);
if (a.tags.navigate.lineOfSight) {
for (var m = 0; m < g.length; m++) {
var v = g[m].pano
, A = v.position.distanceTo(l);
if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
return null;
n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
var y = n.raycaster.intersectObjects(this.model.colliders);
if (0 === y.length || y[0].distance > A)
return v
}
return null
}
return g.length > 0 && g[0].pano
} */
n.prototype.closestPanoTowardTag = function(e, t, type) {//寻找最接近热点的pano
var i = []
, o = []
, l = this.disc.getWorldPosition();
if (e === s.PANORAMA) {
var c = .5
, h = t.position.clone().sub(l).normalize();
if(type!="force") i.push(p.filters.inPanoDirection(l, h, c)); // i.push(p.filters.isPanoAligned()),
var tag = this;
i.push(function(t){ //是否可见
return t.neighbourPanos[tag.posGets.list[0]] || t.neighbourPanos[tag.posGets.list[1]];
}) //}else i.push(p.filters.isNeighbourPanoTo(t))//!force2
o.push(p.scoreFunctions.direction(l, h))
}
var u = new r.Vector3, d = function(e){
u.copy(l).sub(e.position);
var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
, i = a.tags.navigate.tiltTolerance;
return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
}
, f = function(e) {
return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
};
i.push(f, d),//如果force要不要不push??否则会有得到null的风险,于是就在currentPano处展开,而curentPAno处可能disc不可见。
o.push(p.scoreFunctions.distanceSquared(this, -2));
var g = this.model.panos.sortByScore(i, o);//var g = this.model.panos.sortByScore(i, o);
/* if (type!= "force" && g && a.tags.navigate.lineOfSight) {
for (var m = 0; m < g.length; m++) {
var v = g[m].pano
, A = v.position.distanceTo(l);
if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
return null;
n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
var ee = this.model.floorList.reduce(function(t, e) {
return e.hidden ? t : t.concat(e.collider.children)
}, []);
var y = n.raycaster.intersectObjects(ee);
if (0 === y.length || y[0].distance > A - this.discScale*SIZE/2)//discScale
return v
}
//if(type == "force") return this.closestPanoTowardTag(e, t, "force2");
return null;
} */
return g && g.length > 0 && g[0].pano
}
,
n.prototype.getAngle = function(player, lookAt){//xzw 加 算视线方向与对准方向的夹角
var b = player.camera.quaternion.clone()
, _ = (new r.Matrix4).lookAt(player.currentPano.position, lookAt, new r.Vector3(0,1,0))
, T = (new r.Quaternion).setFromRotationMatrix(_)
,R = new r.Vector3(0,0,-1).clone().applyQuaternion(b)
, P = new r.Vector3(0,0,-1).clone().applyQuaternion(T)
, O = R.angleTo(P);
return O / Math.PI * 180;
}
n.prototype.examine = function(e,type) { //校准tag xzw
var t = e.mode
, i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
, n = this.disc.getWorldPosition();
this.billboard.setActiveState();
//xzw
e.flyingToTag = true;
var done = function(t){ t.billboard.examTimes=0; e.flyingToTag = false; }
//----end
var o = function() {
if(e.mode != "panorama"){//xzw 加
e.flyingToTag = false;
return;
}
var t = this.billboard.getDimensions()
, n = new r.Vector3;
u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
n.unproject(e.camera);
e.flyToPano({
pano: i,
lookAtPoint: n,
constantMoveSpeed: v=="constant" //匀速 xzw
},function(){ //函数xzw加的 因为有可能校准结束要再校准一次
if(this.billboard.ifOutOfScreen()){
this.billboard.state = "open";//为了防止有的billboard在飞过去后靠边被遮住
setTimeout(function(){
if(this.billboard.ifOutOfScreen()){
if(this.billboard.examTimes > 2){
console.log("exam>2次仍未校准,已放弃"); done(this); return;
}
o("constant");
this.billboard.examTimes++;
}else done(this);
}.bind(this),60)
}else done(this)
}.bind(this))
}.bind(this);
if (t === s.PANORAMA)
if (i !== e.currentPano || (type === "force"&& this.getAngle(e, n)>60) ) {//在click List时 转动较大的话 会不准确 可能因计算billboard位置不准确
var l = {
pano: i,
lookAtPoint: n,
duration: null,
maxDistanceOverride: null,
skipWarpingCheck: !1,
force : type == "force"//xzw
};
e.flyToPano(l, o)
} else
setTimeout(function() {
//this.billboard.open().then(function() { // ----MP 其实可以去掉 有了反而不准
o()
//})
}
.bind(this), 300);//原先是0
else {
var c = {
pano: i
};
if (n) {
var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
}
c.callback = o,
c.duration = 1500,
c.mode = s.PANORAMA,
e.flyToNewMode(c)//xzw
}
}
,
n.prototype.update = function(e, t) {
var i = new r.Vector3;
return function(e, t) {
this.discWorldPosition = this.disc.getWorldPosition(),
this.updateDisc(e, t);
/* this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t), ------MP
i.z < 1 && (i.y *= -1,
this.billboard.update(i, this.getDiscRadius(i, t)))) */
if(this.billboard.needsUpdate()){//xzw
i.copy(this.discWorldPosition).project(t);
if(i.z < 1 || this.updateBoardOrient){
i.y *= -1;
this.updateBoardOrient = false; //由点击列表而exam,更新orientation
this.billboard.div.style.opacity = "1";//由点击列表而exam, 未达到可见位置不出现 通常在左上方?
this.billboard.update(i, this.getDiscRadius(i, t))
}else{
this.billboard.div.style.opacity = "0";
}
}
}
}(),
n.prototype.updateDisc = function(e, t) {
var i = new r.Vector3
, o = new r.Vector3
, l = new r.Vector3
, c = new r.Vector3
, h = new r.Vector3;
return function(e, t) {
var u = a.tags.visibility
, d = a.tags.disc.scale
, p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
this.obj3d.visible) {
this.disc.quaternion.copy(t.quaternion);
var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
i.copy(this.discWorldPosition).project(t),
o.set($('#player').width()/2 , $('#player').height()/2, 1).multiply(i),
l.set(f / 2, 0, 0).add(o),
c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
h.copy(c).unproject(t);
var g = h.distanceTo(this.discWorldPosition)
, m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
this.discScale = g * m,
this.disc.scale.set(this.discScale, this.discScale, this.discScale)
}
}
}(),
n.prototype.getDiscRadius = function(e, t) {
var i = new r.Vector3;
return function(e, t) {
return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
Math.abs(e.x - i.x) * $('#player').width()
}
}(),
n.prototype.tagVisibleOnCurrentFloor = function(e) {
return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
}
,
n.prototype.offScreen = function(e, t) {
var i = e.getWorldPosition().project(t);
return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
}
,
n.viewportScale = function() {
return n.viewportWidth === $('#player').width() && n.viewportHeight === $('#player').height() || (n.viewportWidth = $('#player').width(),
n.viewportHeight = $('#player').height(),
n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
n.currentViewportScale
}
,
t.exports = n
}
).call(this, "/js/tag/tag.js")
}
, {
"../enum/Colors": 19,
"../enum/RenderLayers": 41,
"../enum/RenderOrder": 42,
"../enum/Viewmode": 51,
"../objects/Panorama": 148,
"../settings": 166,
"../shaders": 167,
"../util/common": 185,
"../util/easing": 186,
"../util/lerp": 188,
"../util/logger": 189,
"../util/math": 190,
"../util/texture": 194,
"../util/transitions": 195,
"./Billboard/Billboard": 119,
"./Billboard/BillboardEvent": 120,
"../util/texture" :194,
events: 202,
three: 217
}],
124: [function(e, t, i) {///js/tag/tagManager.js
(function(i) {
"use strict";
function n() {
this.tagState = y.IDLE,
this.intersectTag = null,
this.hoveredTag = null,
this.activeTag = null,
this.tagDiscs = [],
this.raycaster = new r.Raycaster,
this.modelManager = null,
this.player = null,
this.totaltags = 0,
this.navigatingViaTag = !1
// this.enabled = !1
}
var r = e("three")
, o = e("../util/logger")
, a = e("../util/common")
, s = e("../controls/serializer")
, l = e("../objects/Snapshot")
, c = e("../settings")
, h = e("./Billboard/BillboardEvent")
, u = e("./Media/MediaEvent")
, d = e("./Media/LinkType")
, p = e("../enum/Viewmode")
, f = e("../enum/WarpStyle")
, g = e("../enum/BlackoutStyle")
, m = e("../enum/ModelManagerEvents")
, v = e("../enum/tagEvents")
, A = e("../enum/PlayerEvents")
, y = (e("../util/lerp"),
e("../enum/TagStates"))
, C = e("events").EventEmitter
, I = new o(i);
a.extend(n, C),
n.prototype.init = function(e, t) {
this.modelManager = e,
this.player = t,
this.updateModel(),
this.bindEvents()
}
,
n.prototype.update = function(e) {
this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
}
,
n.prototype.updateTags = function(e, t, i, n) {
for (var r in this.model.tags)
this.model.tags[r].update(e, t, i, n)
}
,
n.prototype.updateVisible = function(mode, pano){ //xzw加 根据visibles数据更新热点显示
if(!(this.player || this.player.model)) return;
var tags = this.player.model.tags;
pano = pano || this.player.currentPano;
for (var r in tags){
var visible;
if(mode!="panorama"){
visible = true;
tags[r].disc.material.depthTest = true; //要被遮挡?
}else{
tags[r].disc.material.depthTest = false;
visible = tags[r].state != "rebuildHide" && (pano.neighbourPanos[tags[r].posGets.list[0]] || pano.neighbourPanos[tags[r].posGets.list[1]])
}
tags[r].disc.visible = visible;
}
}
,
/* n.prototype.updateModel = function() {//---MP
this.model = this.modelManager.getActiveModel(),
this.gettagsFromModel(),
this.totaltags = Object.keys(this.model.tags).length
}
,
n.prototype.gettagsFromModel = function() {
this.tagDiscs = [];
for (var e in this.model.tags) {
var t = this.model.tags[e].disc;
t && this.tagDiscs.push(t)
}
}
, */
//xzw: 获取tag的disc 因为编辑页面要一个个添加、一个个删除 所以改
n.prototype.updateModel = function() {
this.model = this.modelManager.getActiveModel(),
this.tagDiscs = [];
this.totaltags = 0;
for (var e in this.model.tags) {
this.getTag(this.model.tags[e])
}
}
,
n.prototype.getTag = function(tag) {
this.tagDiscs.push(tag.disc);
this.totaltags ++;
tag.tagManager = this;
}
,
n.prototype.removeTag = function(tag) {
var i = this.tagDiscs.indexOf(tag.disc);
if(i>-1){
this.tagDiscs.splice(i,1);
this.totaltags --;
}
}
////xzw----end
n.prototype.bindEvents = function() {
function e() {
Object.keys(this.model.tags).forEach(function(e) {
var t = this.model.tags[e];
t.bindEvents(),
t.billboard.on(u.LINK_CLICK, function(e) {
e.type === d.NAVIGATION && this.navigateViaLink(e.url)
}
.bind(this)),
t.billboard.on(u.IMAGE_OPENED, function() {
this.tagState = y.EXAMINE,
this.emit(u.IMAGE_OPENED)
}
.bind(this)),
t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
}
.bind(this))
}
this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
this.player.on(A.Ready, this.onPlayerReady.bind(this)),
this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
e.call(this)
}
,
n.prototype.navigateViaLink = function(e) {
var t = s.deserialize(e);
if (t)
if (t.mode === p.PANORAMA) {
try {
this.player.model.panos.get(t.panoId)
} catch (e) {
return void I.warn("Unable to find panorama location", t.panoId)
}
this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
} else {
var i = {
cameraMode: t.mode,
position: t.position,
quaternion: t.quaternion,
scanId: t.panoId,
orthoZoom: t.zoom,
floorVisibility: t.floorVisibility,
thumbUrl: null,
name: null
};
this.player.flyToNewMode({
mode: t.mode,
duration: c.warp.outsideTime,
warpDest: new l(i),
force: !0
})
}
}
,
n.prototype.handleWarpStart = function(e, t, i, n) {
this.dismissExaminedTag(),
t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
e && (i = g.END),
this.hideShowTagsForBlackoutStyle(i, n))
}
,
n.prototype.handleWarpInterruption = function(e, t, i) {
null !== i && void 0 !== i || (i = c.warp.teleportTime),
this.hideShowTagsForBlackoutStyle(t, i)
}
,
n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
var i = 0
, n = 0
, r = t / 2;
switch (null !== e && void 0 !== e || (e = g.MIDDLE),
e) {
case g.END:
this.hideAlltags(r);
break;
case g.BEGINNING:
this.hideAlltags().done(this.showAlltags.bind(this, r));
break;
case g.NONE:
break;
case g.MIDDLE:
i = r,
n = r,
this.hideAlltags(n),
setTimeout(function() {
this.showAlltags(i)
}
.bind(this), n);
break;
case g.FADEIN:
setTimeout(function() {
this.showAlltags(r)
}
.bind(this), r)
}
}
,
n.prototype.onPlayerModeChanging = function(e, t) {
t !== p.PANORAMA && this.dismissExaminedTag(),
t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
var i = t !== p.OUTDOOR;
i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
}
,
n.prototype.onPanoChange = function(e, t) {
var i = this.navigatingViaTag;
if (this.navigatingViaTag = !1,
!i) {
//this.dismissExaminedTag(); //xzw删 否则会导致热点加上打开又被关闭
var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
, r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
}
}
,
n.prototype.onPlayerReady = function(e, t, i) {
this.startAlltags(e, t ? i : null)
}
,
n.prototype.onPlayerFlyingEnded = function(e, t) {
this.updateClosestTags(e)
}
,
n.prototype.dismissExaminedTag = function() {
this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
this.hoveredTag && (this.hoveredTag.setFreeState(!0),
this.hoveredTag = null)
}
,
n.prototype.startAlltags = function(e, t) {
this.model.shouldShowtags = c.tags.enabled,
this.enabled = !0,
e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
t && setTimeout(function() {
this.activateTag(this.model.getTagBySid(t))
}
.bind(this), c.tags.startup.fadeInDuration / 2))
}
,
n.prototype.showAlltags = function(e, t, i) {
function n() {
o++,
o === this.totaltags && (this.model.tagsShown = !0,
r.resolve())
}
var r = $.Deferred();
if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
return r.resolve().promise();
var o = 0;
for (var a in this.model.tags) {
var s = this.model.tags[a];
s.show(e, t).done(n.bind(this))
}
return r.promise()
}
,
n.prototype.hideAlltags = function(e, t) {
function i() {
r++,
r === this.totaltags && (this.model.tagsShown = !1,
n.resolve())
}
var n = $.Deferred()
, r = 0;
for (var o in this.model.tags) {
var a = this.model.tags[o];
a.hide(e, t).done(i.bind(this)),
a === this.activeTag && this.dismissActiveTag()
}
return n.promise()
}
,
n.prototype.enableHovering = function() {
this.enabled = !0
}
,
n.prototype.disableHovering = function() {
this.enabled = !1
}
,
n.prototype.activateTag = function(e, t) {
t = t || y.EXAMINE,
this.activeTag = e,
this.activeTag.hoveringDisc = !0,
this.activeTag.setHoverState(t === y.EXAMINE),
this.tagState = t,
this.emit(v.TagActivated, e)
}
,
n.prototype.dismissActiveTag = function() {
this.activeTag.hoveringDisc = !1,
this.activeTag.setFreeState(!0);
var e = this.activeTag;
this.activeTag = null,
this.tagState = y.IDLE,
this.emit(v.TagDismissed, e)
}
,
n.prototype.clickedOnTag = function(e) {
//xzw 打开热点列表
if(this.player.markspot || this.player.startGetPos) return;
var canOpen = this.player.editor.openList(this.intersectTag.listElem)
if(!canOpen && (this.intersectTag!=this.player.chosenSpot || this.intersectTag.billboard.label == "")){ //在无法关闭当前列表时点击其他热点
return;
}
this.player.editor.openPanel(0);
//end
var t = function() {
this.navigatingViaTag = !0,
this.activeTag.examine(this.player),
this.emit(v.TagNavigation, this.activeTag)
}
.bind(this);
return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
this.activeTag = this.intersectTag,
t(),
!0) : (this.dismissActiveTag(),
!1)
}
,
n.prototype.intersecttag = function() {//对应旧的findIntersectTag
var e = new r.Vector3
, t = new r.Vector3
, i = new r.Vector3;
return function(n, r, o) {
/* if (!this.enabled) //xzw 没必要
return null; */
var a = null
, s = this.tagDiscs.filter(function(e) {
return e.parent.visible
});
if (s.length > 0) {
/* var l = this.model.floors.reduce(function(e, t) {
return t.hidden ? e : e.concat(t.collider.children)
}, s); */
//xzw: 热点即使被墙挡住,只要显示就要能被hover
var l;
if(this.player.mode != "panorama") l = this.model.floors.reduce(function(e, t) {
return t.hidden ? e : e.concat(t.collider.children)
}, s);
else l = s;
e.set(n.x, n.y, -1).unproject(o),
t.set(n.x, n.y, 1).unproject(o),
i.copy(t).sub(e).normalize(),
this.raycaster.set(e, i);
var c = this.raycaster.intersectObjects(l);
c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
}
return this.intersectTag = a,
r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
this.hoveredTag = a
}
.bind(this)),
a.billboard.on(h.LEAVE, function() {
this.hoveredTag = null
}
.bind(this))),
this.activateTag(a, y.BROWSE))),
a
}
}(),
n.prototype.rankedtagInDirection = function() {
var e = []
, t = []
, i = new r.Vector3
, n = new r.Vector3
, o = new r.Vector3;
return function(r, a, s, l) {
var c = 0;
t.length = 0;
for (var h = 0; h < this.closesttags.length; h++) {
var u = this.closesttags[h];
n.copy(u.position),
n.add(u.discPosition),
i.copy(a),
i.sub(n).negate(),
i.normalize();
var d = i.dot(l);
if (d >= 0) {
o.copy(n),
o.project(s);
var p = this.intersecttag(o, !1, s);
if (p) {
if (c >= e.length)
for (var f = 0; f < 64; f++)
e.push({
tag: u,
dot: d
});
var g = e[c];
g.tag = u,
g.dot = d,
g.position = math.projectPositionToCanvas(n, s),
t.push(g),
c++
}
}
}
return t.sort(function(e, t) {
return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
}),
r < t.length ? t[r].tag : null
}
}(),
n.prototype.updateClosestTags = function() {
var e = new r.Vector3
, t = 30;
return function(i) {
this.closesttags || (this.closesttags = []),
this.closesttags.length = 0;
var n = this.model.tags;
if (n)
for (var r in n)
if (n.hasOwnProperty(r)) {
var o = n[r]
, a = o.position;
e.copy(i),
e.sub(a).negate();
var s = e.lengthSq();
s < t && this.closesttags.push(o)
}
}
}(),
t.exports = n
}
).call(this, "/js/tag/tagManager.js")
}
, {
"../controls/serializer": 14,
"../enum/BlackoutStyle": 18,
"../enum/tagEvents": 32,
"../enum/ModelManagerEvents": 33,
"../enum/PlayerEvents": 40,
"../enum/TagStates": 44,
"../enum/Viewmode": 51,
"../enum/WarpStyle": 52,
"../objects/Snapshot": 153,
"../settings": 166,
"../util/common": 185,
"../util/lerp": 188,
"../util/logger": 189,
"./Billboard/BillboardEvent": 120,
"./Media/LinkType": 130,
"./Media/MediaEvent": 131,
events: 202,
three: 217
}],
125: [function(e, t, i) {///js/tag/Media/EmbedlyEmbed.js
(function(i) {
"use strict";
function n() {
this.embedWrapper = null,
this.embedElement = null
}
var r = e("../../util/ajax")
, o = e("./mediaSettings")
, a = e("../../settings")
, s = e("../../util/logger")
, l = new s(i);
n.prototype.createDomElement = function() {
return this.embedWrapper = document.createElement("div"),
this.embedWrapper.classList.add("tag-embed"),
this.embedWrapper.classList.add("hidden"),
this.embedWrapper
}
,
n.prototype.load = function(e) {
var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
return new Promise(function(e, i) {
r.get(t).then(function(t) {
if (t = JSON.parse(t),
t.html && t.html.indexOf("