PluginProbe
Welcart e-Commerce / 2.11.35
Welcart e-Commerce v2.11.35
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
usc-e-shop / js / cart_escott_link.js

cart_escott_link.js in Welcart e-Commerce 2.11.35, at js/cart_escott_link.js

70 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(document).ready( function($) {
2 $('body input[type="submit"]').each( function(i,e) {
3 if( "confirm" == $(this).attr("name") ) {
4 $(this).parents("form").attr("id","delivery-form");
5 $(this).parents("form").attr("name","delivery_form");
6 }
7 });
8 if ( 'link' == escott_params.card_activate ) {
9 var agree_dialog = '<div id="escott-agree-dialog">'
10 +'<textarea class="escott_agreement_message" readonly>'+escott_params.message.agreement+'</textarea>'
11 +'<div class="send agree_form_send">'
12 +'<input type="button" id="escott_agree_cancel" class="back_to_delivery_button" value="'+escott_params.message.disagree+'" />&nbsp;&nbsp;'
13 +'<input type="button" id="escott_agree_next" class="to_confirm_button" value="'+escott_params.message.agree+'" />'
14 +'</div>'
15 +'</div><input type="hidden" id="escott_agree" value="">';
16 // $("#delivery-form").after(agree_dialog);
17 $(agree_dialog).appendTo($("#delivery-form"));
18 $("#escott-agree-dialog .send").css("text-align","center");
19 $("#escott-agree-dialog").css("display","none");
20 }
21 });
22 jQuery( function($) {
23 $("#escott-agree-dialog").dialog({
24 bgiframe: true,
25 autoOpen: false,
26 height: "400",
27 width: "200",
28 resizable: true,
29 modal: true,
30 create: function() {
31 $("#escott-agree-dialog").parent(".ui-dialog").attr("id","escott-dialog");
32 },
33 open: function() {
34 },
35 close: function() {
36 }
37 });
38
39 $(document).on( "click", "#escott_agree_next", function(e) {
40 $("#escott_agree").val("agree");
41 $("#escott-agree-dialog").dialog("close");
42 var element = document.createElement("input");
43 element.setAttribute("type","hidden");
44 element.setAttribute("name","confirm");
45 element.setAttribute("value","confirm");
46 document.delivery_form.appendChild(element);
47 document.delivery_form.submit();
48 return true;
49 });
50
51 $(document).on( "click", "#escott_agree_cancel", function(e) {
52 $("#escott_agree").val("");
53 $("#escott-agree-dialog").dialog("close");
54 });
55
56 $(document).on( "click", ".to_confirm_button", function(e) {
57 if( $("#payment_name_"+uscesL10n.escott_link_payment_id).prop("checked") && 'link' == escott_params.card_activate ) {
58 if ( "agree" == $("#escott_agree").val() ) {
59 // $("#delivery-form").submit();
60 // return true;
61 } else {
62 e.preventDefault();
63 e.stopPropagation();
64 $("#escott-agree-dialog").dialog("open");
65 return false;
66 }
67 }
68 });
69 });
70