/* 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). */ /* section link map */ /* maps id reference to URL */ var section_link_map = {}; section_link_map['gore1e-ch01-sec1-001'] = 'gore1e_ch1_2.html'; section_link_map['gore1e-ch01-sec1-002'] = 'gore1e_ch1_3.html'; section_link_map['gore1e-ch01-sec1-003'] = 'gore1e_ch1_4.html'; section_link_map['gore1e-ch01-sec1-004'] = 'gore1e_ch1_5.html'; section_link_map['gore1e-ch01-sec1-005'] = 'gore1e_ch1_6.html'; section_link_map['gore1e-ch02-sec1-001'] = 'gore1e_ch2_2.html'; section_link_map['gore1e-ch02-sec1-002'] = 'gore1e_ch2_3.html'; section_link_map['gore1e-ch02-sec1-003'] = 'gore1e_ch2_4.html'; section_link_map['gore1e-ch02-sec1-004'] = 'gore1e_ch2_5.html'; section_link_map['gore1e-ch02-sec1-005'] = 'gore1e_ch2_6.html'; section_link_map['gore1e-ch03-sec3-001'] = 'gore1e_ch3_2.html'; section_link_map['gore1e-ch03-sec3-002'] = 'gore1e_ch3_3.html'; section_link_map['gore1e-ch03-sec3-003'] = 'gore1e_ch3_4.html'; section_link_map['gore1e-ch03-sec3-004'] = 'gore1e_ch3_5.html'; section_link_map['gore1e-ch03-sec3-005'] = 'gore1e_ch3_6.html'; section_link_map['gore1e-ch04-sec1-001'] = 'gore1e_ch4_2.html'; section_link_map['gore1e-ch04-sec1-002'] = 'gore1e_ch4_3.html'; section_link_map['gore1e-ch04-sec1-003'] = 'gore1e_ch4_4.html'; section_link_map['gore1e-ch04-sec1-004'] = 'gore1e_ch4_5.html'; section_link_map['gore1e-ch04-sec1-005'] = 'gore1e_ch4_6.html'; section_link_map['gore1e-ch05-sec1-001'] = 'gore1e_ch5_2.html'; section_link_map['gore1e-ch05-sec1-002'] = 'gore1e_ch5_3.html'; section_link_map['gore1e-ch05-sec1-003'] = 'gore1e_ch5_4.html'; section_link_map['gore1e-ch05-sec1-004'] = 'gore1e_ch5_5.html'; section_link_map['gore1e-ch05-sec1-005'] = 'gore1e_ch5_6.html'; section_link_map['gore1e-ch05-sec1-006'] = 'gore1e_ch5_7.html'; section_link_map['gore1e-ch06-sec1-001'] = 'gore1e_ch6_2.html'; section_link_map['gore1e-ch06-sec1-002'] = 'gore1e_ch6_3.html'; section_link_map['gore1e-ch06-sec1-003'] = 'gore1e_ch6_4.html'; section_link_map['gore1e-ch06-sec1-004'] = 'gore1e_ch6_5.html'; section_link_map['gore1e-ch06-sec1-005'] = 'gore1e_ch6_6.html'; section_link_map['gore1e-ch06-sec1-006'] = 'gore1e_ch6_7.html'; section_link_map['gore1e-ch06-sec1-007'] = 'gore1e_ch6_8.html'; section_link_map['gore1e-ch07-sec1-001'] = 'gore1e_ch7_2.html'; section_link_map['gore1e-ch07-sec1-002'] = 'gore1e_ch7_3.html'; section_link_map['gore1e-ch07-sec1-003'] = 'gore1e_ch7_4.html'; section_link_map['gore1e-ch07-sec1-004'] = 'gore1e_ch7_5.html'; section_link_map['gore1e-ch07-sec1-005'] = 'gore1e_ch7_6.html'; section_link_map['gore1e-ch08-sec1-001'] = 'gore1e_ch8_2.html'; section_link_map['gore1e-ch08-sec1-002'] = 'gore1e_ch8_3.html'; section_link_map['gore1e-ch08-sec1-003'] = 'gore1e_ch8_4.html'; section_link_map['gore1e-ch08-sec1-004'] = 'gore1e_ch8_5.html'; section_link_map['gore1e-ch08-sec1-005'] = 'gore1e_ch8_6.html'; section_link_map['gore1e-ch08-sec1-006'] = 'gore1e_ch8_7.html'; section_link_map['gore1e-ch09-sec1-001'] = 'gore1e_ch9_2.html'; section_link_map['gore1e-ch09-sec1-002'] = 'gore1e_ch9_3.html'; section_link_map['gore1e-ch09-sec1-003'] = 'gore1e_ch9_4.html'; section_link_map['gore1e-ch09-sec1-004'] = 'gore1e_ch9_5.html'; section_link_map['gore1e-ch09-sec1-005'] = 'gore1e_ch9_6.html'; section_link_map['gore1e-ch09-sec1-006'] = 'gore1e_ch9_7.html'; section_link_map['gore1e-ch10-sec1-001'] = 'gore1e_ch10_2.html'; section_link_map['gore1e-ch10-sec1-002'] = 'gore1e_ch10_3.html'; section_link_map['gore1e-ch10-sec1-003'] = 'gore1e_ch10_4.html'; section_link_map['gore1e-ch10-sec1-004'] = 'gore1e_ch10_5.html'; section_link_map['gore1e-ch10-sec1-005'] = 'gore1e_ch10_6.html'; section_link_map['gore1e-ch10-sec1-006'] = 'gore1e_ch10_7.html'; section_link_map['gore1e-ch10-sec1-007'] = 'gore1e_ch10_8.html'; section_link_map['gore1e-ch10-sec1-008'] = 'gore1e_ch10_9.html'; section_link_map['gore1e-ch11-sec1-001'] = 'gore1e_ch11_2.html'; section_link_map['gore1e-ch11-sec1-002'] = 'gore1e_ch11_3.html'; section_link_map['gore1e-ch11-sec1-003'] = 'gore1e_ch11_4.html'; section_link_map['gore1e-ch11-sec1-004'] = 'gore1e_ch11_5.html'; section_link_map['gore1e-ch11-sec1-005'] = 'gore1e_ch11_6.html'; section_link_map['gore1e-ch11-sec1-006'] = 'gore1e_ch11_7.html'; section_link_map['gore1e-ch11-sec1-007'] = 'gore1e_ch11_8.html'; section_link_map['gore1e-ch12-sec1-001'] = 'gore1e_ch12_2.html'; section_link_map['gore1e-ch12-sec1-002'] = 'gore1e_ch12_3.html'; section_link_map['gore1e-ch12-sec1-003'] = 'gore1e_ch12_4.html'; section_link_map['gore1e-ch12-sec1-004'] = 'gore1e_ch12_5.html'; section_link_map['gore1e-ch12-sec1-005'] = 'gore1e_ch12_6.html'; section_link_map['gore1e-ch12-sec1-006'] = 'gore1e_ch12_7.html'; section_link_map['gore1e-ch13-sec1-001'] = 'gore1e_ch13_2.html'; section_link_map['gore1e-ch13-sec1-002'] = 'gore1e_ch13_3.html'; section_link_map['gore1e-ch13-sec1-003'] = 'gore1e_ch13_4.html'; section_link_map['gore1e-ch13-sec1-004'] = 'gore1e_ch13_5.html'; section_link_map['gore1e-ch13-sec1-005'] = 'gore1e_ch13_6.html'; section_link_map['gore1e-ch13-sec1-006'] = 'gore1e_ch13_7.html'; section_link_map['gore1e-ch14-sec1-001'] = 'gore1e_ch14_2.html'; section_link_map['gore1e-ch14-sec1-002'] = 'gore1e_ch14_3.html'; section_link_map['gore1e-ch14-sec1-003'] = 'gore1e_ch14_4.html'; section_link_map['gore1e-ch14-sec1-004'] = 'gore1e_ch14_5.html'; section_link_map['gore1e-ch14-sec1-005'] = 'gore1e_ch14_6.html'; section_link_map['gore1e-app01-sec1-001'] = 'gore1e_app1_2.html'; section_link_map['gore1e-app01-sec1-002'] = 'gore1e_app1_3.html'; section_link_map['gore1e-app01-sec1-003'] = 'gore1e_app1_4.html'; section_link_map['gore1e-app01-sec1-004'] = 'gore1e_app1_5.html'; /************************************** Set this to the DF book ID (Subtype) **************************************/ xBookUtils.bookID = "gore1e"; /* 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", // to move h3 out of b0x_inner //cfg_Box_moveTitle: "all", //cfg_Box_moveTitleExclude: "", //cfg_Figures_targetDefault: "_blank", cfg_Figures_resizeDivWidth: "on", 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: "", cfg_pageNumbers: "on", cfg_PPM_pageJump: "on", initialize_sections: function() { // Do not delete this this._super(); // Anything that needs to be done before the page displays // should be done here. var bookid = "gore1e"; var matches; // Run section-link_map above, providing section links //Section references linked to sections $('a[href]').each(function(){ var old_href = $(this).attr('href'); if(section_link_map.hasOwnProperty(old_href)){ $(this).attr('href', section_link_map[old_href]); } }); }, // 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. ////////////////////////////////////////////////// // remove popup handler from chapter cover images $('[data-block_type="cover_image"] > img').unbind() ////////////////////// // add click events // ////////////////////// //////////////////////////////////////////////////////// // common code for all popups - sizing - positioning var pop_content = function(url, w, h) { var path = window.location.pathname; //if (path.search('supp_wins') < 0) { var newWin = window.open(url,'_blank','width='+w+',height='+h+',menubar=0,location=0,scrollbars=1',''); newWin.moveTo(300, 200); //} }; ///////////// // TABLES ///////////// $('[data-block_type^="table"]').click(function() { if ($(this).parents('[data-type="section"]').hasClass("table")) { return; } var firstTableText = $(this).find('[data-type="table_text"]').eq(0); var supp_win; var chnum = firstTableText.find('[data-block_type="tbmcl-n"] strong').text(); var chapnum = chnum.replace(/Table (\d+)\.(.*)/i, "$1"); var tabnum = chnum.replace(/Table (\d+\.\d+)/i, "$1"); tabnum = tabnum.replace(/\./, "_"); var win_body = $(this).parents('body#supp_win'); // if not a supp_win, else different path to table file if (win_body.length == 0) { supp_win = "asset/ch" + chapnum + "/table_" + tabnum + ".html"; } else { supp_win = "table_" + tabnum + ".html"; } pop_content(supp_win, "800px", "400px"); }); // in-text links (spans) $('[data-block_type="tbl_link"]').click(function(i, el) { var supp_win = $(this).attr('data-url'); pop_content(supp_win, "800px", "400px"); }); // also pop any spotlight unnumbered tables with data-attr="pop" $('[data-block_type="untable"][data-attr="pop"]').click(function() { if ($(this).parents('[data-type="section"]').hasClass("table")) { return; } var supp_win; // have to get chapter number from table div id var chnum = $(this).attr('id'); var chapnum = chnum.replace(/gore1e-ch0?(\d+)-untab-\d+[c]?/, "$1"); var win_body = $(this).parents('body#supp_win'); supp_win = "asset/ch" + chapnum + "/table_" + chapnum + "_spotlight.html"; pop_content(supp_win, "600px", "600px"); }); ///////////////////////////////////////////////////////////// // SUPPLEMENTAL WINDOWS // adjust caption width for figures in supplemental windows ///////////////////////////////////////////////////////////// $(window).load(function() { $('#supp_win > [data-type="figure"]').each(function() { // $(this).removeAttr('data-caption-compass'); var imgwidth = $(this).find('img').width(); $(this).find('[data-type="figure_text"]').width(imgwidth); // don't popup images from supplemental windows $(this).find('img').unbind(); $(this).find('[data-type="number"]').unbind(); }); }); ///////////////////////////////////////////////////////////// // My Personal Success Plan // Add required elements for styling ///////////////////////////////////////////////////////////// // wrap the left-hand side of this feature in a container $('[data-block_type="bx5-h"] [data-type="title"]').each(function () { $(this).nextUntil('[data-type="table"]').andSelf().wrapAll('
'); }); } // end initialize2 }); // end Player_subtype // Do not delete this player = new Player_subtype();