1riot.tag2('rc-riot-avail-pricing', '<div class="tag-content"> <div if="{mode==\'summary\'}" class="{\'price-summary\' : true, \'has-package\' : has_package, \'has-coupon\' : has_coupon, \'has-savings\' : has_savings, \'is-alternate\' : is_alternate}"> <div id="detailed-quote-response"> </div> {pricing_text} <div class="display-savings" if="{savings_text != \'\'}"> <span>{opts.txt.savings_annot}</span> {savings_text}! </div> <a class="trigger" onclick="{triggerClicked}"> {opts.txt.trigger} <i> <?xml version="1.0" encoding="utf-8"?> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="-285 381.8 40.8 30.7" style="enable-background:new -285 381.8 40.8 30.7;" xml:space="preserve" preserveaspectratio="xMinYMid"> <path d="M-247,386.8h-11.4l-1.4-3.5c-0.3-0.9-1.2-1.5-2.2-1.5h-5c-1,0-1.8,0.5-2.2,1.6l-1.3,3.4h-11.4c-1.6,0-2.9,1.2-2.9,2.9v20 c0,1.6,1.2,2.9,2.9,2.9h35c1.6,0,2.9-1.2,2.9-2.9v-19.7h0.1v-0.2C-244.2,388-245.4,386.8-247,386.8z M-274.9,388.5v22.3h-7.1 c-0.7,0-1.2-0.5-1.2-1.2v-20c0-0.7,0.5-1.1,1.2-1.1H-274.9z M-268.7,386.8l1.2-2.8c0.1-0.2,0.3-0.4,0.5-0.4h5c0.3,0,0.5,0.1,0.6,0.3 l1.2,2.9H-268.7z M-273.2,410.8v-22.3h16.3v22.3H-273.2z M-245.9,389.7v20c0,0.7-0.5,1.2-1.1,1.2h-8.2v-22.3h8.2 C-246.4,388.5-245.9,389-245.9,389.7z"></path> </svg> </i> </a> </div> <div if="{mode==\'detail\'}" id="{\'pricing-detail-\' + eid}" class="{\'pricing-detail\': true, \'full\': true}"> <div id="detailed-quote-response"> </div> <div each="{ind, og in offer_groups}" class="{\'offer-group\': true, og.offerby: true}"> <h5 if="{og.name !=\'\'}">{og.name}</h5> <div each="{price in og.offers}" class="{\'rc-price\': true, \'has-package\': price.has_package, \'is-alternate\' : price.is_alternate}"> <div if="{price.dn.length}" class="display-name">{price.dn}</div> <div if="{parent.parent.opts.show_quote_detail && price.dd.length}" class="display-detail">{price.dd}</div> <div if="{parent.parent.opts.show_quote_savings && price.has_savings}" class="display-savings"> <span>{parent.parent.opts.txt.savings_annot}</span> {parent.parent.RCRiotUtils.formatSavings(price, precision, parent.parent.opts.display_type)} </div> <div class="price"> <span class="original-price" if="{price.s && parent.parent.opts.show_original_price}"> {parent.parent.RCRiotUtils.formatOriginalPrice(price, precision, parent.parent.opts.display_type)} </span> {parent.parent.RCRiotUtils.formatPrice(price, precision, parent.parent.opts.display_type)} <sup if="{parent.parent.opts.txt.annot}"> {parent.parent.opts.txt.annot} </sup> </div> <div if="{price.packages_title || price.packages_desc}" class="packages"> <div if="{price.packages_header}" class="packages-header"><span></span><div>{price.packages_header}</div><span></span></span></div> <div if="{price.packages_title}" class="packages-title">{price.packages_title}</div> <div if="{price.packages_desc}" class="packages-desc">{price.packages_desc}</div> </div> <button if="{parent.parent.opts.show_quote_link}" data-price="{price}" onclick="{parent.parent.quoteClicked}" class="quote"> {parent.parent.opts.txt.quote} </button> <button if="{parent.parent.opts.show_buy}" data-price="{price}" onclick="{parent.parent.buyClicked}" class="book"> {parent.parent.opts.txt.buy} </button> <button if="{parent.parent.opts.show_add}" data-price="{price}" onclick="{parent.parent.addClicked}" class="add"> {parent.parent.opts.txt.add} </button> </div> </div> </div> <div if="{mode==\'alternates\'}" id="{\'pricing-detail-\' + eid}" class="{\'pricing-detail\': true, \'full\': true}"> <div id="detailed-quote-response"> </div> <div each="{og in featuredOfferGroups()}" class="{\'offer-group\': true, og.offerby: true}"> <h5 if="{og.name !=\'\'}">{og.name}</h5> <div each="{price in og.offers}" class="{\'rc-price\': true, \'has-package\': price.has_package, \'is-alternate\' : price.is_alternate}"> <div class="offer-dates" if="{!price.restrictions}"> <div>{addCustomDatesFormat(og)}</div> <a class="flex-trigger" onclick="{popModalWith(getAlternatesOpts())}" if="{parent.parent.has_alternates}">{tokenize(parent.parent.opts.txt.trigger)}</a> </div> <div if="{price.dn.length}" class="display-name">{price.dn}</div> <div if="{parent.parent.opts.show_quote_detail && price.dd.length}" class="display-detail">{price.dd}</div> <div if="{parent.parent.opts.show_quote_savings && price.has_savings}" class="display-savings"> <span>{parent.parent.opts.txt.savings_annot}</span> {parent.parent.RCRiotUtils.formatSavings(price, precision, parent.parent.opts.display_type)} </div> <div class="price"> <span class="original-price" if="{price.s && parent.parent.opts.show_original_price}"> {parent.parent.RCRiotUtils.formatOriginalPrice(price, precision, parent.parent.opts.display_type)} </span> {parent.parent.RCRiotUtils.formatPrice(price, precision, parent.parent.opts.display_type)} <sup if="{parent.parent.opts.txt.annot}"> {parent.parent.opts.txt.annot} </sup> </div> <button if="{parent.parent.opts.show_quote_link}" data-price="{price}" onclick="{parent.parent.quoteClicked}" class="quote"> {parent.parent.opts.txt.quote} </button> <button if="{parent.parent.opts.show_buy}" data-price="{price}" onclick="{parent.parent.buyClicked}" class="book"> {parent.parent.opts.txt.buy} </button> <button if="{parent.parent.opts.show_add}" data-price="{price}" onclick="{parent.parent.addClicked}" class="add"> {parent.parent.opts.txt.add} </button> </div> </div> <div if="{featuredOfferGroups().length < 1}" class="not-available"> {opts.txt.not_available} <span if="{search_date}" class="search-date">{search_date}</span> <a class="flex-trigger" onclick="{popModalWith(getAlternatesOpts())}" if="{has_alternates && featuredOfferGroups().length < 1}"> {tokenize(opts.txt.trigger)} </a> </div> </div> <div if="{!opts.teaser && current_price}" class="{\'cost-calculator \': true}"> <a class="show-calculator-trigger" onclick="{showCostCalculator}">View the split cost</a> </div> </div>', '@-webkit-keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } @-moz-keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } @-o-keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } @keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } rc-riot-avail-pricing,[riot-tag="rc-riot-avail-pricing"],[data-is="rc-riot-avail-pricing"]{ display: block; } rc-riot-avail-pricing .tag-content .price-summary,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary{ font-weight: bold; color: #ff1e00; font-size: 16px; padding-top: 7px; } rc-riot-avail-pricing .tag-content .price-summary a,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary a,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary a{ font-size: 14px; color: #ff1e00; letter-spacing: .03em; padding-top: 3px; } rc-riot-avail-pricing .tag-content .price-summary a:hover,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary a:hover,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary a:hover,rc-riot-avail-pricing .tag-content .price-summary a:active,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary a:active,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary a:active{ text-decoration: underline; cursor: pointer; } rc-riot-avail-pricing .tag-content .price-summary a i,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary a i,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary a i{ width: 18px; height: 18px; margin-left: 5px; display: block; float: right;
1 margin-top: 1px; } rc-riot-avail-pricing .tag-content .price-summary a i #Layer_1,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary a i #Layer_1,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary a i #Layer_1{ fill: #ff1e00; } @media only screen and (min-width: 30.0625em) { rc-riot-avail-pricing .tag-content .price-summary,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary{ font-size: 18px; } rc-riot-avail-pricing .tag-content .price-summary a,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary a,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary a{ padding-top: 5px; } rc-riot-avail-pricing .tag-content .price-summary a i,[riot-tag="rc-riot-avail-pricing"] .tag-content .price-summary a i,[data-is="rc-riot-avail-pricing"] .tag-content .price-summary a i{ width: 22px; margin-top: -1px; } } rc-riot-avail-pricing .tag-content .offer-group > h5,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group > h5,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group > h5{ color: #111; border-bottom: solid 1px rgba(17, 17, 17, 0.1); padding-bottom: 10px; margin-top: -5px; } rc-riot-avail-pricing .tag-content .offer-group .rc-price,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price{ text-align: center; } rc-riot-avail-pricing .tag-content .offer-group .rc-price button,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button{ text-transform: none; height: auto; background: #ff1e00; color: #fff; letter-spacing: .03em; margin-bottom: 5px; background-color: #ff1e00; border-radius: 3px; color: #fff; display: inline-block; text-align: center; border: none; transition-property: background-color, color; transition-timing-function: ease-in-out; transition-duration: .15s; letter-spacing: .03em; font-family: "Helvetica", Helvetica, "Arial", Arial, sans-serif; line-height: 1.3 !important; padding: 7px 10px; font-size: 14px; min-height: 30px; width: auto; } rc-riot-avail-pricing .tag-content .offer-group .rc-price button:hover,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button:hover,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button:hover,rc-riot-avail-pricing .tag-content .offer-group .rc-price button:active,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button:active,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button:active{ background-color: #db1a00; } rc-riot-avail-pricing .tag-content .offer-group .rc-price button:hover,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button:hover,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button:hover,rc-riot-avail-pricing .tag-content .offer-group .rc-price button:active,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button:active,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group .rc-price button:active{ background: #111; } rc-riot-avail-pricing .tag-content .offer-group div.price,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group div.price,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group div.price{ text-align: center; color: #ff1e00; font-size: 24px; } rc-riot-avail-pricing .tag-content .offer-group div.price .original-price,[riot-tag="rc-riot-avail-pricing"] .tag-content .offer-group div.price .original-price,[data-is="rc-riot-avail-pricing"] .tag-content .offer-group div.price .original-price{ font-size: 0.8em; text-decoration: line-through; } .node-listing.view-mode-full rc-riot-avail-pricing .tag-content .rc-price,.node-listing.view-mode-full [riot-tag="rc-riot-avail-pricing"] .tag-content .rc-price,.node-listing.view-mode-full [data-is="rc-riot-avail-pricing"] .tag-content .rc-price{ text-align: center; } .node-listing.view-mode-full rc-riot-avail-pricing .tag-content button.quote,.node-listing.view-mode-full [riot-tag="rc-riot-avail-pricing"] .tag-content button.quote,.n
1ode-listing.view-mode-full [data-is="rc-riot-avail-pricing"] .tag-content button.quote{ display: block; width: 100%; text-align: center; text-decoration: underline; min-height: 0; padding: 0; margin-top: 12px; background: none; box-shadow: none; color: #111; font-weight: 400; } .node-listing.view-mode-full rc-riot-avail-pricing .tag-content button.quote:hover,.node-listing.view-mode-full [riot-tag="rc-riot-avail-pricing"] .tag-content button.quote:hover,.node-listing.view-mode-full [data-is="rc-riot-avail-pricing"] .tag-content button.quote:hover,.node-listing.view-mode-full rc-riot-avail-pricing .tag-content button.quote:active,.node-listing.view-mode-full [riot-tag="rc-riot-avail-pricing"] .tag-content button.quote:active,.node-listing.view-mode-full [data-is="rc-riot-avail-pricing"] .tag-content button.quote:active{ text-decoration: none; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .display-name,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .display-name,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .display-name{ font-size: 18px; color: #111; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .display-detail,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .display-detail,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .display-detail{ color: rgba(17, 17, 17, 0.9); } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .display-savings,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .display-savings,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .display-savings{ font-size: 18px; font-weight: 700; padding-top: 7px; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content div.price,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content div.price,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content div.price{ font-size: 20px; padding-bottom: 5px; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .display-savings,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .display-savings,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .display-savings,.reveal-modal rc-riot-avail-pricing .tag-content .tag-content div.price,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content div.price,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content div.price{ color: #ff1e00; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .rc-price > button.book,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.book,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.book{ background-color: #ff1e00; border-radius: 3px; color: #fff; display: inline-block; text-align: center; border: none; transition-property: background-color, color; transition-timing-function: ease-in-out; transition-duration: .15s; letter-spacing: .03em; font-family: "Helvetica", Helvetica, "Arial", Arial, sans-serif; line-height: 1.3 !important; padding: 10px 12px; font-size: 15px; min-height: 38px; width: auto; min-height: 0; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .rc-price > button.book:hover,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.book:hover,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.book:hover,.reveal-modal rc-riot-avail-pricing .tag-content .tag-content .rc-price > button.book:active,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.book:active,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.book:active{ background-color: #db1a00; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .rc-price > button.add,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add{ background-color: #ff1e00; border-radius: 3px; color: #fff; display: inline-block; text-align: center; border: none; transition-property: background-color, color; transition-timing-function: ease-in-out; transition-duration: .15s; letter-spacing: .03em; font-family: "Helvetica", Helvetica, "Arial", Arial, sans-serif; line-height: 1.3 !important; padding: 10px 12px; font-size: 15px; min-height: 38px; width: auto; background-color: rgba(255, 255, 255, 0); border: solid 2px #ff1e00; color: #ff1e00; padding: 8px 12px; min-height: 0; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .rc-price > button.add:hover,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add:hover,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add:hover,.reveal-modal rc-riot-avail-pricing .tag-content .tag-content .rc-price > button.add:active,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add:active,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add:active{ background-color: #db1a00; } .reveal-modal rc-riot-avail-pricing .tag-content .tag-content .rc-price > button.add:hover,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add:hover,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add:hover,.reveal-modal rc-riot-avail-pricing .tag-content .tag-content .rc-price > button.add:active,.reveal-modal [riot-tag="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add:active,.reveal-modal [data-is="rc-riot-avail-pricing"] .tag-content .tag-content .rc-price > button.add:active{ background-color: #ff1e00; color: #fff; } rc-riot-avail-pricing .tag-content .call-to-book,[riot-tag="rc-riot-avail-pricing"] .tag-content .call-to-book,[data-is="rc-riot-avail-pricing"] .tag-content .call-to-book{ font-weight: bold; }', 'class="mode-{mode}"', function(opts) { 2 this.mixin('RCRiotOrder'); 3 this.mixin('RCRiotAvailPricing'); 4 5 (function ($, tag) { 6 7 if (tag.opts.inline_quote) { 8 tag.pricing_set = false;
9 tag.current_price = 0; 10 tag.nights = 0; 11 tag.num_bedrooms = tag.opts.num_bedrooms ? tag.opts.num_bedrooms : 0; 12 tag.max_occupancy = tag.opts.max_occupancy ? tag.opts.max_occupancy : 0; 13 14 tag.on('update', function () { 15 if (!tag.pricing_set && tag.has_pricing) { 16 tag.pricing_set = true; 17 tag.current_price = $('#detailed-quote-response tr.total td.amount').text().replaceAll("$", "").replaceAll(',', ''); 18 tag.showInlineQuote(); 19 } 20 }); 21 22 tag.RCRiotAvailPricing.on('PricingChanged', function (data) { 23 tag.pricing = data.pricing['eid-' + tag.eid]; 24 tag.showInlineQuote(); 25 }); 26 27 tag.showInlineQuote = function () { 28 var $pricing = $(tag.root), 29 $quote = $pricing.find('#detailed-quote-response'), 30 $filter = $pricing.parents('#rc-riot-avail-filter'); 31 32 if (tag.pricing && tag.pricing.prices.length && $filter.length) { 33 tag.activePrice = tag.pricing.prices[0]; 34 tag.nights = tag.activePrice.nt; 35 $filter.addClass('quote-loading'); 36 tag.showDetailedQuote(tag.activePrice).done(function (data) { 37 tag.current_price = $('tr.total td.amount', data.content).text().replaceAll("$", "").replaceAll(',', ''); 38 $quote.html(data.content); 39 $filter.removeClass('quote-loading'); 40 tag.update(); 41 }); 42 } 43 }; 44 } 45 46 tag.showCostCalculator = function(e) { 47 RiotTagsModal.mount( 48 'vrfusion-site-cost-calculator', 49 { 50 current_price: tag.current_price, 51 nights: tag.nights, 52 num_bedrooms: tag.num_bedrooms, 53 max_occupancy: tag.max_occupancy 54 }, 55 'tiny' 56 ); 57 } 58 59 })(jQuery, this); 60 61 this.mixin('RCRiotOrder'); 62 this.mixin('RiotNotify'); 63 this.mixin('RiotTagsChildren'); 64 this.mixin('RCRiotAvailPricing'); 65 this.mixin('RCRiotAvailPricingGrouper'); 66 this.mixin('RCRiotAvailPricingTokenizer'); 67 68 if (typeof RCAddonProvider !== 'undefined') { 69 this.mixin('RCAddonProvider'); 70 } 71 72 (function($, tag) { 73 tag.precision = parseInt(opts.precision, 10) || 0; 74 tag.mode = opts.mode || 'default'; 75 tag.eid = opts.eid || null; 76 tag.pricing = opts.pricing || tag.getItemPricing(tag.eid); 77 tag.offerby = opts.offerby || 'default'; 78 tag.has_call_to_book = opts.has_call_to_book || false; 79 tag.show_buy = (opts && opts.show_buy) || opts.show_buy || false; 80 tag.show_add = (opts && opts.show_add) || opts.show_add || false; 81 tag.has_package = false; 82 tag.has_coupon = false; 83 tag.has_savings = false; 84 tag.has_alternates = false; 85 tag.has_modal_options = false; 86 tag.item = opts.item || null; 87 tag.show_in_modal = tag.mode === 'modal' || tag.mode === 'alternates'; 88 tag.classes = {}; 89 tag.classes['mode-' + opts.mode] = true; 90 tag.RCRiotAvailPricing.on('PricingChanged', function(data) { 91 tag.pricing = data.pricing['eid-' + tag.eid]; 92 tag.update(); 93 }); 94 95 tag.on('update', function() { 96 var params; 97 98 tag.has_alternates = false; 99 if (tag.opts.not_available_date) { 100 params = tag.getLastSearch(); 101 if (typeof params != 'undefined' && typeof params['rcav'] != 'undefined') { 102 tag.search_date = params['rcav']['begin']; 103 } 104 } 105 106 if (typeof tag.pricing != 'undefined') { 107 tag.has_pricing = true; 108 tag.eid = tag.pricing.eid; 109 tag.pricing_text = tag.formatItemPriceRange( 110 tag.eid, 111 0, 112 tag.opts.display_type 113 ); 114 tag.savings_text = tag.formatItemSavingsRange( 115 tag.eid, 116 0, 117 tag.opts.display_type 118 ); 119 } else { 120 tag.has_pricing = false; 121 } 122 tag.offer_groups = (tag.opts.offer_groups) 123 ? tag.opts.offer_groups 124 : tag.processPricing(tag.pricing, tag); 125 126 tag.buildModalOptions(tag.offer_groups); 127 if (tag.children && tag.children.length && tag.eid) { 128 var rcUpliftChildIndex = tag.getRcUpliftChild(); 129 if (rcUpliftChildIndex >= 0) { 130 tag.children[rcUpliftChildIndex].options.eid = tag.eid; 131 } 132 } 133 134 tag.classes['has-package'] = tag.has_package; 135 tag.classes['has-coupon'] = tag.has_coupon; 136 tag.classes['has-savings'] = tag.has_savings; 137 tag.classes['is-alternate'] = tag.has_alternates; 138 }); 139 140 tag.getRcUpliftChild = function() { 141 return tag.children.findIndex(function(child) { 142 if (!child) { 143 return false;
144 } 145 return child.plugin === "RCUpliftPayment"; 146 }); 147 } 148 149 tag.addClicked = function(e) { 150 tag.addOrderLineItem(e.item.price).done(function() { 151 tag.showOrderDetail(); 152 }); 153 }; 154 155 tag.buyClicked = function(e) { 156 tag.buyNow(e.item.price); 157 }; 158 159 tag.quoteClicked = function(e) { 160 $(e.target).addClass('pending').prop('disabled', true); 161 tag 162 .showDetailedQuote(e.item.price, opts.show_buy && !opts.has_call_to_book ? opts.txt.buy : null) 163 .done(function(data) { 164 if (opts.has_call_to_book) { 165 data.content += "<div class='call-to-book'>" + opts.txt.call_to_book_text + "<a href='tel:" + opts.txt.call_to_book_number + "'>" + opts.txt.call_to_book_number + "</a></div>"; 166 } 167 RiotTagsModal.show($(data.content), 'tiny'); 168 }) 169 .always(function() { 170 $(e.target).removeClass('pending').prop('disabled', false); 171 }); 172 }; 173 174 tag.triggerClicked = function(e) { 175 if ( 176 opts.trigger_order && 177 tag.pricing.prices.length == 1 && 178 $('rc-riot-order').length > 0 179 ) { 180 tag.addOrderLineItem(tag.pricing.prices[0]).done(function() { 181 tag.showOrderDetail(); 182 }); 183 } else { 184 tag.popModal(opts); 185 } 186 }; 187 188 tag.getAlternatesOpts = function () { 189 var newOpts = $.extend({}, opts), 190 group; 191 if (!tag.offer_groups) { 192 return newOpts; 193 } 194 195 newOpts.offer_groups = {}; 196 197 for (group in tag.offer_groups) { 198 if (!tag.offer_groups[group].featured) { 199 newOpts.offer_groups[group] = tag.offer_groups[group]; 200 201 newOpts.offer_groups[group]['offers'].map(function(offer, index) { 202 if (index > 0 && typeof offer.show_in_modal != 'undefined' && offer.show_in_modal) { 203 204 newOpts.offer_groups[group]['offers'].splice(index); 205 } 206 }); 207 } 208 } 209 210 return newOpts; 211 }; 212 213 tag.primaryOffers = function() { 214 var key, 215 groups = tag.featuredOfferGroups(), 216 offers = []; 217 218 for (key in groups) { 219 if (tag.mode === 'modal') { 220 offers = [tag.getBestPricedOffer(groups, key)]; 221 } 222 else { 223 offers = groups[key]['offers'].filter(function (offer) { 224 return offer.show_in_modal == 'undefined' || !offer.show_in_modal; 225 }); 226 if (!offers.length) { 227 offers = [tag.getBestPricedOffer(groups, key)]; 228 } 229 } 230 231 groups[key]['offers'] = offers; 232 } 233 return groups; 234 }; 235 236 tag.buildModalOptions = function(offer_groups) { 237 var name, 238 offers, 239 group, 240 bestOffer = {}, 241 has_modal_options = false; 242 243 if (!tag.opts.txt.modal_pricing_trigger || !tag.show_in_modal) { 244 return; 245 } 246 247 tag.modalOptions = {}; 248 if (!offer_groups) { 249 tag.has_modal_options = has_modal_options; 250 return; 251 } 252 253 for (name in offer_groups) { 254 if (offer_groups[name].featured) { 255 bestOffer = tag.getBestPricedOffer(offer_groups, name); 256 offers = offer_groups[name]['offers'].filter(function (offer) { 257 var isSameEid = !offer.qp.special_data || !this.qp.special_data || offer.qp.special_data.special_nid === this.qp.special_data.special_nid; 258 return !isSameEid || offer.show_in_addition || offer.qp.special_data && tag.mode === 'modal'; 259 }, bestOffer); 260 261 if (offers.length) { 262 has_modal_options = true; 263 group = $.extend({}, offer_groups[name]); 264 group.offers = offers; 265 tag.modalOptions[name] = group; 266 } 267 } 268 } 269 270 tag.has_modal_options = has_modal_options; 271 }; 272 273 tag.getBestPricedOffer = function(groups, key) { 274 return groups[key]['offers'].reduce(function (prevOffer, offer) { 275 if (!prevOffer) { 276 277 return offer; 278 } 279 else if (typeof offer.qp.special_data == 'undefined') { 280 281 return offer; 282 } 283 else if (prevOffer.show_in_addition && !offer.show_in_addition) { 284 285 return offer; 286 } 287 else if (prevOffer.show_in_addition && prevOffer.qp.special_data && prevOffer.p > offer.p) { 288 289 return offer; 290 } 291 else if (!offer.show_in_addition && prevOffer.qp.special_data && prevOffer.p > offer.p) { 292 293 return offer; 294 } 295 296 return prevOffer; 297 }); 298 }; 299 300 tag.getModalOpts = function () { 301 var newOpts = $.extend({}, opts); 302 newOpts.offer_groups = tag.modalOptions; 303 return newOpts; 304 }; 305 306 tag.popModal = function (modalOpts) { 307 RiotTagsModal.mount( 308 'rc-riot-avail-pricing', 309 $.extend({}, modalOpts, { mode: 'detail' }), 310 'small' 311 ); 312 }; 313 314 tag.popModalWith = function (modalOpts) { 315 return function (e) { 316 tag.popModal(modalOpts); 317 }; 318 }; 319 })(jQuery, this); 320});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.