PageSourceSearch

https://www.krieger-schramm.de/typo3conf/ext/nb_marketplace/Resour…/Scripts/nb_marketplace.js?1658845006

js krieger-schramm.de collected 2026-10-04 05:36:55 UTC 15,334 bytes, 259 lines download raw bytes

1$(document).ready(function(){
2
3    var form    = $('input#powermail_field_produkte').closest('form');
4    var input   = $('input#powermail_field_produkte');
5
6    form.on('submit', function(e){
7        $('div.nbmp-bookmarks-list button.nbmp-bookmarks').each(function(){
8            input.val(input.val() + $(this).data('uid') + ',');
9        })
10        input.val(input.val().slice(0,-1));
11        // console.log(input.val().slice(0,-1));
12    })
13
14    $('button.delete-all-from-lefalet').on('click', function (){
15        $('div.nbmp-bookmarks-list button.nbmp-bookmarks').click();
16    })
17
18    $('.nbmp-bookmarks').on('click', function() {
19    	$(this).toggleClass('isBookmark');
20    })
21
22    var valid = true;
23
24    $('*.sv-bookmarks').on('click', function(){
25
26        if(!$(this).hasClass('isBookmark')){
27            $('*.check-before-bookmark').each(function(){
28                if($(this).val() == ''){
29                    valid = false;
30                }
31            })
32
33            if(!valid){
34                alert('Bitte eine Größe & Anzahl wählen!');
35            }else{
36                bookmarkHandling($(this));
37                $('*.sv-bookmarks').addClass('isBookmark');
38            }
39
40            valid = true;
41        }
42
43    })
44
45    $('select#filter-section').on('change', function (){
46        location.href = $('input#filter-section-' + $(this).val()).val();
47    })
48
49})
50
51function bookmarkHandling(button){
52
53    var uid             = $(button).data('uid'),
54        type            = $(button).data('type'),
55        price           = $(button).data('price'),
56        contribution    = $(button).data('contribution'),
57        category        = $(button).data('category'),
58        image           = $(button).data('image'),
59        headline        = $(button).data('headline'),
60        teaser          = $(button).data('teaser'),
61        code            = $(button).data('code'),
62        size            = ($(button).data('update') == '1') ? $(button) : $('select.fashion-size'),
63        count           = ($(button).data('update') == '1') ? $(button) : $('select.fashion-count'),
64        link            = $(button).data('link'),
65        update          = $(button).data('update')
66    ;
67
68    var getData;
69
70    if($(button).hasClass('leaflet-count')){
71        getData = {uid:uid, count:count.val(), update:update}
72    }else if($(button).hasClass('leaflet-size')){
73        getData = {uid:uid, size:size.val(), update:update}
74    }else{
75        getData = {uid:uid, category:category, size:size.val(), count:count.val()}
76    }
77
78    // console.log(getData);
79
80    $.post('index.php?eID=mpleaflet_notice', getData, function(data) {
81        if(data == 'added'){
82            if(!$('div.nbmp-bookmarks-list > div.col--3.p-2').length){
83                $('p.no-bookmarks').hide();
84                $('div.nbmp-bookmarks-list-btns').show();
85                $('div#leaflet-footer').show();
86            }
87            if(type == 'default'){
88                $('div.nbmp-bookmarks-list').append(getLeafletDefaultItemHtml(uid, image, headline, teaser, code, link));
89            }else{
90                $('div.nbmp-bookmarks-list').append(getLeafletFashionItemHtml(uid, image, headline, size, count, price, contribution, link, type));
91                $('div#product-'+uid+' select.leaflet-size').val(size.val());
92                $('div#product-'+uid+' select.leaflet-size option[value="'+size.val()+'"]').attr('selected','');
93                $('div#product-'+uid+' select.leaflet-count').val(count.val());
94                $('div#product-'+uid+' select.leaflet-count option[value="'+count.val()+'"]').attr('selected','');
95                var absPrice = parseFloat($('span#price-abs').attr('data-price')) + getFashionPrice(price, count.val(), contribution);
96                // console.log(parseFloat($('span#price-abs').data('price')));
97                // console.log(getFashionPrice(price, count.val(), contribution));
98                $('span#price-abs')
99                    .attr('data-price', absPrice)
100                    .text(formatPrice(absPrice))
101                ;
102
103            }
104            if($('span.count-size-note').length){
105                $('span.count-size-note').removeClass('d-none');
106                $('select.fashion-size, select.fashion-count').attr('disabled','');
107            }
108        }else if(data == 'removed'){
109            $('div.nbmp-bookmarks-list button.nbmp-bookmarks[data-uid="'+uid+'"]').closest('div.col--3.p-2').remove();
110            $('button.nbmp-bookmarks[data-uid="'+uid+'"], *.sv-bookmarks[data-uid="'+uid+'"]').removeClass('isBookmark');
111            if(!$('div.nbmp-bookmarks-list > div.col--3.p-2').length){
112                $('p.no-bookmarks').show();
113                $('div.nbmp-bookmarks-list-btns').hide();
114                $('div#leaflet-footer').hide();
115            }
116            if(type == 'fashion'){
117                var absPrice = (parseFloat($('span#price-abs').attr('data-price')) - getFashionPrice(price, 1, 1)).toFixed(2);
118                // console.log(parseFloat($('span#price-abs').attr('data-price')));
119                // console.log(getFashionPrice(price, 1, 1));
120                // console.log(parseFloat($('span#price-abs').attr('data-price')) - getFashionPrice(price, 1, 1));
121                $('span#price-abs')
122                    .attr('data-price', absPrice)
123                    .text(formatPrice(absPrice))
124                ;
125            }
126            if($('span.count-size-note').length){
127                $('span.count-size-note').addClass('d-none');
128                $('select.fashion-size, select.fashion-count').removeAttr('disabled');
129            }
130        }else if(data == 'updated'){
131            // console.log(parseFloat($('span#price-abs').attr('data-price')));
132            // console.log(price);
133            // console.log(count.val());
134            // console.log(contribution);
135            var productCard     = $(button).closest('div.marketcard');
136
137            if($(button).hasClass('leaflet-count')){
138                var productPrice    = getFashionPrice(price, count.val(), contribution);
139                var absPrice        = parseFloat($('span#price-abs').attr('data-price')) - parseFloat($('span[data-price]', productCard).attr('data-price')) + productPrice;
140                $('span#price-abs')
141                    .attr('data-price', absPrice)
142                    .text(formatPrice(absPrice))
143                ;
144                $('span[data-price]', productCard)
145                    .attr('data-price', productPrice)
146                    .text(formatPrice(productPrice))
147                ;
148            }
149
150        }else{
151            alert('Aktion ohne Erfolg.');
152        }
153    });
154
155}
156
157function getLeafletDefaultItemHtml(uid, image, headline, teaser, code, link){
158
159    return '' +
160        '<div class="col--3 p-2">\n' +
161        '   <div id="product-'+uid+'" class="cards marketcard">\n' +
162        '       <div class="card-3">\n' +
163        '           <div class="media">\n' +
164        '               <figure class="media--image card--image">\n' +
165        '                   <div class="image__wrapper--16-9">\n' +
166        '                      <img src="'+image+'" alt="" width="700" height="394">\n' +
167        '                   </div>\n' +
168        '               </figure>\n' +
169        '               <div class="card--titel">\n' +
170        '                   <span class="headline d-inline-block">'+headline+'</span>\n' +
171        '                   <button class="bookmarks nbmp-bookmarks ms-4 isBookmark" data-uid="'+uid+'" onclick="bookmarkHandling(this);">\n' +
172        '                       <svg width="31" height="27" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">\n' +
173        '                           <g>\n' +
174        '                               <path class="bookmarks--innerHearth" d="m30.17459,12.22818c-1.04595,2.62168 -11.78643,12.52417 -14.62968,15.21517a0.08912,0.08912 0 0 0 -0.07551,-0.03466a0.08541,0.08541 0 0 0 -0.07551,0.03466c-2.84325,-2.691 -13.58497,-12.59348 -14.63092,-15.21517c-0.77487,-1.94089 -1.46557,-5.10721 0.61891,-8.27724c1.75398,-2.67243 5.16415,-4.26426 8.16955,-3.8991c3.49063,0.42457 4.95124,2.2491 5.9155,3.56489c0.96921,-1.31579 2.42363,-3.14033 5.9155,-3.56489c3.00788,-0.36515 6.41805,1.22667 8.16955,3.8991c2.08819,3.17003 1.39873,6.33635 0.62262,8.27724z"></path>\n' +
175        '                               <path class="bookmarks--outerHearth" d="m22.24748,0.00134l0,0.83915c2.54468,0 5.19827,1.43571 6.6018,3.57195a7.32956,7.32956 0 0 1 1.23768,4.13263a9.23188,9.23188 0 0 1 -0.703,3.37145c-0.20422,0.51116 -1.19436,2.01742 -5.52749,6.37283c-2.78974,2.80335 -5.95326,5.77379 -7.8432,7.54987l-0.55324,0.52106l-0.55448,-0.52106c-1.88994,-1.77484 -5.05346,-4.74528 -7.8432,-7.54987c-4.33189,-4.35541 -5.32204,-5.86167 -5.52749,-6.37283a9.28882,9.28882 0 0 1 -0.703,-3.37145a7.3209,7.3209 0 0 1 1.23768,-4.13263c1.4023,-2.13624 4.05589,-3.57195 6.6018,-3.57195a6.26392,6.26392 0 0 1 0.76736,0.04579c3.25263,0.39606 4.50888,2.10406 5.33937,3.22912l0.67701,0.91836l0.67578,-0.91836c0.83049,-1.12877 2.08673,-2.83306 5.33937,-3.22912a6.27877,6.27877 0 0 1 0.76736,-0.04579l0,-0.83915l0.0099,0zm0,0a7.22436,7.22436 0 0 0 -0.86638,0.05075c-3.49151,0.42453 -4.95073,2.25011 -5.91489,3.56577c-0.96911,-1.31566 -2.42462,-3.14124 -5.91489,-3.56577a7.24416,7.24416 0 0 0 -0.86638,-0.05075c-2.77489,0 -5.71686,1.53225 -7.30233,3.94945c-2.08302,3.17095 -1.39239,6.3357 -0.61884,8.27763c1.04584,2.61646 11.78646,12.52412 14.62942,15.21361a0.08292,0.08292 0 0 1 0.0755,-0.03466a0.0854,0.0854 0 0 1 0.0755,0.03466c2.84667,-2.68949 13.58234,-12.59714 14.62818,-15.21361c0.77603,-1.94193 1.46542,-5.10668 -0.61884,-8.27763c-1.58795,-2.4172 -4.52992,-3.94945 -7.30233,-3.94945l-0.00371,0z"></path>\n' +
176        '                           </g>\n' +
177        '                       </svg>\n' +
178        '                   </button>\n' +
179        '                   <span class="headline">'+teaser+'</span>\n' +
180        '               </div>\n' +
181        '               <div class="button--outer">\n' +
182        '                   <a class="button button--tertiary button--boss" href="'+link+'">Zum Produkt</a>\n' +
183        '                   <span class="bold ms-1 mt-2 mb-2">Artikel-Code: '+code+'</span>\n' +
184        '               </div>\n' +
185        '           </div>\n' +
186        '       </div>\n' +
187        '   </div>\n' +
188        '</div>' +
189    '';
190
191}
192
193function getLeafletFashionItemHtml(uid, image, headline, size, count, price, contribution, link, type){
194
195    var newPrice = getFashionPrice(price, count.val(), contribution);
196
197    return '' +
198        '<div class="col--3 p-2">\n' +
199        '   <div id="product-'+uid+'" class="cards marketcard">\n' +
200        '       <div class="card-3">\n' +
201        '           <div class="media">\n' +
202        '               <figure class="media--image card--image">\n' +
203        '                   <div class="image__wrapper--16-9">\n' +
204        '                      <img src="'+image+'" alt="" width="700" height="394">\n' +
205        '                   </div>\n' +
206        '               </figure>\n' +
207        '               <div class="card--titel">\n' +
208        '                   <span class="headline d-inline-block">'+headline+'</span>\n' +
209        '                   <button class="bookmarks nbmp-bookmarks ms-4 isBookmark" data-type="'+type+'" data-price="'+newPrice+'" data-uid="'+uid+'" onclick="bookmarkHandling(this);">\n' +
210        '                       <svg class="cross" width="31" height="27" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" viewBox="0 0 100 100">\n' +
211        '                           <g transform="translate(0,-952.36218)">\n' +
212        '                               <path style="text-indent:0;text-transform:none;direction:ltr;block-progression:tb;baseline-shift:baseline;enable-background:accumulate;" d="m 17.069155,958.36232 a 2.0002,2.0002 0 0 0 -1.38518,0.58566 l -9.0982501,9.09825 a 2.0002,2.0002 0 0 0 0,2.82855 l 31.4938101,31.48152 -31.4938101,31.4938 a 2.0002,2.0002 0 0 0 0,2.8282 l 9.0982501,9.0982 a 2.0002,2.0002 0 0 0 2.82855,0 l 31.48154,-31.4938 31.4938,31.4938 a 2.0002,2.0002 0 0 0 2.82817,0 l 9.09824,-9.0982 a 2.0002,2.0002 0 0 0 0,-2.8282 l -31.49381,-31.4938 31.49381,-31.48152 a 2.0002,2.0002 0 0 0 0,-2.82855 l -9.09824,-9.09825 a 2.0002,2.0002 0 0 0 -2.82817,0 l -31.4938,31.4938 -31.48154,-31.4938 a 2.0002,2.0002 0 0 0 -1.44337,-0.58566 z" fill-opacity="1" fill-rule="evenodd" stroke="none" marker="none" visibility="visible" display="inline" overflow="visible"><path>\n' +
213        '                               </path></path>\n' +
214        '                           </g>\n' +
215        '                       </svg>\n' +
216        '                   </button>\n' +
217        '               </div>\n' +
218        '               <div class="flex flex-wrap align-items-center">\n' +
219        '                   <div class="custom-select button--outer me-3">\n' +
220        '                       <label>\n' +
221        '                           <select class="leaflet-size" autocomplete="off" data-update="1" data-uid="'+uid+'" onChange="bookmarkHandling(this);">\n' +
222        '                           ' + $(size).html() + '\n' +
223        '                           </select>\n' +
224        '                       </label>\n' +
225        '                   </div>\n' +
226        '                   <div class="custom-select button--outer">' +
227        '                       <label>\n' +
228        '                           <select class="leaflet-count" autocomplete="off" data-price="'+price+'" data-update="1" data-uid="'+uid+'" data-contribution="'+contribution+'" onChange="bookmarkHandling(this);">\n' +
229        '                           ' + $(count).html() + '\n' +
230        '                           </select>' +
231        '                       </label>\n' +
232        '                   </div>' +
233        '               </div>\n' +
234        '               <div class="mt-3">\n' +
235        '                   <span>Preis Eigenanteil gesamt:</span>\n' +
236        '                   <span class="d-block" data-price="'+newPrice+'">'+formatPrice(newPrice)+'</span>\n' +
237        '               </div>\n' +
238        '               <div class="button--outer">\n' +
239        '                   <a href="'+link+'" class="button button--tertiary button--boss">Zum Produkt</a>\n' +
240        '               </div>\n' +
241        '           </div>\n' +
242        '       </div>\n' +
243        '   </div>\n' +
244        '</div>' +
245        '';
246
247}
248
249function getFashionPrice(basicPrice, count, contribution){
250
251    return parseFloat((parseFloat(basicPrice) * parseInt(count) * parseFloat(contribution)).toFixed(2));
252
253}
254
255function formatPrice(price){
256
257    return parseFloat(price).toFixed(2).replace('.',',') + ' €';
258
259}

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.