/* 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 = "theguide11e"; xBookUtils.supp_content['IN'].visible = true; 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. }, // 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. safe_log("in main content frame: " + xBookUtils.inMainContentFrame()); var ch_num = $("#manuscript").data("chapter-number"); if ($('[data-block_type="h1_wr"]').length > 0) { $('body').addClass('h1_wr'); $("p > img").each(function() { var height = $(this).height(); var i = 1; if (height >= 28) { i++; $(this).addClass('tall'); } }); $("li:has(img)").addClass('li-adjust') } if (ch_num === 101) { $('body').addClass('handbook'); var title = $('h2 [data-type="title"]'); var title_txt = title.text(); if (match = title_txt.match(/([A-Z]\d+)( .*)/)) { title.html('' + match[1] + '' + match[2]); } } if ($('[data-block_type="glossary"]').length > 0) { $('body').addClass('glossary'); } $('[data-block_type="inst_bx"]').insertBefore( $('h2') ); if ($('[data-block_type="remix"]').length > 0) { var $h2 = $('h2'); var h2_txt = $h2.text(); if (match = h2_txt.match(/(REMIX): (.*)/)) { $h2.text(match[1]); } } if ($('[data-block_type="reflecting"]').length > 0) { var $h2 = $('h2'); $h2.text('THINKING CRITICALLY'); } if ($('[data-block_type="h1_gtr"]').length > 0) { $('[data-block_type="h1_gtr"]').prepend('
GUIDE TO READING
') } if ($('[data-block_type="h1_gtw"]').length > 0) { $('[data-block_type="h1_gtw"]').prepend('GUIDE TO WRITING
') } if ($('[data-block_type="h1_wat"]').length > 0) { $('[data-block_type="h1_wat"]').prepend('A WRITER AT WORK
') } } // end initialize2 }); // end Player_subtype // Do not delete this player = new Player_subtype();