Subversion-Projekte lars-tiefland.cienc

Revision

Revision 9 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
9 lars 1
    $(function(){
2
        $('.add_image').button({
3
            icons:{
4
                primary:'ui-icon-plus'
5
            }
6
        }).click(add_images);
7
        $('.add_folder').button({
8
            icons:{
9
                primary:'ui-icon-plus'
10
            }
11
        }).click(add_folder);
12
        $('.del_image').button({
13
            icons:{
14
                primary:'ui-icon-trash'
15
            }
16
        });
17
 
18
        $('.search').button({
19
            icons:{
20
                primary: "ui-icon-search"
21
            }
22
        }).click(search);
23
 
24
        $('#upload_dlg .nav').css("cursor","pointer").click(nav);
25
 
26
		$('#userQuestion').dialog({
27
			autoOpen:false,
28
			modal:true,
29
			width:800,
30
			resizable:false,
31
			buttons:[{
32
				text:"ja",
33
				icons: {
34
					primary: "ui-icon-check"
35
				},
36
				showText: false,
37
				click:function()
38
				{
39
					$('#userResult').load("/backend/user/del",$('#user_form').serializeArray(),function(){
40
						$('#userResult').dialog("open");
41
					})
42
					$('#userQuestion').dialog("close");
43
				}
44
			},
45
			{
46
				text:"nein",
47
				icons: {
48
					primary: "ui-icon-close"
49
				},
50
				showText: false,
51
				click:function(){
52
					$('#userQuestion').dialog("close");
53
				}
54
			}]
55
		});
56
        function nav()
57
        {
58
            f_name=$(this).attr("data-fname");
59
            l_id=$('#lID').val();
60
            l_type=$('#lType').val();
17 lars 61
            $('#upload_dlg').load("/backend/bildverwaltung/upload?folder="+f_name+"&l_type="+l_type+"&l_id="+l_id);
9 lars 62
        }
63
 
64
        $('#upload_dlg').dialog({
65
            autoOpen: false,
66
            modal:true,
67
            width:"95%",
68
            height:600,
69
            resizable:false,
70
            close:function(){
71
                l_id=$('#lID').val();
72
                l_type=$('#lType').val();
73
                $('#bildverwaltung').load("/Online-Shop/bilder.php?l_id="+l_id+"&l_type="+l_type);
74
            },
75
            buttons:{
76
                "Abbrechen":function()
77
                {
78
                    l_id=$('#lID').val();
79
                    l_type=$('#lType').val();
80
                    $('#bildverwaltung').load("/Online-Shop/bilder.php?l_id="+l_id+"&l_type="+l_type);
81
                    $('#upload_dlg').dialog("close");
82
                }
83
            }
84
        });
85
 
86
        $('#folder_dialog').dialog({
87
            autoOpen:false,
88
            modal:true,
89
            width:800,
90
            resizable:false,
91
            buttons:{
92
                "Ordner anlegen":function(){
93
                    $.post("/backend/toolbox/mkdir/",$('#create_folder').serializeArray(),function(html){
94
                        //alert(html);
95
                    });
96
                    $('#folder_dialog').dialog("close");
97
                },
98
                "Abbruch": function(){
99
                    $('#folder_dialog').dialog("close");
100
                }
101
            }
102
        })
103
 
104
        function search(e)
105
        {
106
            e.preventDefault();
107
            $('#search_media').submit();
108
        }
109
 
110
        function add_images(e)
111
        {
112
            e.preventDefault();
113
            $('#upload_dlg').dialog('open');
114
        }
115
 
116
        function add_folder(e)
117
        {
118
            e.preventDefault();
119
            $('#folder_dialog').dialog("open");
120
        }
121
        $('#taskResult').dialog({
122
            width:800,
123
            autoOpen:false,
124
            modal:true,
125
            resizable:false,
126
            buttons:[{
127
                text:"OK",
128
                icons: {
129
                    primary: "ui-icon-check"
130
                },
131
                showText: false,
132
                click:function()
133
                {
134
                    $('#taskResult').dialog("close");
135
                    document.location.reload();
136
                }
137
            }]
138
        });
139
        $('#taskForm').dialog({
140
            width:800,
141
            //height:600,
142
            autoOpen:false,
143
            modal:true,
144
            resizable:false,
145
            buttons:[{
146
                text:"speichern",
147
                icon: "ui-icon-check",
148
                showLabel: false,
149
                click:function()
150
                {
151
                    $('#taskResult').load("/backend/scheduler/save/",$('#scheduler_form').serializeArray(),function(){
152
                        $('#taskResult').dialog("open");
153
                    })
154
                    $('#taskForm').dialog("close");
155
                }
156
            },
157
            {
158
                text:"verwerfen",
159
				icon:"ui-icon-close",
160
                showLabel: false,
161
                click:function(){
162
                    $('#taskForm').dialog("close");
163
                }
164
            }]
165
        })
166
/*        $( "#taskForm" ).dialog({
167
          buttons: [
168
            {
169
              text: "speicehrn",
170
              icons: {
171
                primary: "ui-icon-heart"
172
              },
173
              click: function() {
174
                $( this ).dialog( "close" );
175
              }
176
 
177
              // Uncommenting the following line would hide the text,
178
              // resulting in the label being used as a tooltip
179
            }
180
          ]
181
        });*/
182
        $('.task_edit').click(edit_task);
183
        $('.newTask').click(newTask);
184
 
185
        $('#userResult').dialog({
186
            width:800,
187
            autoOpen:false,
188
            modal:true,
189
            resizable:false,
190
            buttons:[{
191
                text:"OK",
192
                icons: {
193
                    primary: "ui-icon-check"
194
                },
195
                showText: false,
196
                click:function()
197
                {
198
                    $('#userResult').dialog("close");
199
                    document.location.reload();
200
                }
201
            }]
202
        });
203
        $('#userForm').dialog({
204
            width:800,
205
            //height:600,
206
            autoOpen:false,
207
            modal:true,
208
            resizable:false,
209
            buttons:[{
210
                text:"speichern",
211
                icon: {
212
                	icon:"ui-icon-check"
213
				},
214
                showLabel: false,
215
                click:function()
216
                {
217
                    $.post("/backend/user/save/",$('#user_form').serializeArray(),function(erg){
218
                    	ret=erg.split('|');
219
                    	if(ret[0]==0)
220
                    	{
221
		                    $('#userForm').dialog("close");
222
    	                    $('#userResult').dialog("open");
223
                    	}
224
                    	else
225
                    	{
226
                    		$('#userForm').html(ret[1]);
227
                    	}
228
                    })
229
                }
230
            },
231
            {
232
                text:"verwerfen",
233
				icon:{
234
					icon: "ui-icon-close"
235
				},
236
                showLabel: false,
237
                click:function(){
238
                    $('#userForm').dialog("close");
239
                }
240
            }]
241
        })
242
        $('#userRechteForm').dialog({
243
            width:800,
244
            height:600,
245
            autoOpen:false,
246
            modal:true,
247
            resizable:false,
248
            buttons:[{
249
                text:"speichern",
250
                icon: {
251
                	icon:"ui-icon-check"
252
				},
253
                showLabel: false,
254
                click:function()
255
                {
256
                    $.post("/backend/user_rechte/save/",$('#user_rechte_form').serializeArray(),function(erg){
257
                    	ret=erg.split('|');
258
                        $('#userResult').html('Benutzerrechte gespeichert').dialog("open");
259
	                    $('#userRechteForm').dialog("close");
260
                    })
261
                }
262
            },
263
            {
264
                text:"verwerfen",
265
				icon:{
266
					icon: "ui-icon-close"
267
				},
268
                showLabel: false,
269
                click:function(){
270
                    $('#userRechteForm').dialog("close");
271
                }
272
            }]
273
        })
274
        $('.user_edit').click(edit_user).button({
275
        	icons:{
276
        		primary:"ui-icon-pencil"
277
        	}
278
        });
279
        $('.user_del').click(del_user).button({
280
        	icons:{
281
        		primary:"ui-icon-trash"
282
        	}
283
        });
284
        $('.user_rights').click(user_rights).button();
285
        $('.new_user').click(newUser).button({
286
        	icons:{
287
        		primary:"ui-icon-plus"
288
        	}
289
        });
290
    });
