/*
This is the standard template you should add to your book JS file before
customizing.
Uncomment any of the configuration options to change the default behavior (see
https://macmillanhighered.atlassian.net/wiki/display/MP/Player+Configuration+Options
for descriptions of the options).
*/
xBookUtils.bookID = "bergerinvitels2ecanadian";
var Player_subtype = Player_manuscript_type.extend({
//cfg_removeRawHtmlDivs: "on",
cfg_showAnswer: "on",
//cfg_showAnswerAutoWrapThis: "off",
//cfg_Box_moveTitle: "all",
//cfg_Box_moveTitleExclude: "",
cfg_Figures_targetDefault: "_blank",
//cfg_Figures_resizeDivWidth: "off",
cfg_Figures_autoHtml: "on",
cfg_LH_autoHtml: "on",
//cfg_LH_externalTargetDefault: "_pop",
//cfg_LH_internalTargetDefault: "_pop",
//cfg_LH_ebookTargetDefault: "_pop",
cfg_LH_imageTargetDefault: "_blank",
cfg_Glossary_useStickyDiv: "on",
cfg_Glossary_hoverTerms: "on",
initialize_sections: function() {
// Do not delete this
this._super();
// Anything that needs to be done before the page displays
// should be done here.
$('[data-block_type="especially"]').each(xBookUtils.checkShowAnswer);
//Style the Part Introduction Titles
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Part 1 Introduction/, "The Beginning");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Part 2 Introduction/, "The First Two Years");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Part 3 Introduction/, "Early Childhood");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Part 4 Introduction/, "Middle Childhood");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Part 5 Introduction/, "Adolescence");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Part 6 Introduction/, "Adulthood");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Part 7 Introduction/, "Late Adulthood");
});
//Remove the Chapter Titles
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Chapter Introduction/, "");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Frontmatter Introduction/, "");
});
//Styling the Chapter Review titles
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Summary/, "Summary");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Key Terms/, "Key Terms");
});
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/What Have You Learned\?/, "What Have You Learned?");
});
$("div[level=1] > h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/Applications/, "Applications");
});
$('p strong').each(function() {
var $this = $(this);
var term = $this.html();
if (!xBookUtils.emptyValue(player.glossary.get_entry(term))) {
$this.attr('data-type', 'termref').attr('tabindex', '0');
}
});
var $chapter = xBookUtils.getChapter();
// Style the Key Points box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/KEY points/, "KEY Points");
});
}, // end initialize_sections
initialize: function(id) {
// Do not delete this
this._super(id);
this.xrefs = new XRefs_manuscript_subtype();
this.glossary = new Glossary_manuscript_subtype();
this.figures = new Figures_manuscript_subtype();
}, // end initialize
initialize2: function() {
$("[data-type='icon']").click(function() {
var $this = $(this); // save reference to the element that was clicked
var url = $this.data("link-url"); // get link-url
window.open(url);
});
// Do not delete this
this._super();
var link_handler = new LinkHandler();
// Anything that can be done after the page displays
// should be done here.
} // end initialize2
}); // end Player_subtype
// Do not delete this
player = new Player_subtype();