Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
    //$Id: toolbox.js 3839 2022-11-15 09:27:48Z tiefland $
2
    $(function(){
3
        $('.add_image').button({
4
            icons:{
5
                primary:'ui-icon-plus'
6
            }
7
        }).click(add_images);
8
        $('.add_folder').button({
9
            icons:{
10
                primary:'ui-icon-plus'
11
            }
12
        }).click(add_folder);
13
        $('.del_image').button({
14
            icons:{
15
                primary:'ui-icon-trash'
16
            }
17
        });
18
 
19
        $('.search').button({
20
            icons:{
21
                primary: "ui-icon-search"
22
            }
23
        }).click(search);
24
 
25
        $('#upload_dlg .nav').css("cursor","pointer").click(nav);
26
 
27
        function nav()
28
        {
29
            let f_name=$(this).attr("data-fname");
30
            let l_id=$('#lID').val();
31
            let l_type=$('#lType').val();
32
            $('#upload_dlg').load("/media/?folder="+f_name+"&l_type="+l_type+"&l_id="+l_id);
33
        }
34
 
35
        $('#upload_dlg').dialog({
36
            autoOpen: false,
37
            modal:true,
38
            width:"95%",
39
            height:600,
40
            resizable:false,
41
            close:function(){
42
                let l_id=$('#lID').val();
43
                let l_type=$('#lType').val();
44
                $('#bildverwaltung').load("/Online-Shop/bilder.php?l_id="+l_id+"&l_type="+l_type);
45
            },
46
            buttons:{
47
                "Abbrechen":function()
48
                {
49
                    let l_id=$('#lID').val();
50
                    let l_type=$('#lType').val();
51
                    $('#bildverwaltung').load("/Online-Shop/bilder.php?l_id="+l_id+"&l_type="+l_type);
52
                    $(this).dialog("close");
53
                }
54
            }
55
        });
56
 
57
        $('#folder_dialog').dialog({
58
            autoOpen:false,
59
            modal:true,
60
            width:800,
61
            resizable:false,
62
            buttons:{
63
                "Abbruch": function(){
64
                    $(this).dialog("close");
65
                }
66
            }
67
        })
68
 
69
        function search(e)
70
        {
71
            e.preventDefault();
72
            $('#search_media').submit();
73
        }
74
 
75
        function add_images(e)
76
        {
77
            e.preventDefault();
78
            $('#upload_dlg').dialog('open');
79
        }
80
 
81
        function add_folder(e)
82
        {
83
            e.preventDefault();
84
            $('#folder_dialog').dialog("open");
85
        }
86
        $('#createFolder').click(function(){
87
            $.post("mkdir.php",$('#create_folder').serializeArray(),function(html){
88
                //alert(html);
89
            });
90
            $('#folder_dialog').dialog("close");
91
        })
92
        $('#taskResult').dialog({
93
            width:800,
94
            autoOpen:false,
95
            modal:true,
96
            resizable:false,
97
            buttons:[{
98
                text:"OK",
99
                icons: {
100
                    primary: "ui-icon-check"
101
                },
102
                showText: false,
103
                click:function()
104
                {
105
                    $('#taskResult').dialog("close");
106
                    document.location.reload();
107
                }
108
            }]
109
        });
110
        $('#taskForm').dialog({
111
            width:800,
112
            //height:600,
113
            autoOpen:false,
114
            modal:true,
115
            resizable:false,
116
            position:{
117
                my:"top",
118
                at:"top"
119
            },
120
            buttons:[{
121
                text:"speichern",
122
                icons: {
123
                    primary: "ui-icon-check"
124
                },
125
                showText: false,
126
                click:function()
127
                {
128
                    $('#taskResult').load("scheduler.php",$('#scheduler_form').serializeArray(),function(){
129
                        $('#taskResult').dialog("open");
130
                    })
131
                    $('#taskForm').dialog("close");
132
                }
133
            },
134
            {
135
                text:"verwerfen",
136
                icons: {
137
                    primary: "ui-icon-close"
138
                },
139
                showText: false,
140
                click:function(){
141
                    $(this).dialog("close");
142
                }
143
            }]
144
        })
145
        $('.task_edit').click(edit_task);
146
        $('.task_copy').click(copy_task);
147
        $('.newTask').click(newTask);
148
    });
149
 
150
    function newTask(e)
151
    {
152
        e.preventDefault();
153
        let url="/toolbox/scheduler.php?mode=edit";
154
        $.get(url,function(html)
155
        {
156
            $('#taskForm').html(html).dialog("open").dialog('option', 'title', 'Job anlegen');
157
        });
158
    }
159
    function edit_task(e)
160
    {
161
        e.preventDefault();
162
        let tIdArr=$(this).attr("id").split("_");
163
        let tId=tIdArr[1];
164
        let url="/toolbox/scheduler.php?mode=edit&id="+tId;
165
        $.get(url,function(html)
166
        {
167
            $('#taskForm').html(html).dialog("open").dialog('option', 'title', 'Job editieren');
168
        });
169
    }
170
    function copy_task(e)
171
    {
172
        e.preventDefault();
173
        let tIdArr=$(this).attr("id").split("_");
174
        let tId=tIdArr[1];
175
        let url="/toolbox/scheduler.php?mode=copy&id="+tId;
176
        $.get(url,function(html)
177
        {
178
            $('#taskForm').html(html).dialog("open").dialog('option', 'title', 'Job kopieren');
179
        });
180
    }