Subversion-Projekte lars-tiefland.ci

Revision

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

Revision Autor Zeilennr. Zeile
875 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
 
1113 lars 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
		});
875 lars 56
        function nav()
57
        {
58
            f_name=$(this).attr("data-fname");
59
            l_id=$('#lID').val();
60
            l_type=$('#lType').val();
61
            $('#upload_dlg').load("/Online-Shop/upload.php?folder="+f_name+"&l_type="+l_type+"&l_id="+l_id);
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);
878 lars 81
                    $('#upload_dlg').dialog("close");
875 lars 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(){
907 lars 93
                    $.post("/backend/toolbox/mkdir/",$('#create_folder').serializeArray(),function(html){
875 lars 94
                        //alert(html);
95
                    });
878 lars 96
                    $('#folder_dialog').dialog("close");
875 lars 97
                },
98
                "Abbruch": function(){
878 lars 99
                    $('#folder_dialog').dialog("close");
875 lars 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");
945 lars 135
                    document.location.reload();
875 lars 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",
948 lars 147
                icon: "ui-icon-check",
148
                showLabel: false,
875 lars 149
                click:function()
150
                {
942 lars 151
                    $('#taskResult').load("/backend/scheduler/save/",$('#scheduler_form').serializeArray(),function(){
875 lars 152
                        $('#taskResult').dialog("open");
153
                    })
154
                    $('#taskForm').dialog("close");
155
                }
156
            },
157
            {
158
                text:"verwerfen",
949 lars 159
				icon:"ui-icon-close",
160
                showLabel: false,
875 lars 161
                click:function(){
878 lars 162
                    $('#taskForm').dialog("close");
875 lars 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);
966 lars 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",
985 lars 211
                icon: {
212
                	icon:"ui-icon-check"
213
				},
966 lars 214
                showLabel: false,
215
                click:function()
216
                {
1053 lars 217
                    $.post("/backend/user/save/",$('#user_form').serializeArray(),function(erg){
218
                    	ret=erg.split('|');
219
                    	if(ret[0]==0)
220
                    	{
1069 lars 221
		                    $('#userForm').dialog("close");
1053 lars 222
    	                    $('#userResult').dialog("open");
223
                    	}
224
                    	else
225
                    	{
226
                    		$('#userForm').html(ret[1]);
227
                    	}
966 lars 228
                    })
229
                }
230
            },
231
            {
232
                text:"verwerfen",
990 lars 233
				icon:{
234
					icon: "ui-icon-close"
235
				},
966 lars 236
                showLabel: false,
237
                click:function(){
238
                    $('#userForm').dialog("close");
239
                }
240
            }]
241
        })
1020 lars 242
        $('#userRechteForm').dialog({
243
            width:800,
1042 lars 244
            height:600,
1020 lars 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
                {
1088 lars 256
                    $.post("/backend/user_rechte/save/",$('#user_rechte_form').serializeArray(),function(erg){
1048 lars 257
                    	ret=erg.split('|');
1095 lars 258
                        $('#userResult').html('Benutzerrechte gespeichert').dialog("open");
259
	                    $('#userRechteForm').dialog("close");
1020 lars 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
        })
966 lars 274
        $('.user_edit').click(edit_user);
1107 lars 275
        $('.user_del').click(del_user);
1020 lars 276
        $('.user_rights').click(user_rights);
966 lars 277
        $('.new_user').click(newUser);
875 lars 278
    });
279
 
1108 lars 280
	function del_user()
1107 lars 281
	{
282
		tIdArr=$(this).attr("id").split("_");
283
		tId=tIdArr[1];
1112 lars 284
		$('#userQuestion').load("/backend/user/del/"+tId,function(){
1107 lars 285
			$('#userQuestion').dialog("open");
286
		})
287
	}
875 lars 288
    function newTask(e)
289
    {
290
        e.preventDefault();
907 lars 291
        url="/backend/scheduler/edit/";
875 lars 292
        $.get(url,function(html)
293
        {
294
            $('#taskForm').html(html).dialog("open");
295
        });
296
    }
297
    function edit_task(e)
298
    {
299
        e.preventDefault();
300
        tIdArr=$(this).attr("id").split("_");
301
        tId=tIdArr[1];
907 lars 302
        url="/backend/scheduler/edit/"+tId;
875 lars 303
        $.get(url,function(html)
304
        {
305
            $('#taskForm').html(html).dialog("open");
306
        });
307
    }
966 lars 308
 
309
    function newUser(e)
310
    {
311
        e.preventDefault();
312
        url="/backend/user/edit/";
313
        $.get(url,function(html)
314
        {
315
            $('#userForm').html(html).dialog("open");
316
        });
317
    }
318
    function edit_user(e)
319
    {
320
        e.preventDefault();
321
        tIdArr=$(this).attr("id").split("_");
322
        tId=tIdArr[1];
323
        url="/backend/user/edit/"+tId;
324
        $.get(url,function(html)
325
        {
326
            $('#userForm').html(html).dialog("open");
327
        });
328
    }
1020 lars 329
    function user_rights(e)
330
    {
331
        e.preventDefault();
332
        tIdArr=$(this).attr("id").split("_");
333
        tId=tIdArr[1];
334
        url="/backend/user_rechte/edit/"+tId;
335
        $.get(url,function(html)
336
        {
337
            $('#userRechteForm').html(html).dialog("open");
338
        });
339
    }