1var px = jQuery.noConflict(); 2var body = px(document); 3var meldung = false; 4 5function Meldung(typ, text) 6{ 7 clearTimeout(meldung); 8 px('.pxwf-meldungen').html('<div class="pxwf-meldung typ-' + typ + '">' + text + '</div>').addClass('aktiv'); 9 meldung = setTimeout(function(){ px('.pxwf-meldungen').removeClass('aktiv'); }, text.length * 200); 10} 11function Formular(inhalt, befehl) 12{ 13 let form = new FormData(); 14 if(befehl) form.append('BEFEHL', befehl); 15 px(inhalt).find('input, textarea, select').each(function() 16 { 17 let e = px(this); 18 if(e.is(':checkbox')) 19 { 20 if(e.hasClass('binary')) form.append(e.attr('name'), (e.prop('checked') === true ? '1' : '0')); 21 else (e.prop('checked') === true ? form.append(e.attr('name'), e.val()) : null); 22 } 23 else if(e.is(':file')) 24 { 25 if(e.prop('files')[0]) for(var i = 0; i < e.get(0).files.length; i++) form.append(e.attr('name') + (e.get(0).files.length > 1 ? '[]' : ''), e.get(0).files[i]); 26 } 27 else form.append(e.attr('name'), e.val()); 28 }); 29 return form; 30} 31function Formular_Setzen(inhalt, name, daten) 32{ 33 e = px(inhalt).find('[name="' + name + '"]'); 34 if(e.is(':checkbox')) 35 { 36 if(e.hasClass('binary')) (daten === 1 ? e.prop('checked', true) : e.prop('checked', false)); 37 else e(':checkbox[value=' + daten + ']').prop("checked","true"); 38 } 39 else e.val(daten); 40} 41function Termin_Leeren() 42{ 43 px('.px-calendar').wrap('<form>').closest('form').get(0).reset(); 44 px('.px-calendar').unwrap(); 45 px('[name="px-calendar-event-id"]').val(0); 46 px('#px-calendar-vorschau').html(''); 47 px('[name="px-calendar-titel"]').focus(); 48 px('.fileContainer span').html(px('.fileContainer small').html()); 49} 50function Termin_Auslesen(id) 51{ 52 px.ajax( 53 { 54 url : '/typo3conf/ext/px_erweiterung_calendar/Classes/Controller/handler.php', 55 cache : false, 56 type : 'POST', 57 dataType : 'JSON', 58 data : 59 { 60 'BEFEHL': 'BEFEHL_termin_auslesen', 61 'id' : id 62 }, 63 success : function(data) 64 { 65 px('#px-calendar-kalender input[type="checkbox"]').prop('checked', false); 66 for(let name in data) 67 { 68 Formular_Setzen('.px-calendar .left', name, data[name]); 69 } 70 for(let uid in data['kalender']) px('#px-calendar-kalender div input[type="checkbox"][value="' + data['kalender'][uid] + '"]').prop('checked', true); 71 72 px('[name="px-calendar-event-id"]').val(id); 73 px('#px-calendar-vorschau').html(data['termin']); 74 } 75 }); 76} 77function Termin_Liste() 78{ 79 px.ajax( 80 { 81 url : '/typo3conf/ext/px_erweiterung_calendar/Classes/Controller/handler.php', 82 cache : false, 83 type : 'POST', 84 dataType : 'HTML', 85 data : 86 { 87 'BEFEHL': 'BEFEHL_termin_liste', 88 }, 89 success : function(data) 90 { 91 px('.px-calendar .right .scrollbox').html(data); 92 } 93 }); 94} 95 96body.ready(function(){ 97 98 body.on('change','.fileContainer input[type="file"]',function(){ 99 let p = px(this).parent(); 100 p.children('span').html(this.value.split('\\')[2] || p.children('small').html()); 101 }); 102 103 body.on('click', '#px-calendar-speichern', function(){ 104 let data = Formular('.px-calendar', (px('[name="px-calendar-event-id"]').val() == 0 ? 'BEFEHL_termin_speichern' : 'BEFEHL_termin_bearbeiten')); 105 if(px('#px-calendar-kalender input[type="checkbox"]:checked').length === 0) Meldung(3, 'Es muss ein ausspielender Kalender gewählt werden.'); 106 else px.ajax( 107 { 108 url : '/typo3conf/ext/px_erweiterung_calendar/Classes/Controller/handler.php', 109 cache : false, 110 processData : false, 111 contentType : false, 112 type : 'POST', 113 dataType : 'JSON', 114 data : data, 115 success : function(data) 116 { 117 Meldung(data[0], data[1]); 118 Termin_Leeren(); 119 Termin_Liste(); 120 } 121 }); 122 }); 123 124 body.on('click', '#px-calendar-entfernen', function(){ 125 px.ajax( 126 { 127 url : '/typo3conf/ext/px_erweiterung_calendar/Classes/Controller/handler.php', 128 cache : false, 129 type : 'POST', 130 dataType : 'JSON', 131 data : 132 { 133 'BEFEHL': 'BEFEHL_termin_löschen', 134 'id' : px('[name="px-calendar-event-id"]').val(), 135 }, 136 success : function(data) 137 { 138 Meldung(data[0], data[1]); 139 Termin_Leeren(); 140 Termin_Liste(); 141 } 142 }); 143 }); 144 145 body.on('click', '.px-calendar .right .scrollbox .px-calendar-zeile', function(){ 146 Termin_Leeren(); 147 Termin_Auslesen(px(this).data('id')); 148 }); 149 150 body.on('click', '#px-calendar-filter', function(e){ 151 e.stopPropagation(); 152 px('.px-calendar-filter-liste').fadeToggle(100); 153 }); 154 body.on('click', '#alle-filter', function(){ 155 px('[name="px-calendar-filter"]').prop('checked', !px('[name="px-calendar-filter"]').prop('checked')); 156 let filter = []; 157 px('[name="px-calendar-filter"]').each(function(){ if(px(this).prop('checked') === true) filter.push(px(this).val()); }); 158 px.ajax( 159 { 160 url : '/typo3conf/ext/px_erweiterung_calendar/Classes/Controller/handler.php', 161 cache : false, 162 type : 'POST', 163 dataType : 'HTML', 164 data : 165 { 166 'BEFEHL' : 'BEFEHL_termin_filter', 167 'filter' : filter, 168 }, 169 success : function(data) 170 { 171 px('.px-calendar .right .scrollbox').html(data); 172 } 173 }); 174 }); 175 body.on('click', '[name="px-calendar-filter"]', function(){ 176 let filter = []; 177 px('[name="px-calendar-filter"]').each(function(){ if(px(this).prop('checked') === true) filter.push(px(this).val()); }); 178 px.ajax( 179 { 180 url : '/typo3conf/ext/px_erweiterung_calendar/Classes/Controller/handler.php', 181 cache : false, 182 type : 'POST', 183 dataType : 'HTML', 184 data : 185 { 186 'BEFEHL' : 'BEFEHL_termin_filter', 187 'filter' : filter, 188 }, 189 success : function(data) 190 { 191 px('.px-calendar .right .scrollbox').html(data); 192 } 193 }); 194 }); 195 196 body.on('click', '.px-calendar-termin-inhalt.be .entferner', function(){ 197 let aid = px(this).data('id'); 198 var tid = px('[name="px-calendar-event-id"]').val(); 199 px.ajax( 200 { 201 url : '/typo3conf/ext/px_erweiterung_calendar/Classes/Controller/handler.php', 202 cache : false, 203 type : 'POST', 204 dataType : 'JSON', 205 data : 206 { 207 'BEFEHL' : 'BEFEHL_anhang_löschen', 208 'termin_id' : tid, 209 'anhang_id' : aid 210 }, 211 success : function(data) 212 { 213 Meldung(data[0], data[1]); 214 Termin_Auslesen(tid); 215 } 216 }); 217 }); 218 219 body.on('click', '#px-calendar-neu', function(){ 220 Termin_Leeren(); 221 }); 222 223 body.on('click','.px-calendar-termin:not(.be)',function(e){ 224 e.stopPropagation(); 225 // px('.px-calendar-termin-inhalt').not(this).removeClass('aktiv'); 226 px(this).next('.px-calendar-termin-inhalt').toggleClass('aktiv'); 227 }); 228});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.