PageSourceSearch

https://eabimoveis.com/media/widesysjqueryeasy/libs/jquery.widesys…?bfd8687bbf005fe4a431de059f377553

js eabimoveis.com collected 2026-10-10 01:24:21 UTC 8,088 bytes, 252 lines download raw bytes

1/**
2 * Widesys closeTip
3 */
4Widesys.closeTip = function (view) {
5    if (view) {
6        jQuery.ajax({
7            url: 'index.php?option=com_widesys',
8            global: false,
9            dataType: 'json',
10            type: 'POST',
11            beforeSend: function (){			
12            },
13            data: 'view=ajax&format=raw&task=ajax.closeTip&view=' + view,
14            success: function (data){
15                if (data) {					
16                    if (!data.success || data.messages.alert) {
17                        Widesys.renderMessages(data.messages);
18                        return false;
19                    }
20                }
21            }
22        });
23    }
24}
25
26Widesys.renderMessages = function(messages) {
27	Joomla.renderMessages(messages);	
28};
29
30// AjaxQ jQuery Plugin
31// Copyright (c) 2012 Foliotek Inc.
32// MIT License
33// https://github.com/Foliotek/ajaxq
34
35(function ($) {
36
37    var queues = {};
38    var activeReqs = {};
39
40    // Register an $.ajaxq function, which follows the $.ajax interface, but allows a queue name which will force only one request per queue to fire.
41    $.ajaxq = function (qname, opts) {
42
43        if (typeof opts === "undefined") {
44            throw ("AjaxQ: queue name is not provided");
45        }
46
47        // Will return a Deferred promise object extended with success/error/callback, so that this function matches the interface of $.ajax
48        var deferred = $.Deferred(),
49            promise = deferred.promise();
50
51        promise.success = promise.done;
52        promise.error = promise.fail;
53        promise.complete = promise.always;
54
55        // Create a deep copy of the arguments, and enqueue this request.
56        var clonedOptions = $.extend(true, {}, opts);
57        enqueue(function () {
58            // Send off the ajax request now that the item has been removed from the queue
59            var jqXHR = $.ajax.apply(window, [clonedOptions]);
60
61            // Notify the returned deferred object with the correct context when the jqXHR is done or fails
62            // Note that 'always' will automatically be fired once one of these are called: http://api.jquery.com/category/deferred-object/.
63            jqXHR.done(function () {
64                deferred.resolve.apply(this, arguments);
65            });
66            jqXHR.fail(function () {
67                deferred.reject.apply(this, arguments);
68            });
69
70            jqXHR.always(dequeue); // make sure to dequeue the next request AFTER the done and fail callbacks are fired
71            return jqXHR;
72        });
73
74        return promise;
75
76
77        // If there is no queue, create an empty one and instantly process this item.
78        // Otherwise, just add this item onto it for later processing.
79        function enqueue(cb) {
80            if (!queues[qname]) {
81                queues[qname] = [];
82                var xhr = cb();
83                activeReqs[qname] = xhr;
84            }
85            else {
86                queues[qname].push(cb);
87            }
88        }
89
90        // Remove the next callback from the queue and fire it off.
91        // If the queue was empty (this was the last item), delete it from memory so the next one can be instantly processed.
92        function dequeue() {
93            if (!queues[qname]) {
94                return;
95            }
96            var nextCallback = queues[qname].shift();
97            if (nextCallback) {
98                var xhr = nextCallback();
99                activeReqs[qname] = xhr;
100            }
101            else {
102                delete queues[qname];
103                delete activeReqs[qname];
104            }
105        }
106    };
107
108    // Register a $.postq and $.getq method to provide shortcuts for $.get and $.post
109    // Copied from jQuery source to make sure the functions share the same defaults as $.get and $.post.
110    $.each(["getq", "postq"], function (i, method) {
111        $[method] = function (qname, url, data, callback, type) {
112
113            if ($.isFunction(data)) {
114                type = type || callback;
115                callback = data;
116                data = undefined;
117            }
118
119            return $.ajaxq(qname, {
120                type: method === "postq" ? "post" : "get",
121                url: url,
122                data: data,
123                success: callback,
124                dataType: type
125            });
126        };
127    });
128
129    var isQueueRunning = function (qname) {
130        return queues.hasOwnProperty(qname);
131    };
132
133    var isAnyQueueRunning = function () {
134        for (var i in queues) {
135            if (isQueueRunning(i)) return true;
136        }
137        return false;
138    };
139
140    $.ajaxq.isRunning = function (qname) {
141        if (qname) return isQueueRunning(qname);
142        else return isAnyQueueRunning();
143    };
144
145    $.ajaxq.getActiveRequest = function (qname) {
146        if (!qname) throw ("AjaxQ: queue name is required");
147
148        return activeReqs[qname];
149    };
150
151    $.ajaxq.abort = function (qname) {
152        if (!qname) throw ("AjaxQ: queue name is required");
153
154        var current = $.ajaxq.getActiveRequest(qname);
155        delete queues[qname];
156        delete activeReqs[qname];
157        if (current) current.abort();
158    };
159
160    $.ajaxq.clear = function (qname) {
161        if (!qname) {
162            for (var i in queues) {
163                if (queues.hasOwnProperty(i)) {
164                    queues[i] = [];
165                }
166            }
167        }
168        else {
169            if (queues[qname]) {
170                queues[qname] = [];
171            }
172        }
173    };
174
175})(jQuery);
176
177/**
178 * ALAJAX auto sender for jQuery
179 * Create an auto ajax sender from your basic HTML code.
180 * @url http://www.alajax.com/
181 * @version 1.2
182 * CopyRight: GNU General Public License v2
183 * 
184 * Developed by: Alaa Badran
185 * http://www.alajax.com/
186 * Email [email protected]
187 *
188 */
189
190(function ($) {
191
192    jQuery.fn.alajax = function (options) {
193        // sgObj is a holder for #gallery container.. Cashing it.
194        var aObj = $(this); // contaciner object
195        var aForm = ($(this).is('form') ? $(this) : $(this).find('form').eq(0)); // Storing Form object
196        var oid = $(this).attr('id'); // Storing the ID of current Object
197
198        // Default settings.
199        var settings = {
200            type: 'json',   // 'text', 'json' or 'xml'
201            success: function () { },
202            error: function () { },
203            beforeSend: function () { },
204            postType: aForm.attr('method'), // Storing Form method.. POST or GET
205            tourl: aForm.attr('action'), // Storing URL to send data to
206            queueName: 'default'
207        };
208        settings = $.extend(settings, options);
209
210        function _sendData() {
211            // Run AJAX function
212            $.ajaxq(settings.queueName, { /* USADO ajaxq para executar requisicoes ajax em ordem de pedido */
213                type: settings.postType,
214                url: settings.tourl,
215                data: aForm.serialize(),
216                dataType: settings.type,
217                beforeSend: function () {
218                    // add code here if you want to do something before sending the form
219                    settings.beforeSend();
220                    //NProgress.start();
221                },
222                success: function (data, textStatus, jqXHR) {
223                    // Add code here when send is successful.
224                    //NProgress.done();
225                    settings.success(data);
226                },
227                complete: function (data, textStatus, jqXHR) {
228                    //NProgress.done();
229                },
230                error: function (jqXHR, textStatus, errorThrown) {
231                    //alert(errorThrown);
232                    settings.error();
233                }
234            });
235        }
236
237        /**
238         * The initializer for this plugin.
239         */
240        function _init() {
241            aForm.submit(function (event) {
242                _sendData(); // Processing
243                event.preventDefault(); // To disable form submitting. Submit will be by AJAX only using the function above.
244            });
245        }
246
247        return _init();
248    }
249
250})(jQuery);
251
252// END of Plugin

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.