Subversion Repositories cheapmusic

Rev

Rev 134 | Rev 141 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 134 Rev 137
Line 140... Line 140...
140
                    $xh->tag('i', "cancel_presentation");
140
                    $xh->tag('i', "cancel_presentation");
141
                  $xh->close(); // button
141
                  $xh->close(); // button
142
                $xh->close(); // div
142
                $xh->close(); // div
143
                $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
143
                $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
144
                $xh->tag('script');
144
                $xh->tag('script');
145
                  $str =  trim('document.addEventListener("DOMContentLoaded", function() {');
145
                  $str =  my_trim('document.addEventListener("DOMContentLoaded", function() {');
146
                  $str .= trim('	document.getElementById("tableFilter").addEventListener("keyup", function() {');
146
                  $str .= my_trim('	document.getElementById("tableFilter").addEventListener("keyup", function() {');
147
                  $str .= trim('        filterWishlist();');
147
                  $str .= my_trim('        filterWishlist();');
148
                  $str .= trim('	});');
148
                  $str .= my_trim('	});');
149
                  $str .= trim('	document.getElementById("tableFilterReset").addEventListener("click", function() {');
149
                  $str .= my_trim('	document.getElementById("tableFilterReset").addEventListener("click", function() {');
150
                  $str .= trim('        document.getElementById("tableFilter").value = "";');
150
                  $str .= my_trim('        document.getElementById("tableFilter").value = "";');
151
                  $str .= trim('        filterWishlist();');
151
                  $str .= my_trim('        filterWishlist();');
152
                  $str .= trim('	});');
152
                  $str .= my_trim('	});');
153
                  $str .= trim('});');
153
                  $str .= my_trim('});');
154
                  $xh->insert_code($str);
154
                  $xh->insert_code($str);
155
                $xh->close(); // script
155
                $xh->close(); // script
156
              $xh->close(); // div
156
              $xh->close(); // div
157
 
157
 
158
              $xh->add_attribute("method", "post");
158
              $xh->add_attribute("method", "post");
Line 288... Line 288...
288
                      $xh->close(); // tr
288
                      $xh->close(); // tr
289
                    $xh->close(); // thead
289
                    $xh->close(); // thead
290
 
290
 
291
                    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
291
                    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
292
                    $xh->tag('script');
292
                    $xh->tag('script');
293
                      $str =  trim('document.addEventListener("DOMContentLoaded", function() {');
293
                      $str =  my_trim('document.addEventListener("DOMContentLoaded", function() {');
294
                      $str .= trim('	document.getElementById("sortColumn1").addEventListener("click", function() {');
294
                      $str .= my_trim('	document.getElementById("sortColumn1").addEventListener("click", function() {');
295
                      $str .= trim('        sortTable("wishlistTable", 1, "text");');
295
                      $str .= my_trim('        sortTable("wishlistTable", 1, "text");');
296
                      $str .= trim('	});');
296
                      $str .= my_trim('	});');
297
                      $str .= trim('	document.getElementById("sortColumn2").addEventListener("click", function() {');
297
                      $str .= my_trim('	document.getElementById("sortColumn2").addEventListener("click", function() {');
298
                      $str .= trim('        sortTable("wishlistTable", 2, "text");');
298
                      $str .= my_trim('        sortTable("wishlistTable", 2, "text");');
299
                      $str .= trim('	});');
299
                      $str .= my_trim('	});');
300
                      $str .= trim('	document.getElementById("sortColumn4").addEventListener("click", function() {');
300
                      $str .= my_trim('	document.getElementById("sortColumn4").addEventListener("click", function() {');
301
                      $str .= trim('        sortTable("wishlistTable", 4, "text");');
301
                      $str .= my_trim('        sortTable("wishlistTable", 4, "text");');
302
                      $str .= trim('	});');
302
                      $str .= my_trim('	});');
303
                      $str .= trim('	document.getElementById("sortColumn5").addEventListener("click", function() {');
303
                      $str .= my_trim('	document.getElementById("sortColumn5").addEventListener("click", function() {');
304
                      $str .= trim('        sortTable("wishlistTable", 5, "text");');
304
                      $str .= my_trim('        sortTable("wishlistTable", 5, "text");');
305
                      $str .= trim('	});');
305
                      $str .= my_trim('	});');
306
                      $str .= trim('	document.getElementById("sortColumn6").addEventListener("click", function() {');
306
                      $str .= my_trim('	document.getElementById("sortColumn6").addEventListener("click", function() {');
307
                      $str .= trim('        sortTable("wishlistTable", 6, "text");');
307
                      $str .= my_trim('        sortTable("wishlistTable", 6, "text");');
308
                      $str .= trim('	});');
308
                      $str .= my_trim('	});');
