/*
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 = "hockenbury7e";
/*
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: "thinklike_scientist",
//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_hoverTerms: "on",
cfg_Glossary_useStickyDiv: "on",
// MR - added for links.js support
cfg_LH_useOpenContent: "on",
cfg_LH_useLinksFile: "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-type="question"] p, [data-type="question"] ol').each(xBookUtils.checkShowAnswer);
$('[data-type="question"]').each(xBookUtils.checkShowAnswer);
/*
$('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');
}
});
*/
$('h4.level3').each(function() {
var l3title = $(this).html();
var res = l3title.replace(/([^:]+): (.*)/, "$1$2");
$(this).html(res);
});
var $chapter = xBookUtils.getChapter();
var image_path = xBookUtils.getBaseUrl() + 'asset/img_ch' + $chapter + '/hockenbury7e_ch' + $chapter + '_un_1.jpg';
$('div[data-block_type="intro_box"]').css('background', "url(" + image_path +") no-repeat");
/* MR - special image size adjust for chapter 14 */
$('div[id="hockenbury7e-chapter14-intro-box"][data-block_type="intro_box"]').css('background-position', "92% 70%");
/* MR - special image size adjust for chapter 5 */
$('div[id="hockenbury7e-chapter5-intro-box"][data-block_type="intro_box"]').css('background-position', "-200px 0");
/* MR - special image size adjust for chapter 12 */
$('div[id="hockenbury7e-chapter12-intro-box"][data-block_type="intro_box"]').css('background-repeat', "repeat");
$('div[id="hockenbury7e-chapter12-intro-box"][data-block_type="intro_box"]').css('background-position-x', "199px");
$('div[id="hockenbury7e-chapter12-intro-box"][data-block_type="intro_box"]').css('background-position-y', "-90px");
//Style Myth or Science box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/MYTH OR SCIENCE/, "MYTH OR<\/span> SCIENCE");
});
//Style In This Chapter box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/IN THIS CHAPTER/, "IN<\/span> THIS CHAPTER");
});
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/IN THIS APPENDIX/, "IN<\/span> THIS APPENDIX");
});
//Style Myth/Science box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/MYTH !lhtriangle! SCIENCE/, "MYTH SCIENCE<\/span>");
});
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/MYTH !rhtriangle! SCIENCE/, "MYTH <\/span> SCIENCE");
});
//Style Introduction title
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/INTRODUCTION: (.*?)/, "INTRODUCTION:<\/br><\/span>$1");
});
//Style Section titles
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/([^:]+): (.*?)/, "$1<\/br>$2");
});
//Style Psych For Your Life title
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/PSYCH FOR YOUR LIFE/, "PSYCH FOR YOUR LIFE<\/span>");
});
//Style Chapter Review title
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/CHAPTER REVIEW/, "CHAPTER REVIEW<\/span>");
});
//Style KEY TERMS title
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/KEY TERMS/, "KEY TERMS<\/span>");
});
//Style KEY PEOPLE title
$("h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/KEY PEOPLE/, "KEY PEOPLE<\/span>");
});
//Style the split level sections titles
$("div[level=2] > h2[class=section-title] > span[data-type=title]").html(function () {
return $(this).html().replace(/(.*?): (.*?)/, "$1<\/br><\/span>$2");
});
//Style CULTURE AND HUMAN BEHAVIOR box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/CULTURE AND HUMAN BEHAVIOR/, "CULTURE AND HUMAN BEHAVIOR<\/span>");
});
//Style SCIENCE vs. PSEUDOSCIENCE box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/SCIENCE VERSUS PSEUDOSCIENCE/, "SCIENCE VERSUS PSEUDOSCIENCE<\/span>");
});
//Style CRITICAL THINKING box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/CRITICAL THINKING AND QUESTIONS/, "CRITICAL THINKING AND QUESTIONS<\/span>");
});
//Style CRITICAL THINKING box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/CRITICAL THINKING/, "CRITICAL THINKING<\/span>");
});
//Style FOCUS ON NEUROSCIENCE box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/FOCUS ON NEUROSCIENCE/, "FOCUS ON NEUROSCIENCE<\/span>");
});
//Style IN FOCUS box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/IN FOCUS/, "IN FOCUS<\/span>");
});
//wrapping the mythscience boxes in another div to get the purple bubbles to appear to the right
$("div[data-block_type=mythscience]").html(function () {
$(this).wrap("");
});
//Style Concept Review box titles
$("h3[data-type=title]").html(function () {
return $(this).html().replace(/CONCEPT REVIEW (\d+\.\d+)/, "CONCEPT REVIEW $1<\/span>");
});
$("h4[class=level3]").html(function () {
return $(this).html().replace(/New Think Like a Scientist Model and Digital Feature/, "New Think Like a Scientist<\/em> Model and Digital Feature");
});
$("h4[class=level3]").html(function () {
return $(this).html().replace(/New Myth or Science\? Feature/, "New Myth or Science?<\/em> Feature");
});
$("div[data-block_type=criticalthinking_title]").html(function () {
return $(this).html().replace(/Does Exposure to Media Violence Cause Aggressive Behavior/, "Does Exposure to Media Violence Cause<\/em> Aggressive Behavior");
});
$('div#toc_dialog > div:first').html(function() {
return $(this).html().replace(/1.2 TO THE INSTRUCTOR/,"FM.2 TO THE INSTRUCTOR");
});
//$('div#hockenbury7e-ch3-fig-15').attr('style','width: 130px');
$('div#hockenbury7e-ch3-fig-15').css('width', '130px');
$('div#hockenbury7e-ch4-fig-11').attr('style','width: 250px');
$('div#hockenbury7e-ch3-fig-38').css('width', '300px');
$('div#hockenbury7e-ch12-table-2 li').addClass('ul_surround');
//$('div#hockenbury7e-ch12-table-2 li.ul_surround').wrapall("");
}, // 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);
});
$('div#hockenbury7e-ch7-fig-14 span[data-block_type="show_sol"]').click(function(){
$('div#hockenbury7e-ch7-fig-18').toggle();
});
// 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();