Subversion Repositories My Stuff

Rev

Rev 3 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13 kardasa 1
/*#######################################################################
3 kardasa 2
# This script is distributed in the hope that it will be useful,
3
# but WITHOUT ANY WARRANTY; without even the implied warranty of
4
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5
# GNU General Public License for more details.
6
# Author: Andrzej Kardaƛ
7
# License: GPLv3
8
# The full version of the licencse can be obtainted by visiting:
9
# http://www.gnu.org/licenses/gpl.html
13 kardasa 10
#######################################################################*/
3 kardasa 11
$.fx.speeds._default = 1000;
12
$(document).ready(function() {
13
        $('a.email_link').each(function() {
14
                var $link = $(this);
15
                var $dialog = $('<div id="email_form"></div>')
16
                        .dialog({
17
                                autoOpen: false,
18
                                width: 780,
19
                                height: 'auto',
20
                                title: $link.attr('title'),
21
                                resizable: false,
22
                                modal: true,
23
                                show: 'blind',
24
                                hide: 'explode'
25
                        });
26
 
27
                $link.click(function() {
28
                        $('#overlay').show();
29
                        $('#ajax-indicator').show();
30
                        var options = {
31
                        target: '#email_form',
32
                        success: function() {
33
                              $('#email_form > #form-idicator').hide();
34
                              $('#email_form > form').ajaxForm(options);
35
                        },
36
                        beforeSubmit: function() {
37
                              $('#email_form > #form-indicator').show();
38
                        }
39
                        };
40
                        $dialog.load($link.attr('href'),function(){
41
                              $('#email_form > form').ajaxForm(options);
42
                              $('#ajax-indicator').hide();
43
                              $('#overlay').hide();
44
                              $dialog.dialog('open');
45
                        });
46
                        return false;
47
                });
48
        });
49
});