Subversion-Projekte lars-tiefland.ci

Revision

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