/*
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).
*/
/**************************************
Set this to the DF book ID (Subtype)
**************************************/
xBookUtils.bookID = "belsky4e";
/*
You only need to set the disciplines if you are using the HTML Quiz
question delivery method, which only BSM ebooks and HTML Quizzes are at this
time (in other words, if this is a FW ebook then you don't need to do a thing).
Change the zeros to the discipline number for each tier on PX.
Discipline numbers:
History: 6696 (all tiers)
Composition: 6698 (all tiers)
Communication: 6700 (all tiers)
College Success: 6704 (all tiers)
If you do not know the discipline number for your book then ask your MP.
*/
xBookUtils.discipline = {
dev: 0,
qa: 0,
pr: 0,
www: 0
}
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_LH_useOpenContent: "on",
cfg_LH_useLinksFile: "on",
cfg_Glossary_hoverTerms: "on",
//cfg_Glossary_useStickyDiv: "on",
//cfg_Glossary_hoverTermsNoClick: "",
initialize_sections: function() {
// Do not delete this
this._super();
// Anything that needs to be done before the page displays
// should be done here.
/***************************************/
/* REFERENCES - Output c with an accent */
if ($("[data-block_type='c-accent']").length) {
var html = $("[data-block_type='c-accent']").html();
$("[data-block_type='c-accent']").html("ć");
} /* if *?
/***************************************/
/* Move Chapter Number to Outline */
if (($("[data-block_type='chapter_number']").length) && ($("[data-block_type='co-toc-t']").length)) {
var chap_num = $("[data-block_type='chapter_number']").detach();
$("[data-block_type='co-toc-t']").prepend(chap_num);
} /* if */
/***************************************/
/* Move Caption Text for TABLES to Top */
$("[data-type='table']").each(function() {
var tab_text = $(this).children("[data-type='table_text']").detach() ;
$(this).prepend(tab_text);
});
/***************************************/
/* Add image for Tying It All Together */
$("[data-block_type='sr-h']").each(function() {
$(this).prepend("") ;
});
/***************************************/
/* Experiencing the Lifespan - add for text color */
if ($("[data-block_type='bx1-t'] [data-type='box_inner'] h3").length) {
var html = $("[data-block_type='bx1-t'] [data-type='box_inner'] h3").html();
html = "" + html;
html = html.replace(":", ":");
$("[data-block_type='bx1-t'] [data-type='box_inner'] h3").html(html);
} /* if */
/***************************************/
/* Add image for Hot in Developmental Science */
$("[data-block_type='bx4-t']").each(function() {
$(this).children("[data-type='box_inner']").prepend("") ;
/* Add span to color "Hot in Development Science:" text */
var the_html = $(this).children("[data-type='box_inner']").children("[data-type='title']").html() ;
the_html = the_html.replace("Hot in Developmental Science:", "Hot in Developmental Science:");
$(this).children("[data-type='box_inner']").children("[data-type='title']").html(the_html) ;
/* Add image at end of Hot section */
$(this).children("[data-type='box_inner']").children("[data-block_type='bx4-txt-last']").children("p").append("") ;
});
/***************************************/
/* INTERVENTIONS - add for text color */
if ($("[data-block_type='bx5-ht'] [data-type='box_inner'] h3").length) {
$("[data-block_type='bx5-ht'] [data-type='box_inner'] h3").each(function() {
var html = $(this).html();
html = "" + html;
html = html.replace(":", ":");
$(this).html(html);
}); /* each */
} /* if */
/***************************************/
/* In Supplemental Window add FIGURE num to caption */
if ($("#supp_win").length) {
if ($("[data-block_type='figure']").length) {
var f_name = $("[data-block_type='figure']").children("img").attr("src") ;
var ch_num = f_name.match(/belsky4e_fig(\d+)_(\d+)/);
if (ch_num != null) {
var num_html = "" + "Figure " + Number(ch_num[1]) + "." + Number(ch_num[2]) + ": " ;
$("[data-block_type='figure']").children("[data-type='figure_text']").prepend(num_html) ;
} /* if */
} /* if */
} /* if */
/***************************************/
/* In Supplemental Window disable links */
if ($("#supp_win").length) {
if ($("#supp_win [data-type='figure_text'] [data-type='caption'] a").length) {
$("#supp_win [data-type='figure_text'] [data-type='caption'] a").css("pointer-events", "none").css("cursor", "default").css("font-weight", "normal").css("color", "#636466");
} /* if */
} /* if */
/***************************************/
/* In Supplemental Window adjust image size */
if ($("#supp_win").length) {
if ($("[data-type='figure']").length) {
var width, height;
width = $("[data-type='figure']").children("img").attr("width");
height = $("[data-type='figure']").children("img").attr("height");
if (width >= height)
$("[data-type='figure']").children("img").css("max-height", "650px");
else
$("[data-type='figure']").children("img").css("max-width", "650px");
} /* if */
} /* if */
}, // end initialize_sections
/*
You will most likely not make any changes to the initialize
method unless you know exactly what you are doing :-)
*/
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() {
// 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();