291
 
292
	function del_user()
293
	{
294
		tIdArr=$(this).attr("id").split("_");
295
		tId=tIdArr[1];
296
		$('#userQuestion').load("/backend/user/del/"+tId,function(){
297
			$('#userQuestion').dialog("open");
298
		})
299
	}
300
    function newTask(e)
301
    {
302
        e.preventDefault();
303
        url="/backend/scheduler/edit/";
304
        $.get(url,function(html)
305
        {
306
            $('#taskForm').html(html).dialog("open");
307
        });
308
    }
309
    function edit_task(e)
310
    {
311
        e.preventDefault();
312
        tIdArr=$(this).attr("id").split("_");
313
        tId=tIdArr[1];
314
        url="/backend/scheduler/edit/"+tId;
315
        $.get(url,function(html)
316
        {
317
            $('#taskForm').html(html).dialog("open");
318
        });
319
    }
320
 
321
    function newUser(e)
322
    {
323
        e.preventDefault();
324
        url="/backend/user/edit/";
325
        $.get(url,function(html)
326
        {
327
            $('#userForm').html(html).dialog("open");
328
        });
329
    }
330
    function edit_user(e)
331
    {
332
        e.preventDefault();
333
        tIdArr=$(this).attr("id").split("_");
334
        tId=tIdArr[1];
335
        url="/backend/user/edit/"+tId;
336
        $.get(url,function(html)
337
        {
338
            $('#userForm').html(html).dialog("open");
339
        });
340
    }
341
    function user_rights(e)
342
    {
343
        e.preventDefault();
344
        tIdArr=$(this).attr("id").split("_");
345
        tId=tIdArr[1];
346
        url="/backend/user_rechte/edit/"+tId;
347
        $.get(url,function(html)
348
        {
349
            $('#userRechteForm').html(html).dialog("open");
350
        });
351
    }