PageSourceSearch

https://verzolla.com/Plugins/Widgets.QuoteRequest/Scripts/quote-requester.js

js verzolla.com collected 2026-10-08 01:23:26 UTC 7,936 bytes, 211 lines download raw bytes

1$(document).ready(function () {
2    $("#form-request").on('submit',function (e) {
3        e.preventDefault();
4        var url = "/QuoteRequest/SendQuote"; // the script where you handle the form input.
5        $("#request").hide();
6        $(".loader").show();
7        debugger;
8        $.ajax({
9            type: "POST",
10            url: url,
11            data: $("#form-request").serialize(), // serializes the form's elements
12            dataType: 'json',
13            success: function (data) {
14                if (data.success == true) {
15                    //alert("La tua richiesta di preventivo e' stata inoltrata con successo!")
16                    //document.location.href = data.returnUrl;
17                    $("<p>" + data.message + "</p>").dialog({
18                        resizable: false,
19                        modal: true,
20                        draggable: false,
21                        dialogClass: 'quoteRequest',
22                        buttons: {
23                            "OK": function () {
24                                document.location.href = data.returnUrl;
25                            }
26                        }
27                    })
28                }
29                else
30                {
31                    //alert(data.message);
32                    $("<p>" + data.message + "</p>").dialog({
33                        resizable: false,
34                        modal: true,
35                        draggable: false,
36                        dialogClass: 'quoteRequest',
37                        buttons: {
38                            "OK": function () {
39                                $(this).dialog("close");
40                            }
41                        }
42                    })
43                }
44                $("#request").show();
45                $(".loader").hide();
46                e.preventDefault();
47                return false;
48            },
49            error: function (data)
50            {
51                debugger;
52                //alert("Problemi riprova piu' tardi");
53                $("<p>Problemi, riprova piu' tardi</p>").dialog({
54                    resizable: false,
55                    modal: true,
56                    draggable: false,
57                    dialogClass: 'quoteRequest',
58                    buttons: {
59                        "OK": function () {
60                            $(this).dialog("close");
61                        }
62                    }
63                })
64                $("#request").show();
65                $(".loader").hide();
66            }
67        });
68        
69        e.preventDefault(); // avoid to execute the actual submit of the form.
70    });
71    
72    //IN ROSSO "a preventivo" o "preventivo"
73    $("span:contains('preventivo')").css('color', 'red');
74
75
76})
77
78function SendQuote()
79{
80    $('#modal-form').show();
81    $('#modalform').siblings('.ui-dialog-buttonpane').find('button').show();
82    $(".loader").hide();
83    $('#response').remove();
84    $("#modalform").dialog({                                                            //Shows dialog
85        height: 250,
86        width: 450,
87        modal: true,
88        buttons: {
89            "Salva": function () {
90                dataForm = $('#modal-form').serialize();
91                note = $("#QuoteNote").val();
92                $('#modalform').siblings('.ui-dialog-buttonpane').find('button').hide();
93                $('#modal-form').hide();
94                $(".loader").show();
95                $.ajax({
96                    url: "/QuoteRequest/SendQuote",
97                    type: "POST",
98                    data: dataForm + "&QuoteNote=" + quoteId,
99                    dataType: 'json',
100                     success: function (data) {
101                         if (data.success == true) {
102                                $("#modalform").dialog('close');
103                                alert("La tua richiesta di preventivo e' stata inoltrata con successo!")
104                                document.location.href = data.returnUrl;
105                        }
106                        else
107                         {
108                             $("#modalform").dialog('close');
109                             alert(data.message);
110                         }
111                $("#request").show();
112                $(".loader").hide();
113            },
114            error: function (data)
115            {
116                $("#modalform").dialog('close');
117                alert("Problemi riprova piu' tardi");
118                $("#request").show();
119                $(".loader").hide();
120            }
121                })
122            }
123        }
124
125    });
126    return false;
127
128}
129
130
131
132function Approva(quoteId)
133{
134    if (confirm("Sei sicuro?")) {
135        var url = "/QuoteRequest/Approve"; // the script where you handle the form input.
136        $(".actions").hide();
137        $(".loader-2").show();
138        $.ajax({
139            type: "POST",
140            url: url,
141            data: "QuoteId="+quoteId, // serializes the form's elements
142            dataType: 'json',
143            success: function (data) {
144                if (data.success == true) {
145                    alert("Hai confermato correttamente il preventivo")
146                    document.location.href = data.returnUrl;
147                }
148                else {
149                    alert(data.message);
150                }
151                $(".actions").show();
152                $(".loader-2").hide();
153            },
154            error: function (data) {
155                alert("Problemi riprova piu' tardi");
156                $(".actions").show();
157                $(".loader-2").hide();
158            }
159        });
160    }
161        e.preventDefault(); // avoid to execute the actual submit of the form.
162    
163
164}
165function Reject(quoteId) {
166    $('#modal-form').show();
167    $('#modalform').siblings('.ui-dialog-buttonpane').find('button').show();
168    $(".loader").hide();
169    $('#response').remove();
170    $("#modalform").dialog({                                                            //Shows dialog
171        height: 250,
172        width: 450,
173        modal: true,
174        buttons: {
175            "Richiedi nuovo preventivo": function () {
176                dataForm = $('#modal-form').serialize();
177                $('#modalform').siblings('.ui-dialog-buttonpane').find('button').hide();
178                $('#modal-form').hide();
179                $(".loader").show();
180                $.ajax({
181                    url: "/QuoteRequest/Riproponi",
182                    type: "POST",
183                    data: dataForm + "&QuoteId=" + quoteId,
184                    dataType: 'json',
185                    error: function (XMLHttpRequest, textStatus, errorThrown) {
186                        alert("An error has occurred making the request: " + errorThrown)
187                        $(".loader").hide();
188                        $("#modalform").dialog('close');
189                    },
190                    success: function (data) {
191                        //Do stuff here on success such as modal info    
192                        if (data.success) {
193                            $(".loader").hide();
194                            $("#modalform").append("<div id='response'>" + data.message + "</div>");
195                            $(".actions").remove();
196                            $("#status-request").text(data.returnUrl)
197                            $("#quote-semaforo").attr('src', '/Plugins/Widgets.QuoteRequest/Content/img/yellow.png')
198                        }
199                        else {
200                            $(".loader").hide();
201                            $("#modalform").append("<div id='response' style='color:red'>" + data.message + "</div>");
202                        }
203
204                    }
205                })
206            }
207        }
208
209    });
210
211}

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.