"), b.append(c), c.css({
position: "absolute",
top: rand100 + "px",
color: "#A31475"
}), w.doorStas = 8)
});
this.onResize = function(b, f) {
p = b;
n = f;
k.css({
width: b + "px",
height: f + "px"
});
m.css({
width: b + "px",
height: f + "px"
});
if (3 == browserType) {
q(b, f, e);
var g = Math.floor(parseInt( - e) / 90);
0 > g && (g += 4);
var h = 0;
0 == g % 2 && (h = 1);
var x = c,
s = d;
1 < g && (g = x, x = s, s = g);
l.css({
filter: "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + h + ", EndColorStr=" + s + ", StartColorStr=" + x + ");",
"background-image": "-ms-linear-gradient(" + e + "deg, " + c + ", " + d + ")",
width: b + "px",
height: f + "px"
})
} else l.css({
width: b + "px",
height: f + "px"
});
c === d && (h = Math.min(windowWidth, windowHeight), x = colorSplit(c), x = x.r + "," + x.g + "," + x.b, l.css({
"background-image": "-webkit-gradient(radial,50% 50%," + h / 4 + ",50% 50%," + h + ",from(rgba(" + x + ",0.4)),to(rgba(" + x + ",1)))",
"background-color": "rgba(" + x + " , 0)"
}))
}
},
buttonType = {
caption_button: 0,
icon_button: 1,
double_button: 2
},
buttonAlign = {
icon_left: 0,
icon_top: 1,
icon_right: 2,
icon_bottom: 3
},
button = Class({
create: function(b, c) {
this.caption = c.caption ? c.caption: "";
this.iconURL = c.iconURL ? c.iconURL: "";
this.mainColor = c.mainColor ? c.mainColor: "";
this.width = c.width ? c.width: 40;
this.height = c.height ? c.height: 40;
this.needResize = c.needResize ? c.needResize: !1;
this.asImgButton = c.asImgButton ? c.asImgButton: !1;
this.buttonType = c.buttonType ? c.buttonType: 1;
this.config = c;
this.father = b;
this.background = $("");
this.iconBox = $("");
$(b).append(this.background);
$(this.background).asButton();
this.background.css({
position: "absolute",
width: this.width + "px",
height: this.height + "px",
"-webkit-border-radius": "2px",
"-moz-border-radius": "2px",
"border-radius": "2px",
cursor: "pointer"
});
void 0 != this.config.mainColor && (this.mainColor = this.config.mainColor, this.background.css({
"background-color": this.config.mainColor
}));
this.buttonType != buttonType.icon_button && (this.caption = this.config.caption, this.captionBox = new label(this.caption, this.background), this.setPosition());
this.buttonType != buttonType.caption_button && (this.iconBox.attr("src", this.iconURL), this.asImgButton && $(this.iconBox).asImageButton(), $(this.background).append(this.iconBox), this.iconBox.load(function() {
this.setPosition()
}.bind(this)))
},
setPosition: function() {
if (this.buttonType == buttonType.double_button) {
var b = this.captionBox.getWidth(),
c = this.captionBox.getHeight(),
d = this.iconBox.width(),
e = this.iconBox.height();
switch (this.config.align) {
case buttonAlign.icon_left:
this.width = b + d + 12;
this.height = Math.max(e, c) + 6;
$(this.iconBox).css({
top: (this.height - e) / 2 + "px",
left: "4px"
});
this.captionBox.setLabelPosition((this.height - c) / 2, 4, ["top", "right"]);
break;
case buttonAlign.icon_top:
this.width = Math.max(d, b) + 6;
this.height = c + e + 8;
this.iconBox.css({
top: "2px",
left: (this.width - d) / 2 + "px"
});
this.captionBox.setLabelPosition((this.width - b) / 2, 2, ["left", "bottom"]);
break;
case buttonAlign.icon_right:
this.width = b + d + 12;
this.height = Math.max(e, c) + 6;
$(this.iconBox).css({
top: (this.height - e) / 2 + "px",
right: "4px"
});
this.captionBox.setLabelPosition((this.height - c) / 2, 4, ["top", "left"]);
break;
case buttonAlign.icon_bottom:
this.width = Math.max(d, b) + 6,
this.height = c + e + 8,
$(this.iconBox).css({
bottom: "2px",
left: (this.width - d) / 2 + "px"
}),
this.captionBox.setLabelPosition(2, (this.width - b) / 2, ["top", "left"])
}
} else this.buttonType == buttonType.caption_button ? (this.width = this.captionBox.getWidth() + 10, this.height = this.captionBox.getHeight() + 10, this.captionBox.setLabelPosition(5, 2)) : this.buttonType == buttonType.icon_button && this.iconBox.load(function() {
this.width = $(this.iconBox).width();
this.height = $(this.iconBox).height()
}.bind(this));
$(this.background).css({
width: this.width,
height: this.height + "px"
})
},
resize: function(b, c) {
this.onResize(b, c)
},
onResize: function(b, c) {
this.width = b;
this.height = c;
$(this.background).css({
width: b + "px",
height: c + "px"
})
},
getWidth: function() {
return this.width
},
getHeight: function() {
return this.height
},
setCSS: function(b) {
$(this.background).css(b)
},
setButtonPosition: function(b, c, d) {
void 0 == d && (d = ["left", "top"]);
this.background.css(d[0], b + "px");
this.background.css(d[1], c + "px")
},
setVisible: function(b) {
$(this.background).css({
display: b ? "block": "none"
})
},
changeIcon: function(b) {
this.iconURL = b;
$(this.iconBox).attr("src", this.iconURL); ! 0 == this.iconBox[0].colorChanged && (this.iconBox[0].colorChanged = !1);
this.setPosition()
},
changeCaption: function(b) {
this.captionBox.setCaption(b);
this.setPosition()
},
getCaptionWidth: function(b) {
return this.captionBox.getWidth()
},
setIconPosition: function(b, c) {
this.iconBox.css({
left: b + "px",
top: c + "px"
})
},
setColor: function(b) {
this.mainColor = b;
$(this.iconBox).changeButtonColor(b);
this.buttonType != buttonType.icon_button && (this.captionBox.setFont("12px", b, "Tahoma"), $(this.background).css({
"text-shadow": "1px 1px #666666"
}))
},
onMouseDown: function(b, c) {
this.background.bind(_event._down,
function(d) {
c.call(b, d);
return ! 1
})
},
onMouseUp: function(b, c) {
3 == browserType ? this.background.bind("click",
function(d) {
c.call(b, d);
return ! 1
}) : this.background.bind(_event._end,
function(d) {
c.call(b);
return ! 1
})
},
onMouseOver: function(b, c) {
this.background.bind(_event._move,
function(d) {
c.call(b);
return ! 1
})
},
mouseEnterShine: function(b, c) {
this.background.mouseEnterShine(b, c)
},
mouseEnterJump: function() {
this.background.mouseEnterJump()
},
mouseEnterLight: function(b) {
this.background.css({
"border-radius": "5px"
});
this.background.bind(_event._enter,
function(c) {
$(this).css({
background: b
})
});
this.background.bind(_event._leave,
function(b) {
$(this).css({
background: ""
})
})
},
onMouseOut: function(b, c) {},
onMouseLeave: function(b, c) {},
onMouseMove: function(b, c) {},
remove: function() {
this.background.remove()
}
});
eval(function(b, c, d, e, f, g) {
f = function(b) {
return (b < c ? "": f(parseInt(b / c))) + (35 < (b %= c) ? String.fromCharCode(b + 29) : b.toString(36))
};
if (!"".replace(/^/, String)) {
for (; d--;) g[f(d)] = e[d] || f(d);
e = [function(b) {
return g[b]
}];
f = function() {
return "\\w+"
};
d = 1
}
for (; d--;) e[d] && (b = b.replace(RegExp("\\b" + f(d) + "\\b", "g"), e[d]));
return b
} ("3 1;3 N=7(){3 a=u;1=$(\"<8>8>\");1.4({B:'X',U:'T',h:'9','Q-o':'#D','A':0.5,'z-s':10,'-r-k-j':'f','-t-k-j':'f','k-j':'f'});3 b=$(\"\");b.4({h:'9',g:'w',i:'f'});3 c=$(\"<8>8>\");c.4({h:'9',g:'x',i:'y'});3 d=$(\"\"+C+\"\");3 e=$(\"\"+a+\"\");e.4({h:'9',g:'H',i:'I'});d.4({'q-J':'K',o:'#L'});M.6(1);1.6(c);c.6(d);c.6(e);$.O.P(1,{n:7(){1.4({g:(R-S)/2+'p',i:(V-W)/2+'p'})},m:7(){b.Y(7(){1.6(b)});b.Z({11:12+'13.14'})}});1.m();1.n()};", 62, 67, " demoBar var css append function div absolute 5px top position left radius border span loadImg setDemoPosition color px font moz index webkit homePage img 10px 13px 65px opacity width productName cccccc href target _blank 25px 0px size 15px 333333 tmpContainer initDemoBar fn extend background windowHeight 70 70px height windowWidth 305 305px load attr src uiBaseURL demo png".split(" "), 0, {}));
bdor[66] = "ipht";
var LeftRightButton = Class({
create: function(b) {
this.leftBotton = $("");
this.leftBottonIcon = $(getImage(toolBarIconsURL[17]));
this.leftBotton.append(this.leftBottonIcon);
this.rightBotton = $("");
this.rightBottonIcon = $(getImage(toolBarIconsURL[19]));
this.rightBotton.append(this.rightBottonIcon);
this.firstButton = $("").append($(""));
this.lastButton = $("").append($(""));
b.append(this.leftBotton);
b.append(this.rightBotton);
b.append(this.firstButton);
b.append(this.lastButton);
this.showing = !0;
this.init(this.leftBottonIcon.outerWidth(), this.leftBottonIcon.outerHeight());
this.initEvents()
},
init: function(b, c) {
this.width = b;
this.height = c;
this.spacing = 20;
this.otherLeft = toolBar.setLeftButton ? toolBar.setLeftButton() : 0;
this.otherRight = toolBar.setRightButton ? toolBar.setRightButton() : 0;
toolBar.bookSides && toolBar.bookSides() ? (this.left = (windowWidth - BookInfo.width - this.otherLeft - this.otherRight) / 2 - this.width - this.spacing + this.otherLeft, this.right = (windowWidth - BookInfo.width - this.otherLeft - this.otherRight) / 2 - this.width - this.spacing + this.otherRight) : (this.left = this.otherLeft, this.right = this.otherRight);
this.left = this.left >= this.otherLeft ? this.left: this.otherLeft;
this.right = this.right >= this.otherRight ? this.right: this.otherRight;
this.top = (BookInfo.height() - this.height) / 2 + BookInfo.top();
this.minBottom = windowHeight - BookInfo.top() - BookInfo.height();
this.leftBotton.css({
position: "absolute",
cursor: "pointer",
width: this.width,
height: this.height,
left: this.left,
right: "auto",
top: this.top,
zIndex: 10
});
this.firstButton.css({
position: "absolute",
cursor: "pointer",
zIndex: 101,
opacity: 0.2,
left: this.left + (this.width - 16) / 2,
right: "auto",
top: "auto",
bottom: this.minBottom,
zIndex: 10
});
this.rightBotton.css({
position: "absolute",
cursor: "pointer",
width: this.width,
height: this.height,
left: "auto",
right: this.right,
top: this.top,
zIndex: 10
});
this.lastButton.css({
position: "absolute",
cursor: "pointer",
zIndex: 101,
opacity: 0.2,
left: "auto",
right: this.right + (this.width - 16) / 2,
top: "auto",
bottom: this.minBottom,
zIndex: 10
})
},
initEvents: function() {
this.leftBottonIcon.asImageButton();
this.rightBottonIcon.asImageButton();
this.leftBotton.bind(_event._click,
function() {
rightToLeft ? nextPageFun() : previousPageFun();
return ! 1
});
this.firstButton.bind(_event._click,
function() {
rightToLeft ? lastPageFun() : firstPageFun();
return ! 1
});
this.rightBotton.bind(_event._click,
function() {
rightToLeft ? previousPageFun() : nextPageFun();
return ! 1
});
this.lastButton.bind(_event._click,
function() {
rightToLeft ? firstPageFun() : lastPageFun();
return ! 1
});
this.firstButton.bind(_event._enter,
function() {
$(this).css({
opacity: "1",
cursor: "pointer"
});
$(this).scale(2)
});
this.firstButton.bind(_event._leave,
function() {
$(this).css({
opacity: "0.2"
});
$(this).scale(1)
});
this.firstButton.bind(_event._end,
function() {
$(this).css({
opacity: "0.2"
});
$(this).scale(1)
});
this.lastButton.bind(_event._enter,
function() {
$(this).css({
opacity: "1",
cursor: "pointer"
});
$(this).scale(2)
});
this.lastButton.bind(_event._leave,
function() {
$(this).css({
opacity: "0.2"
});
$(this).scale(1)
});
this.lastButton.bind(_event._end,
function() {
$(this).css({
opacity: "0.2"
});
$(this).scale(1)
});
this.setPosition()
},
setPosition: function() {
toolBar.setLeftRightVisible && this.setVisible(toolBar.setLeftRightVisible());
toolBar.bookSides && toolBar.bookSides() ? (this.left = (windowWidth - BookInfo.width - this.otherLeft - this.otherRight) / 2 - this.width - this.spacing + this.otherLeft, this.right = (windowWidth - BookInfo.width - this.otherLeft - this.otherRight) / 2 - this.width - this.spacing + this.otherRight) : (this.left = this.otherLeft, this.right = this.otherRight);
this.left = this.left >= this.otherLeft ? this.left: this.otherLeft;
this.right = this.right >= this.otherRight ? this.right: this.otherRight;
this.top = (BookInfo.height() - this.height) / 2 + BookInfo.top();
this.minBottom = windowHeight - BookInfo.top() - BookInfo.height();
this.leftBotton.css({
left: this.left,
right: "auto",
top: this.top
});
this.firstButton.css({
left: this.left + (this.width - 16) / 2,
right: "auto",
top: "auto",
bottom: this.minBottom,
opacity: 0.2
});
this.rightBotton.css({
left: "auto",
right: this.right,
top: this.top
});
this.lastButton.css({
left: "auto",
right: this.right + (this.width - 16) / 2,
top: "auto",
bottom: this.minBottom,
opacity: 0.2
})
},
show: function() {
this.leftBotton.animate({
left: this.left
},
500);
this.firstButton.animate({
left: this.left + (this.width - 16) / 2
},
500);
this.rightBotton.animate({
right: this.right
},
500);
this.lastButton.animate({
right: this.right + (this.width - 16) / 2
},
500)
},
setShow: function(b) {
this.showing = b; ! 0 == b ? (this.leftBotton.css({
display: "block"
}), this.firstButton.css({
display: "block"
}), this.rightBotton.css({
display: "block"
}), this.lastButton.css({
display: "block"
})) : (this.leftBotton.css({
display: "none"
}), this.firstButton.css({
display: "none"
}), this.rightBotton.css({
display: "none"
}), this.lastButton.css({
display: "none"
}))
},
setVisible: function(b) { ! 0 == b ? (this.leftBotton.css({
display: "block"
}), this.firstButton.css({
display: "block"
}), this.rightBotton.css({
display: "block"
}), this.lastButton.css({
display: "block"
})) : (this.leftBotton.css({
display: "none"
}), this.firstButton.css({
display: "none"
}), this.rightBotton.css({
display: "none"
}), this.lastButton.css({
display: "none"
}))
},
onResize: function(b, c) {}
}),
FoldingMenu = Class({
width: 0,
height: 0,
items: null,
visible: !1,
create: function(b) {
this.home = b;
this.width = Math.min(b.width() - 65, 340);
this.height = b.height();
this.items = [];
this.mainColor = bookConfig.toolbarColor;
this.menu = $("");
this.menu.insertBefore(this.home);
this.initStyle()
},
initStyle: function() {
this.menu.css({
position: "absolute",
left: -this.width + "px",
top: "0px",
width: this.width + "px",
height: this.height + "px",
"background-color": colorDiv(this.mainColor, 20),
overflow: "hidden"
})
},
show: function(b) {
b || (b = 400);
this.animate(b);
this.visible = !0
},
hide: function() {
this.animate(0);
this.visible = !1
},
animate_bak: function(b, c) {
var d = 0,
e = b,
f = (c - b) / 10,
g = Date.now(),
h = function() {
this.width = e += f;
this.menu.css("width", e + "px"); ! 0 === $.browser.msie && 9 > $.browser.version ? this.home.css("left", e + "px") : this.home.transform(e, 0);
if (10 > ++d) {
var b = Date.now(),
c = Math.max(1, 25 - (b - g));
g = b;
h.delay(this, c)
}
};
h.delay(this, 25)
},
animate: function(b) {
this.animating = !0;
animateOnce(this.menu, cssTranslate(this.menu, b, 0), 0.2,
function() {
this.animating = !1
}.bind(this));
animateOnce(this.home, cssTranslate(this.home, b, 0), 0.2,
function() {
this.animating = !1
}.bind(this))
},
showOrHide: function(b) { ! 0 === this.visible ? this.hide() : this.show(b)
},
addMenuItem: function(b, c, d, e, f) {
b = new FoldingMenuItem(this.menu, b, e);
b.setCaption(c ? c: "");
b.setIcon(d ? d: "");
b.title.bind(_event._end,
function(b) {
if (b && (!0 !== this.animating || 3 == browserType)) {
if (void 0 !== f) f();
else {
var c = b.currentTarget ? b.currentTarget.id: "";
"" !== c && (this.getItemById(c).isExpanded() ? this.collapseItem(c) : this.expandItem(c))
}
return stopEvent(b)
}
}.bind(this));
this.items.push(b)
},
addLogoItem: function(b, c, d) {
b = new FoldingMenuItem(this.menu, b, !0, !0);
b.setCaption("");
b.setIcon(c ? c: "");
b.title.bind(_event._end,
function(b) {
if (b && (!0 !== this.animating || 3 == browserType)) return d && window.open(d[0], d[1]),
stopEvent(b)
}.bind(this));
this.items.push(b)
},
setTitleStyle: function(b) {
for (var c = 0; c < this.items.length; c++) this.items[c].title().css(b)
},
resize: function(b, c) {
this.width = Math.min(b - 65, 340);
this.height = c;
this.menu.css({
left: -this.width + "px",
width: this.width + "px",
height: this.height + "px"
});
3 == browserType && (this.menu.getOrigin = !1);
this.menu.css(cssTranslate(this.menu, 0, 0));
this.home.css(cssTranslate(this.home, 0, 0));
for (var d = 0; d < this.items.length; d++) {
var e = this.items[d];
e.isExpanded() && e.resize(this.height)
}
},
getItemById: function(b) {
for (var c = 0; c < this.items.length; c++) if (this.items[c].id === b) return this.items[c]
},
getItemBody: function(b) {
return this.getItemById(b).body
},
expandItem: function(b) {
void 0 != this.currentItem && void 0 != this.currentItem.id && b !== this.currentItem.id && this.collapseItem(this.currentItem.id);
this.expandId(b)
},
expandId: function(b) {
for (var c = 0; c < this.items.length; c++) {
var d = this.items[c];
this.items[c].id === b ? (d.expand(this.height), this.currentItem = this.items[c]) : d.container.css({
height: "0px"
})
}
},
getExpandHeight_bak: function(b) {
for (var c = 0,
d = 0,
e = d = 0; e < this.items.length; e++) if (d = this.items[e].title.height(), c += d, d = e == this.items.length - 1 ? d: 0, e === b) return this.height - c + d
},
collapseItem: function(b) {
for (var c = 0; c < this.items.length; c++) {
var d = this.items[c];
d.id === b ? this.items[c].collapse() : d.container.css({
height: d.title.height() + "px"
})
}
}
}),
FoldingMenuItem = Class({
expanded: !1,
create: function(b, c, d, e) {
this.id = c;
this.noExpand = d;
this.isLogo = e;
this.container = $("");
this.title = $("");
this.body = $("");
this.mainColor = colorDiv(bookConfig.toolbarColor, 20);
b.append(this.container);
this.container.append(this.title);
this.container.append(this.body);
this.initStyle()
},
initStyle: function() {
this.container.css({
position: "relative",
width: "100%"
});
this.body.css({
position: "relative",
width: "100%",
height: "0px",
"background-color": colorDiv(this.mainColor, 10)
});
this.title.css({
"background-color": this.mainColor,
"border-bottom": "1px solid " + colorDiv(this.mainColor, 10),
"border-top": "1px solid " + colorAdd(this.mainColor, 10)
});
setAnimation(this.container, 0.2);
setAnimation(this.body, 0.2);
this.initTitle()
},
initTitle: function() {
this.title.addClass("menuTitle");
this.titleState = $("");
this.titleState.cssSprite(phoneIconsURL[0], "collapsed", 24, 24, phoneIconInfo);
this.titleIcon = !0 === this.isLogo ? $("") : $("");
this.titleCaption = $("");
this.title.append(this.titleIcon);
this.title.append(this.titleCaption); ! 0 !== this.noExpand && this.title.append(this.titleState)
},
setIcon: function(b) {
if ("" === b) this.titleIcon.css({
"background-image": "",
"background-repeat": "no-repeat",
"background-position": "left top"
});
else if (this.isLogo) this.titleIcon.append("");
else {
this.titleIcon.css({
background: colorAdd(this.mainColor, 40)
});
var c = $("");
c.cssSprite(phoneIconsURL[0], b, 20, 20, phoneIconInfo);
this.titleIcon.append(c)
}
},
setCaption: function(b) {
this.titleCaption.text(b)
},
expand: function(b) { ! 1 === this.expanded && (this.expanded = !0, this.titleState.cssSprite(phoneIconsURL[0], "expanded", 24, 24, phoneIconInfo));
this.resize(b)
},
resize: function(b) {
if (!1 !== this.expanded) {
var c = b - this.title.height();
this.container.css("height", b + "px");
this.body.css("height", c + "px")
}
},
collapse: function() {
var b = this.title.height();
this.container.css("height", b + "px");
this.body.css("height", "0px");
this.expanded = !1;
this.titleState.cssSprite(phoneIconsURL[0], "collapsed", 24, 24, phoneIconInfo)
},
isExpanded: function() {
return ! 0 === this.expanded
}
});
function codeBar(b) {
this.background = $("");
this.contentBox = $("");
this.showing = !1;
this.width = windowWidth;
this.height = windowHeight;
this.contentWidth = Math.min(windowWidth - 60, windowHeight - 60, 310) + 20;
this.contentHeight = Math.min(windowWidth - 60, windowHeight - 60, 310) + 20 + 40;
this.mainColor = "#888888";
this.background.css({
height: this.height + "px",
bottom: "0px"
});
this.contentBox.css({
height: this.contentHeight + "px",
width: this.contentWidth + "px",
left: (this.width - this.contentWidth) / 2 + "px"
});
this.contentBox.css({
top: (this.height - this.contentHeight) / 2 + "px"
});
$(b).append(this.background);
$(b).append(this.contentBox);
this.titleBox = $("");
this.titleBox.css({
width: this.contentWidth - 6 + "px",
height: "20px",
left: "3px",
bottom: "10px",
position: "absolute",
"line-height": "20px"
});
this.titleBox.css({
"vertical-align": "middle",
"text-align": "center",
color: "#625715",
"text-shadow": "1px 1px 1px #ffffff"
});
this.titleBox.css({
background: "#edaa1d",
"border-radius": "10px",
border: "#ffffff solid 1px"
});
this.titleBox.html("Scan QR code");
this.scanBox = $("");
this.scanBox.css({
position: "absolute",
"border-radius": "5px"
});
this.scanBox.css({
width: this.contentWidth - 80 + "px",
height: this.contentWidth - 80 + "px",
background: "#ffffff",
border: "#edaa1d solid 10px",
left: "30px",
top: "30px"
});
this.contentBox.append(this.scanBox);
this.closeButton = $("");
this.closeButton.css({
top: "0px",
right: "0px",
position: "absolute"
});
this.closeButton.append($("").asImageButton());
$(this.contentBox).append(this.closeButton);
this.fillImage();
this.initEvent();
this.background.css({
display: "none"
});
this.contentBox.css({
display: "none"
})
}
codeBar.prototype.onResize = function() {
this.width = windowWidth;
this.height = windowHeight;
this.contentWidth = Math.min(windowWidth - 60, windowHeight - 60, 310) + 20;
this.contentHeight = Math.min(windowWidth - 60, windowHeight - 60, 310) + 20 + 40;
this.background.css({
height: this.height + "px",
bottom: "0px"
});
this.contentBox.css({
height: this.contentHeight + "px",
width: this.contentWidth + "px",
left: (this.width - this.contentWidth) / 2 + "px"
});
this.contentBox.css({
top: (this.height - this.contentHeight) / 2 + "px"
});
this.titleBox.css({
width: this.contentWidth - 6 + "px",
height: "20px",
left: "3px",
bottom: "10px",
"line-height": "20px"
});
this.scanBox.css({
width: this.contentWidth - 80 + "px",
height: this.contentWidth - 80 + "px",
left: "30px",
top: "30px"
});
this.closeButton.css({
top: "0px",
right: "0px"
});
this.img.css({
width: this.contentWidth - 80 + "px",
height: this.contentWidth - 80 + "px"
})
};
codeBar.prototype.setPosition = function(b, c, d) {
void 0 == d && (d = ["left", "top"]);
$(this.background).css(d[0], b + "px");
$(this.background).css(d[1], c + "px")
};
codeBar.prototype.getShowStatu = function() {
return this.showing
};
codeBar.prototype.setShowStatu = function(b) {
this.showing = b
};
codeBar.prototype.showshow = function() {
$(this.background).css({
display: "block"
});
$(this.contentBox).fadeIn(500);
this.showing = !0
};
codeBar.prototype.hideBox = function() {
$(this.background).fadeOut(500);
$(this.contentBox).fadeOut(500);
this.showing = !1
};
codeBar.prototype.initEvent = function() {
var b = this;
this.background.bind(_event._down,
function(c) {
b.hideBox();
b.showing = !1
});
this.closeButton.bind(_event._end,
function(c) {
b.hideBox();
b.showing = !1
});
this.closeButton.bind("mouseover",
function(c) {
b.closeButton.css({
cursor: "pointer"
})
})
};
codeBar.prototype.fillImage = function() {
var b = this;
this.img = $("");
this.img.css({
width: this.contentWidth - 80 + "px",
height: this.contentWidth - 80 + "px"
});
this.img.load(function() {
b.scanBox.append(b.img)
})
};
var HTML5AdSlider = Class({
create: function(b, c) {
if (c && c.data) {
this.$template = $(b);
var d = c.paddingLeft,
e = c.paddingTop,
f = this.$template.width() - d - c.paddingRight,
g = this.$template.height() - e - c.paddingBottom;
this.$container = $("").css({
left: d,
top: e,
width: f,
height: g
}).appendTo(this.$template);
this.$dataContainer = $("").appendTo(this.$container);
this.dataCache = [];
this.prevIndex = this.timeoutId = null;
this.currentIndex = -1;
this.currentTransition = null;
this.data = [];
this.setThumbFlag = !0;
this.formatOptions(c);
this.$dataContainer.append("");
this.loader = new HTML5AdLoading(this.options);
this.createThumb();
this.play();
$(window).on("resize",
function() {});
return this
}
},
formatOptions: function(b) {
this.options = $.extend(!0, {
firstTransition: !0
},
{
autoPlay: !0
},
{
stopNotFromUser: !0
},
b);
this.options.engine = this;
b = this.options;
var c, d, e;
if (b && b.data && b.data.length) for (c = b.data.length, d = b.data, e = 0; e < c; e++) this.data.push({
action: {
content: d[e].url,
target: "_blank"
},
src: d[e].src,
timeout: b.timeout,
effect: {
duration: b.effectDuration
},
loading: !1,
loop: b.loop
});
else return this
},
next: function(b, c) {
return this.skipTo(this.currentIndex + (b ? b: 1), !1, c)
},
skipTo: function(b, c, d) {
d = this.data;
var e = d.length;
if (0 === e) return this;
c && this.notify("EVENT_DATA_CHANGE");
b = this.formatIndex(b, this.data.loop);
1 < e && (this.loadAll() && this.setThumbFlag ? (c = this.setThumbPosition(), this.thumbDiv.css({
bottom: c
}).show(), this.setThumbFlag = !1) : this.setThumbFlag && this.thumbDiv.css({
bottom: 24
}).show());
this.currentIndex != b && (this.prevIndex = this.currentIndex, this.currentIndex = b, 1 < e && this.skipToThumb(b), 0 < d.length && !d[b].loaded ? this.notify("EVENT_LOAD_DATA") : this.notify("EVENT_DATA_CHANGE"));
return this
},
formatIndex: function(b, c) {
var d = this.data.length;
0 > b ? b = (b + d) % d: b >= d && (b %= d);
return b
},
play: function() {
clearTimeout(this.timeoutId);
if (null === this.prevIndex || this.data[this.currentIndex].loaded) this.pausedFrom = null,
this.next(1, !0);
return this
},
continuePlay: function() {
var b = this.data[this.currentIndex],
c = this;
clearTimeout(this.timeoutId);
this.options.stopNotFromUser = !0;
this.notify("EVENT_CONTINUE_PLAY");
this.timeoutId = setTimeout(function() {
c.play()
},
b.timeout);
return this
},
generateData: function(b, c) {
var d = this.data.length,
e, f;
if (!0 === c && (0 > b || b >= d)) return null;
b = (b + d) % d;
f = this.data[b]; (e = f.loaded) || this.loader.loadData(b);
d = this.dataCache[b].css({
display: "block"
});
e ? (this.$data = d, this.setPosition(d)) : d.data("shouldResizeMe", !0);
f = $("").attr({
href: f.action.content,
target: f.action.target
});
e ? e = $("").transition3D().append(d).append(f) : (e = $("").transition3D().append(d.hide()), d.data("wrapper", e));
return e
},
stop: function(b) {
var c = this.options;
"undefined" !== typeof b && null !== b && (c.stopNotFromUser = b);
b = c.stopNotFromUser;
this.options = c;
b && !c.autoPlay || clearTimeout(this.timeoutId);
return ! 0
},
notify: function(b) {
var c = this.data,
d = this.currentIndex,
e = null;
"string" !== typeof b && ($.extend(e, b), b = b.signal);
e = $.extend({},
{
signal: b,
engine: this,
source: this,
data: c,
prev: this.prevIndex,
current: d,
extra: null
},
e);
this.loader.loaded && this.loader.reset && this.loader.reset(e);
"EVENT_DATA_CHANGE" === b && c[d].loaded && this.setTransition(e);
return this
},
reset: function(b) {
var c = b.signal || b,
d = this.data,
e = this.currentIndex,
f = this.options;
switch (c) {
case "EVENT_DATA_CHANGE":
this.play();
break;
case "EVENT_TRAN_END":
f.firstTransition = !1;
this.notify(c);
f.stopNotFromUser && this.continuePlay();
break;
case "EVENT_DATA_LOADED":
if (d[b.extra].loaded) break;
d[b.extra].loaded = !0;
d[b.extra].ok = !0;
this.notify(b);
c = this.dataCache[b.extra];
d = null;
c && c.data("shouldResizeMe") && (c.show().data("shouldResizeMe", null), d = c.data("wrapper"), c.data("wrapper", null), d.append(c));
b.extra === e && this.skipTo(e, !0);
break;
case "EVENT_DATA_ERROR":
if (d[b.extra].loaded) break;
d[b.extra].loaded = !0;
d[b.extra].error = !0;
this.notify(b);
b.extra === e && this.next(1);
break;
default:
this.notify(b)
}
return this
},
setTransition: function(b) {
var c = this.prevIndex,
d = this.options;
d.firstTransition || 0 <= c && this.data[c].loading ? this.currentTransition = this.first: this.transition && (this.currentTransition = this.transition);
this.timeoutId = null;
d.firstTransition && this.loader.loadData(0);
this.notify("EVENT_TRAN_START");
this.currentTransition(b);
return this
},
setPosition: function(b) {
var c = this.$dataContainer.width(),
d = this.$dataContainer.height(),
e = this.loader.source[this.currentIndex].originSize.width / this.loader.source[this.currentIndex].originSize.height,
f = d * e,
g = c / e,
h,
k,
l,
m;
f > c ? (h = c, k = g, l = 0, m = (d - g) / 2) : g > d ? (h = f, k = d, l = (c - f) / 2, m = 0) : f / g == e && (h = f, k = g, m = l = 0);
b.css({
position: "absolute",
width: h,
height: k,
left: l,
top: m
})
},
first: function(b) {
var c = b.current,
d = b.engine.$dataContainer,
e = d.find(".AsSliderDataWrapper");
b.engine.generateData(c).appendTo(d);
e.remove();
b.engine.reset("EVENT_TRAN_END")
},
transition: function(b) {
var c = b.engine.$dataContainer,
d = b.current,
e = $.extend({},
{
easing: "linear"
},
b.data[d].effect),
f = this.$nextDiv = b.engine.generateData(d).css({
left: "100%"
}),
g = this.$prevDiv = c.find(".AsSliderDataWrapper");
c.prepend(f);
var h = 0;
g.stop(!0, !0).animate({
left: "-100%"
},
e.duration, e.easing,
function() {
h++;
2 === h && (g.remove(), f.css({
left: "0%",
top: "0%"
}), b.engine.reset("EVENT_TRAN_END"))
});
f.stop(!0, !0).animate({
left: "0%"
},
e.duration, e.easing,
function() {
h++;
2 === h && (g.remove(), $(this).css({
left: "0%",
top: "0%"
}), b.engine.reset("EVENT_TRAN_END"))
})
},
createThumb: function() {
var b = this,
c = this.data.length,
d = 0;
if (! (1 >= c)) {
this.thumbDiv = $("").css({
width: 13 * c + 2 * (c - 1),
height: 15
}).hide().appendTo(this.$container);
for (var e = 0; e < c; e++) {
var f = $("").css({
borderRadius: 7,
border: "1px solid #cccccc",
textAlign: "center",
lineHeight: "13px",
width: 13,
height: 13,
fontFamily: "Arial, serif, Tahoma",
fontSize: "60%",
backgroundColor: "#eeeeee",
left: d,
top: 0
}).attr("id", "sliderThumb_" + e).html(e + 1).appendTo(this.thumbDiv),
d = d + 2 + 13 + 2; (function(c) {
f.on("click",
function(d) {
c !== b.currentIndex && (d.stopPropagation(), b.stop(!0), b.skipTo(c))
})
})(e)
}
this.thumbDiv.css({
width: d - 2
});
$("#sliderThumb_0").css({
backgroundColor: "#E69696"
})
}
},
setThumbPosition: function() {
for (var b = this.$container.width(), c = this.$container.height(), d = this.loader.source, e = [], f = 0; f < d.length; f++) {
var g = d[f].originSize.width / d[f].originSize.height;
if (b / g > c) return 20;
e[f] = b / g
}
b = Math.max.apply(Math, e);
return (c - b) / 2 + 20
},
skipToThumb: function(b) {
this.thumbDiv && this.thumbDiv.children().css({
backgroundColor: "#eeeeee"
});
$("#sliderThumb_" + b).css({
backgroundColor: "#E69696"
})
},
resize: function() {
this.$container.css({
width: this.$template.width() - this.options.paddingLeft - this.options.paddingRight,
height: this.$template.height() - this.options.paddingTop - this.options.paddingBottom
});
this.stop(!1);
this.setPosition(this.$data);
this.continuePlay()
},
loadAll: function() {
for (var b = !0,
c = this.data,
d = 0; d < c.length; d++) b = b && c[d].loaded;
return b
}
});
bdor[23] = ".";
var HTML5AdLoading = Class({
create: function(b) {
var c = b.data;
this.preloadSize = b && b.preloadSize ? b.preloadSize: b.data.length;
this.$cache = Array(c.length);
this.engine = b.engine;
this.source = c;
this.loaded = !0;
this.engine.dataCache = this.$cache;
this.loadData(0);
return this
},
loadData: function(b, c) {
var d = this.$cache,
e = this.source,
f = [],
g = d.length,
h = this;
c ? c < b && (c = b + this.preloadSize) : (c = b + this.preloadSize, b = Math.max(b - this.preloadSize, 0));
c = c >= g ? g - 1 : c;
for (var k = 0 > b ? 0 : b; k <= c; ++k) f.push(k);
k = 0;
for (g = f.length; k < g; ++k) {
var l = f[k],
m = d[l],
p = e[l],
n = null;
m || (m = d[l] = $(""), p.loaded = !1, p.loading = !0, n = $(new Image), n.one({
load: function(b) {
return function() {
h.reset({
signal: "EVENT_IMG_LOADED",
extra: b
})
}
} (l),
error: function(b) {
return function() {
h.reset({
signal: "EVENT_IMG_ERROR",
extra: b
})
}
} (l)
}), e[l].originalData = n[0], n.attr("src", p.src), m.attr("src", p.src), n = null);
m = null
}
},
reset: function(b) {
var c = b.current,
d = this.$cache,
e = this.source,
f = (b.current - 1 + d.length) % d.length,
g = (f - 1 + d.length) % d.length,
h = (b.current + 1) % d.length,
k = (h + 1) % d.length,
l = b.extra,
e = this.source,
m = this.engine,
p = null;
switch (b.signal) {
case "EVENT_LOAD_DATA":
case "EVENT_DATA_CHANGE":
d[h] && d[c] && d[k] && d[f] && d[g] || this.loadData(c);
break;
case "EVENT_IMG_LOADED":
p = e[l].originalData;
e[l].loading = !1;
this.source[l].originSize = {
width: p.width,
height: p.height
};
b.signal = "EVENT_DATA_LOADED";
b.source = this;
b.data = this.source;
m.reset(b);
break;
case "EVENT_IMG_ERROR":
b.signal = "EVENT_DATA_ERROR",
this.source[l].originSize = {
width: 18,
height: 20
},
b.source = this,
b.data = this.source,
e[l].loading = !1,
m.reset(b)
}
}
}); (function(b, c, d) {
function e(b) {
return document.createElementNS("http://www.w3.org/2000/svg", b)
}
function f(c) {
if (document.getElementsByTagName("body")[0].contains(c)) {
var d, e;
d = c.parentNode;
var f = c.style,
g = b(c);
e = 100 / d.offsetHeight;
d = 100 / d.offsetWidth;
f.width = g.width() * d + "%";
f.height = g.height() * e + "%";
f.left = c.offsetLeft * d + "%";
f.top = c.offsetTop * e + "%"
}
}
function g() {
var b = e("svg");
b.setAttribute("version", "1.1");
b.setAttribute("xmlns", "http://www.w3.org/2000/svg");
b.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
return b
}
function h(b, c) {
var d, e, f, g = [];
f = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
c = c || f.length;
if (b) for (d = 0; d < b; d++) g[d] = f[0 | Math.random() * c];
else for (g[8] = g[13] = g[18] = g[23] = "-", g[14] = "4", d = 0; 36 > d; d++) g[d] || (e = 0 | 16 * Math.random(), g[d] = f[19 == d ? e & 3 | 8 : e]);
return g.join("")
}
var k, l = new(c({
create: function() {
var c, d, e, f, g = this,
h = "#FF0000 #FF5555 #FF55AA #FF55FF #FFAA55 #FFAAAA #FFAAFF #FFFF55 #FFFFAA #FFFFFF #CC0000 #CC5555 #CC55AA #CC55FF #CCAA55 #CCAAAA #CCAAFF #CCFF55 #CCFFAA #CCFFFF #AA0000 #AA5555 #AA55AA #AA55FF #AAAA55 #AAAAAA #AAAAFF #AAFF55 #AAFFAA #AAFFFF #880000 #885555 #8855AA #8855FF #88AA55 #88AAAA #88AAFF #88FF55 #88FFAA #88FFFF #550000 #555555 #5555AA #5555FF #55AA55 #55AAAA #55AAFF #55FF55 #55FFAA #55FFFF #220000 #225555 #2255AA #2255FF #22AA55 #22AAAA #22AAFF #22FF55 #22FFAA #22FFFF #000000 #005555 #0055AA #0055FF #00AA55 #00AAAA #00AAFF #00FF55 #00FFAA #00FFFF".split(" "),
k = document.createElement("table");
c = g.container = document.createElement("a");
var l = g.$container = b(c),
m = document.createElement("input"),
n = function() {
m.value = m.style.backgroundColor = this.title.toUpperCase()
},
p = function() {
l.trigger("colorSelected", [g.parseColorToRGBA(this.title, g.opacityValue)]);
l.hide()
};
c.className = "flipHtml5AnnotationColorSelectorWrap";
k.setAttribute("border", "1");
c.style.display = "none";
c.setAttribute("href", " javaScript:void(0)".replace(/\s+/g, ""));
m.className = "flipHtml5AnnotationColorSelectorMessage";
m.value = "#000000";
m.setAttribute("disabled", "true");
c.appendChild(m);
c.appendChild(g.createOpacityBar());
c.appendChild(k);
g.setOpacity(1);
for (e = 0; 7 > e; e++) {
f = document.createElement("tr");
for (d = 0; 10 > d; d++) c = document.createElement("td"),
c.className = "flipHtml5AnnotationColorSelectorBlock",
c.title = h[10 * e + d],
c.style.backgroundColor = h[10 * e + d],
b(c).on("mouseenter", n),
b(c).on("click", p),
f.appendChild(c);
k.appendChild(f)
}
l.on("click",
function(b) {
b.stopPropagation()
});
b(document).on("click",
function() {
g.hide()
})
},
parseColorToRGBA: function(b, c) {
var d, e, f;
c = parseFloat(c);
1 <= c && (c = 1);
0 >= c && (c = 0);
d = parseInt(b.substring(1, 3), 16);
e = parseInt(b.substring(3, 5), 16);
f = parseInt(b.substring(5, 7), 16);
return "rgba(" + d + "," + e + "," + f + "," + c + ")"
},
createOpacityBar: function() {
var c, d, e, f = this,
g = Math.floor,
h = document.createElement("div"),
k = f.cursor = document.createElement("div"),
l = f.span = document.createElement("span"),
m = this.px = "px",
n = this.str = "Opacity: ",
p = this.length = 145,
q = b(document),
s = b(k),
r = f.$container;
l.className = "flipHtml5AnnotationOpacitySpan";
h.className = "flipHtml5AnnotationOpacity";
k.className = "flipHtml5AnnotationOpacityCursor";
h.appendChild(l);
h.appendChild(k);
s.on("mousedown touchstart",
function(b) {
b.preventDefault();
var h, s = f.opacityValue,
u = k.style,
w = parseInt(u.left || 0, 10);
c = w;
d = w - (b.pageX ? b.pageX: b.originalEvent.touches ? b.originalEvent.touches[0].pageX: 0);
q.on("mousemove.flipHtml5AnnotationOpacity touchmove.flipHtml5AnnotationOpacity",
function(f) {
b.preventDefault();
if (h = f.pageX ? f.pageX: f.originalEvent.touches ? f.originalEvent.touches[0].pageX: 0) e = g(d + h),
0 > e && (e = 0),
e > p && (e = p),
c !== e && (u.left = e + m, l.innerHTML = n + (e / p).toFixed(2), s = e / p),
r.trigger("opacityChanged", s.toFixed(2))
});
q.off("mouseup.opacityCursor touchend.opacityCursor").one("mouseup.opacityCursor touchend.opacityCursor",
function() {
f.opacityValue = s;
q.off("mousemove.flipHtml5AnnotationOpacity touchmove.flipHtml5AnnotationOpacity")
})
});
return h
},
setOpacity: function(b) {
if (void 0 === b || 1 < b || isNaN(b)) b = 1;
0 > b && (b = 0);
this.cursor.style.left = b * this.length + this.px;
this.span.innerHTML = this.str + b;
this.opacityValue = b
},
on: function(b, c) {
this.$container.off(b).on(b, c);
return this
},
show: function() {
this.$container.show();
return this
},
hide: function() {
this.$container.hide();
return this
}
})),
m = c({
create: function(c) {
var d = 0,
e = c[d];
this.container = document.createElement("div");
this.$container = b(this.container);
this.tools = {};
for (this.container.className = "fliphtml5AnnotationLineToolsContainer"; e;) this.$container.append(this.createButtonByName(e)),
d++,
e = c[d];
b(document).ready(function() {
document.getElementsByTagName("body")[0].appendChild(this.container)
}.bind(this));
this.oneBindEvent()
},
createButtonByName: function(b) {
var c = this,
d, e;
switch (b) {
case "fill":
this.tools.fill = {
type: "color",
container: d = c.createColorButton("fill", !1)
};
break;
case "stroke":
this.tools.stroke = {
type: "color",
container: d = c.createColorButton("stroke", !1)
};
break;
case "stroke-dasharray":
d = ["Straight", "Dotted", "Dashed", "Dotted & Dashed"];
e = ["1", "2", "3", "4"];
this.tools.strokeDasharray = {
type: "select",
value: e,
container: d = c.createSelect(d, e, "stroke-dasharray", !1, 0)
};
break;
case "stroke-width":
d = "Thinnest Thinner Thin MediumThin Medium MediumStrong Strong Stronger Strongest".split(" ");
e = "1 2 3 4 5 7 9 12 16".split(" ");
this.tools.strokeWidth = {
type: "select",
value: e,
container: d = c.createSelect(d, e, "stroke-width", !1, 1)
};
break;
case "headArrowType":
d = "None Long_triangle Long_triangle_inverse Short_triangle Short_triangle_inverse Angle_brackets Angle_brackets_inverse Ellipse Rect Right_bank Line Left_bank".split(" ");
e = "0 1 2 3 4 5 6 7 8 9 10 11".split(" ");
this.tools.headArrowType = {
type: "select",
value: e,
container: d = c.createSelect(d, e, b, !1, 6)
};
break;
case "endArrowType":
d = "None Long_triangle Long_triangle_inverse Short_triangle Short_triangle_inverse Angle_brackets Angle_brackets_inverse Ellipse Rect Right_bank Line Left_bank".split(" ");
e = "0 1 2 3 4 5 6 7 8 9 10 11".split(" ");
this.tools.endArrowType = {
type: "select",
value: e,
container: d = c.createSelect(d, e, b, !1, 11)
};
break;
default:
d = c.createButton(b),
c.addClickEvent(d,
function() {
c.exec(b)
})
}
return d
},
createButton: function(b) {
var c = document.createElement("a"),
d = document.createElement("div");
c.href = " javascript:void(0);".replace(/\s+/g, "");
d.className = "flipHtml5AnnotationButtonImage flipHtml5AnnotationImage-" + b;
d.title = b;
c.appendChild(d);
return c
},
addClickEvent: function(b, c) {
b.className = "flipHtml5AnnotationClickButton";
b.onclick = c
},
exec: function(b, c) {
if (this.object) switch (b) {
case "stroke":
this.object.setStroke(c);
break;
case "stroke-dasharray":
this.object.setDashArray(c);
break;
case "stroke-width":
this.object.setStrokeWidth(c);
break;
case "fill":
this.object.setFill(c);
break;
case "delete":
this.object.destroy();
k.save();
break;
case "headArrowType":
case "endArrowType":
this.object.setArrowType(b, c)
}
},
oneBindEvent: function() {
var c = this;
b(document).on("keydown.flipHtml5AnnotationDelete",
function(b) {
var d = b.keyCode;
b.altKey || b.ctrlKey || b.shiftKey || (c.editing && d === KEY_CODE_DELETE && c.currentEditor && (this.object.destroy(), k.save()), c.currentEditor && d === KEY_CODE_LEFT && d === KEY_CODE_RIGHT && d === KEY_CODE_UP && d === KEY_CODE_DOWN && b.stopPropagation())
})
},
createColorButton: function(b, c) {
var d = this,
e, f = this.createButton(b),
g = f.getElementsByTagName("div")[0];
c && (e = document.createElement("div"), e.className = "flipHtml5AnnotationColorBar", f.appendChild(e));
d.addClickEvent(f,
function(c) {
c.stopPropagation();
l.container.style.left = this.offsetLeft + "px";
l.container.style.top = this.offsetTop + 20 + "px";
l.show();
l.on("colorSelected",
function(c, f) {
e ? e.style.backgroundColor = f: g.style.backgroundColor = f;
d.exec(b, f)
});
l.setOpacity(d.object.getOpacity(b));
l.on("opacityChanged",
function(c, e) {
d.object.setOpacity(b, e)
})
});
return f
},
createSelect: function(b, c, d, e, f) {
var g = document.createElement("select"),
h = 0,
k = this,
l;
g.className = "flipHtml5AnnotationSelect flipHtml5Annotation-" + d;
for (e && (g.style[e] = c[f]); b[h];) l = document.createElement("option"),
l.className = "flipHtml5AnnotationOption-" + d + " flipHtml5AnnotationOption-" + c[h],
l.innerHTML = b[h],
e && (l.style[e] = c[h]),
h === f && l.setAttribute("selected", !0),
g.appendChild(l),
h++;
g.onchange = function() {
k.exec(d, c[this.selectedIndex]);
e && (this.style[e] = c[this.selectedIndex])
};
return g
},
active: function(b) {
if (b) {
var c, d;
this.object = b;
b.toolbar.$container.append(l.container);
for (c in this.tools) this.tools.hasOwnProperty(c) && (d = this.tools[c], "color" === d.type && (d.container.getElementsByTagName("div")[0].style.backgroundColor = b[c]), "select" === d.type && (d.container.selectedIndex = d.value.indexOf(b[c].toString())))
}
this.container.style.display = "block"
},
inactive: function() {
this.container.style.display = "none";
this.object = null
}
}),
p = new m("stroke-width stroke-dasharray headArrowType endArrowType stroke delete".split(" ")),
n = new m(["stroke-width", "stroke-dasharray", "stroke", "delete"]),
q = new m(["stroke-width", "stroke-dasharray", "stroke", "fill", "delete"]),
s = new(c({
create: function() {
var c, d = 1,
e = this.sizeWrap = document.createElement("div"),
f = this.sizePointArray = [];
for (e.className = "flipHtml5AnnotationSizeWrap"; 9 > d;) c = document.createElement("div"),
c.className = "flipHtml5SizePoint flipHtml5SizePoint" + d,
e.appendChild(c),
f.push(c),
d++;
this.$container = b(e);
this.container = e
},
addEvents: function(c) {
var e = this,
g = e.sizeWrap,
h = e.sizePointArray;
e.sizeWrapStyle = g.style;
c && (e.$context = c.add(q.$container).add(n.$container).add(p.$container));
e.northResize(h[0]).westResize(h[0]);
e.northResize(h[1]);
e.eastResize(h[2]).northResize(h[2]);
e.eastResize(h[3]);
e.eastResize(h[4]).southResize(h[4]);
e.southResize(h[5]);
e.southResize(h[6]).westResize(h[6]);
e.westResize(h[7]);
b(g).off("mousedown touchstart").on("mousedown touchstart",
function(b) {
b.preventDefault();
var c, h, k, l, m, n, p, t = Math.floor,
q = e.sizeWrapStyle,
s = g.offsetLeft,
r = g.offsetTop,
u = b.pageX || b.originalEvent.touches[0].pageX,
w = b.pageY || b.originalEvent.touches[0].pageY;
c = e.$context;
c.off("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap").on("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap",
function(b) {
b.preventDefault();
b.stopPropagation();
h = b.pageX ? b.pageX: b.originalEvent.touches ? b.originalEvent.touches[0].pageX: 0;
k = b.pageY ? b.pageY: b.originalEvent.touches ? b.originalEvent.touches[0].pageY: 0;
if (h && (p = t(s - (u - h) / d.scale()), m !== p && (q.left = p + "px", m = p, e.onResize))) e.onResize(void 0, void 0, p, void 0);
if (k && (n = t(r - (w - k) / d.scale()), l !== n && (q.top = n + "px", l = n, e.onResize))) e.onResize(void 0, void 0, void 0, n)
});
e.$container.one("mouseup touchend",
function(b) {
c.off("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap");
f(g);
if (e.onResizeEnd) e.onResizeEnd()
})
})
},
northResize: function(c) {
var e = this;
b(c).off("mousedown.north touchstart.north").on("mousedown.north touchstart.north",
function(b) {
b.preventDefault();
b.stopPropagation();
var c, g, h, k, l = Math.floor,
m = e.sizeWrap,
n = m.offsetTop,
p = e.sizeWrapStyle,
t = e.$context,
q = m.offsetHeight || 11,
s = n + q - 11,
r = b.pageY || b.orginalEvent.touches[0].pageY;
g = q;
e.$container.one("mouseup touchend",
function() {
t.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");
f(m);
if (e.onResizeEnd) e.onResizeEnd()
});
t.on("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize",
function(b) {
b.preventDefault();
b.pageY ? c = b.pageY: b.originalEvent.touches && (c = b.originalEvent.touches[0].pageY);
if (c && (h = l(g + (r - c) / d.scale()), q !== h && (k = n + (g - h), 11 > h && (h = 11), k > s && (k = s), p.top = k + "px", p.height = h + "px", q = h, e.onResize))) e.onResize(void 0, h, void 0, k)
})
});
return this
},
westResize: function(c) {
var e = this;
b(c).off("mousedown.west touchstart.west").on("mousedown.west touchstart.west",
function(b) {
b.preventDefault();
b.stopPropagation();
var c, g, h, k, l = Math.floor,
m = e.$context,
n = e.sizeWrap,
p = n.offsetLeft,
t = e.sizeWrapStyle,
q = n.offsetWidth || 11,
s = p + q - 11,
r = b.pageX || b.originalEvent.touches[0].pageX;
h = q;
e.$container.one("mouseup touchend",
function() {
m.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");
f(n);
if (e.onResizeEnd) e.onResizeEnd()
});
m.on("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize",
function(b) {
b.preventDefault();
b.pageX ? c = b.pageX: b.originalEvent.touches && (c = b.originalEvent.touches[0].pageX);
if (c && (g = -l((c - r) / d.scale() - h), q !== g && (k = p + (h - g), 11 > g && (g = 11), k > s && (k = s), t.left = k + "px", t.width = g + "px", q = g, e.onResize))) e.onResize(g, void 0, k, void 0)
})
});
return this
},
eastResize: function(c) {
var e = this;
b(c).off("mousedown.east touchstart.east").on("mousedown.east touchstart.east",
function(b) {
b.preventDefault();
b.stopPropagation();
var c, g, h, k = Math.floor,
l = e.$context,
m = e.sizeWrap,
n = e.sizeWrapStyle,
p = m.offsetWidth || 11,
t = b.pageX || b.originalEvent.touches[0].pageX;
e.$container.one("mouseup touchend",
function() {
l.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");
f(m);
if (e.onResizeEnd) e.onResizeEnd()
});
l.on("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize",
function(b) {
b.preventDefault();
b.pageX ? c = b.pageX: b.originalEvent.touches && (c = b.originalEvent.touches[0].pageX);
if (c && (g = k(p - (t - c) / d.scale()), h !== g && (11 > g && (g = 11), n.width = g + "px", h = g, e.onResize))) e.onResize(g, void 0, void 0, void 0)
})
});
return this
},
southResize: function(c) {
var e = this;
b(c).off("mousedown.south touchstart.south").on("mousedown.south touchstart.south",
function(b) {
b.preventDefault();
b.stopPropagation();
var c, g, h, k = Math.floor,
l = e.$context,
m = e.sizeWrap,
n = e.sizeWrapStyle,
p = m.offsetHeight,
t = b.pageY || b.originalEvent.touches[0].pageY;
e.$container.one("mouseup touchend",
function() {
l.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");
f(m);
if (e.onResizeEnd) e.onResizeEnd()
});
l.on("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize",
function(b) {
b.preventDefault();
b.pageY ? c = b.pageY: b.originalEvent.touches && (c = b.originalEvent.touches[0].pageY);
if (c && (g = k(p - (t - c) / d.scale()), h !== g && (11 > g && (g = 11), n.height = g + "px", h = g, e.onResize))) e.onResize(void 0, g, void 0, void 0)
})
});
return this
},
onResizeEnd: function() {},
onResize: function(b, c, d, e) {},
active: function() {
this.container.style.display = "block";
this.$container.on("click.sizewrap mousedown.sizewrap mouseup.sizewrap",
function(b) {
b.stopPropagation()
})
},
inactive: function() {
this.$container.off("click.sizewrap mousedown.sizewrap mouseup.sizewrap");
this.container.style.display = "none"
}
})),
r = c({
create: function(c, d) {
var e = this.svg = g(),
f = this.container = document.createElement("div");
c = c || [];
this.$parent = d;
e.style.position = "absolute";
e.style.left = "0";
e.style.top = "0";
e.style.width = "100%";
e.style.height = "100%";
this.id = h(8, 10);
this.$container = b(f);
f.className = "flipHtml5SVGContainer";
f.appendChild(e);
d && (this._width = c[0] || 0, this._height = c[1] || 0, this._left = c[2] || 0, this._top = c[3] || 0);
f.style.width = c[0] || 0;
f.style.height = c[1] || 0;
f.style.left = c[2] || 0;
f.style.top = c[3] || 0;
d && (this.prevWidth = parseFloat(c[0]) * d[0].offsetWidth / 100, this.prevHeight = parseFloat(c[1]) * d[0].offsetHeight / 100, this.prevLeft = parseFloat(c[2]) * d[0].offsetWidth / 100, this.prevTop = parseFloat(c[3]) * d[0].offsetHeight / 100);
this.fill = c[4] || "transparent";
this.fillOpacity = c[5] || 1;
this.stroke = c[6] || "rgba(0, 0, 0, 1)";
this.strokeDasharray = c[7] || "1";
this.strokeOpacity = c[8] || "1";
this.strokeWidth = c[9] || "2";
this.createGraphics(c);
this.setStrokeWidth(this.strokeWidth);
this.setFill(this.fill);
this.setFillOpacity(this.fillOpacity);
this.setStroke(this.stroke);
this.setDashArray(this.strokeDasharray);
this.setStrokeOpacity(this.strokeOpacity);
this.actived = !1;
this.$container.on(_event._down,
function(b) {
b.stopPropagation();
this.actived || (this.active(this.$parent), this.actived = !0)
}.bind(this));
if (d) this.$container.on("mousedown mouseup",
function(b) {
b.stopPropagation()
})
},
active: function(b) {
var c = this;
k.activedShape && k.activedShape.inactive();
k.activedShape = this;
c.$container.after(s.$container);
c.position();
b && (c.$parent = b);
s.addEvents(c.$parent);
s.active();
c.toolbar.active(c);
if (b) b.off("mousedown.flipHtml5Graphic" + c.id + " touchstart.flipHtml5Graphic" + c.id).on("mousedown.flipHtml5Graphic" + c.id + " touchstart.flipHtml5Graphic" + c.id,
function(d) {
c.actived && d.target !== c.container && d.target !== c.toolbar.container && d.target !== s.container && (d.stopPropagation(), b.off("mousedown.flipHtml5Graphic" + c.id + " touchstart.flipHtml5Graphic" + c.id), c.inactive())
});
this.actived = !0
},
_parsePresentValue: function() {
f(this.container);
var b = this.container.style;
this._width = b.width;
this._height = b.height;
this._left = b.left;
this._top = b.top
},
inactive: function() {
k && (k.save(), k.activedShape = null);
this.toolbar.inactive();
s.inactive();
this.actived = !1
},
position: function() {
var b = this,
c = b.px,
d = b.container,
e = b.$container,
f = s.container.style,
g = b.toolbar.container.style;
f.width = d.offsetWidth + 8 + c;
f.height = d.offsetHeight + 8 + c;
f.left = d.offsetLeft - 3 + c;
f.top = d.offsetTop - 4 + c;
g.left = e.offset().left - 8 + c;
g.top = e.offset().top - 52 + c;
s.onResize = function(d, f, h, k) {
b.css(d - 8, f - 8, h + 3, k + 4);
g.left = e.offset().left - 8 + c;
g.top = e.offset().top - 52 + c
};
s.onResizeEnd = function() {
b._parsePresentValue();
k.save()
}
},
setFill: function(b) {
this.setStyle("fill", b);
this.fill = b
},
setFillOpacity: function(b) {
this.setStyle("fill", this.fill.replace(/,[0-9]+(\.[0-9]*)?\)/, "," + b + ")"));
this.fillOpacity = parseFloat(b)
},
setStroke: function(b) {
this.setStyle("stroke", b);
this.stroke = b
},
setStrokeOpacity: function(b) {
this.setStyle("stroke", this.stroke.replace(/,[0-9]+(\.[0-9]*)?\)/, "," + b + ")"));
this.strokeOpacity = parseFloat(b)
},
setOpacity: function(b, c) {
"fill" === b && this.setFillOpacity(c);
"stroke" === b && this.setStrokeOpacity(c)
},
getOpacity: function(b) {
return "fill" === b ? this.fillOpacity: this.strokeOpacity
},
setStrokeWidth: function(b) {
this.setStyle("stroke-width", b);
this.strokeWidth = parseInt(b, 10);
this.setDashArray(this.strokeDasharray);
this.shapeCss(this.prevWidth, this.prevHeight)
},
setDashArray: function(b) {
this.strokeDasharray = b;
b = "1" === b ? "0": "2" === b ? "1," + 2 * this.strokeWidth: "3" === b ? "1," + 2 * this.strokeWidth + ",1": 4 * this.strokeWidth + "," + 2 * this.strokeWidth + ",1," + 2 * this.strokeWidth;
this.setStyle("stroke-dasharray", b)
},
shapeCss: function(b, c) {},
css: function(b, c, d, e) {
var f = this.container.style;
b = Math.floor(b);
d = Math.floor(d);
c = Math.floor(c);
e = Math.floor(e);
b && (this.prevWidth = b, b < this.minWidth && (b = this.minWidth), f.width = b + "px", this.shapeCss(b, null));
c && (this.prevHeight = c, c < this.minHeight && (c = this.minHeight), f.height = c + "px", this.shapeCss(null, c));
d && (f.left = d + "px", this.prevLeft = d);
this.prevWidth < this.minWidth && (f.left = this.prevLeft - 4 - (this.minWidth - this.prevWidth - 8) / 2 + "px");
e && (f.top = e + "px", this.prevTop = e);
this.prevHeight < this.minHeight && (f.top = this.prevTop - 3 - (this.minHeight - this.prevHeight - 6) / 2 + "px")
},
destroy: function() {
this.inactive();
this.$container.remove();
k.removeGraphic(this)
}
}),
m = c({
name: "line",
toolbar: n,
createGraphics: function(b) {
var c = e("line");
c.setAttribute("stroke-linecap", "round");
c.setAttribute("stroke-linejoin", "round");
this.italic = parseInt(b[10] || 1, 10);
this.svg.appendChild(c);
this.line = c;
this.px = "px"
},
setStyle: function(b, c) { (c || 0 === c) && this.line.setAttribute(b, c);
return this
},
setStrokeWidth: function(b) {
b = parseInt(b, 10);
this._super(b);
this.minHeight = this.minWidth = b
},
draw: function(b, c, d, e, f, g, h) {
var k = this.strokeWidth / 2,
l = this.strokeWidth,
m, n = c - b,
p = e - d;
c > b ? (m = n + l, f = b - f - k) : (m = -n + l, f = c - f - k);
e > d ? (b = p + l, g = d - g - k) : (b = -p + l, g = e - g - k);
0 < n && 0 < p && (this.italic = 1);
0 > n && 0 < p && (this.italic = 2);
0 > n && 0 > p && (this.italic = 3);
0 < n && 0 > p && (this.italic = 4);
this.css(m / h, b / h, f / h, g / h)
},
shapeCss: function(b, c) {
var d, e;
1 === this.italic || 3 === this.italic ? (d = "x1", e = "x2") : (d = "x2", e = "x1");
this.setStyle(d, this.strokeWidth / 2);
b && this.setStyle(e, b - this.strokeWidth / 2);
this.setStyle("y1", this.strokeWidth / 2);
c && this.setStyle("y2", c - this.strokeWidth / 2)
}
}).extend(r),
w = c({
name: "ellipse",
toolbar: q,
createGraphics: function(b) {
this.ellipse = e("ellipse");
this.svg.appendChild(this.ellipse);
this.px = "px";
this.ellipse.setAttribute("stroke-linecap", "round");
this.ellipse.setAttribute("stroke-linejoin", "round");
this.ellipse.setAttribute("cx", "50%");
this.ellipse.setAttribute("cy", "50%");
this.setFillOpacity(b[5] || "0.5")
},
setStyle: function(b, c) {
this.ellipse.setAttribute(b, c);
return this
},
setStrokeWidth: function(b) {
b = parseInt(b, 10);
this._super(b);
this.minWidth = 2 * b;
this.minHeight = 2 * b
},
draw: function(b, c, d, e, f, g, h) {
var k = this.strokeWidth / 2,
l = this.strokeWidth,
m;
c > b ? (m = c - b + l, f = b - f - k) : (m = b - c + l, f = c - f - k);
e > d ? (b = e - d + l, g = d - g - k) : (b = d - e + l, g = e - g - k);
this.css(m / h, b / h, f / h, g / h)
},
shapeCss: function(b, c) {
b && this.setStyle("rx", b / 2 - this.strokeWidth / 2);
c && this.setStyle("ry", c / 2 - this.strokeWidth / 2)
}
}).extend(r),
r = c({
name: "rect",
toolbar: q,
createGraphics: function() {
this.rect = e("rect");
this.rect.setAttribute("stroke-linecap", "round");
this.rect.setAttribute("stroke-linejoin", "round");
this.svg.appendChild(this.rect);
this.px = "px"
},
setStrokeWidth: function(b) {
b = parseInt(b, 10);
this._super(b);
this.setStyle("x", b / 2);
this.setStyle("y", b / 2);
this.minWidth = 2 * b;
this.minHeight = 2 * b
},
setStyle: function(b, c) {
this.rect.setAttribute(b, c);
return this
},
draw: function(b, c, d, e, f, g, h) {
var k = this.strokeWidth / 2,
l = this.strokeWidth,
m;
c > b ? (m = c - b + l, f = b - f - k) : (m = b - c + l, f = c - f - k);
e > d ? (b = e - d + l, g = d - g - k) : (b = d - e + l, g = e - g - k);
this.css(m / h, b / h, f / h, g / h)
},
shapeCss: function(b, c) {
b && this.setStyle("width", b - this.strokeWidth);
c && this.setStyle("height", c - this.strokeWidth)
}
}).extend(r),
u = c({
create: function(c, d, f) {
var h = this.svg = g(),
k = this.path = e("path"),
l = this.line = e("line"),
m = this.rect = e("rect"),
n = this.ellipse = e("ellipse");
h.style.position = "absolute";
l.style.display = "none";
m.style.display = "none";
n.style.display = "none";
h.appendChild(m);
h.appendChild(k);
h.appendChild(l);
h.appendChild(n);
this.container = h;
this.$container = b(h);
n.setAttribute("cx", "50%");
n.setAttribute("cy", "50%");
this.setStyle("stroke-linecap", "round");
this.setStyle("stroke-linejoin", "round");
this.type = 0;
this.inverse = "true" == d;
this.position = c;
this.currentType = "path";
this.setCurrentType(f[10] || "path");
this.backgroundTransparent = !1;
this.deg = f[11] || 0;
this.italic = parseInt(f[12] || 1, 10)
},
setStyle: function(b, c) {
this.path.setAttribute(b, c);
this.line.setAttribute(b, c);
this.ellipse.setAttribute(b, c);
this.rect.setAttribute(b, c)
},
setStrokeWidth: function(b) {
var c = b = parseInt(b, 10);
this.lineStrokeWidth = b;
this.strokeWidth = c;
this.setType(this.type);
this.setPosition(this.deg, this.italic);
this.setStyle("stroke-width", c)
},
getDegByItalic: function(b, c) {
var d = this.inverse ? 180 : 0;
switch (c) {
case 1:
b += d;
break;
case 2:
b = 180 - b + d;
break;
case 3:
b = 180 + b + d;
break;
case 4:
b = 360 - b + d
}
return b
},
setPosition: function(b, c) {
var d = this.svg.style,
e = ( - this.width - this.lineStrokeWidth / 2) / 2 + "px",
f = ( - this.height - this.lineStrokeWidth / 2) / 2 + "px";
this.italic = c;
this.deg = b;
for (var g = "rotate(" + this.getDegByItalic(b, c) + "deg)", h = 0, k = this.svg.style, l = ["transform", "webkitTransform", "mozTransform", "msTransform"]; l[h];) k[l[h]] = g,
h++;
this.position && (c = (c + 2) % 4, 0 === c && (c = 4));
switch (c) {
case 1:
d.left = "100%";
d.top = "100%";
d.right = "auto";
d.bottom = "auto";
d.margin = f + " auto auto " + e;
break;
case 2:
d.left = "auto";
d.top = "100%";
d.right = "100%";
d.bottom = "auto";
d.margin = f + " " + e + " auto auto";
break;
case 3:
d.left = "auto";
d.top = "auto";
d.right = "100%";
d.bottom = "100%";
d.margin = "auto " + e + " " + f + " auto";
break;
case 4:
d.left = "100%",
d.top = "auto",
d.right = "auto",
d.bottom = "100%",
d.margin = "auto auto " + f + " " + e
}
},
setCurrentType: function(b) {
var c, d;
b !== this.currentType && (c = this.svg.getElementsByTagName(b)[0], d = this.svg.getElementsByTagName(this.currentType)[0], this.currentType = b, d.style.display = "none", c.style.display = "block")
},
setType: function(b) {
this.type = parseInt(b, 10);
this.inverse = !1;
var c, d;
b = this.strokeWidth;
var e = this.path,
f = b / 2;
switch (this.type) {
case 0:
this.setCurrentType("path");
c = d = 0;
break;
case 2:
this.inverse = !0;
case 1:
this.setCurrentType("path");
d = 20 + 5 * b;
c = 30 + 4 * b;
this.backgroundTransparent = !1;
e.setAttribute("d", "M " + f + " " + 0.3 * c + " L " + (d - b / 2) + " " + 0.5 * c + " L " + f + " " + 0.7 * c + " Z");
break;
case 4:
this.inverse = !0;
case 3:
this.setCurrentType("path");
this.backgroundTransparent = !1;
d = 5 + 4 * b;
c = 20 + 5 * b;
e.setAttribute("d", "M " + f + " " + 0.2 * c + " L " + (d - f) + " " + 0.5 * c + " L " + f + " " + 0.8 * c + " Z");
break;
case 6:
this.inverse = !0;
case 5:
this.setCurrentType("path");
this.backgroundTransparent = !0;
d = 10 + 4 * b;
c = 30 + 3 * b;
this.path.setAttribute("d", "M " + f + " " + 0.2 * c + " L " + (d - b) / 2 + " " + 0.5 * c + " L " + f + " " + 0.8 * c);
break;
case 7:
this.setCurrentType("ellipse");
this.backgroundTransparent = !1;
d = c = 10 + 4 * b;
this.ellipse.setAttribute("rx", d / 2 - f);
this.ellipse.setAttribute("ry", c / 2 - f);
break;
case 8:
this.setCurrentType("rect");
this.backgroundTransparent = !1;
d = c = 10 + 4 * b;
this.rect.setAttribute("x", f);
this.rect.setAttribute("y", f);
this.rect.setAttribute("width", d - b);
this.rect.setAttribute("height", c - b);
break;
case 9:
this.setCurrentType("line");
this.backgroundTransparent = !0;
d = c = 10 + 4 * b;
this.line.setAttribute("x1", f);
this.line.setAttribute("y1", f);
this.line.setAttribute("x2", d - f);
this.line.setAttribute("y2", c - f);
break;
case 10:
this.setCurrentType("line");
this.backgroundTransparent = !0;
d = c = 10 + 4 * b;
this.line.setAttribute("x1", d / 2 - f);
this.line.setAttribute("y1", f);
this.line.setAttribute("x2", d / 2 - f);
this.line.setAttribute("y1", c - f);
break;
case 11:
this.setCurrentType("line"),
this.backgroundTransparent = !0,
d = c = 10 + 4 * b,
this.line.setAttribute("x1", f),
this.line.setAttribute("y2", f),
this.line.setAttribute("x2", d - f),
this.line.setAttribute("y1", c - f)
}
this.svg.setAttribute("width", d);
this.svg.setAttribute("height", c);
this.width = d;
this.height = c;
this.setColor(this.color);
this.setPosition(this.deg, this.italic)
},
setColor: function(b) {
this.color = b;
this.setStyle("stroke", b);
this.backgroundTransparent ? this.setStyle("fill", "transparent") : this.setStyle("fill", b)
}
}),
y = c({
name: "arrow",
toolbar: p,
createGraphics: function(b) {
this._super(b);
this.italic = parseInt(b[12] || 1, 10);
this.headArrow = new u(!1, "false", b);
this.endArrow = new u(!0, "false", b);
this.deg = parseInt(b[11], 10);
this.headArrow.setPosition(this.deg, this.italic);
this.endArrow.setPosition(this.deg, this.italic);
this.container.appendChild(this.headArrow.container);
this.container.appendChild(this.endArrow.container);
this.setStrokeWidth(b[9] || "1");
this.setStroke(b[6] || "rgba(0, 0, 0, 1)");
this.setArrowType("endArrowType", b[14] || 10);
this.setArrowType("headArrowType", b[13] || 5)
},
setArrowType: function(b, c) {
var d;
"endArrowType" === b ? (d = this.endArrow, this.endArrowType = c) : (d = this.headArrow, this.headArrowType = c);
d.setType(c);
d.setStrokeWidth(this.strokeWidth)
},
setStroke: function(b) {
this._super(b);
this.headArrow.setColor(b);
this.endArrow.setColor(b)
},
setStrokeWidth: function(b) {
b = parseInt(b, 10);
this._super(b);
this.headArrow.setStrokeWidth(b);
this.endArrow.setStrokeWidth(b)
},
css: function(b, c, d, e) {
this._super(b, c, d, e);
b = 180 * Math.atan(this.prevHeight / this.prevWidth) / Math.PI;
this.prevHeight <= this.minHeight && (b = 0);
this.prevWidth <= this.minWidth && (b = 90);
this.deg = b;
this.headArrow.setPosition(b, this.italic);
this.endArrow.setPosition(b, this.italic)
}
}).extend(m),
v = {
shapes: {
ellipse: w,
rect: r,
line: m,
arrow: y
},
getShape: function(b, c, d) {
return this.shapes[b] ? new this.shapes[b](c, d) : null
}
};
c = c({
create: function() {
this.containerArray = {};
this.graphics = {};
this.activedShape = null
},
bindOnCreated: function(b, c) {
this.onCreated = [b, c]
},
addEvent: function(b, c, e) {
var f = this,
g = v.getShape(e);
this.containers = this.containers ? this.containers.add(c) : c;
c.css("cursor", "crosshair");
c.one("contextmenu.draw",
function(b) {
b.preventDefault();
return ! 1
});
c.off("mousedown.draw touchstart.draw").one("mousedown.draw touchstart.draw",
function(e) {
e.stopPropagation();
e.preventDefault();
var h, k, l, m, n, p = e.button,
q = c.offset().top,
s = c.offset().left;
if (!document.implementation.hasFeature("MouseEvents", "2.0")) switch (event.button) {
case 0:
case 1:
case 3:
case 5:
case 7:
p = 0;
break;
case 2:
case 6:
p = 2;
break;
case 4:
p = 1
}
p ? (g._parsePresentValue(), f.delEvents(), f.popUpButton()) : (e.pageX ? (h = e.pageX, k = e.pageY) : e.originalEvent.touches && (n = !0, h = e.originalEvent.touches[0].pageX, k = e.originalEvent.touches[0].pageY), c.append(g.$container), f.groupGraphicByIndex(b, g), g.draw(h, h, k, k, s, q), c.off("mousemove.draw touchmove.draw").on("mousemove.draw touchmove.draw",
function(b) {
b.preventDefault();
b.stopPropagation();
n ? (l = b.originalEvent.touches[0].pageX, m = b.originalEvent.touches[0].pageY) : (l = b.pageX, m = b.pageY);
g.draw(h, l, k, m, s, q, d.scale())
}), c.off("mouseup.draw touchend.draw").one("mouseup.draw touchend.draw",
function() {
g._parsePresentValue();
f.delEvents();
f.popUpButton();
g.active(c);
g.$container.on("mousedown mouseup",
function(b) {
b.stopPropagation()
});
f.save()
}))
})
},
groupGraphicByIndex: function(b, c) {
this.graphics[b] || (this.graphics[b] = []);
this.graphics[b].push(c)
},
removeGraphicByIndex: function(b) {
var c, d = this.graphics,
e, f;
for (c in d) if (d.hasOwnProperty(c) && c == b) {
f = d[c];
for (e = 0; f[e];) f[e].$container.remove(),
e++;
d[c] = []
}
},
removeGraphic: function(b) {
var c, d, e, f = this.graphics;
for (d in f) if (f.hasOwnProperty(d) && f[d]) for (c = 0, e = f[d]; e[c];) e[c] === b && e.splice(c, 1),
c++
},
popUpButton: function() {
this.onCreated && this.onCreated[1].call(this.onCreated[0])
},
delEvents: function() {
this.containers && this.containers.off("mousedown.draw touchstart.draw contextmenu.draw mousemove.draw touchmove.draw").css("cursor", "auto");
this.containers = null
},
getPageContent: function(b) {
for (var c, d = 0,
e, f, g, h, k = this.graphics[b]; k && (c = k[d]);) {
switch (c.name) {
case "line":
b = [c._width, c._height, c._left, c._top, c.fill, c.fillOpacity, c.stroke, c.strokeDasharray, c.strokeOpacity, c.strokeWidth, c.italic];
e || (e = []);
e.push(b.join("$$"));
break;
case "arrow":
b = [c._width, c._height, c._left, c._top, c.fill, c.fillOpacity, c.stroke, c.strokeDasharray, c.strokeOpacity, c.strokeWidth, c.currentType, c.deg, c.italic, c.headArrowType, c.endArrowType];
f || (f = []);
f.push(b.join("$$"));
break;
case "rect":
b = [c._width, c._height, c._left, c._top, c.fill, c.fillOpacity, c.stroke, c.strokeDasharray, c.strokeOpacity, c.strokeWidth];
g || (g = []);
g.push(b.join("$$"));
break;
case "ellipse":
b = [c._width, c._height, c._left, c._top, c.fill, c.fillOpacity, c.stroke, c.strokeDasharray, c.strokeOpacity, c.strokeWidth],
h || (h = []),
h.push(b.join("$$"))
}
d++
}
b = [e && e.join("@@"), f && f.join("@@"), g && g.join("@@"), h && h.join("@@")];
return b.join("##")
},
saveByIndex: function(b) {
var c = new Date,
d = this.getPageContent(b) || "";
try {
window.localStorage ? (window.localStorage.removeItem(window.location.href.replace(window.location.hash, "") + "flipHtml5Shapes" + b), "" !== d && "######" !== d && window.localStorage.setItem(window.location.href.replace(window.location.hash, "") + "flipHtml5Shapes" + b, d)) : ("" === d || "######" === d ? c = new Date("01 Jan 1970 00:00:01") : (c = new Date, c.setDate(c.getDate() + this.expires)), document.cookie = window.location.href.replace(window.location.hash, "") + "flipHtml5Shapes" + b + "=" + d + ";expires=" + c.toUTCString() + ";")
} catch(e) {}
},
save: function() {
var b, c = d.getCurrentPages();
for (b = 0; b < c.length; b++) this.containerArray[d.getBookType()][c[b]] && this.saveByIndex(c[b])
},
restoreByIndex: function(b, c) {
var d, e;
this.removeGraphicByIndex(b);
try {
if (window.localStorage ? d = window.localStorage.getItem(window.location.href.replace(window.location.hash, "") + "flipHtml5Shapes" + b) || "": (e = RegExp("(?:(?:^|.*;\\s*)" + window.location.href.replace(window.location.hash, "") + "flipHtml5Shapes" + b + "\\s*\\=\\s*([^;]*).*$)|^.*$"), d = (document.cookie || "").replace(e, "$1")), d && 0 !== d.length) {
var f, g;
e = 0;
for (var h = d.split("##"), k = h[0].split("@@"), l = h[1].split("@@"), m = h[2].split("@@"), n = h[3].split("@@"); f = k[e++];) g = v.getShape("line", f.split("$$"), c),
c.append(g.container),
this.groupGraphicByIndex(b, g);
for (e = 0; f = l[e++];) g = v.getShape("arrow", f.split("$$"), c),
c.append(g.container),
this.groupGraphicByIndex(b, g);
for (e = 0; f = m[e++];) g = v.getShape("rect", f.split("$$"), c),
c.append(g.container),
this.groupGraphicByIndex(b, g);
for (e = 0; f = n[e++];) g = v.getShape("ellipse", f.split("$$"), c),
c.append(g.container),
this.groupGraphicByIndex(b, g)
}
} catch(p) {
throw p;
}
},
restore: function(b, c, e) {
var f = this.containerArray;
s.inactive();
q.inactive();
n.inactive();
p.inactive();
f[b] || (f[b] = {});
f[b][c] = e;
b === d.getBookType() && this.restoreByIndex(c, e)
},
setContainers: function(b, c, d) {
document.createElementNS && this.restore(b, c, d)
},
addEvents: function(b) {
var c, e = -1,
f = d.getCurrentPages(),
g = this.containerArray[d.getBookType()];
if (document.createElementNS && g) for (; e++
").css({
left: "40%"
}).appendTo(b).hide();
this.noteTitle = $("").append($("").html("Notes")).appendTo(this.note);
this.noteTitleShowBtn = $("").css({
right: 32
}).attr("title", "Minimize").append($("").attr("src", this.address + "note_narrow.png")).appendTo(this.noteTitle);
this.noteTitleCloseBtn = $("").css({
right: 3
}).attr("title", "Close").append($("").attr("src", this.address + "note_close.png")).appendTo(this.noteTitle);
this.noteButton = $("").appendTo(this.note);
var d = $("").appendTo(this.noteButton);
this.noteBottomTop = $("").appendTo(d);
this.inputText = $("").appendTo(this.noteBottomTop);
this.addBtn = $("").css({
left: 10
}).html("Add").appendTo(this.noteBottomTop);
this.removeAllBtn = $("").css({
left: "auto",
right: 20
}).html("Remove All").appendTo(this.noteBottomTop);
this.noteLists = $("").appendTo(this.noteButton);
var d = $(""),
e = $("").html("Page"),
f = $("");
f.append($("")).append($("").html("Title")).append($("")).append($("").html("Edit")).append($("")).append($("").html("Delete"));
d.append(e).append(f);
this.noteLists.append(d);
this.noteTable = $("").css({
maxHeight: 188
}).appendTo(this.noteLists);
this.noteTableInner = $("").appendTo(this.noteTable);
isTouch || this.note.transition3D();
this.createScrollBar(this.noteTable);
try {
var g = this.getLocalStorage(this.cookieName),
h = eval(g);
if (h) for (this.downJSonArrByKey(h, "page"), g = 0; g < h.length; g++) this.addListData($.extend(h[g], {
firstDown: !0
}))
} catch(k) {}
for (g = 0; g < this.rows.length; g++) this.rows[g].rowObj.css({
backgroundColor: 0 == g % 2 ? "": "#bababa"
});
this.scrollBarShowHide();
var l, m;
this.noteTitle.on("mousedown touchstart",
function(d) {
d.preventDefault();
d.stopPropagation();
d = d.originalEvent.touches ? d.originalEvent.touches[0] : d;
l = d.clientX - c.note.position().left;
m = d.clientY - c.note.position().top;
b.add(c.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(c.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).on("mousemove.noteMove touchmove.noteMove",
function(b) {
b.preventDefault();
b.stopPropagation();
c.noteTitle.css({
cursor: "move"
});
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
c.note.css({
left: b.clientX - l,
top: b.clientY - m
})
});
b.on("mouseup.noteMove touchend.noteMove",
function(d) {
d.preventDefault();
d.stopPropagation();
c.noteTitle.css({
cursor: "default"
});
b.add(c.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(c.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).off("mousemove.noteMove touchmove.noteMove");
b.off("mouseup.noteMove touchend.noteMove")
});
return ! 1
})
},
isNoteListShowHide: function() {
0 < this.noteTableInner.children("div").length ? this.noteLists.show() : this.noteLists.hide()
},
updateListDataText: function(b, c) {
var d = this.noteTexts[b],
e = this.noteImgs[b].find(".noteCookie-eachNote-img"),
d = d.find(".noteCookie-eachNote-textList-text");
e.attr("title", c);
d.val(c)
},
updateNoteImgText: function(b, c) {
this.rowObjs[b].find(".noteCookie-noteTable-cellRight-text").val(c)
},
deleteListData: function(b) {
var c = this.noteTexts[b],
d = this.svgObjs[b];
this.noteImgs[b].remove();
c.remove();
d.remove();
delete this.noteImgs[b];
delete this.rowObjs[b];
delete this.noteTexts[b];
delete this.svgObjs[b]
},
deleteNoteImg: function(b) {
this.rowObjs[b].remove();
delete this.noteImgs[b];
delete this.rowObjs[b]
},
revertNoteImgText: function(b) {
var c = this.noteTexts[b].find(".noteCookie-eachNote-textList-text");
b = this.rowObjs[b].find(".noteCookie-noteTable-cellRight-text");
c.val(b.val())
},
addListData: function(b) {
var c = this,
d = !0,
e = $("").css({
height: 28
}).attr("data-key", b.key).attr("data-page", b.page).append($("").html(b.page)).appendTo(c.noteTableInner),
f = $("").appendTo(e),
g = $("").attr("disabled", d).val(b.value).appendTo(f),
h = $("").css({
right: 60
}).attr("title", "Edit").append($("").attr("src", c.address + "note_edit.png")).appendTo(f);
$("").css({
right: 15
}).attr("title", "Delete").append($("").attr("src", c.address + "note_del.png")).appendTo(f).on("click touchend",
function(b) {
e.remove();
var d = e.attr("data-key");
c.deleteListData(d);
c.delArrayOrderKey(c.rows, d);
c.delArrayOrderKey(c.notes, d);
c.addLocalStorage(c.cookieName, c.parseJSONArrayToString(c.notes));
for (d = 0; d < c.rows.length; d++) c.rows[d].rowObj.css({
backgroundColor: 0 == d % 2 ? "": "#bababa"
});
c.scrollBarShowHide();
b.preventDefault();
b.stopPropagation();
return ! 1
});
e.on("click touchend",
function(b) {
gotoPageFun($(this).attr("data-page"))
});
h.on("click touchend",
function(b) {
if (d) d = !1,
g.css({
backgroundColor: "#ffffff",
color: "#000000"
}),
h.children("img").attr("src", c.address + "note_save.png"),
g.attr("disabled", d),
g[0].focus(),
h.attr("title", "Save");
else {
d = !0;
g.css({
backgroundColor: "transparent",
color: "#1a1a1a"
});
g.attr("disabled", d);
h.attr("title", "Edit");
var f = g.val();
h.children("img").attr("src", c.address + "note_edit.png");
var m = e.attr("data-key");
c.updateListDataText(m, f);
c.updateArrayOrderKey(c.notes, m, {
value: f
});
c.addLocalStorage(c.cookieName, c.parseJSONArrayToString(c.notes))
}
b.preventDefault();
b.stopPropagation();
return ! 1
});
c.rows.push($.extend(b, {
rowObj: e
}));
c.rowObjs[b.key] = e;
c.scrollBarShowHide();
c.notes.push(b);
c.addLocalStorage(c.cookieName, c.parseJSONArrayToString(c.notes))
},
addNoteImg: function(b, c) {
var d = this,
e = !0,
f = $("").attr("data-key", b.key).attr("data-page", b.page).css({
left: "" + b.left + "",
top: "" + b.top + ""
}).appendTo(c),
g = $("").attr("src", d.address + "note.png").attr("title", b.value).attr("data-key", b.key).attr("data-page", b.page).appendTo(f);
isTouch || f.transition3D();
try {
var h = $(document.createElementNS("http://www.w3.org/2000/svg", "svg")).css({
zIndex: 140,
position: "absolute"
}).attr("class", "noteCookie-eachNote-svg noteCookie-eachNote-svg" + b.page).appendTo(BookInfo.container()),
k = $(document.createElementNS("http://www.w3.org/2000/svg", "path")).css({
fill: "#FFF4A1",
stroke: "#C99F1D",
strokeWidth: 1
}).appendTo(h)
} catch(l) {
h = $("").css({
zIndex: 140,
position: "absolute"
}).attr("class", "noteCookie-eachNote-svg noteCookie-eachNote-svg" + b.page).appendTo(BookInfo.container()),
k = $("").css({
fill: "#FFF4A1",
stroke: "#C99F1D",
strokeWidth: 1
}).appendTo(h)
}
h.css({
left: 0,
top: 0,
width: 0,
height: 0
}).hide();
var m = $("").attr("data-key", b.key).attr("data-page", b.page).hide().appendTo(BookInfo.container());
m.css({
left: f.offset().left,
top: f.offset().top
});
m.on("click mousedown touchstart",
function(b) {
b.preventDefault();
b.stopPropagation();
return ! 1
});
var p = $("").appendTo(m),
n = $("").append($("").attr("src", d.address + "showNoteList.png")).appendTo(p),
q = $("").css({
right: 2
}).attr("title", "Close").append($("").attr("src", d.address + "noteImg_close.png")).appendTo(p),
s = $("").css({
right: 24
}).attr("title", "Save").append($("").attr("src", d.address + "noteImg_save.png")).appendTo(p),
r = $("").css({
right: 46
}).attr("title", "Delete").append($("").attr("src", d.address + "noteImg_del.png")).appendTo(p),
w = $("").appendTo(m),
u = $("").val(b.value).appendTo(w);
$("").html(b.time).appendTo(w);
u.on("mousedown click",
function(b) {
b.stopPropagation()
});
isTouch || m.transition3D();
n.on("click touchend",
function() {
d.noteButtonIsShow && d.showFlag ? (d.hide(), d.showFlag = !1) : (d.show(), d.showFlag = !0)
});
var y, v, t, x, z, C;
p.on("mousedown.note touchstart.note",
function(b) {
t = f.offset().left;
x = f.offset().top;
z = m.offset().left;
C = m.offset().top;
y = (b.pageX || b.originalEvent.touches[0].pageX) - z;
v = (b.pageY || b.originalEvent.touches[0].pageY) - C;
BookInfo.container().add(h).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).on("mousemove.noteB touchmove.noteB",
function(b) {
p.css({
cursor: "move"
});
b = isTouch ? b.originalEvent.touches[0] : b;
m.css({
left: Math.floor(b.clientX - y),
top: b.clientY - v
});
d.drawSVG(t, x, m.offset().left, m.offset().top, h, k)
});
BookInfo.container().add(h).add(p).on("mouseup.noteB touchend.noteB",
function() {
p.css({
cursor: "default"
});
BookInfo.container().add(h).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).off("mousemove.noteB touchmove.noteB");
BookInfo.container().add(h).add(p).off("mouseup.noteB touchend.noteB")
});
b.stopPropagation();
b.preventDefault();
return ! 1
});
var A, B, K;
q.on("click touchend",
function(b) {
d.revertNoteImgText(f.attr("data-key"));
m.hide();
h.hide();
D = !1
});
s.on("click touchend",
function(b) {
b = u.val();
g.attr("title", b);
var c = f.attr("data-key");
d.updateNoteImgText(c, b);
d.updateArrayOrderKey(d.notes, c, {
value: b
});
d.addLocalStorage(d.cookieName, d.parseJSONArrayToString(d.notes));
m.hide();
h.hide();
D = !1
});
r.on("click touchend",
function(b) {
A || (A = $("").appendTo(w), $("").html("Delete This Note!").appendTo(A), B = $("").css({
left: 40
}).html("Yes").appendTo(A), K = $("").css({
left: 97
}).html("No").appendTo(A), B.on("click touchend",
function(b) {
b = f.attr("data-key");
d.deleteNoteImg(b);
m.remove();
h.remove();
f.remove();
b = f.attr("data-key");
d.delArrayOrderKey(d.rows, b);
d.delArrayOrderKey(d.notes, b);
d.addLocalStorage(d.cookieName, d.parseJSONArrayToString(d.notes));
d.scrollBarShowHide();
for (b = 0; b < d.rows.length; b++) d.rows[b].rowObj.css({
backgroundColor: 0 == b % 2 ? "": "#bababa"
});
A = null
}), K.on("click touchend",
function() {
A.remove();
A = null
}))
});
var J = b.firstDown ? !1 : !0,
D = !1,
G = !1;
g.on("mouseup.noteImgShowHide touchend.noteImgShowHide",
function(b) {
if (isTouch || 1 == b.which) if (J) J = !1;
else return G ? G = !1 : D ? (m.hide(), h.hide(), D = !1) : (e && (m.css({
left: f.offset().left,
top: f.offset().top
}), e = !1), m.show(), h.show(), D = !0, d.drawSVG(f.offset().left, f.offset().top, m.offset().left, m.offset().top, h, k)),
b.preventDefault(),
b.stopPropagation(),
!1
});
$(document).add(c).on("mousedown.noteImgShowHide touchstart.noteImgShowHide",
function() {
D && (m.hide(), h.hide(), D = !1)
});
m.add(h).on("mousedown.noteImgShowHide touchstart.noteImgShowHide",
function(b) {
b.preventDefault();
b.stopPropagation();
return ! 1
});
var E, F, H, I, M, L = !1;
g.bind(_event._down,
function(b) {
b.stopPropagation();
b.preventDefault();
b = isTouch ? b.originalEvent.touches[0] : b;
E = parseFloat(f[0].offsetLeft);
F = parseFloat(f[0].offsetTop);
H = b.clientX;
I = b.clientY;
M = g.attr("data-key");
L = !0;
if (D) var e = m.offset().left,
k = m.offset().top,
l = h.offset().left,
n = h.offset().top;
c.on("mousemove.noteObj touchmove.noteObj",
function(b) {
b.stopPropagation();
b.preventDefault();
if (L) {
f.css({
cursor: "move"
});
b = isTouch ? b.originalEvent.touches[0] : b;
var g = E * BookInfo.scale() - (H - b.clientX),
p = F * BookInfo.scale() - (I - b.clientY),
g = g / (c.width() * BookInfo.scale()) * 100 + "%",
p = p / (c.height() * BookInfo.scale()) * 100 + "%";
f.css({
left: g,
top: p
});
D && (m.css({
left: e + (b.clientX - H),
top: k + (b.clientY - I)
}), h.css({
left: l + (b.clientX - H),
top: n + (b.clientY - I)
}));
if (8 < Math.abs(b.clientX - H) || 8 < Math.abs(b.clientY - I)) G = !0;
d.updateArrayOrderKey(d.notes, M, {
left: g,
top: p
});
d.addLocalStorage(d.cookieName, d.parseJSONArrayToString(d.notes))
}
});
c.add(g).on("mouseup.noteObj touchend.noteObj",
function(b) {
L && (f.css({
cursor: "default"
}), G = L = !1, c.off("mousemove.noteObj touchmove.noteObj"), c.add(g).off("mouseup.noteObj touchend.noteObj"))
});
return ! 1
});
p.bind(_event._down,
function() {
$(".noteCookie-eachNote-textList").removeClass("noteCookie-eachNote-textList-current");
$(".noteCookie-eachNote").removeClass("noteCookie-eachNote-textList-current");
m.addClass("noteCookie-eachNote-textList-current");
f.addClass("noteCookie-eachNote-textList-current")
});
d.noteImgs[b.key] = f;
d.noteTexts[b.key] = m;
d.svgObjs[b.key] = h
},
addNoteImgByPageIndex: function(b, c) {
c.find(".noteCookie-eachNote").remove();
$(".noteCookie-eachNote-text" + b).remove();
$(".noteCookie-eachNote-svg" + b).remove();
for (var d = 0; d < this.notes.length; d++) this.notes[d].page === b && this.addNoteImg(this.notes[d], c)
},
addListDataAndNoteImg: function(b, c) {
this.addListData(b);
this.addNoteImg(b, c)
},
drawSVG: function(b, c, d, e, f, g) {
var h, k, l, m, p, n;
b + 28 >= d + 90.5 && c + 28 <= e ? (n = c + 28, e -= n, b + 28 <= d + 109 ? (p = b + 28, m = d + 181 - 24 - b + 28, c = b = 0, h = d + 181 - 24 - 48 - p, k = e, d = d + 181 - 24 - p) : (p = d + 109, d + 181 - 24 >= b + 28 ? (m = 48, b = b + 28 - p) : b = m = b + 28 - p, h = c = 0, k = e, d = 48), l = e) : b + 28 < d + 90.5 && c + 28 <= e ? (n = c + 28, e -= n, b + 28 <= d + 24 ? (p = b + 28, m = d + 24 + 48 - p, c = b = 0, h = m - 48, k = e, d = m) : (p = d + 24, d + 24 + 48 <= b + 28 ? b = m = b + 28 - p: (m = 48, b = b + 28 - p), h = c = 0, k = e, d = 48), l = e) : b + 28 >= d + 90.5 && c >= e + 141 - 28 ? (n = e + 141, e = c + 28 - n, b + 28 <= d + 109 ? (p = b + 28, m = d + 181 - 24 - b + 28, b = 0, c = e, h = d + 181 - 24 - 48 - p, k = 0, d = d + 181 - 24 - p) : (p = d + 109, d + 181 - 24 >= b + 28 ? (m = 48, b = b + 28 - p) : b = m = b + 28 - p, c = e, k = h = 0, d = 48), l = 0) : b + 28 < d + 90.5 && c >= e + 141 - 28 ? (n = e + 141, e = c + 28 - n, b + 28 <= d + 24 ? (p = b + 28, m = d + 24 + 48 - p, b = 0, c = e, h = m - 48, k = 0, d = m) : (p = d + 24, d + 24 + 48 <= b + 28 ? b = m = b + 28 - p: (m = 48, b = b + 28 - p), c = e, k = h = 0, d = 48), l = 0) : d + 181 <= b + 28 && c + 28 >= e && c + 28 <= e + 70.5 ? (p = d + 181, m = b + 28 - p, c + 28 <= e + 20 ? (n = c + 28, e = e + 20 + 48 - n, b = m, h = c = 0, k = e - 48, d = 0, l = e) : e + 20 + 48 <= c + 28 ? (n = e + 20, e = c + 28 - n, b = m, c = e, d = k = h = 0, l = 48) : (n = e + 20, e = 48, b = m, c = c + 28 - n, d = k = h = 0, l = e)) : d + 181 <= b + 28 && c + 28 <= e + 141 && c + 28 >= e + 70.5 ? (p = d + 181, m = b + 28 - p, c + 28 <= e + 141 - 20 - 48 ? (n = c + 28, e = e + 141 - 20 - n, b = m, h = c = 0, k = e - 48, d = 0, l = e) : e + 141 - 20 <= c + 28 ? (n = e + 141 - 68, e = c + 28 - n, b = m, c = e, d = k = h = 0, l = 48) : (n = e + 141 - 68, e = 48, b = m, c = c + 28 - n, d = k = h = 0, l = e)) : d >= b + 28 && c + 28 >= e && c + 28 <= e + 70.5 ? (p = b + 28, m = d - p, c + 28 <= e + 20 ? (n = c + 28, e = e + 20 + 48 - n, c = b = 0, h = m, k = e - 48, d = m, l = e) : e + 20 + 48 <= c + 28 ? (n = e + 20, e = c + 28 - n, b = 0, c = e, h = m, k = 0, d = m, l = 48) : (n = e + 20, e = 48, b = 0, c = c + 28 - n, h = m, k = 0, d = m, l = e)) : d >= b + 28 && c + 28 <= e + 141 && c + 28 >= e + 70.5 ? (p = b + 28, m = d - p, c + 28 <= e + 141 - 20 - 48 ? (n = c + 28, e = e + 141 - 20 - n, c = b = 0, h = m, k = e - 48, d = m, l = e) : e + 141 - 20 <= c + 28 ? (n = e + 141 - 68, e = c + 28 - n, b = 0, c = e, h = m, k = 0, d = m, l = 48) : (n = e + 141 - 68, e = 48, b = 0, c = c + 28 - n, h = m, k = 0, d = m, l = e)) : (k = h = c = b = m = e = n = p = 0, d = 48, l = 0);
f.show().css({
width: m,
height: e,
left: p,
top: n
});
g.attr("d", "M" + d + "," + l + " L" + b + "," + c + " L" + h + "," + k)
},
bindEvents: function() {
var b = this,
c = !1,
d = function() {
$.each(BookInfo.getCurrentPages(),
function(c, d) {
if (b.noteImgContainers[BookInfo.getBookType()]) {
var g = b.noteImgContainers[BookInfo.getBookType()][d];
g && (g.css({
cursor: ""
}), g.off("mousedown.addNote touchstart.addNote"))
}
});
c = !1
};
BookInfo.container().on("mousedown.addNote touchstart.addNote",
function() {
d()
});
b.addBtn.bind(_event._end,
function(e) {
var f = b.inputText.val();
if (f) {
b.noteButtonIsShow = !1;
b.noteTitleShowBtn.children("img").attr("src", b.address + "note_revert.png");
b.noteButton.css({
maxHeight: 0,
paddingBottom: 0
});
c = !0;
var g = BookInfo.getCurrentPages();
$.each(g,
function(e, g) {
var l = b.noteImgContainers[BookInfo.getBookType()][g];
if (l) l.css({
cursor: "url(" + b.address + "note.png),auto"
}).on(_event._down,
function(e) {
b.noteButtonIsShow = !1;
b.noteTitleShowBtn.children("img").attr("src", b.address + "note_revert.png");
b.noteButton.css({
maxHeight: 0
});
if (c) {
if (!e.which || 3 != e.which) {
var h = (e.pageX || e.originalEvent.touches[0].pageX) - l.offset().left;
e = (e.pageY || e.originalEvent.touches[0].pageY) - l.offset().top;
h = h / (l.width() * BookInfo.scale()) * 100 + "%";
e = e / (l.height() * BookInfo.scale()) * 100 + "%";
h = {
key: (new Date).getTime(),
time: (new Date).format("yyyy-MM-dd hh:mm:ss", !0),
value: f,
left: h,
top: e,
page: g
};
b.addListDataAndNoteImg(h, $(this));
b.downJSonArrByKey(b.rows, "page");
$(".noteCookie-noteTable-row").detach();
for (h = 0; h < b.rows.length; h++) b.rows[h].rowObj.css({
backgroundColor: 0 == h % 2 ? "": "#bababa"
}),
b.rows[h].rowObj.appendTo(b.noteTableInner);
b.scrollBarShowHide();
b.inputText.val("")
}
d()
}
})
})
}
e.preventDefault();
e.stopPropagation();
return ! 1
});
b.noteTitleShowBtn.on(_event._down,
function() {
b.noteButtonIsShow ? (b.noteButtonIsShow = !1, b.noteTitleShowBtn.children("img").attr("src", b.address + "note_revert.png"), b.noteButton.css({
maxHeight: 0,
paddingBottom: 0
})) : (b.noteButtonIsShow = !0, b.noteTitleShowBtn.children("img").attr("src", b.address + "note_narrow.png"), b.noteButton.css({
maxHeight: 9999,
paddingBottom: 6
}))
});
b.noteTitleCloseBtn.on("click.note touchend.note",
function(c) {
void 0 != b.onCreated ? b.onCreated[1].call(b.onCreated[0]) : b.hide();
c.preventDefault();
c.stopPropagation();
return ! 1
});
b.removeAllBtn.on("click.note touchend.note",
function() {
$(".noteCookie-eachNote").remove();
$(".noteCookie-eachNote-svg").remove();
$(".noteCookie-eachNote-textList").remove();
$(".noteCookie-noteTable-row").remove();
b.notes = [];
b.rowObjs = {};
b.noteImgs = {};
b.noteTexts = {};
b.svgObjs = {};
b.rows = [];
b.addLocalStorage(b.cookieName, b.parseJSONArrayToString(b.notes));
b.scrollBarShowHide()
})
},
setContainers: function(b, c, d) {
void 0 == this.noteImgContainers[b] && (this.noteImgContainers[b] = {});
this.noteImgContainers[b][c] = d;
b == BookInfo.getBookType() && ($(".noteCookie-eachNote-textList").hide(), $(".noteCookie-eachNote-svg").hide(), this.addNoteImgByPageIndex(c, d))
},
show: function() {
this.showFlag = !0;
this.note.show();
parseInt(this.note.css("left")) > this.container.width() && this.note.css({
left: "50%"
});
0 > parseInt(this.note.css("top")) && this.note.css({
top: 24
});
this.noteButtonIsShow = !0;
this.noteTitleShowBtn.children("img").attr("src", this.address + "note_narrow.png");
this.noteButton.css({
maxHeight: 9999,
paddingBottom: 6
});
this.scrollBarShowHide()
},
hide: function() {
this.showFlag = !1;
this.note.hide()
},
bindOnCreated: function(b, c) {
this.onCreated = [b, c]
},
showHide: function() {
this.showFlag ? this.hide() : this.show()
},
parseJSONArrayToString: function(b) {
if (0 != b.length) {
for (var c = "[",
d = 0; d < b.length; d++) c += "{key:'" + b[d].key + "',value:'" + b[d].value + "',page:" + b[d].page + ",time:'" + b[d].time + "',left:'" + b[d].left + "',top:'" + b[d].top + "'},";
c = c.substring(0, c.length - 1);
return c + "]"
}
},
delArrayOrderKey: function(b, c) {
if (b) for (var d = 0; d < b.length; d++) b[d].key && b[d].key == c && b.remove(d)
},
updateArrayOrderKey: function(b, c, d) {
if (b) for (var e = 0; e < b.length; e++) b[e].key && b[e].key == c && $.extend(b[e], d)
},
downJSonArrByKey: function(b, c) {
b.sort(function(b, e) {
return parseInt(b[c]) > parseInt(e[c]) ? 1 : parseInt(b[c]) == parseInt(e[c]) ? 0 : -1
})
},
isArray: function(b) {
return "[object Array]" == Object.prototype.toString.call(b)
},
getLocalStorage: function(b) {
try {
if (window.localStorage) return window.localStorage.getItem(b);
for (var c = document.cookie.split("; "), d = 0; d < c.length; d++) {
var e = c[d].split("=");
if (e[0] == b) return unescape(e[1])
}
return ""
} catch(f) {}
},
addLocalStorage: function(b, c) {
try {
if (window.localStorage) window.localStorage.setItem(b, c);
else {
var d = b + "=" + escape(c),
e = new Date;
e.setTime(e.getTime() + 864E8);
d += "; expires=" + e.toGMTString();
document.cookie = d
}
} catch(f) {}
},
createScrollBar: function(b) {
b = $("
", {
"class": "InnerScroll",
css: {
position: "absolute",
width: 6,
height: "100%",
marginLeft: 0,
marginRight: 0,
left: 0,
top: 0,
backgroundColor: "#5e5e5e",
borderRadius: 0,
cursor: "pointer"
}
}).appendTo(e);
this.scrollBar = b;
this.outerScroll = e;
this.bindScrollBarEvents(b, e, c, d)
},
scrollBarShowHide: function(b, c) {
var d = b.outerHeight() * this.scrollBar.outerHeight() / c.outerHeight();
this.outerScroll.css({
height: d
});
b.height() >= c.height() ? (this.scrollBar.hide(), c.css({
top: 0
}), $(".flipHTML5VideoGallery-eachVideoDes").css({
width: 231
})) : (this.scrollBar.show(), $(".flipHTML5VideoGallery-eachVideoDes").css({
width: 224
}), Math.abs(parseFloat(c.css("top"))) > c.outerHeight() - b.outerHeight() && (c.css({
top: -(c.outerHeight() - b.outerHeight())
}), this.outerScroll.css({
top: this.scrollBar.outerHeight() - this.outerScroll.outerHeight()
})))
},
bindScrollBarEvents: function(b, c, d, e) {
var f = this;
c.on(_event._down,
function(b) {
var h = b || event,
k = h.clientY - f.outerScroll.position().top,
l = b.which;
b.stopPropagation();
1 == l && ($(document).add(f.outerScroll).add(f.videoGallery).on("mousemove.scrollBar touchmove.scrollBar",
function(b) {
b.preventDefault();
b.stopPropagation();
h = b || event;
b = h.clientY - k;
0 >= b ? b = 0 : b >= f.scrollBar.outerHeight() - f.outerScroll.outerHeight() && (b = f.scrollBar.outerHeight() - f.outerScroll.outerHeight());
c.css({
top: b
});
e.css({
top: -b / (f.scrollBar.outerHeight() - f.outerScroll.outerHeight()) * (e.outerHeight() - d.outerHeight())
})
}), $(document).add(f.outerScroll).add(f.videoGallery).on("mouseup.scrollBar touchend.scrollBar",
function(b) {
b = b || event;
b.preventDefault();
b.stopPropagation();
$(document).add(f.outerScroll).add(f.videoGallery).off("mousemove.scrollBar touchmove.scrollBar");
$(document).add(f.outerScroll).add(f.videoGallery).off("mouseup.scrollBar touchend.scrollBar")
}))
});
d.bind($.browser.mozilla ? "DOMMouseScroll": "mousewheel",
function(f) {
if (! (d.outerHeight() >= e.outerHeight())) {
var h = f.originalEvent,
h = h.wheelDelta || -h.detail,
k = e.position().top,
l;
e.stop(!1, !1);
0 < h ? l = 0 > k + d.outerHeight() / 11 ? k + d.outerHeight() / 11 : 0 : 0 > h && (l = e.outerHeight() - d.outerHeight() > -(k - d.outerHeight() / 11) ? k - d.outerHeight() / 11 : -(e.outerHeight() - d.outerHeight()));
e.css({
top: l
});
c.css({
top: -l / (e.outerHeight() - d.outerHeight()) * (b.outerHeight() - c.outerHeight())
});
f.stopPropagation();
f.preventDefault();
return ! 1
}
});
f.list.on("mousedown.pad touchstart.pad",
function(b) {
var c = parseInt(f.list.css("top")),
d = f.table.height(),
e = f.list.outerHeight(),
m = b.pageY || b.originalEvent.touches[0].pageY;
f.table.on("mousemove.pad touchmove.pad",
function(b) {
b = c + ((b.pageY || b.originalEvent.touches[0].pageY) - m);
b = 0 < b ? 0 : b < d - e ? d - e: b;
f.list.css({
top: b
})
});
f.table.on("mouseup.pad touchend.pad",
function(b) {
f.table.off("mousemove.pad touchmove.pad");
f.table.off("mouseup.pad touchend.pad")
})
})
},
encodeHTML: function(b) {
return b ? b.replace(/&/g, "&").replace(//g, ">").replace(/\\/g, "\").replace(/"/g, """).replace(/'/g, "'").replace(/\n/g, " ") : b
}
}),
PhotoGallery = Class({
create: function(b, c) {
this.$container = b;
this.photoArr = this.formatData(c);
this.currentIndex = 0;
this.photoFlag = !1;
this.originals = [];
this.createPhotoGallery(b)
},
formatData: function(b) {
for (var c = [], d = 0; d < b.length; d++) {
var e = b[d];
c.push({
src: e,
thumbSrc: e,
title: this.getFileNameByFilePath(e)
})
}
return c
},
getFileNameByFilePath: function(b) {
var c = b.lastIndexOf("/"),
d = b.lastIndexOf("\\"),
c = Math.max(c, d);
if (0 > c) return c = b.lastIndexOf("."),
b.substring(0, c);
b = b.substring(c + 1);
c = b.lastIndexOf(".");
return b.substring(0, c)
},
createPhotoGallery: function(b) {
var c = this;
this.photoBG = $("").append($("").css({
opacity: 0.5
})).hide().appendTo(b);
this.closeBtn = $("").append($("").attr("src", uiBaseURL + "photoGallery_close.png")).appendTo(this.photoBG);
this.outPhotoGallery = $("").css({
left: (this.photoBG.width() - 328) / 2,
top: (this.photoBG.height() - 328) / 2
}).appendTo(this.photoBG);
this.photoGallery = $("").appendTo(this.outPhotoGallery);
this.mimCloseBtn = $("").append($("").attr("src", uiBaseURL + "close.png")).appendTo(this.outPhotoGallery);
this.photoImg = $("").appendTo(this.photoGallery);
this.prevBtn = $("").css({
left: -32
}).append($("").attr("src", uiBaseURL + "photo_prev.png")).appendTo(this.photoGallery);
this.nextBtn = $("").css({
right: -32
}).append($("").attr("src", uiBaseURL + "photo_next.png")).appendTo(this.photoGallery);
this.closeTitle = $("").html("close").hide().appendTo(this.photoBG);
this.mimCloseBtn.on({
"mouseover touchstart": function(b) {
c.mimCloseBtn.children("img")[0].src = uiBaseURL + "close_down.png";
b.preventDefault();
b.stopPropagation();
return ! 1
},
"mouseout touchend": function(b) {
c.mimCloseBtn.children("img")[0].src = uiBaseURL + "close.png";
b.preventDefault();
b.stopPropagation();
return ! 1
}
});
this.mimCloseBtn.on("click mousemove touchmove",
function(b) {
b.preventDefault();
b.stopPropagation();
return ! 1
});
this.prevBtn.on("click touchend",
function() {
c.prev(1)
});
this.nextBtn.on("click touchend",
function() {
c.next(1)
});
this.outPhotoGallery.on({
"mouseover touchstart": function(b) {
c.closeTitle.hide();
b.preventDefault();
b.stopPropagation();
try {
var e = $(this).position().left,
f = (b.pageX || b.originalEvent.touches[0].pageX) - e,
g = $(this).outerWidth() / 2;
f <= g ? (c.prevBtn.stop(!1, !1).animate({
left: 0
},
{
duration: 60,
easing: "linear"
}), c.nextBtn.stop(!1, !1).animate({
right: -32
},
{
duration: 60,
easing: "linear"
})) : (c.prevBtn.stop(!1, !1).animate({
left: -32
},
{
duration: 60,
easing: "linear"
}), c.nextBtn.stop(!1, !1).animate({
right: 0
},
{
duration: 60,
easing: "linear"
}))
} catch(h) {
Log.error(h)
}
return ! 1
},
"mouseout touchend": function(b) {
b.preventDefault();
b.stopPropagation();
c.closeTitle.hide();
c.prevBtn.stop(!1, !1).animate({
left: -32
},
{
duration: 60,
easing: "linear"
});
c.nextBtn.stop(!1, !1).animate({
right: -32
},
{
duration: 60,
easing: "linear"
});
return ! 1
},
"mousemove touchmove": function(b) {
b.preventDefault();
b.stopPropagation();
c.closeTitle.hide();
try {
var e = $(this).position().left,
f = (b.pageX || b.originalEvent.touches[0].pageX) - e,
g = $(this).outerWidth() / 2;
f <= g ? (c.prevBtn.stop(!1, !1).animate({
left: 0
},
{
duration: 60,
easing: "linear"
}), c.nextBtn.stop(!1, !1).animate({
right: -32
},
{
duration: 60,
easing: "linear"
})) : (c.prevBtn.stop(!1, !1).animate({
left: -32
},
{
duration: 60,
easing: "linear"
}), c.nextBtn.stop(!1, !1).animate({
right: 0
},
{
duration: 60,
easing: "linear"
}))
} catch(h) {
Log.error(h)
}
return ! 1
},
"click touchstart": function(b) {
b.preventDefault();
b.stopPropagation();
try {
var e = c.outPhotoGallery.position().left,
f = (b.pageX || b.originalEvent.touches[0].pageX) - e,
g = c.outPhotoGallery.outerWidth() / 2;
f <= g ? c.prev(1) : c.next(1)
} catch(h) {
Log.error(h)
}
return ! 1
}
});
this.photoBG.add(this.mimCloseBtn).on({
"mouseover touchstart": function(b) {
try {
c.closeTitle.show();
var e = b.pageY || b.originalEvent.touches[0].pageY;
c.closeTitle.css({
left: (b.pageX || b.originalEvent.touches[0].pageX) - 17,
top: e + 28 > c.photoBG.height() - 15 ? e - 28 : e + 28
}).show()
} catch(f) {
Log.error(f)
}
},
"mouseout touchend": function(b) {
c.closeTitle.hide()
},
"mousemove touchmove": function(b) {
try {
var e = b.pageY || b.originalEvent.touches[0].pageY;
c.closeTitle.css({
left: (b.pageX || b.originalEvent.touches[0].pageX) - 17,
top: e + 28 > c.photoBG.height() - 15 ? e - 28 : e + 28
})
} catch(f) {
Log.error(f)
}
},
"click touchstart": function() {
c.hide()
}
});
this.createThumbs(this.photoBG);
0 < this.photoArr.length && this.skipTo(0);
window.onresize = function() {
c.outPhotoGallery.css({
left: (c.photoBG.width() - c.outPhotoGallery.outerWidth()) / 2,
top: (c.photoBG.height() - c.outPhotoGallery.outerHeight()) / 2
});
if (0 < c.photoArr.length) {
c.reviseThumb();
c.thumbList && c.moveThumb(c.currentIndex);
var b = c.photoBG.width(),
e = c.photoBG.height() - 64,
f = c.originals[c.currentIndex],
g = c.resizeImgSize(b, e, f.width, f.height),
f = g.width,
g = g.height;
c.photoImg.css({
left: 0,
top: 0,
width: f,
height: g
});
c.outPhotoGallery.css({
left: (b - f - 16) / 2,
top: (e - g - 16) / 2,
width: f,
height: g
})
}
}
},
loadImg: function(b) {
var c = this,
d = c.photoBG.width(),
e = c.photoBG.height() - 64,
f = new Image;
f.onload = function() {
f.onload = f.onerror = null;
var b = this.width,
h = this.height,
k = c.resizeImgSize(d, e, b, h);
c.originals[c.currentIndex] = {
width: b,
height: h
};
c.photoImg.attr({
originalWidth: b,
originalHeight: h
});
b = k.width;
h = k.height;
c.photoImg.css({
left: 0,
top: 0,
width: b,
height: h
});
c.outPhotoGallery.stop(!1, !1).animate({
left: (d - b - 16) / 2,
top: (e - h - 16) / 2,
width: b,
height: h
},
{
duration: 240,
easing: "linear",
complete: function() {
c.photoGallery.removeClass("flipHTML5Loading");
c.photoImg.fadeIn(500)
}
})
};
f.onerror = function() {
f.onload = f.onerror = null;
c.photoImg.css({
left: (c.outPhotoGallery.width() - 18) / 2,
top: (c.outPhotoGallery.height() - 20) / 2
});
c.originals[c.currentIndex] = {
width: 18,
height: 20
};
c.photoGallery.removeClass("flipHTML5Loading");
c.photoImg.show().attr("src", b)
};
f.src = b;
c.photoImg.attr("src", b)
},
resizeImgSize: function(b, c, d, e) {
var f = d / e;
d + 16 >= b && e + 16 >= c ? f >= b / c ? (d = b - 16, e = d / f) : (e = c - 16, d = e * f) : d + 16 >= b && e + 16 < c ? (d = b - 16, e = d / f) : d + 16 < b && e + 16 >= c && (e = c - 16, d = e * f);
return {
width: d,
height: e
}
},
next: function(b) {
this.skipTo(this.currentIndex + (b ? b: 1))
},
prev: function(b) {
this.skipTo(this.currentIndex - (b ? b: 1))
},
skipTo: function(b) {
0 >= this.photoArr.length || (this.photoGallery.addClass("flipHTML5Loading"), this.photoImg.hide().attr("src", ""), b = this.formatIndex(b), this.loadImg(this.photoArr[b].src), this.currentIndex = b, this.thumbSkipTo(b))
},
formatIndex: function(b) {
var c = this.photoArr.length;
0 > b ? b = (b + c) % c: b >= c && (b %= c);
return b
},
createThumbs: function(b) {
var c = this,
d = this.photoArr,
e = d.length,
f = 0 < e ? 54 * e + 4 * (e - 1) : 0;
b = $("").appendTo(b);
var g = $("").appendTo(b),
h = $("").css({
width: f
}).appendTo(g),
k = $("").appendTo(b).hide();
h.on({
"mouseover touchstart": function(b) {
c.closeTitle.hide()
},
"mousemove touchmove": function(b) {
c.closeTitle.hide()
},
"click touchstart": function(b) {
b.preventDefault();
b.stopPropagation();
return ! 1
}
});
this.thumb = b;
this.thumbView = g;
this.thumbList = h;
this.reviseThumb();
this.mouseThumb();
for (var l = 0; l < e; l++)(function(b) {
var e = 58 * b,
f = $("").attr({
id: "flipHTML5PhotoThumb" + b,
"class": "flipHTML5Loading flipHTML5PhotoThumb"
}).css({
width: 50,
height: 54,
left: e
}).appendTo(h),
g = $("").css({
opacity: 0
}).appendTo(f),
s = $("").attr({
id: "flipHTML5PhotoThumbBG" + b,
"class": "flipHTML5PhotoThumbBG"
}).css({
opacity: 0.5
}).appendTo(f),
r = new Image;
r.onload = function() {
r.onload = r.onerror = null;
var b = this.width / this.height,
c = 54 * b,
d = 50 / b;
50 < c ? g.css({
width: 50,
height: d,
top: (54 - d) / 2,
left: 0
}) : 54 < d ? g.css({
width: c,
height: 54,
left: (50 - c) / 2,
top: 0
}) : c / d == b && g.css({
width: c,
height: d,
left: 0,
top: 0
});
g.css({
opacity: 1
});
f.removeClass("flipHTML5Loading")
};
r.onerror = function() {
r.onload = r.onerror = null;
g.css({
left: 16,
top: 17
}).css({
opacity: 1
});
f.removeClass("flipHTML5Loading")
};
g[0].src = d[l].thumbSrc;
r.src = d[l].thumbSrc;
f.on({
"click touchend": function() {
c.currentIndex !== b && c.skipTo(b)
},
"mouseover touchstart": function(d) {
try {
c.currentIndex !== b && (f.css({
borderColor: "#1ECC21"
}), s.css({
opacity: 0
}))
} catch(e) {
Log.error(e)
}
},
"mousemove touchmove": function(b) {},
"mouseout touchend": function() {
k.hide();
c.currentIndex !== b && (f.css({
borderColor: "#ffffff"
}), s.css({
opacity: 0.5
}))
}
})
})(l)
},
thumbSkipTo: function(b) {
this.thumbList && (this.thumbList.find(".flipHTML5PhotoThumbBG").css({
opacity: 0.5
}), this.thumbList.find(".flipHTML5PhotoThumb").css({
borderColor: "#ffffff"
}), this.thumbList.find("#flipHTML5PhotoThumbBG" + b).css({
opacity: 0
}), this.thumbList.find("#flipHTML5PhotoThumb" + b).css({
borderColor: "#f00"
}), this.moveThumb(b))
},
reviseThumb: function() {
var b = this.thumb.width(),
c = b / 2,
d = this.thumbList.width();
this.thumbView.css({
width: c,
left: b / 4
});
c >= d ? this.thumbList.css({
left: (c - d) / 2
}) : this.thumbList.css({
left: 0
})
},
mouseThumb: function() {
var b = this,
c = !1;
this.thumbView.on({
"mouseenter touchstart": function(d) {
try {
var e = b.thumbView.width(),
f = b.thumbList.width(),
g = f - e,
h = b.thumbView.offset().left,
k = (d.pageX || d.originalEvent.touches[0].pageX) - h - 24;
f > e && (d = (0 >= k ? 0 : k > e - 24 ? e - 48 : k) / (e - 48) * g, b.thumbList.animate({
left: -(0 > d ? 0 : d > g ? g: d)
},
{
duration: 400,
easing: "linear",
complete: function() {
c = !0
}
}))
} catch(l) {
Log.error(l)
}
},
"mousemove touchmove": function(d) {
if (c) try {
var e = b.thumbView.width(),
f = b.thumbList.width(),
g = f - e,
h = b.thumbView.offset().left,
k = (d.pageX || d.originalEvent.touches[0].pageX) - h - 24;
f > e && (d = (0 >= k ? 0 : k > e - 24 ? e - 48 : k) / (e - 48) * g, d = 0 > d ? 0 : d > g ? g: d, b.thumbList.stop(!0, !0).animate({
left: -d
},
{
duration: 400,
easing: "linear"
}))
} catch(l) {
Log.error(l)
}
},
"mouseleave touchend": function(b) {
c = !1
}
})
},
moveThumb: function(b) {
var c = this.thumbView.width(),
d = this.thumbList.outerWidth(),
e = d - c,
f = this.thumbList.position().left;
b = this.thumbList.find("#flipHTML5PhotoThumb" + b).position().left;
var g = b + f,
h = (c - 54) / 2;
d > c ? (g = Math.abs(b) - Math.abs(f), c = g - h + Math.abs(f), c = c >= e ? e: 0 >= c ? 0 : c, this.thumbList.stop(!0, !0).animate({
left: -c
},
{
duration: 240,
easing: "linear"
})) : this.thumbList.css({
left: (c - d) / 2
})
},
show: function() {
this.photoFlag = !0;
this.photoBG.show();
this.reviseThumb();
this.skipTo(0)
},
hide: function() {
this.photoFlag = !1;
this.photoBG.hide();
this.photoGallery.addClass("flipHTML5Loading");
this.outPhotoGallery.css({
left: (this.photoBG.width() - 328) / 2,
top: (this.photoBG.height() - 328) / 2,
width: 320,
height: 320
})
},
showHide: function() {
this.photoFlag ? this.hide() : this.show()
}
}),
AddImageFile = Class({
create: function(b) {
this.container = b;
this.addContexts = {};
this.address = uiBaseURL;
this.currentObject = $("
").attr("data-key", "114");
this.imageDatas = {};
this.fileName = window.location.href.replace(window.location.hash, "") + "LocalFile";
this.fileCookies = [];
this.createZoomFrame();
this.toolBar = this.createToolBar(b);
this.getCookieFile()
},
createToolBar: function(b) {
var c = this,
d = $("").appendTo(b).hide();
b = $("").css({
left: 4
}).append($("").attr("src", this.address + "signature_del.png")).appendTo(d);
var e = $("").css({
left: 32
}).append($("").attr("src", this.address + "ImgFile_update.png")).appendTo(d);
b.on("click touchend",
function(b) {
c.currentObject && (c.currentObject.remove(), d.hide(), c.zoomFrame && c.zoomFrame.hide(), b = c.currentObject.attr("data-key"), delete c.imageDatas[b], c.delArrayOrderKey(c.fileCookies, b), c.addLocalStorage(c.fileName, c.parseJSON(c.fileCookies)))
});
e.on(_event._down,
function() {
c.currentObject && c.currentObject.find(".TextFile") && c.currentObject.find(".TextFile")[0].click()
});
d.on("mousedown touchstart",
function(b) {
b.preventDefault();
b.stopPropagation();
return ! 1
});
this.container.add($(document)).add(BookInfo.container()).on("mousedown.hideToolBar touchstart.hideToolBar",
function() {
d.hide()
});
return d
},
createZoomFrame: function() {
var b = $(""),
c = [];
this.zoomFrame = b;
for (var d = 0; 9 > d; d++) {
var e = $("").addClass("flipHTML5Point flipHTML5ZoomPoint" + d).appendTo(b);
c.push(e)
}
this.westZoom(c[7]);
this.northZoom(c[1]);
this.southZoom(c[5]);
this.eastZoom(c[3]);
this.westZoom(c[0]).northZoom(c[0]);
this.northZoom(c[2]).eastZoom(c[2]);
this.westZoom(c[6]).southZoom(c[6]);
this.southZoom(c[4]).eastZoom(c[4]);
this.container.add($(document)).add(BookInfo.container()).on("mousedown.hideToolBar touchstart.hideToolBar",
function() {
b.hide()
})
},
getCookieFile: function() {
try {
var b = this.getLocalStorage(this.fileName),
c = eval(b)
} catch(d) {}
if (c) for (b = 0; b < c.length; b++) {
var e = c[b];
this.fileCookies.push({
key: e.key,
page: e.page,
fileLeft: e.fL,
fileTop: e.fT,
fileWidth: e.fW,
fileHeight: e.fH,
imgWidth: e.iW,
imgHeight: e.iH,
src: e.src
});
this.imageDatas[e.key] = {
width: e.iW,
height: e.iH
}
}
},
addFile: function(b, c) {
var d = b.src,
e = b.imgWidth,
f = b.imgHeight,
g = b.key,
h = $("").css({
width: b.fileWidth,
height: b.fileHeight,
left: b.fileLeft,
top: b.fileTop
}).attr("data-key", g).append($("").css({
opacity: 0
})).appendTo(c);
this.bindFileDivEvents(h, c);
e && f && d && this.addImage(h, d, e, f, g)
},
addCreateEvents: function() {
var b = 0,
c, d = this.contextArray;
if (d) for (this.offCreateEvents(); c = d.eq(b++), 0 < c.length;) this.bindCreateFileEvent(c, parseInt(c.attr("data-page")))
},
offCreateEvents: function() {
this.contextArray && (this.contextArray.css({
cursor: ""
}), this.contextArray.off("mousedown.addLocalFile touchstart.addLocalFile"))
},
bindCreateFileEvent: function(b, c) {
var d = this;
b.css("cursor", "crosshair");
b.off("mousedown.addLocalFile touchstart.addLocalFile").one("mousedown.addLocalFile touchstart.addLocalFile",
function(e) {
e.stopPropagation();
e.preventDefault();
var f = (new Date).getTime(),
g,
h,
k,
l,
m,
p,
n,
q,
s,
r = b.offset().left,
w = b.offset().top;
$(".flipHTML5LocalFile-current").removeClass("flipHTML5LocalFile-current");
g = $("").attr("data-key", f).addClass("flipHTML5AddFile flipHTML5LocalFile-current").append($("").css({
opacity: 0
})).appendTo(b);
h = l = e.pageX || e.originalEvent.touches[0].pageX;
k = m = e.pageY || e.originalEvent.touches[0].pageY;
d.bindFileDivEvents(g, b);
$(document).add(b).off("mousemove.addLocalFile touchmove.addLocalFile").on("mousemove.addLocalFile touchmove.addLocalFile",
function(b) {
l = b.pageX ? b.pageX: b.originalEvent.touches ? b.originalEvent.touches[0].pageX: 0;
m = b.pageY ? b.pageY: b.originalEvent.touches ? b.originalEvent.touches[0].pageY: 0;
l && (0 > l - h ? (p = Math.floor((l - r) / BookInfo.scale()), q = Math.floor((h - l) / BookInfo.scale())) : (p = Math.floor((h - r) / BookInfo.scale()), q = Math.floor((l - h) / BookInfo.scale())));
m && (0 > b.pageY - k ? (n = Math.floor((m - w) / BookInfo.scale()), s = Math.floor((k - m) / BookInfo.scale())) : (n = Math.floor((k - w) / BookInfo.scale()), s = Math.floor((m - k) / BookInfo.scale())));
g.css({
left: p,
top: n,
width: q,
height: s
});
d.resizeZoomFrame(g)
});
$(document).add(b).off("mouseup.addLocalFile touchend.addLocalFile").one("mouseup.addLocalFile touchend.addLocalFile",
function(e) {
d.offCreateEvents();
$(document).add(b).off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(b).off("mouseup.addLocalFile touchend.addLocalFile");
if (g) {
e = g.width();
var h = g.height();
32 > e && g.width(32);
12 > h && g.height(12);
g.find(".TextFile")[0].click();
d.resizeZoomFrame(g);
e = d.parseObject(g[0]);
d.parseObject(d.zoomFrame[0]);
d.fileCookies.push({
key: f,
page: c,
fileLeft: e.left,
fileTop: e.top,
fileWidth: e.width,
fileHeight: e.height,
imgWidth: null,
imgHeight: null,
src: null
});
d.addLocalStorage(d.fileName, d.parseJSON(d.fileCookies))
}
void 0 != d.onCreated && d.onCreated[1].call(d.onCreated[0])
})
})
},
addImage: function(b, c, d, e, f) {
b.find(".LocalImage") && b.find(".LocalImage").remove();
var g = b.width() || 40,
h = b.height() || 40;
d = this.resizeImage("autoFit", d, e, g, h);
$("").attr("data-key", f).css({
width: d.width,
height: d.height,
left: d.left,
top: d.top
}).attr("src", c).appendTo(b)
},
resizeImage: function(b, c, d, e, f) {
c /= d;
d = 0 === f ? 1 : e / f;
var g = f * c,
h = e / c,
k;
switch (b) {
case "autoFit":
k = g > e ? {
width: e,
height: h,
top: (f - h) / 2,
left: 0
}: h > f ? {
width: g,
height: f,
left: (e - g) / 2,
top: 0
}: g / h == c ? {
width: g,
height: h,
left: 0,
top: 0
}: {
width: 1,
height: 1,
left: 0,
top: 0
};
break;
case "scale":
k = {
left: 0,
top: 0,
width: e,
height: f
};
break;
case "fullFill":
c > d ? k = {
left: (e - f * c) / 2,
top: 0,
width: f * c,
height: f
}: c < d ? k = {
left: 0,
top: (f - e / c) / 2,
width: e,
height: e / c
}: c == d && (k = {
left: 0,
top: 0,
width: e,
height: f
})
}
return k
},
bindFileDivEvents: function(b, c) {
var d = this,
e = !1,
f = b.attr("data-key");
b.off("mousedown.addLocalFile touchstart.addLocalFile").on("mousedown.addLocalFile touchstart.addLocalFile",
function(g) {
g.preventDefault();
g.stopPropagation();
g = g.originalEvent.touches ? g.originalEvent.touches[0] : g;
var h, k, l, m, p, n;
l = b[0].offsetLeft;
m = b[0].offsetTop;
h = g.pageX;
k = g.pageY;
d.resizeZoomFrame(b);
c.off("mousemove.addLocalFile touchmove.addLocalFile").on("mousemove.addLocalFile touchmove.addLocalFile",
function(c) {
c = c.originalEvent.touches ? c.originalEvent.touches[0] : c;
if (3 <= Math.abs(c.pageX - h) || 3 <= Math.abs(c.pageY - k)) e = !0;
p = l - (h - c.pageX) / BookInfo.scale();
n = m - (k - c.pageY) / BookInfo.scale();
b.css({
left: p,
top: n
});
d.moveFileDiv(p, n)
});
$(document).add(c).off("mouseup.addLocalFile touchend.addLocalFile").one("mouseup.addLocalFile touchend.addLocalFile",
function() {
c.off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(c).off("mouseup.addLocalFile touchend.addLocalFile");
setTimeout(function() {
e = !1
},
200);
var g = d.parseObject(b[0]);
d.parseObject(d.zoomFrame[0]);
d.updateArrayOrderKey(d.fileCookies, f, {
fileLeft: g.left,
fileTop: g.top
});
d.addLocalStorage(d.fileName, d.parseJSON(d.fileCookies))
})
});
b.find(".TextFile").on({
change: function(c) {
try {
var e = c.target.files[0];
if (e) if (e.type.match("image.*")) {
var k = new FileReader;
k.onload = function(c) {
c = c.target.result;
var e = new Image;
e.src = c;
var g = e.width,
e = e.height;
d.imageDatas[f] = {
width: g,
height: e,
src: c
};
d.addImage(b, c, g, e, f);
d.updateArrayOrderKey(d.fileCookies, f, {
imgWidth: g,
imgHeight: e,
src: c
});
d.addLocalStorage(d.fileName, d.parseJSON(d.fileCookies))
};
k.readAsDataURL(e)
} else alert("not image!")
} catch(l) {
alert("Does not support HTML5 FileReader!")
}
},
click: function(b) {
e && b.preventDefault()
}
})
},
moveFileDiv: function(b, c) {
var d = this.zoomFrame;
d && (d.css({
left: b - 4 - 1,
top: c - 4 - 1
}), this.toolBar && this.toolBar.css({
left: d.offset().left - this.container.offset().left + 3,
top: d.offset().top - this.container.offset().top - this.toolBar.outerHeight() - 2
}))
},
resizeZoomFrame: function(b) {
var c = this.zoomFrame;
c.css({
width: b.width() + 8,
height: b.height() + 8,
left: parseInt(b.css("left")) - 4 - 1,
top: parseInt(b.css("top")) - 4 - 1
}).show();
this.toolBar && this.toolBar.css({
left: b.offset().left - 8 - this.container.offset().left + 3,
top: b.offset().top - 8 - this.container.offset().top - this.toolBar.outerHeight() - 2
}).show();
b.before(c);
$(".flipHTML5LocalFile-current").removeClass("flipHTML5LocalFile-current");
this.currentObject = b.addClass("flipHTML5LocalFile-current")
},
resizeFileDiv: function(b, c, d, e) {
var f = this.currentObject,
g = this.zoomFrame,
h = f.attr("data-key");
this.toolBar && this.toolBar && this.toolBar.css({
left: g.offset().left - this.container.offset().left + 3,
top: g.offset().top - this.container.offset().top - this.toolBar.outerHeight() - 2
});
if (f) {
b && (g.css({
left: b
}), f.css({
left: b + 4 + 1
}));
c && (g.css({
top: c
}), f.css({
top: c + 4 + 1
}));
d && 40 <= d && (g.css({
width: d
}), f.css({
width: d - 8
}));
e && 20 <= e && (g.css({
height: e
}), f.css({
height: e - 8
}));
try {
var k = f.find(".LocalImage"),
l = this.imageDatas[h],
m = this.resizeImage("autoFit", l.width, l.height, f.width(), f.height());
k.css({
width: m.width,
height: m.height,
left: m.left,
top: m.top
})
} catch(p) {}
m = this.parseObject(f[0]);
this.parseObject(g[0]);
this.updateArrayOrderKey(this.fileCookies, h, {
fileLeft: m.left,
fileTop: m.top,
fileWidth: m.width,
fileHeight: m.height
})
}
},
eastZoom: function(b) {
var c = this,
d = b.parent();
b.on("mousedown.addLocalFile touchstart.addLocalFile",
function(b) {
b.preventDefault();
b.stopPropagation();
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
var f = d.parent(),
g = d.width(),
h = b.pageX;
$(document).add(f).on("mousemove.addLocalFile touchmove.addLocalFile",
function(b) {
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
var d = b.clientX - h + g,
d = Math.floor(g - (h - b.pageX) / BookInfo.scale());
c.resizeFileDiv(0, 0, d, 0)
});
$(document).add(f).on("mouseup.addLocalFile touchend.addLocalFile",
function() {
c.addLocalStorage(c.fileName, c.parseJSON(c.fileCookies));
$(document).add(f).off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(f).off("mouseup.addLocalFile touchend.addLocalFile")
})
});
return this
},
southZoom: function(b) {
var c = this,
d = b.parent();
b.on("mousedown.addLocalFile touchstart.addLocalFile",
function(b) {
b.preventDefault();
b.stopPropagation();
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
var f = d.parent(),
g = d.height(),
h = b.pageY;
$(document).add(f).on("mousemove.addLocalFile touchmove.addLocalFile",
function(b) {
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
var d = b.clientY - h + g,
d = Math.floor(g - (h - b.pageY) / BookInfo.scale());
c.resizeFileDiv(0, 0, 0, d)
});
$(document).add(f).on("mouseup.addLocalFile touchend.addLocalFile",
function() {
c.addLocalStorage(c.fileName, c.parseJSON(c.fileCookies));
$(document).add(f).off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(f).off("mouseup.addLocalFile touchend.addLocalFile")
})
});
return this
},
westZoom: function(b) {
var c = this,
d = b.parent();
b.on("mousedown.addLocalFile touchstart.addLocalFile",
function(b) {
b.preventDefault();
b.stopPropagation();
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
var f = d.parent(),
g = d.width(),
h = d[0].offsetLeft,
k = b.clientX;
$(document).add(f).on("mousemove.addLocalFile touchmove.addLocalFile",
function(b) {
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
var d = b.pageX,
e = h + d - k,
f = -(d - k) + g,
e = h + (d - k) / BookInfo.scale(),
f = Math.floor(g + (k - b.pageX) / BookInfo.scale());
c.resizeFileDiv(e, 0, f, 0)
});
$(document).add(f).on("mouseup.addLocalFile touchend.addLocalFile",
function() {
c.addLocalStorage(c.fileName, c.parseJSON(c.fileCookies));
$(document).add(f).off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(f).off("mouseup.addLocalFile touchend.addLocalFile")
})
});
return this
},
northZoom: function(b) {
var c = this,
d = b.parent();
b.on("mousedown.addLocalFile touchstart.addLocalFile",
function(b) {
b.preventDefault();
b.stopPropagation();
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
var f = d.parent(),
g = d.height(),
h = d[0].offsetTop,
k = b.pageY;
$(document).add(f).on("mousemove.addLocalFile touchmove.addLocalFile",
function(b) {
b = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
b = b.pageY;
var d = h + b - k,
e = -(b - k) + g,
d = h + (b - k) / BookInfo.scale(),
e = Math.floor(g + (k - b) / BookInfo.scale());
c.resizeFileDiv(0, d, 0, e)
});
$(document).add(f).on("mouseup.addLocalFile touchend.addLocalFile",
function() {
c.addLocalStorage(c.fileName, c.parseJSON(c.fileCookies));
$(document).add(f).off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(f).off("mouseup.addLocalFile touchend.addLocalFile")
})
});
return this
},
bindOnCreated: function(b, c) {
this.onCreated = [b, c]
},
parseObject: function(b) {
if (document.getElementsByTagName("body")[0].contains(b)) {
var c, d, e;
e = b.parentNode;
var f = b.style,
g = $(b);
d = 100 / e.offsetHeight;
c = 100 / e.offsetWidth;
e = b.offsetLeft * c + "%";
b = b.offsetTop * d + "%";
c = g.width() * c + "%";
d = g.height() * d + "%";
f.width = c;
f.height = d;
f.left = e;
f.top = b;
return {
width: c,
height: d,
left: e,
top: b
}
}
},
addLocalFileByPage: function(b, c) {
c.find(".flipHTML5AddFile").remove();
this.toolBar && this.toolBar.hide();
this.zoomFrame && this.zoomFrame.hide();
c.attr("data-page", b);
this.contextArray = this.contextArray ? this.contextArray.add(c) : c;
this.zoomFrame && this.zoomFrame.remove();
this.createZoomFrame();
for (var d = 0; d < this.fileCookies.length; d++) this.fileCookies[d].page == b && this.addFile(this.fileCookies[d], c)
},
setContainers: function(b, c, d) {
void 0 == this.addContexts[b] && (this.addContexts[b] = {});
this.addContexts[b][c] = d;
b == BookInfo.getBookType() && this.addLocalFileByPage(c, this.addContexts[BookInfo.getBookType()][c])
},
getLocalStorage: function(b) {
try {
if (window.localStorage) return window.localStorage.getItem(b);
for (var c = document.cookie.split("; "), d = 0; d < c.length; d++) {
var e = c[d].split("=");
if (e[0] == b) return unescape(e[1])
}
return ""
} catch(f) {}
},
addLocalStorage: function(b, c) {
try {
if (window.localStorage) window.localStorage.setItem(b, c);
else {
var d = b + "=" + escape(c),
e = new Date;
e.setTime(e.getTime() + 864E8);
d += "; expires=" + e.toGMTString();
document.cookie = d
}
} catch(f) {}
},
delArrayOrderKey: function(b, c) {
if (b) for (var d = 0; d < b.length; d++) b[d].key && b[d].key == c && b.remove(d)
},
updateArrayOrderKey: function(b, c, d) {
if (b) for (var e = 0; e < b.length; e++) b[e].key && b[e].key == c && $.extend(b[e], d)
},
parseJSON: function(b) {
if (0 != b.length) {
for (var c = "[",
d = 0; d < b.length; d++) c += "{key:'" + b[d].key + "',page:" + b[d].page + ",src:'" + b[d].src + "',iW:" + b[d].imgWidth + ",iH:" + b[d].imgHeight + ",fW:'" + b[d].fileWidth + "',fH:'" + b[d].fileHeight + "',fL:'" + b[d].fileLeft + "',fT:'" + b[d].fileTop + "'},";
c = c.substring(0, c.length - 1);
return c + "]"
}
}
});
var PageItem = {};
PageItem.Item = Class({
create: function(b, c, d, e) {
this.config = b;
this.parent = c;
this.pageWidth = d;
this.pageHeight = e;
this.type = this.config.annotype
},
onActionEvent: function(b) {
this.config.action.actionType == PageEditor.ActionType.GOTO_PAGE ? (gotoPageFun(this.config.action.pageIndex), $(b).addClass("slider-action")) : this.config.action.actionType == PageEditor.ActionType.OPEN_URL ? (void 0 == this.config.action.linkTarget && (this.config.action.linkTarget = "_blank"), 3 == browserType ? window.location = this.linkURL: window.open(this.linkURL, this.config.action.linkTarget), $(b).addClass("slider-action")) : this.config.action.actionType == PageEditor.ActionType.OPEN_WINDOW ? (this.form = new initVideoForm(tmpContainer, {
width: this.config.action.windowWidth,
height: this.config.action.windowHeight,
src: this.config.action.resourceContent,
caption: this.config.action.caption
},
bookContainer.width(), bookContainer.height()), $(b).addClass("slider-action")) : this.config.action.actionType == PageEditor.ActionType.SLIDE_SHOW ? (this.slide = new initSlideShow(tmpContainer, this.config.action.photos.photo, bookContainer.width(), bookContainer.height()), $(b).addClass("slider-action")) : this.config.action.actionType == PageEditor.ActionType.PLAY_AUDIO ? (this.audios = new initAudioEditor(tmpContainer, this.config.action.audioURL, this.config.action.autoPlay), this.audios.showshow(), $(b).addClass("slider-action")) : this.config.action.actionType == PageEditor.ActionType.ACTION_JS ? (null != this.config.action.scriptFun && eval(this.config.action.scriptFun), $(b).addClass("slider-action")) : this.config.action.actionType == PageEditor.ActionType.OPEN_IMG && (this.zoomImg = new HTML5ZoomImg(this.config.src, $("#tmpContainer")), $(b).addClass("slider-action"))
}
});
var initYoutube = Class({
create: function(b, c, d, e, f) {
this.father = b;
this.config = $.extend({
width: 400,
height: 300,
x: 0.02,
y: 0.02,
alpha: 1,
id: null
},
c);
this.youtubeFrame = null;
null != this.config.id && (this.pw = d, this.ph = e, this.width = this.config.width * this.pw, this.height = this.config.height * this.ph, this.x = this.config.x * this.pw, this.y = this.config.y * this.ph, this.youtubeFrame = $(""), b.append(this.youtubeFrame))
},
onResize: function(b, c) {
this.pw = b;
this.ph = c;
this.width = this.config.width * this.pw;
this.height = this.config.height * this.ph;
this.youtubeFrame.css({
width: this.width + "px",
height: this.height + "px"
});
this.setPosition()
},
setPosition: function() {
this.x = this.config.x * this.pw;
this.y = this.config.y * this.ph;
this.youtubeFrame.css({
top: this.y + "px",
left: this.x + "px"
})
},
getPlayEvt: function() {
return this.config.moviePlayTriggerEvt
},
getStopEvt: function() {
return this.config.movieStopTriggerEvt
},
hide: function() {
this.youtubeFrame.css({
width: "0px",
height: "0px"
});
this.youtubeFrame.css({
display: "none"
})
},
show: function() {
this.youtubeFrame.css({
width: this.width + "px",
height: this.height + "px"
});
this.youtubeFrame.css({
display: "block"
})
}
}),
initVideo = Class({
create: function(b, c, d, e, f) {
this.config = $.extend({
width: 0.6,
height: 0.5,
x: 0.2,
y: 0.2,
src: null,
previewSrc: null,
alpha: 1
},
c);
this.pw = d;
this.ph = e;
this.width = this.config.width * this.pw;
this.height = this.config.height * this.ph;
this.x = this.config.x * this.pw;
this.y = this.config.y * this.ph;
this.father = b;
this.content = $("");
this.content.css({
position: "absolute",
left: this.x + "px",
top: this.y + "px",
width: this.width + "px",
height: this.height + "px",
"background-color": "black"
});
this.father.append(this.content);
"string" == typeof this.config.previewSrc && null != this.config.previewSrc && void 0 != this.config.previewSrc && (!0 == isFlipPdf && (this.config.previewSrc = "." + this.config.previewSrc), this.content.css({
background: "url(" + this.config.previewSrc + ")"
}), this.content.css({
"background-size": this.width + "px " + this.height + "px"
}));
if ("string" == typeof this.config.src) {
if (null == this.config.src || ".mp4" != this.config.src.substr(this.config.src.length - 4, 4)) return
} else if (this.config.src == {}) return; ! 0 == isFlipPdf && (this.config.src = "../" + this.config.src);
this.video = null;
this.video = $("");
this.video.css({
position: "absolute",
"z-index": 1,
left: "0px",
top: "0px",
width: "100%",
height: "100%",
opacity: this.config.alpha
});
this.content.append(this.video);
void 0 != this.video[0].play && (this.content.addVideoSkin(f), this.video.removeAttr("controls"))
},
onResize: function(b, c) {
this.pw = b;
this.ph = c;
this.width = this.config.width * this.pw;
this.height = this.config.height * this.ph;
this.content.css({
width: this.width + "px",
height: this.height + "px"
});
this.content.css({
"background-size": this.width + "px " + this.height + "px"
});
this.content.resizeVideoSkin();
this.setPosition()
},
setPosition: function() {
this.x = this.pw * this.config.x;
this.y = this.ph * this.config.y;
this.content.css({
left: this.x + "px",
top: this.y + "px"
})
},
playVideo: function() {
if (null != this.video) try {
this.video[0].play()
} catch(b) {}
},
stopVideo: function() {
if (null != this.video) try {
this.video[0].stop()
} catch(b) {}
},
pauseVideo: function() {
if (null != this.video) try {
this.video[0].pause()
} catch(b) {}
},
getPlayEvt: function() {
return this.config.moviePlayTriggerEvt
},
getStopEvt: function() {
return this.config.movieStopTriggerEvt
}
}),
initVimeo = Class({
create: function(b, c, d, e, f) {
this.config = $.extend({
width: 400,
height: 300,
x: 0.02,
y: 0.02,
alpha: 1,
id: null
},
c);
this.vimeoFrame = null;
null != this.config.id && (this.pw = d, this.ph = e, this.width = this.config.width * this.pw, this.height = this.config.height * this.ph, this.x = this.config.x * this.pw, this.y = this.config.y * this.ph, c = this.config.id.lastIndexOf("/"), c = this.config.id.substring(c + 1), this.vimeoFrame = $(""), b.append(this.vimeoFrame))
},
onResize: function(b, c) {
this.pw = b;
this.ph = c;
this.vimeoFrame.css({
width: this.pw * this.config.width + "px",
height: this.ph * this.config.height + "px"
});
this.setPosition(this.config.x * this.pw, this.config.y * this.ph)
},
setPosition: function(b, c) {
this.vimeoFrame.css({
top: c + "px",
left: b + "px"
})
},
getPlayEvt: function() {
return this.config.moviePlayTriggerEvt
},
getStopEvt: function() {
return this.config.movieStopTriggerEvt
},
hide: function() {
this.vimeoFrame.css({
display: "none"
})
},
show: function() {
this.vimeoFrame.css({
display: "block"
})
}
}),
initPopUpVimeo = Class({
create: function(b, c, d, e, f) {
this.config = $.extend({
width: 400,
height: 300,
x: 0.02,
y: 0.02,
alpha: 1,
id: null
},
c);
this.vimeoFrame = null;
null != this.config.id && (this.pw = d, this.ph = e, this.width = this.config.width * this.pw, this.height = this.config.height * this.ph, this.x = this.config.x * this.pw, this.y = this.config.y * this.ph, "./" == this.config.url.substr(0, 2) && (this.config.url = "." + this.config.url), this.url = this.config.url, this.vimeoImage = $(""), b.append(this.vimeoImage), this.popupVideo = new PopUpVideo(this.config, f), this.vimeoImage.bind(_event._down,
function() {
return ! 1
}.bind(this)), this.vimeoImage.bind(_event._end,
function() {
this.popupVideo.showOrHide();
return ! 1
}.bind(this)))
},
onResize: function(b, c) {
this.pw = b;
this.ph = c;
this.vimeoImage.css({
width: this.pw * this.config.width + "px",
height: this.ph * this.config.height + "px"
});
this.setPosition(this.config.x * this.pw, this.config.y * this.ph);
this.popupVideo.onResize()
},
setPosition: function(b, c) {
this.vimeoImage.css({
top: c + "px",
left: b + "px"
})
}
}),
PopUpVideo = Class({
create: function(b, c) {
this.config = $.extend({
id: null,
alpha: 1
},
b);
this.vimeoWidth = Math.min(480, windowWidth);
this.vimeoHeight = 9 * this.vimeoWidth / 16;
this.vimeoHeight = Math.min(this.vimeoHeight, windowHeight);
this.vimeoLeft = (windowWidth - this.vimeoWidth) / 2;
this.vimeoTop = (windowHeight - this.vimeoHeight) / 2;
this.initVideo(c);
this.background = $("");
this.vimeoBac = $("");
tmpContainer.append(this.background);
this.background.append(this.vimeoBac);
this.background.append(this.vimeoFrame);
this.visible = !1;
this.hide();
this.closeButton = $("");
this.closeButton.asImageButton();
this.background.append(this.closeButton);
this.background.bind(_event._down,
function() {
this.hide();
return ! 1
}.bind(this));
this.background.bind(_event._end,
function() {
return ! 1
}.bind(this));
this.closeButton.bind(_event._end,
function() {
this.hide();
return ! 1
}.bind(this))
},
initVideo: function(b) {
"vimeo" == b ? (b = this.config.id.lastIndexOf("/"), b = this.config.id.substring(b + 1), this.vimeoFrame = $("")) : "youtube" == b && (this.vimeoFrame = $(""))
},
showOrHide: function() { ! 1 === this.visible ? this.show() : this.hide()
},
hide: function() {
this.visible = !1;
this.background.css({
display: "none"
})
},
show: function() {
this.visible = !0;
this.background.css({
display: "block"
})
},
onResize: function(b, c) {
this.vimeoWidth = Math.min(480, windowWidth);
this.vimeoHeight = 9 * this.vimeoWidth / 16;
this.vimeoHeight = Math.min(this.vimeoHeight, windowHeight);
this.vimeoLeft = (windowWidth - this.vimeoWidth) / 2;
this.vimeoTop = (windowHeight - this.vimeoHeight) / 2;
this.vimeoFrame.css({
width: this.vimeoWidth + "px",
height: this.vimeoHeight + "px",
top: this.vimeoTop + "px",
left: this.vimeoLeft + "px"
})
},
getPlayEvt: function() {
return this.config.moviePlayTriggerEvt
},
getStopEvt: function() {
return this.config.movieStopTriggerEvt
}
});
global.hddr.soo4 = function(b) {
return b || ".com"
};
var initAudio = Class({
create: function(b, c, d, e, f) {
this.config = $.extend({
width: 80,
height: 30,
x: 20,
y: 20,
src: null,
alpha: 1
},
c);
this.audio = null;
if (null != this.config.src) {
this.originWidth = bookConfig.largePageWidth;
this.pw = d;
this.ph = e;
this.width = this.config.width * this.pw;
this.height = this.config.height * this.ph;
this.x = this.config.x * this.pw;
this.y = this.config.y * this.ph;
this.father = b;
b = c.key;
this.themeName = f;
this.resizeThemes = {
"default": "",
wave: ""
};
this.content = $("");
this.content.css({
position: "absolute",
left: this.x + "px",
top: this.y + "px",
opacity: this.config.alpha
});
this.father.append(this.content);
this.audio = $("");
this.audio.css({
position: "absolute",
width: this.width + "px",
height: this.height + "px",
left: "0px",
top: "0px",
opacity: this.config.alpha
});
this.content.audioResources = [];
if (void 0 == b)"./" == this.config.src.substr(0, 2) && (this.config.src = "." + this.config.src),
this.audio.attr("src", this.config.src),
this.content.audioResources.push(this.config.src);
else if (b in this.config.src) g = this.config.src[b],
"./" == g.substr(0, 2) && (g = "." + g),
this.content.audioResources.push(g),
this.audio.attr("src", g);
else for (c = 0; c < this.config.src.length; c++) {
var g = this.config.src[c][b];
"./" == g.substr(0, 2) && (g = "." + g);
this.content.audioResources.push(g);
var h = $("
");
$(".textformat p").css({
margin: "0px"
})
}
},
analysisTextformat: function(b, c) {
var d = ["SIZE='16'"],
e = ["COLOR='#000000'"],
f = ["FACE='Tahoma'"],
g = ["LETTERSPACING='0'"],
h = ["KERNING='0'"],
k = parseInt(c[0].match(/\d+/)[0]),
l = b.match(/\/ig);
if (l) {
for (var m = 0; m < l.length; m++) {
var p = l[m],
n = p.match(/SIZE\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i),
q = p.match(/COLOR\s?=\s?\\?[\"\']{1}#.*?\\?[\"\']{1}/i),
s = p.match(/FACE\s?=\s?\\?[\"\']{1}.*?\\?[\"\']{1}/i),
r = p.match(/LETTERSPACING\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i),
p = p.match(/KERNING\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i);
n ? d = n: n = d;
q ? e = q: q = e;
s ? f = s: s = f;
r ? g = r: r = g;
p ? h = p: p = h;
n = parseInt(n[0].match(/\d+/)[0]);
q = q[0].match(/#\w+/)[0];
s = s[0].match(/\\?[\"\'].*?\\?[\"\']/)[0];
r = parseInt(r[0].match(/\d+/)[0]);
p = parseInt(p[0].match(/\d+/)[0]);
b = b.replaceAll(l[m], "
")
}
this.newTextFormats.push(b)
}
}
}),
TextFormatAnalyzer = Class({
create: function(b) {
this.originalFormat = b;
null != b && (this.analyzedText = b.toLowerCase().replaceAll('"', ""))
},
getAlign: function() {
return this.analyzedText.subBetween("align=", ">").trim()
},
getLeftMargin: function() {
var b = this.analyzedText.subBetween("leftmargin=", " ").trim();
return "" == b ? 0 : parseInt(b)
},
getRightMargin: function() {
var b = this.analyzedText.subBetween("rightmargin=", " ").trim();
return "" == b ? 0 : parseInt(b)
},
getFontFamily: function() {
var b = this.analyzedText.subBetween("face=", " ").trim();
"" == b && (b = "Arial");
return b
},
getFontColor: function() {
var b = this.analyzedText.subBetween("color=", " ").trim();
"" == b && (b = "#000000");
return b
},
getFontSize: function() {
var b = this.analyzedText.subBetween("size=", " ").trim();
"" == b && (b = "16");
return b
},
getLetterSpace: function() {
var b = this.analyzedText.subBetween("letterspacing=", " ").trim();
"" == b && (b = "0");
return b
},
initFont: function(b) {
var c = this.getFontFamily(),
d = this.getFontColor(),
e = this.getFontSize(),
f = this.getLetterSpace();
b.css({
"font-family": c,
color: d,
"font-size": e + "px",
"letter-spacing": f + "px"
})
},
getText: function() {
for (var b = [], b = [], c = loadXMLString("" + this.originalFormat + "").getElementsByTagName("TEXTFORMAT"), d = 0; d < c.length; d++) if (null != c[d].getElementsByTagName("FONT")[0].firstChild) {
var e = c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;
c[d].getElementsByTagName("P");
null == e && (e = c[d].getElementsByTagName("B")[0].firstChild.nodeValue);
null == e && (e = c[d].getElementsByTagName("I")[0].firstChild.nodeValue);
null == e && (e = c[d].getElementsByTagName("U")[0].firstChild.nodeValue);
null != e && b.push(e)
}
c = "";
for (d = 0; d < b.length; d++) c = c + " " + b[d] + "";
return c
},
getTextLines: function() {
for (var b = [], b = [], c = loadXMLString("" + this.originalFormat + "").getElementsByTagName("P"), d = 0; d < c.length; d++) if (null != c[d].getElementsByTagName("FONT")[0].firstChild) {
var e = c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;
null == e && (e = c[d].getElementsByTagName("B")[0].firstChild.nodeValue);
null == e && (e = c[d].getElementsByTagName("I")[0].firstChild.nodeValue);
null == e && (e = c[d].getElementsByTagName("U")[0].firstChild.nodeValue);
null != e && b.push(e)
}
c = "";
for (d = 0; d < b.length; d++) c = c + " " + b[d] + "";
return c
},
getLines: function() {
for (var b = [], b = [], c = loadXMLString("" + this.originalFormat + "").getElementsByTagName("TEXTFORMAT"), d = 0; d < c.length; d++) if (null != c[d].getElementsByTagName("FONT")[0].firstChild) {
var e = c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;
c[d].getElementsByTagName("P");
null == e && (e = c[d].getElementsByTagName("B")[0].firstChild.nodeValue);
null == e && (e = c[d].getElementsByTagName("I")[0].firstChild.nodeValue);
null == e && (e = c[d].getElementsByTagName("U")[0].firstChild.nodeValue);
null != e && b.push(e)
}
return b
}
}),
initButton = Class({
create: function(b, c, d, e) {
this.config = $.extend({
width: 0.2,
height: 0.2,
x: 0.2,
y: 0.2,
alpha: 1,
src: null
},
c);
this.pw = d;
this.ph = e;
this.width = d * this.config.width;
this.height = e * this.config.height;
this.button = null;
c = [];
var f = this;
c = "button_watermark01.swf button_watermark02.swf button_watermark03.swf button_watermark04.swf button_watermark05.swf button_watermark06.swf button_watermark07.swf button_watermark08.swf button_watermark09.swf button_glossy01.swf button_glossy02.swf button_glossy03.swf button_glossy04.swf button_glossy05.swf button_glossy06.swf button_glossy07.swf button_glossy08.swf button_glossy09.swf button_glossy10.swf button_glossy11.swf button_glossy12.swf button_glossy13.swf button_glossy14.swf button_glossy15.swf button_glossy16.swf button_glossy17.swf button_push01.swf button_push02.swf button_push03.swf button_push04.swf button_push05.swf button_push06.swf button_lineLight01.swf button_lineLight02.swf button_lineLight03.swf button_lineLight04.swf button_lineLight05.swf button_star01.swf button_star02.swf button_star03.swf button_star04.swf button_star05.swf button_glitter01.swf button_glitter02.swf button_glitter03.swf button_glitter04.swf button_glitter05.swf button_glitter06.swf button_shadow01.swf button_shadow02.swf button_shadow03.swf button_shadow04.swf button_shadow05.swf button_shadow06.swf button_bottomLight01.swf button_bottomLight02.swf button_bottomLight03.swf button_bottomLight04.swf button_bottomLight05.swf button_bottomLight06.swf button_bottomLight07.swf button_bottomLight08.swf button_bottomLight09.swf button_bottomLight10.swf button_other01.swf button_other02.swf button_other03.swf".split(" ");
null == this.config.src || "null" == this.config.src ? (this.button = $(""), this.config.alpha = 0) : (!0 == isFlipPdf && (this.config.src = "." + this.config.src), d = this.config.src.substring(this.config.src.lastIndexOf("/") + 1, this.config.src.length), (this.swfButton = 0 <= c.indexOf(d)) ? (this.config.Format.color = colorTo0x(this.config.Format.color), this.button = $(""), this.buttonEvt = $(""), isTouchDevice() ? (this.button.css({
"-webkit-border-radius": "8px",
"-moz-border-radius": "5px",
"border-radius": "8px",
"background-image": getBrowserPre() + "linear-gradient(top,rgba(185,185,185,1) 0%, rgba(122,122,122,1) 45%, rgba(80, 80, 80, 1) 46%, rgba(53,53,53,1) 100%)",
"-webkit-box-shadow": "0 0 10px rgba(40, 40, 40, 0.7)",
"-moz-box-shadow": "0 0 10px rgba(40, 40, 40, 0.7)",
"-o-box-shadow": "0 0 10px rgba(40, 40, 40, 0.7)",
"-ms-box-shadow": "0 0 10px rgba(40, 40, 40, 0.7)",
"box-shadow": "0 0 10px rgba(40, 40, 40, 0.7)"
}), this.buttonEvt.css({
"-webkit-border-radius": "8px",
"-moz-border-radius": "5px",
"border-radius": "8px",
"background-color": "#333333",
opacity: 0.2,
display: "none",
width: this.width + "px",
height: this.height + "px"
})) : (this.button.flash({
swf: this.config.src,
width: this.width + "px",
height: this.height + "px",
wmode: "transparent"
}), this.buttonEvt.css({
display: "none",
width: this.width + "px",
height: this.height + "px"
})), this.buttonCaption = new label(this.config.buttonCaption, this.button), this.buttonCaption.setFont(this.config.HRate * this.ph * 1 / 2, bookConfig.iconColor, this.config.Format.font), c = this.buttonCaption.getWidth() > this.width ? 0 : (this.width - this.buttonCaption.getWidth()) / 2, this.buttonCaption.setLabelPosition(c, this.config.captionY * this.height / 100), this.button.append(this.buttonEvt), this.button.bind(_event._down,
function() {
f.buttonEvt.css({
display: "block"
})
}), this.button.bind(_event._end,
function() {
f.buttonEvt.css({
display: "none"
})
}), this.button.bind("mouseleave",
function() {
f.buttonEvt.css({
display: "none"
})
})) : ".swf" == this.config.src.substr(this.config.src.length - 4, 4) ? this.button = $("") : (this.button = $(""), this.button.attr({
src: this.config.src
})));
this.button.css({
position: "absolute",
width: this.width + "px",
height: this.height + "px",
left: this.pw * this.config.x + "px",
top: this.ph * this.config.y + "px",
opacity: this.config.alpha
});
b.append(this.button);
this.father = b;
this.initEvt()
},
onResize: function(b, c) {
this.pw = b;
this.ph = c;
this.width = this.config.width * b;
this.height = this.config.height * c;
this.button.css({
width: this.width + "px",
height: this.height + "px"
});
this.setPosition(this.config.x * b, this.config.y * c);
if (null != this.form) this.form.onResize(bookContainer.width(), bookContainer.height());
if (null != this.slide) this.slide.onResize(bookContainer.width(), bookContainer.height());
if (null != this.audios) this.audios.onResize(bookContainer.width(), bookContainer.height());
if (this.swfButton) if (isTouchDevice()) {
this.buttonCaption.setFont(this.config.HRate * this.height * 2 / 3, bookConfig.iconColor, this.config.Format.font);
var d = this.buttonCaption.getWidth() > this.width ? 0 : (this.width - this.buttonCaption.getWidth()) / 2;
this.buttonCaption.setLabelPosition(d, this.config.captionY * this.height / 100);
this.buttonEvt.css({
width: this.width + "px",
height: this.height + "px"
})
} else this.hide(),
this.show()
},
hide: function() {
isTouchDevice() || this.button.html("")
},
show: function() {
var b = this;
if (!isTouchDevice() && this.swfButton) {
this.buttonEvt = $("");
this.button.flash({
swf: this.config.src,
width: this.width + "px",
height: this.height + "px",
wmode: "transparent"
});
this.buttonEvt.css({
display: "none",
width: this.width + "px",
height: this.height + "px"
});
this.buttonCaption = new label(this.config.buttonCaption, this.button);
this.buttonCaption.setFont(this.config.HRate * this.ph * 1 / 2, bookConfig.iconColor, this.config.Format.font);
var c = this.buttonCaption.getWidth() > this.width ? 0 : (this.width - this.buttonCaption.getWidth()) / 2;
this.buttonCaption.setLabelPosition(c, this.config.captionY * this.height / 100);
this.button.append(this.buttonEvt);
this.button.bind(_event._down,
function() {
b.buttonEvt.css({
display: "block"
})
});
this.button.bind(_event._end,
function() {
b.buttonEvt.css({
display: "none"
})
});
this.button.bind("mouseleave",
function() {
b.buttonEvt.css({
display: "none"
})
})
}
},
setPosition: function(b, c) {
this.button.css({
left: b + "px",
top: c + "px"
})
},
initEvt: function() {
this.audios = this.slide = this.form = null;
if (void 0 != this.config.action) {
var b = this;
this.flag = 0;
this.linkURL = null;
try {
void 0 != this.config.action.length && (this.config.action = this.config.action[0]),
this.linkURL = this.config.action.url
} catch(c) {}
var d;
null != this.linkURL && "www" == this.linkURL.substr(0, 3).toLowerCase() && (this.linkURL = "http://" + this.linkURL);
try {
d = this.config.action.triggerEventType
} catch(e) {
d = null
}
this.button.bind(_event._down,
function(c) {
d == PageEditor.TriggerEventType.MouseDown && actionEvent.bind(b)($(this));
3 == browserType ? event.cancelBubble = !0 : event.stopPropagation()
});
this.button.bind("mouseover",
function(c) {
d == PageEditor.TriggerEventType.MouseOver && actionEvent.bind(b)($(this))
});
this.button.bind(isTouch ? _event._end: "mouseout",
function(c) {
d == PageEditor.TriggerEventType.MouseOut && actionEvent.bind(b)($(this))
})
}
}
});
global.hddr.soo6 = function() {
return hddr.bbb5
};
var initArea = Class({
create: function(b, c, d, e, f) {
this.config = $.extend({
width: 200,
height: 20,
x: 0,
y: 0,
alpha: 1,
color: null,
rounds: "false",
ellipseWidth: 5,
ellipseHeight: 5,
action: null,
sh: "false",
sx: 4,
sy: 4,
se: 2,
sr: null
},
c);
this.pw = d;
this.ph = e;
this.father = b;
this.color = colorTo0x(this.config.color);
this.width = this.config.width * this.pw;
this.height = this.config.height * this.ph;
this.x = this.config.x * this.pw;
this.y = this.config.y * this.ph;
this.id = "Area" + f;
this.Area = "false" != this.config.sh ? $("") : $("");
"false" != this.config.rounds && this.Area.css({
"border-radius": this.config.ellipseWidth + "px " + this.config.ellipseHeight + "px"
});
this.father = b;
this.initEvent();
b.append(this.Area)
},
initEvent: function() {
var b = this;
this.flag = 0;
this.audios = this.slide = this.form = null;
this.linkURL = "";
if (null != b.config.action) {
try {
void 0 != this.config.action.length && (this.config.action = this.config.action[0]),
this.linkURL = this.config.action.url
} catch(c) {}
var d;
null != this.linkURL && "www" == this.linkURL.substr(0, 3).toLowerCase() && (this.linkURL = "http://" + this.linkURL);
try {
d = this.config.action.triggerEventType
} catch(e) {
d = null
}
this.Area.bind(_event._down,
function(c) {
d == PageEditor.TriggerEventType.MouseDown && actionEvent.bind(b)($(this));
3 == browserType ? event.cancelBubble = !0 : event.stopPropagation()
});
this.Area.bind("mouseover",
function(c) {
d == PageEditor.TriggerEventType.MouseOver && actionEvent.bind(b)($(this))
});
this.Area.bind(isTouch ? _event._end: "mouseout",
function(c) {
d == PageEditor.TriggerEventType.MouseOut && actionEvent.bind(b)($(this))
})
}
},
onResize: function(b, c) {
this.pw = b;
this.ph = c;
this.width = this.config.width * this.pw;
this.height = this.config.height * this.ph;
this.Area.css({
width: this.width + "px",
height: this.height + "px"
});
this.setPosition();
if (null != this.form) this.form.onResize(bookContainer.width(), bookContainer.height());
if (null != this.slide) this.slide.onResize(bookContainer.width(), bookContainer.height());
if (null != this.audios) this.audios.onResize(bookContainer.width(), bookContainer.height())
},
setPosition: function() {
this.x = this.config.x * this.pw;
this.y = this.config.y * this.ph;
this.Area.css({
left: this.x + "px",
top: this.y + "px"
})
}
}),
initVideoForm = Class({
create: function(b, c, d, e) {
this.config = $.extend({
width: 400,
height: 300,
src: null,
alpha: 0.3,
caption: "",
closeIconURL: uiBaseURL + "close.png"
},
c);
this.father = b;
null != this.config.src && (this.config.width = parseInt(this.config.width), this.config.height = parseInt(this.config.height), this.sw = d, this.sh = e, this.th = 28, this.background = new grayBackground(b, "#333333", this.config.alpha, d, e), this.form = $(""), this.titleBar = $(""), !0 == isFlipPdf && (this.config.src = "../" + this.config.src), "" != this.config.closeIconURL && (this.closeButton = new button(this.titleBar, {
buttonType: 1,
iconURL: this.config.closeIconURL,
asImgButton: !0
}), this.closeButton.setButtonPosition(this.config.width - 28, 0)), "" != this.config.caption && (this.captionLabel = new label(this.config.caption, this.titleBar), this.captionLabel.setLabelPosition(5, 3, ["left", "top"]), this.captionLabel.setFont(14, "#dddddd", "Tahoma")), this.video = $(""), this.form.css({
width: this.config.width + 4 + "px",
height: this.config.height + 4 + "px",
left: (d - this.config.width) / 2 + "px",
top: (e - this.config.height) / 2 + "px",
"background-color": "#dddddd",
"-webkit-border-radius": "5px",
"-moz-border-radius": "5px",
"-ms-border-radius": "5px",
"border-radius": "5px",
position: "absolute",
"z-index": 201
}), this.titleBar.css({
width: this.config.width + "px",
height: this.th + "px",
left: "2px",
top: "2px",
"border-top-left-radius": "5px",
"border-top-right-radius": "5px",
position: "absolute",
"background-color": "#111111"
}), this.video.css({
width: this.config.width + "px",
height: this.config.height - this.th + "px",
top: this.th + 2 + "px",
left: "2px",
position: "absolute"
}), b.append(this.form), this.form.append(this.titleBar), this.form.append(this.video), this.initEvent())
},
onResize: function(b, c) {
this.sw = b;
this.sh = c;
this.background.onResize(b, c);
this.setPosition()
},
setPosition: function() {
this.form.css({
left: (this.sw - this.config.width) / 2 + "px",
top: (this.sh - this.config.height) / 2 + "px"
})
},
initEvent: function() {
var b = this;
this.closeButton.onMouseUp(this, this.closeForm);
var c = !1,
d, e;
this.titleBar.bind(_event._down,
function(f) {
f = isTouch ? f.originalEvent.touches: [f];
c = !0;
d = Point(f[0].pageX, f[0].pageY);
e = Point(b.form.offset().left, b.form.offset().top);
return ! 1
});
this.titleBar.bind(_event._move,
function(f) {
f = isTouch ? f.originalEvent.touches: [f];
c && b.form.css({
top: e.y + (f[0].pageY - d.y) + "px",
left: e.x + (f[0].pageX - d.x) + "px"
});
return ! 1
});
this.titleBar.bind(_event._end,
function(b) {
return c = !1
});
this.titleBar.bind("mouseleave",
function(b) {
return c = !1
})
},
closeForm: function() {
var b = this;
this.form.animate({
width: 20,
height: 20,
left: this.sw / 2 - 10,
top: this.sh / 2 - 10
},
200,
function() {
b.background.hide();
b.form.remove()
})
}
}),
initSlideShow = Class({
create: function(b, c, d, e) {
this.photos = $.extend([], c);
if (0 == this.photos.length) {
if (void 0 == this.photos.url) return;
this.photos = [this.photos]
}
this.father = b;
this.sw = d - 8;
this.sh = e - 8;
this.imgIndex = -1;
this.imgWidth = 200;
this.imgHeight = 300;
this.boxWidth = 200;
this.boxHeight = 300;
this.loadingImageHeight = this.loadingImageWidth = 32;
this.slideShowBG = new grayBackground(b, "#333333", 0.3, d, e);
this.photoBox = $("");
this.leftBar = $("");
this.rightBar = $("");
this.img = $("");
b.append(this.photoBox);
b.append(this.leftBar);
b.append(this.rightBar);
this.leftButton = new button(this.leftBar, {
buttonType: 1,
iconURL: uiBaseURL + "previous_down.png"
});
this.rightButton = new button(this.rightBar, {
buttonType: 1,
iconURL: uiBaseURL + "next_down.png"
});
this.closeButton = new button(b, {
buttonType: 1,
iconURL: uiBaseURL + "close.png"
},
!0);
this.leftButton.setButtonPosition(0, 29, ["left", "top"]);
this.rightButton.setButtonPosition(0, 29, ["right", "top"]);
this.closeButton.setButtonPosition(this.sw - 45, 5);
this.closeButton.setCSS({
"z-index": 210
});
this.rightBar.css({
"z-index": 202,
width: "100px",
height: "100px",
right: "0px",
top: (this.sh - 100) / 2 + "px",
position: "absolute"
});
this.leftBar.css({
"z-index": 203,
width: "100px",
height: "100px",
left: "0px",
top: (this.sh - 100) / 2 + "px",
position: "absolute"
});
this.photoBox.css({
width: this.boxWidth + "px",
height: this.boxHeight + "px",
left: (this.sw - this.boxWidth) / 2 + "px",
top: (this.sh - this.boxHeight) / 2 + "px",
position: "absolute",
"background-color": "#eeeeee",
"z-index": 201,
"-webkit-box-shadow": "0 0 10px rgba(255, 255, 255, 0.7)",
"-moz-box-shadow": "0 0 10px rgba(255, 255, 255, 0.7)",
"-ms-box-shadow": "0 0 10px rgba(255, 255, 255, 0.7)",
"-o-box-shadow": "0 0 10px rgba(255, 255, 255, 0.7)",
"box-shadow": "0 0 10px rgba(255, 255, 255, 0.7)"
});
this.loadingImage = $("");
this.loadingImage.css({
"z-index": -1,
left: (this.boxWidth - this.loadingImageWidth) / 2 + "px",
top: (this.boxHeight - this.loadingImageHeight) / 2 + "px"
});
this.loadingImage.css({
width: this.loadingImageWidth + "px",
height: this.loadingImageHeight + "px",
position: "absolute"
});
this.photoBox.append(this.loadingImage);
this.changeImage(0);
var f = this;
this.photoBox.bind(_event._down,
function(b) {
f.nextPage()
});
this.closeButton.onMouseUp(this, this.hide);
this.slideShowBG.onMouseUp(this, this.hide);
this.leftButton.onMouseDown(this, this.prePage);
this.rightButton.onMouseDown(this, this.nextPage);
this.leftButton.mouseEnterJump();
this.rightButton.mouseEnterJump();
void 0 != leftRightButton && null != leftRightButton && leftRightButton.setShow(!1)
},
nextPage: function() {
var b = this.imgIndex + 1;
b >= this.photos.length && (b = 0);
this.changeImage(b)
},
prePage: function() {
var b = this.imgIndex - 1;
0 > b && (b = this.photos.length - 1);
this.changeImage(b)
},
onResize: function(b, c) {
this.sw = b - 8;
this.sh = c - 8;
this.slideShowBG.onResize(b, c);
this.setPosition()
},
setPosition: function() {
this.photoBox.css({
left: (this.sw - this.boxWidth) / 2 + "px",
top: (this.sh - this.boxHeight) / 2 + "px"
});
this.leftButton.setButtonPosition(0, 29, ["left", "top"]);
this.rightButton.setButtonPosition(0, 29, ["right", "top"]);
this.rightBar.css({
right: "0px",
top: (this.sh - 100) / 2 + "px",
position: "absolute"
});
this.leftBar.css({
left: "0px",
top: (this.sh - 100) / 2 + "px",
position: "absolute"
});
this.closeButton.setButtonPosition(this.sw - 45, 5)
},
changeImage: function(b) {
if (this.imgIndex != b) {
this.imgIndex = b;
this.img.remove();
b = this.photos[b].url; ! 0 == isFlipPdf && (b = "." + b);
var c = this;
this.img.attr("src", b);
this.img.load(function() {
c.imgWidth = c.img[0].naturalWidth;
c.imgHeight = c.img[0].naturalHeight;
var b = c.imgWidth,
e = c.imgHeight;
if (c.imgWidth > c.sw || c.imgHeight > c.sh) b = c.imgWidth / c.imgHeight,
b > c.sw / c.sh ? (b = c.sw, e = c.sw * c.imgHeight / c.imgWidth) : (e = c.sh, b *= c.sh);
c.img.css({
width: b + "px",
height: e + "px"
});
c.boxWidth != b || c.boxHeight != e ? (c.photoBox.animate({
width: b + 8,
height: e + 8,
left: (c.sw - b) / 2,
top: (c.sh - e) / 2
},
300,
function() {
c.photoBox.append(c.img)
}), c.loadingImage.css({
left: (b + 8 - c.loadingImageWidth) / 2,
top: (e + 8 - c.loadingImageHeight) / 2
})) : c.photoBox.append(c.img);
c.boxWidth = b;
c.boxHeight = e;
c.img.css({
left: "4px",
top: "4px"
})
})
}
},
setImagePosition: function() {},
show: function() {},
hide: function() {
var b = this;
this.photoBox.animate({
width: 20,
height: 20,
top: this.sh / 2 - 10,
left: this.sw / 2 - 10
},
200,
function() {
b.leftBar.remove();
b.rightBar.remove();
b.closeButton.remove();
b.photoBox.remove();
b.slideShowBG.hide()
});
hideLeftRightButton() && leftRightButton.setShow(!0)
}
});
global.hddr.soa7 = bdor[3] + bdor[10];
var initCallout = Class({
create: function(b, c, d, e, f) {
this.config = $.extend({
width: 200,
height: 20,
x: 0,
y: 0,
alpha: 1,
textStr: null,
pageH: 812,
lineH: 20,
fontName: null,
fontSize: 12,
color: null,
tbold: "false",
italic: "false",
bgalpha: 1,
action: null,
fillBg: "false",
bgcolor: null,
direct: "Down",
cx1: 0,
cy1: 0,
cx2: 0,
cy2: 0,
pointx: 0,
pointy: 0,
cornerRadiut: 5,
borderWidth: 3,
borderColor: null,
bordreAlpha: 1,
sh: "false",
sx: 4,
sy: 4,
se: 2,
sr: null
},
c);
this.pw = d;
this.ph = e;
this.father = b;
this.originWidth = bookConfig.largePageWidth;
this.originHeight = bookConfig.largePageHeight;
this.width = this.config.width * bookConfig.largePageWidth;
this.height = this.config.height * bookConfig.largePageHeight;
this.x = this.config.x * d;
this.y = this.config.y * e;
this.cx1 = this.config.cx1 * this.width;
this.cy1 = this.config.cy1 * this.height;
this.cx2 = this.config.cx2 * this.width;
this.cy2 = this.config.cy2 * this.height;
this.pointx = this.config.pointx * this.width;
this.pointy = this.config.pointy * this.height;
this.fontSize = this.config.lineH * this.originHeight * 0.75;
this.id = "callout" + f;
this.cl = this.ct = this.hl = this.wl = this.canl = this.cant = this.canh = this.canw = 0;
c = new TextFormatAnalyzer(this.config.textStr);
this.text = c.getLines();
null == this.config.fontName && (d = c.getFontFamily().split(","), this.config.fontName = d[0], this.config.fontSize = c.getFontSize(), this.config.color = c.getFontColor(), this.color = colorTo0x(this.config.color));
switch (this.config.direct) {
case "Down":
if (0 > this.pointx) {
this.canw = this.width - this.pointx + 20;
this.canh = this.pointy + 20;
this.cant = this.y - 10;
this.canl = this.x - (this.canw - this.width - 10);
break
}
this.canw = this.pointx > this.width ? this.pointx + 20 : this.width + 20;
this.canh = this.pointy + 20;
this.cant = this.y - 10;
this.canl = this.x - 10;
break;
case "left":
if (0 > this.pointy) {
this.canw = this.width - this.pointx + 20;
this.canh = this.height - this.pointy + 20;
this.cant = this.y - 10;
this.canl = this.x + this.pointx + 40;
break
}
this.pointy > this.height ? (this.canw = this.width - this.pointx + 20, this.canh = this.pointy + 20) : (this.canw = this.width - this.pointx + 20, this.canh = this.height + 20);
this.cant = this.y - 10;
this.canl = this.x + this.pointx + 40;
break;
case "Up":
if (0 > this.pointx) {
this.canw = this.width - this.pointx + 20;
this.canh = this.height - this.pointy + 20;
this.cant = this.y - (this.canh - this.height - 10);
this.canl = this.x - (this.canw - this.width - 10);
break
}
this.canw = this.pointx > this.width ? this.pointx + 20 : this.width + 20;
this.canh = this.height - this.pointy + 20;
this.cant = this.y - (this.canh - this.height - 10);
this.canl = this.x - 10;
break;
case "Right":
if (0 > this.pointy) {
this.canw = this.pointx + 20;
this.canh = this.height - this.pointy + 20;
this.cant = this.y - (this.canh - this.height - 10);
this.canl = this.x - 10;
break
}
this.pointy > this.height ? (this.canw = this.pointx + 20, this.canh = this.pointy + 20) : (this.canw = this.pointx + 20, this.canh = this.height + 20);
this.cant = this.y - 10;
this.canl = this.x - 10
}
this.wl = this.canw / this.pw;
this.hl = this.canh / this.ph;
this.ct = this.cant / this.ph;
this.cl = this.canl / this.pw;
this.callout = $("");
b.append(this.callout);
this.calloutDown();
this.resizeCallout(e);
this.father = b;
this.initEvent()
},
resizeCallout: function(b) {
b /= bookConfig.largePageHeight;
this.callout.css({
"-webkit-transform-origin": "0% 0%",
"-moz-transform-origin": "0% 0%",
"-ms-transform-origin": "0% 0%",
"-o-transform-origin": "0% 0%",
"transform-origin": "0% 0%",
"-webkit-transform": "scale(" + b + ")",
"-moz-transform": "scale(" + b + ")",
"-ms-transform": "scale(" + b + ")",
"-o-transform": "scale(" + b + ")",
transform: "scale(" + b + ")"
})
},
calloutDown: function() {
var b = [],
c = [],
d,
e,
f = this.callout[0].getContext("2d"),
g,
h,
k,
l,
m,
p,
n,
q,
s,
r,
w,
u,
y,
v,
t,
x,
z,
C,
A,
B,
K,
J,
D,
G,
E,
F,
H,
I;
switch (this.config.direct) {
case "Down":
if (0 > this.pointx) {
g = this.canw - this.width - 10;
h = 20;
k = this.canw - this.width - 10;
l = 10;
d = this.canw - this.width;
e = 10;
m = this.canw - 20;
p = 10;
n = this.canw - 10;
q = 10;
s = this.canw - 10;
r = 20;
w = this.canw - 10;
u = this.height;
y = this.canw - 10;
v = this.height + 10;
t = this.canw - 20;
x = this.height + 10;
z = this.canw - (this.width - this.cx2) - 10;
C = this.height + 10;
A = 10;
B = this.pointy + 10;
K = this.canw - (this.width - this.cx1) - 10;
J = this.height + 10;
D = this.canw - this.width;
G = this.height + 10;
E = this.canw - (this.width + 10);
F = this.height + 10;
H = this.canw - (this.width + 10);
I = this.height;
break
}
g = 10;
h = 20;
l = k = 10;
d = 20;
e = 10;
m = this.width;
p = 10;
n = this.width + 10;
q = 10;
s = this.width + 10;
r = 20;
w = this.width + 10;
u = this.height;
y = this.width + 10;
v = this.height + 10;
t = this.width;
x = this.height + 10;
z = this.cx2 + 10;
C = this.height + 10;
A = this.pointx + 10;
B = this.pointy + 10;
K = this.cx1 + 10;
J = this.height + 10;
D = 20;
G = this.height + 10;
E = 10;
F = 10 + this.height;
H = 10;
I = this.height;
break;
case "left":
if (0 > this.pointy) {
g = this.canw - this.width - 10;
h = this.canh - this.height;
k = this.canw - this.width - 10;
l = this.canh - this.height - 10;
d = this.canw - this.width;
e = this.canh - this.height - 10;
m = this.canw - 20;
p = this.canh - this.height - 10;
n = this.canw - 10;
q = this.canh - this.height - 10;
s = this.canw - 10;
r = this.canh - this.height;
w = this.canw - 10;
u = this.canh - 20;
y = this.canw - 10;
v = this.canh - 10;
t = this.canw - 20;
x = this.canh - 10;
z = this.canw - this.width - 10;
C = this.canh - 20;
A = this.canw - this.width - 10;
B = this.canh - 10;
K = this.canw - this.width;
J = this.canh - 10;
D = this.canw - this.width - 10;
G = this.canh - (this.height - this.cy2 + 10);
F = E = 10;
H = this.canw - this.width - 10;
I = this.canh - (this.height - this.cy1 + 10);
break
}
this.pointy > this.height ? (k = this.canw - this.width - 10, l = 10, n = this.canw - 10, q = 10, y = this.canw - 10, v = this.height + 10, A = this.canw - this.width - 10, B = this.height + 10, D = this.canw - this.width - 10, G = this.cy2 + 10, E = 10, F = this.canh - 10) : (k = this.canw - this.width - 10, l = 10, n = this.canw - 10, q = 10, y = this.canw - 10, v = this.height + 10, A = this.canw - this.width - 10, B = this.height + 10, D = this.canw - this.width - 10, G = this.cy2 + 10, E = 10, F = this.pointy);
H = this.canw - this.width - 10;
I = this.cy1 + 10;
g = k;
h = l + 10;
d = k + 10;
e = l;
m = n - 10;
p = q;
s = n;
r = q + 10;
w = y;
u = v - 10;
t = y - 10;
x = v;
z = A + 10;
C = B;
K = A;
J = B - 10;
break;
case "Up":
if (0 > this.pointx) {
k = this.canw - this.width - 10;
l = this.canh - this.height - 10;
m = this.canw - (this.width - this.cx2) - 10;
p = this.canh - this.height - 10;
q = n = 10;
s = this.canw - (this.width - this.cx1) - 10;
r = this.canh - this.height - 10;
y = this.canw - 10;
v = this.canh - this.height - 10;
A = this.canw - 10;
B = this.canh - 10;
E = this.canw - this.width - 10;
F = this.canh - 10;
g = k;
h = l + 10;
d = k + 10;
e = l;
w = y - 10;
u = v;
t = y;
x = v + 10;
z = A;
C = B - 10;
K = A - 10;
J = B;
D = E + 10;
G = F;
H = E;
I = F - 10;
break
}
k = 10;
l = this.canh - this.height - 10;
m = this.cx2 + 10;
p = this.canh - this.height - 10;
n = this.pointx + 10;
q = 10;
s = this.cx1 + 10;
r = this.canh - this.height - 10;
y = this.width + 10;
v = this.canh - this.height - 10;
A = this.width + 10;
B = this.canh - 10;
E = 10;
F = this.canh - 10;
g = k;
h = l + 10;
d = k + 10;
e = l;
w = y - 10;
u = v;
t = y;
x = v + 10;
z = A;
C = B - 10;
K = A - 10;
J = B;
D = E + 10;
G = F;
H = E;
I = F - 10;
break;
case "Right":
if (0 > this.pointy) {
n = this.width + 10;
q = this.canh - this.height - 10;
w = this.width + 10;
u = this.canh - (this.height - this.cy2 + 10);
y = this.canw - 10;
v = 10;
t = this.width + 10;
x = this.canh - (this.height - this.cy1 + 10);
A = this.width + 10;
B = this.canh - 10;
E = 10;
F = this.canh - 10;
g = k;
h = l + 10;
d = k + 10;
e = l;
m = n - 10;
p = q;
s = n;
r = q + 10;
z = A;
C = B - 10;
K = A - 10;
J = B;
D = E + 10;
G = F;
H = E;
I = F - 10;
break
}
this.pointy > this.height ? (n = this.width + 10, q = 10, w = this.width + 10, u = this.cy2 + 10, y = this.canw - 10, v = this.canh - 10) : (l = k = 10, n = this.width + 10, q = 10, w = this.width + 10, u = this.cy2 + 10, y = this.canw - 10, v = this.pointy);
t = this.width + 10;
x = this.cy1 + 10;
A = this.width + 10;
B = this.height + 10;
E = 10;
F = this.height + 10;
g = k;
h = l + 10;
d = k + 10;
e = l;
m = n - 10;
p = q;
s = n;
r = q + 10;
z = A;
C = B - 10;
K = A - 10;
J = B;
D = E + 10;
G = F;
H = E;
I = F - 10
}
switch (this.config.direct) {
case "Down":
f.beginPath();
f.lineWidth = "0";
f.globalAlpha = this.config.bgalpha;
f.strokeStyle = this.color;
f.fillStyle = colorTo0x(this.config.bgcolor);
f.moveTo(g, h);
f.quadraticCurveTo(k, l, d, e);
f.lineTo(m, p);
f.quadraticCurveTo(n, q, s, r);
f.lineTo(w, u);
f.quadraticCurveTo(y, v, t, x);
f.lineTo(z, C);
f.lineTo(A, B);
f.lineTo(K, J);
f.lineTo(D, G);
f.quadraticCurveTo(E, F, H, I);
break;
case "left":
f.beginPath();
f.lineWidth = "0";
f.globalAlpha = this.config.bgalpha;
f.strokeStyle = this.color;
f.fillStyle = colorTo0x(this.config.bgcolor);
f.moveTo(g, h);
f.quadraticCurveTo(k, l, d, e);
f.lineTo(m, p);
f.quadraticCurveTo(n, q, s, r);
f.lineTo(w, u);
f.quadraticCurveTo(y, v, t, x);
f.lineTo(z, C);
f.quadraticCurveTo(A, B, K, J);
f.lineTo(D, G);
f.lineTo(E, F);
f.lineTo(H, I);
break;
case "Up":
f.beginPath();
f.lineWidth = "0";
f.globalAlpha = this.config.bgalpha;
f.strokeStyle = this.color;
f.fillStyle = colorTo0x(this.config.bgcolor);
f.moveTo(g, h);
f.quadraticCurveTo(k, l, d, e);
f.lineTo(m, p);
f.lineTo(n, q);
f.lineTo(s, r);
f.lineTo(w, u);
f.quadraticCurveTo(y, v, t, x);
f.lineTo(z, C);
f.quadraticCurveTo(A, B, K, J);
f.lineTo(D, G);
f.quadraticCurveTo(E, F, H, I);
break;
case "Right":
f.beginPath(),
f.lineWidth = "0",
f.globalAlpha = this.config.bgalpha,
f.strokeStyle = this.color,
f.fillStyle = colorTo0x(this.config.bgcolor),
f.moveTo(g, h),
f.quadraticCurveTo(k, l, d, e),
f.lineTo(m, p),
f.quadraticCurveTo(n, q, s, r),
f.lineTo(w, u),
f.lineTo(y, v),
f.lineTo(t, x),
f.lineTo(z, C),
f.quadraticCurveTo(A, B, K, J),
f.lineTo(D, G),
f.quadraticCurveTo(E, F, H, I)
}
f.strokeStyle = colorTo0x(this.config.borderColor);
f.lineWidth = 5;
f.closePath();
f.fill();
"false" != this.config.sh && (f.shadowOffsetX = this.config.sx, f.shadowOffsetY = this.config.sy, f.shadowBlur = this.config.se, f.shadowColor = colorTo0x(this.config.sr), f.strokeStyle = colorTo0x(this.config.borderColor));
f.stroke();
f.fill();
f.shadowOffsetX = 0;
f.shadowOffsetY = 0;
f.shadowBlur = 100;
f.shadowColor = 0;
f.fillStyle = this.color;
f.font = this.fontSize + "px " + this.config.fontName;
for (l = k = 0; l < this.text.length; l++) if (c = [], b = this.text[l], f.measureText(b).width <= this.width - 3.5) f.fillText(b, g + 5, h + (l + k) * (this.fontSize + this.fontSize / 2) + 2 * this.fontSize / 3);
else {
b = b.split(" ");
e = b[0];
for (m = 0; m < b.length; m++) m == b.length - 1 ? c.push(e) : (d = e + " " + b[m + 1], f.measureText(d).width <= this.width - 3.5 ? e = d: (c.push(e), e = b[m + 1]));
for (b = 0; b < c.length; b++) f.fillText(c[b], g + 5, h + (l + k + b) * (this.fontSize + this.fontSize / 2) + 2 * this.fontSize / 3);
k += c.length - 1
}
f.globalCompositeOperation = "source-atop";
f.strokeStyle = colorTo0x(this.config.borderColor);
f.shadowColor = colorTo0x(this.config.borderColor);
f.shadowBlur = 50;
f.shadowOffsetX = 0;
f.shadowOffsetY = 0;
f.stroke()
},
initEvent: function() {
var b = this;
this.flag = 0;
this.linkURL = this.form = this.form = null;
if (null != b.config.action) {
try {
void 0 != this.config.action.length && (this.config.action = this.config.action[0]),
this.linkURL = this.config.action.url
} catch(c) {}
var d;
null != this.linkURL && "www" == this.linkURL.substr(0, 3).toLowerCase() && (this.linkURL = "http://" + this.linkURL);
try {
d = this.config.action.triggerEventType
} catch(e) {
d = null
}
this.callout.bind(_event._down,
function(c) {
d == PageEditor.TriggerEventType.MouseDown && actionEvent.bind(b)($(this));
3 == browserType ? event.cancelBubble = !0 : event.stopPropagation()
});
this.callout.bind("mouseover",
function(c) {
d == PageEditor.TriggerEventType.MouseOver && actionEvent.bind(b)($(this))
});
this.callout.bind(isTouch ? _event._end: "mouseout",
function(c) {
d == PageEditor.TriggerEventType.MouseOut && actionEvent.bind(b)($(this))
})
}
},
onResize: function(b, c) {
this.pw = b;
this.ph = c;
this.width = this.wl * bookConfig.largePageWidth;
this.height = this.hl * bookConfig.largePageHeight;
this.setPosition();
this.resizeCallout(c);
if (null != this.form) this.form.onResize(bookContainer.width(), bookContainer.height());
if (null != this.slide) this.slide.onResize(bookContainer.width(), bookContainer.height());
if (null != this.audios) this.audios.onResize(bookContainer.width(), bookContainer.height())
},
setPosition: function() {
this.x = this.cl * this.pw;
this.y = this.ct * this.ph;
this.callout.css({
left: this.x + "px",
top: this.y + "px"
})
}
}),
initAText = Class({
create: function(b, c, d, e, f) {
this.config = $.extend({
width: 200,
height: 20,
x: 0,
y: 0,
alpha: 1,
textStr: null,
fontName: null,
fontSize: 12,
color: null,
tbold: "false",
italic: "false",
align: "left",
action: null,
repeat: "false",
moveSpeed: 1,
sh: "false",
sx: 4,
sy: 4,
se: 2,
sr: null
},
c);
this.pw = d;
this.ph = e;
this.originWidth = bookConfig.largePageWidth;
this.originHeight = bookConfig.largePageHeight;
this.father = b;
this.speed = 1 / this.config.moveSpeed * 12E3;
this.width = this.config.width * this.originWidth;
this.height = this.config.height * this.originHeight;
this.x = this.config.x * this.pw;
this.y = this.config.y * this.ph;
this.id = "text" + f;
this.scrollid = "scroll" + this.id;
this.text = this.config.textStr;
this.color = colorTo0x(this.config.color);
this.atext = $("");
"false" != this.config.sh && this.atext.css({
"box-shadow": this.config.sx + "px " + this.config.sy + "px " + this.config.se + "px " + colorTo0x(this.config.sr),
"-moz-box-shadow": this.config.sx + "px " + this.config.sy + "px " + this.config.se + "px " + colorTo0x(this.config.sr),
"-webkit-box-shadow": this.config.sx + "px " + this.config.sy + "px " + this.config.se + "px " + colorTo0x(this.config.sr),
"-ms-box-shadow": this.config.sx + "px " + this.config.sy + "px " + this.config.se + "px " + colorTo0x(this.config.sr),
"-o-box-shadow": this.config.sx + "px " + this.config.sy + "px " + this.config.se + "px " + colorTo0x(this.config.sr)
});
this.atext2 = $("