309
                      $str .= trim('	document.getElementById("sortColumn7").addEventListener("click", function() {');
309
                      $str .= my_trim('	document.getElementById("sortColumn7").addEventListener("click", function() {');
310
                      $str .= trim('        sortTable("wishlistTable", 7, "numeric");');
310
                      $str .= my_trim('        sortTable("wishlistTable", 7, "numeric");');
311
                      $str .= trim('	});');
311
                      $str .= my_trim('	});');
312
                      $str .= trim('});');
312
                      $str .= my_trim('});');
313
                    $xh->insert_code($str);
313
                    $xh->insert_code($str);
314
                  $xh->close(); // script
314
                  $xh->close(); // script
315
                  $xh->tag('tbody');
315
                  $xh->tag('tbody');
316
 
316
 
317
            while ($row = mysqli_fetch_assoc($result)) {
317
            while ($row = mysqli_fetch_assoc($result)) {
Line 411... Line 411...
411
 
411
 
412
              $xh->close(); // tbody
412
              $xh->close(); // tbody
413
              $xh->close(); // table
413
              $xh->close(); // table
414
              $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
414
              $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
415
              $xh->tag('script');
415
              $xh->tag('script');
416
                $str  = trim('document.addEventListener("DOMContentLoaded", function() {');
416
                $str  = my_trim('document.addEventListener("DOMContentLoaded", function() {');
417
                $str .= trim('  document.getElementById("wishlistTable").addEventListener("click", function(event) {');
417
                $str .= my_trim('  document.getElementById("wishlistTable").addEventListener("click", function(event) {');
418
                $str .= trim('       e = event.target.closest("button") || event.target.closest("a");');
418
                $str .= my_trim('       e = event.target.closest("button") || event.target.closest("a");');
419
                $str .= trim('       tr = event.target.closest("tr");');
419
                $str .= my_trim('       tr = event.target.closest("tr");');
420
                $str .= trim('       if (e && tr && e.id.startsWith("wlEditBtn")) {');
420
                $str .= my_trim('       if (e && tr && e.id.startsWith("wlEditBtn")) {');
421
                $str .= trim('           var id = tr.getAttribute("data-id");');
421
                $str .= my_trim('           var id = tr.getAttribute("data-id");');
422
                $str .= trim('           window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Wishlist", "eventAction" : "Edit", "eventLabel" : ""});');
422
                $str .= my_trim('           window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Wishlist", "eventAction" : "Edit", "eventLabel" : ""});');
423
                $str .= trim('           editWishlist(id, e);');
423
                $str .= my_trim('           editWishlist(id, e);');
424
                $str .= trim('       } else if (e && tr && e.id.startsWith("wlDeleteBtn")) {');
424
                $str .= my_trim('       } else if (e && tr && e.id.startsWith("wlDeleteBtn")) {');
425
                $str .= trim('           var id = tr.getAttribute("data-id");');
425
                $str .= my_trim('           var id = tr.getAttribute("data-id");');
426
                $str .= trim('           var title = tr.getAttribute("data-title");');
426
                $str .= my_trim('           var title = tr.getAttribute("data-title");');
427
                $str .= trim('           var artist = tr.getAttribute("data-artist");');
427
                $str .= my_trim('           var artist = tr.getAttribute("data-artist");');
428
                $str .= trim('           window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Wishlist", "eventAction" : "Delete", "eventLabel" : ""});');
428
                $str .= my_trim('           window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Wishlist", "eventAction" : "Delete", "eventLabel" : ""});');
429
                $str .= trim('           deleteWishlist(id, e, title, artist);');
429
                $str .= my_trim('           deleteWishlist(id, e, title, artist);');
430
                $str .= trim('       } else if (e && tr && e.id.startsWith("wlInfoBtn")) {');
430
                $str .= my_trim('       } else if (e && tr && e.id.startsWith("wlInfoBtn")) {');
431
                $str .= trim('           window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Album Info", "eventAction" : "Click", "eventLabel" : ""});');
431
                $str .= my_trim('           window.dataLayer.push({ "event" : "trackEvent", "eventCategory" : "Album Info", "eventAction" : "Click", "eventLabel" : ""});');
432
                $str .= trim('       } else if (e && tr && e.id.startsWith("wlSearchBtn")) {');
432
                $str .= my_trim('       } else if (e && tr && e.id.startsWith("wlSearchBtn")) {');
433
                $str .= trim('           var title = tr.getAttribute("data-title");');
433
                $str .= my_trim('           var title = tr.getAttribute("data-title");');
434
                $str .= trim('           var artist = tr.getAttribute("data-artist");');
434
                $str .= my_trim('           var artist = tr.getAttribute("data-artist");');
435
                $str .= trim('           var barcode = tr.getAttribute("data-barcode");');
435
                $str .= my_trim('           var barcode = tr.getAttribute("data-barcode");');
436
                $str .= trim('           var searchTitle = tr.getAttribute("data-search-title");');
436
                $str .= my_trim('           var searchTitle = tr.getAttribute("data-search-title");');
437
                $str .= trim('           document.getElementById("discogsTitle").value = title;');
437
                $str .= my_trim('           document.getElementById("discogsTitle").value = title;');
438
                $str .= trim('           document.getElementById("discogsArtist").value = artist;');
438
                $str .= my_trim('           document.getElementById("discogsArtist").value = artist;');
439
                $str .= trim('           document.getElementById("discogsBarcode").value = barcode;');
439
                $str .= my_trim('           document.getElementById("discogsBarcode").value = barcode;');
440
                $str .= trim('           progressBar(searchTitle);');
440
                $str .= my_trim('           progressBar(searchTitle);');
441
                $str .= trim('           if (window.google_tag_manager && window.ga && ga.create) {');
441
                $str .= my_trim('           if (window.google_tag_manager && window.ga && ga.create) {');
442
                $str .= trim('               event.preventDefault();');
442
                $str .= my_trim('               event.preventDefault();');
443
                $str .= trim('               var form = event.target.closest("form");');
443
                $str .= my_trim('               var form = event.target.closest("form");');
444
                $str .= trim('               var input = document.createElement("input");');
444
                $str .= my_trim('               var input = document.createElement("input");');
445
                $str .= trim('               input.setAttribute("type", "hidden");');
445
                $str .= my_trim('               input.setAttribute("type", "hidden");');
446
                $str .= trim('               input.setAttribute("name", "submitBtn");');
446
                $str .= my_trim('               input.setAttribute("name", "submitBtn");');
447
                $str .= trim('               input.setAttribute("value", "discogsSearch");');
447
                $str .= my_trim('               input.setAttribute("value", "discogsSearch");');
448
                $str .= trim('               form.appendChild(input);');
448
                $str .= my_trim('               form.appendChild(input);');
449
                $str .= trim('               window.dataLayer.push({ "event" : "search", "search_term" : title + " by " + (artist.length == 0 ? "Various Artists" : artist), "eventCallback": function () {form.submit();}});');
449
                $str .= my_trim('               window.dataLayer.push({ "event" : "search", "search_term" : title + " by " + (artist.length == 0 ? "Various Artists" : artist), "eventCallback": function () {form.submit();}});');
450
                $str .= trim('           }');
450
                $str .= my_trim('           }');
451
                $str .= trim('       }');
451
                $str .= my_trim('       }');
452
                $str .= trim('  });');
452
                $str .= my_trim('  });');
453
                $str .= trim('});');
453
                $str .= my_trim('});');
454
                $xh->insert_code($str);
454
                $xh->insert_code($str);
455
              $xh->close(); // script
455
              $xh->close(); // script
456
 
456
 
457
              $xh->close(); // div
457
              $xh->close(); // div
458
              $xh->close(); // form
458
              $xh->close(); // form
Line 550... Line 550...
550
                    $xh->add_attribute("name", "submitBtn");
550
                    $xh->add_attribute("name", "submitBtn");
551
                    $xh->add_attribute("value", "Save");
551
                    $xh->add_attribute("value", "Save");
552
                    $xh->tag('button', "Save");
552
                    $xh->tag('button', "Save");
553
                    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
553
                    $xh->add_attribute("nonce", base64_encode($_SESSION["nonce"]));
554
                    $xh->tag('script');
554
                    $xh->tag('script');
555
                      $str =  trim('document.addEventListener("DOMContentLoaded", function() {');
555
                      $str =  my_trim('document.addEventListener("DOMContentLoaded", function() {');
556
                      $str .= trim('	document.getElementById("saveEditedWl").addEventListener("click", function() {');
556
                      $str .= my_trim('	document.getElementById("saveEditedWl").addEventListener("click", function() {');
557
                      $str .= trim('        saveEditedWishlist();');
557
                      $str .= my_trim('        saveEditedWishlist();');
558
                      $str .= trim('	});');
558
                      $str .= my_trim('	});');
559
                      $str .= trim('});');
559
                      $str .= my_trim('});');
560
                      $xh->insert_code($str);
560
                      $xh->insert_code($str);
561
                    $xh->close(); // script
561
                    $xh->close(); // script
562
                    $xh->add_attribute("type", "button");
562
                    $xh->add_attribute("type", "button");
563
                    $xh->add_attribute("class", "btn btn-danger");
563
                    $xh->add_attribute("class", "btn btn-danger");
564
                    $xh->add_attribute("data-dismiss", "modal");
564
                    $xh->add_attribute("data-dismiss", "modal");