PageSourceSearch

https://www.salzburg24.at/storage/scr/1787826327_20251210140216/1_piano_id.js

js salzburg24.at collected 2026-09-24 09:36:29 UTC 4,622 bytes, 158 lines download raw bytes

1fcmsJs.pianoId = {};
2
3// Erzeugt einen Loginbutton. Der Button erhält die Klasse "loading", solange Tp noch nicht geladen ist.
4fcmsJs.pianoId.makeLoginButton = (selector) => {
5   const btn = document.querySelector(selector);
6   btn.addEventListener('click', () => {
7      btn.classList.add('loading');
8      tp.push(['init', () => {
9          tp.pianoId.show({
10            screen : 'login',
11            loginSuccess : (data) => { 
12              if (!data.user.email_confirmation_required) {
13                 window.location.reload(); 
14              }
15            },
16            profileUpdate : () => { window.location.reload(); },
17            loginDisplayed : () => { btn.classList.remove('loading'); }
18        });
19      }]);
20   });
21};
22
23// Loginform im Container containerSelector anzeigen. loggedInMessage wird ausgegeben, wenn User bereits eingeloggt ist.
24fcmsJs.pianoId.injectLoginForm = (containerSelector, loggedInMessage) => {  
25  tp.push(['init', () => {
26    if (tp.pianoId.isUserValid()) {
27      if (loggedInMessage) {
28      	const container = document.querySelector(containerSelector);
29      	container.innerHTML = loggedInMessage;
30      }
31    
32    } else {
33      tp.pianoId.show({
34        screen : 'login',
35      	displayMode : 'inline',
36      	containerSelector,
37      	loginSuccess : () => {  window.location.reload(); }     
38      });
39    }
40  }]);	
41};
42
43// Loginmaske in Fancybox anzeigen
44fcmsJs.pianoId.injectLoginFormIntoFancybox = (containerSelector, fancyboxSelector, fancybox) => {
45  const fbContainer = document.querySelector(fancyboxSelector);
46  fbContainer.classList.add('loading');  
47  tp.push(['init', () => {
48    tp.pianoId.show({
49      screen : 'login',
50      displayMode : 'inline',
51      containerSelector,
52      loginSuccess : () => { fancybox.close(); window.location.reload(); },
53      loginDisplayed : () => { fbContainer.classList.remove('loading'); }
54    });
55  }]);	
56};
57
58/**
59 * zeigt die Piano-Profilseite inline an.
60 * 
61 * @param string selector Container-Selektor
62 * @param string defaultMessage Nachricht anstelle der Profilseite, wenn der User nicht eingeloggt ist
63 * @param object customOptions zusätzliche Optionen für tp
64 * @return void
65 */
66fcmsJs.pianoId.showProfile = (options) => { 
67  options = options || {};
68  
69  if (!options.containerSelector) {
70      fcmsJs.console.error('Kein Container-Selector zur Anzeige der Profilseite angegeben!');
71      return;
72  }
73  
74  const container = document.querySelector(options.containerSelector);
75   
76  tp.push(['init', () => { 
77    
78    if (tp.pianoId.isUserValid()) {
79      tp.myaccount.show({
80      	displayMode: 'inline',
81        containerSelector: options.containerSelector
82      });
83    
84    } else if (options.loggedOutMessage) {
85      container.innerHTML = options.loggedOutMessage;
86    }
87  }]);
88  
89  if (options.iframeTitle) {
90  	window.addEventListener('message', (event) => {
91            
92      if (event.data === 'myAccountDisplayed') {
93       	const ifr = container.querySelector('iframe');
94        
95        if (ifr) {
96       		ifr.title = options.iframeTitle;
97     	}
98      }
99  	});
100  }
101};
102
103// Logout
104fcmsJs.pianoId.logout = () => {
105  tp.push(['init', () => {
106      tp.pianoId.logout();
107  }]);	
108};
109
110// Callback ausführen, wenn User eingeloggt ist
111fcmsJs.pianoId.executeIfLoggedIn = (cb) => {
112  tp.push(['init', () => {
113      if (tp.pianoId.isUserValid()) {
114         cb();     
115      }  
116  }]);	
117};
118
119
120tp = window.tp || [];
121tp.push(['setUsePianoIdUserProvider', true]);
122tp.push(['init', () => {
123	tp.pianoId.init({
124    	displayMode : 'modal',
125        loggedOut: () => { window.location.reload(); }        
126    });
127}]);
128
129// this reloads the page after direct login (NOT login inside checkout)
130tp.push(["addHandler", "loginSuccess", function(data){
131  console.info('##### piano id modal login: %0', data);
132  
133  if (data.source == "PIANOID"){ 
134    window.location.reload();
135  }
136}]);
137
138//Weniger Werbung auf Artikelebene
139window.addEventListener('purEvent', ev => {
140    if(ev.detail.pur === true && document.querySelectorAll('.article_text .grundtext').length > 0){
141    	document.querySelectorAll('.is-pur .article_text .grundtext .adbox').forEach((el) => { el.remove(); });
142    }
143});
144
145/*document.addEventListener ("DOMContentLoaded", () => {
146  
147let pianoJavascriptTag = document.createElement('script');
148pianoJavascriptTag.type = 'text/javascript';
149pianoJavascriptTag.async = true;
150pianoJavascriptTag.src = 'https://experience-eu.piano.io/xbuilder/experience/load?aid=1A1UAVckpe';
151
152document.querySelector('body').append(pianoJavascriptTag);
153
154pianoJavascriptTag.onload = function () {
155  console.info('##### pianoJs loaded');
156};
157
158});*/

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.