/*
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 = "kolbintro5e";
/*
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.
/***************************************************/
/** Format SUMMARY Section **/
if ($("[data-block_type='sum-hd1']").length) {
$("[data-block_type='sum-hd1']").each(function () {
var text = $(this).text();
var vals = text.match(/(\d+-\d+) (.*)/); /* separate number and string */
var new_html = "
" + vals[1] + "" + "" + vals[2] + "
" ;
$(this).html(new_html) ;
}); /* each */
} /* if */
/***************************************************/
/** Adjust chapter_number div to hold just the number **/
/** add div for the word CHAPTER **/
if ($("[data-block_type='chapter_number']").length) {
var html = $("[data-block_type='chapter_number']").text();
var chap_num = html.substr(8) ; /* extract number */
$("[data-block_type='chapter_number']").html(chap_num);
var chaps = ["1", "2", "3", "8", "9", "12", "13"] ;
var a = chaps.indexOf(chap_num) ;
if (a != -1) {
$("[data-block_type='chapter_number']").before("
");
}
else {
$("[data-block_type='chapter_number']").before("
");
} /* if */
} /* if */
/***************************************************/
/** COMPARATIVE & CLINICAL FOCUS **/
/** Add div for image and adjust COMPARATIVE text **/
if ($("[data-block_type='bx1-h-v1']").length) {
$("[data-block_type='bx1-h-v1'] h3[data-type='title']").each(function() {
var html = $(this).html();
if (html.substr(0, 11) == "COMPARATIVE")
$(this).before("
");
else
if (html.substr(0, 8) == "RESEARCH") {
$(this).before("
");
/* position the number */
$(this).css("margin-left", "155px");
} /* else if */
else {
/* set the image for CLINICAL */
$(this).before("
");
/* position the number */
$(this).css("margin-left", "155px");
} /* else */
html = html.replace("COMPARATIVE FOCUS ", "");
html = html.replace("RESEARCH FOCUS ", "");
html = html.replace("CLINICAL FOCUS ", "");
$(this).html(html);
});
} /* if */
/***************************************************/
/** EXPERIMENT Boxes **/
/** Add div for Experiment number **/
if ($("[data-block_type='emt-h']").length) {
$("[data-block_type='emt-h'] h3[data-type='title']").each(function() {
var html = $(this).html();
var num = html.substr(10);
$(this).before("" + num + "
");
$(this).html("EXPERIMENT ");
});
} /* 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", "#000000");
} /* if */
} /* if */
/***************************************/
/* In Supplemental Window adjust image size */
if ($("#supp_win").length) {
if ($("#supp_win > div > div > div[data-block_type='un_figure-lg']").length) { return 0; }
if ($("#supp_win > div > div > div[data-block_type='table-lg']").length) { return 0; }
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();