Updated copyright year.
[mailer.git] / templates / de / html / js / js_admin_ajax.tpl
1 /**
2  * JavaScript for admin AJAX stuff
3  * --------------------------------------------------------------------
4  * Copyright (c) 2003 - 2009 by Roland Haeder
5  * Copyright (c) 2009 - 2016 by Mailer Developer Team
6  * For more information visit: http://mxchange.org
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21  * MA  02110-1301  USA
22  */
23
24 // If all all has been loaded, initialize rest of it
25 $().ready(function () {
26         // Fade default content in
27         window.setTimeout("requestAjaxContent('admin', 'admin_content', '$content[admin_page]', false)", 250);
28
29         // Set default tab id
30         defaultTabId = '$content[admin_page]';
31
32         // Set 'save-changes' button id
33         saveChangesId = 'save_changes';
34
35         //-----------------------------------------
36         //            Tab navigation
37         //-----------------------------------------
38         $('a').each(function (i) {
39                 $(this).on('click', {index:i}, function (event) {
40                         // Is there a valid index?
41                         if (indexTranslation[event.data.index] !== null) {
42                                 // Prevent default action
43                                 event.preventDefault();
44
45                                 // Valid found, so initialize the POST request
46                                 requestAjaxContent('admin', 'admin_content', indexTranslation[event.data.index], false);
47                         } // END - if
48                 });
49         });
50
51         // Register common things (close buttons, drag&drop)
52         registerCommons('admin');
53
54         //-----------------------------------------
55         //             Save changes
56         //-----------------------------------------
57         $('#' + saveChangesId).click(function () {
58                 // Save changes
59                 saveChanges('admin');
60         });
61 });