/* 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 = "listen8e"; /* You only need to set the disciplines if you are using the HTML Quiz question delivery method, which only BSM ebooks 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) */ xBookUtils.discipline = { dev: 6706, qa: 6706, pr: 6706, www: 6706 } 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_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. var ch_num = $("#manuscript").data("chapter-number"); if ($('[data-block_type="about"]').length > 0) { var $h2 = $('h2'); var h2_txt = $h2.text(); if (match = h2_txt.match(/(Preface)--(.*)/)) { $h2.text(match[1]); } } if ($('[data-block_type="ch_intro"]').length > 0) { $('body').addClass('ch_intro'); $('h2').before('
CHAPTER
' + ch_num + '
PRELUDE
UNIT
' + match[1] + '
' + match[1] + '
'); } } if ($('[data-block_type="bx_feat"]').length > 0) { $('body').addClass('bx_feat'); var $h2 = $('h2'); var h2_txt_temp = $h2.text(); var h2_txt = h2_txt_temp.toUpperCase(); $h2.text(h2_txt); if (match = h2_txt.match(/(WAGNER’S TRISTAN AND ISOLDE \(1859\))/)) { $h2.html('WAGNER’S TRISTAN AND ISOLDE \(1859\)'); } } if ($('[data-block_type="goals"]').length > 0) { $('body').addClass('goals'); var $h2 = $('h2'); var h2_txt = $h2.text(); if (match = h2_txt.match(/(Goals for Review)/)) { $h2.text('GOALS FOR REVIEW'); } } if ($('[data-block_type="gp"]').length > 0) { $('body').addClass('gp'); var $h2 = $('h2'); var h2_txt = $h2.text(); if (match = h2_txt.match(/(Global Perspectives): .*?/)) { $h2.text(match[1]); } } // convert termrefs in section titles $('[data-type="section"]').find('termref').each(function() { var $termref = $(this); var data_term = $termref.attr('term'); var termref_txt = $termref.text(); $termref.after('' + termref_txt + ''); $termref.remove(); }); // make notation images a percentage of their original size /*$('[data-type="section"]').find('[data-type="figure"][data-layout-width="notation"] img, [data-block_type="lc_tbl"] img').each(function(){ var img_width = $(this).width(); console.log(img_width); $(this).width($(this).width() * 0.85); $(this).addClass('notation'); }); $('#supp_win').find('[data-type="figure"][data-layout-width="notation"] img').each(function(){ $(this).width($(this).width() * 1.1764); $(this).addClass('sp_notation'); }); // testing get width in PX $('#manuscript').find('[data-type="section"]').each(function(){ var section_width = $(this).width(); console.log(section_width); });*/ } // end initialize2 }); // end Player_subtype // Do not delete this player = new Player_subtype();