Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // START OF SCRIPT
- //
- function opt_loadUsiFbtPopup() {
- (function($) {
- this.opt_addToCartPopup = (function() {
- function opt_addToCartPopup() {}
- opt_addToCartPopup.getPopupHtml = function(id, isFsa) {
- var iconClass;
- iconClass = isFsa ? 'atcFsa' : 'atcRx';
- return "<style type='text/css'> .opt_addToCartButton { display: inline-block; } .opt_buttonContainer { margin: 20px 0; text-align: center; } #USI_DIV1 { width: 528px; height: 200px; margin-left: auto; margin-right: auto; } </style> <div> <h2>Are you sure?</h2> <div class='opt_buttonContainer'> <a href='#'' class='opt_addToCartButton' elementaction='100' alt='' data-id='" + id + "'> <div class='atc " + iconClass + " icnSpr'></div> <div class='atcTxt hdrSpr'>Add to Cart</div> </a> </div> <div>OR</div> <div id='USI_DIV1'>" + usi_wholeThing + "</div> </div>";
- };
- opt_addToCartPopup.attachRealAddToCartEventHandler = function() {
- return $('.opt_addToCartButton').click(function() {
- var button;
- button = $(this);
- window.basket.AddToCart(button, button.data('id'));
- return $('.ui-widget-overlay').click();
- });
- };
- opt_addToCartPopup.attachFakeAddToCartEventHandler = function() {
- var self;
- self = this;
- return $('a.AddToCartLink_JS, a.ATC_Car, .PRD_AddToCart').off('click').click(function(e) {
- var button, id, isFsa;
- e.preventDefault();
- button = $(this);
- id = button.attr('pid');
- isFsa = button.find('.atc').hasClass('atcFsa');
- self.showDialog(id, isFsa);
- return false;
- });
- };
- opt_addToCartPopup.showDialog = function(id, isFsa) {
- $.showDialog({
- width: 600,
- minHeight: 300,
- hideTitle: true,
- html: this.getPopupHtml(id, isFsa),
- clickToClose: true
- });
- return this.attachRealAddToCartEventHandler();
- };
- return opt_addToCartPopup;
- })();
- return $(function() {
- return opt_addToCartPopup.attachFakeAddToCartEventHandler();
- });
- })(jQuery);
- }
- function usi_attemptModalPlacement() {
- if (typeof usi_wholeThing == "undefined" || usi_wholeThing == "") {
- setTimeout(usi_attemptModalPlacement, 2000);
- } else {
- opt_loadUsiFbtPopup();
- }
- }
- usi_attemptModalPlacement();
- //
- // END OF SCRIPT
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement