PageSourceSearch

https://ta-tum.com/lpd/sso-lpd.js

js ta-tum.com collected 2026-09-24 11:31:35 UTC 3,516 bytes, 89 lines download raw bytes

1(function (w) {
2  let LPD_URL = 'https://edelvives-sso.oneclick.es';
3  const height = 570;
4  const width = 600;
5  const offsetPadding = 20;
6  const MESSAGE_CLOSE = 'closelpd';
7
8  function openAuthLPD({ token = '', lang = 'es', termUrl, border = true, theme = '', endpoint = LPD_URL }) {
9    if (endpoint !== LPD_URL) setLPDURL(endpoint);
10    const offsetToApply = border ? offsetPadding : 0;
11    const overlay = document.createElement('div');
12    overlay.id = 'dialog-sso';
13    overlay.classList.add('lpd-overlay');
14
15    const inner = document.createElement('div');
16    inner.classList.add('lpd-inner');
17    inner.addEventListener('click', function () {
18      document.body.removeChild(this.parentNode);
19    });
20    overlay.appendChild(inner);
21
22    const content = document.createElement('div');
23    content.classList.add('lpd-content');
24    if (!border) content.style.borderRadius = 0;
25
26    content.style.height = height + offsetToApply * 2 + 'px';
27    content.style.width = width + offsetToApply * 2 + 'px';
28    content.style.padding = offsetToApply + 'px';
29    const buttonClose = document.createElement('button');
30    buttonClose.setAttribute('type', 'button');
31    buttonClose.classList.add('lpd-content-close');
32    buttonClose.innerHTML =
33      '<svg width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"></path></svg>';
34    buttonClose.addEventListener('click', function () {
35      document.body.removeChild(this.parentNode.parentNode);
36    });
37    content.appendChild(buttonClose);
38    /* const spinner = document.createElement('div');
39    spinner.classList.add('lpd-content-spinner');
40    spinner.innerHTML = 
41      '<svg viewBox="0 0 50 50"><circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5" ></circle></svg>';
42    content.appendChild(spinner); */
43    overlay.appendChild(content);
44
45    const makeIframe = document.createElement('iframe');
46    makeIframe.setAttribute(
47      'src',
48      endpoint +
49        '/authorize?token=' +
50        token +
51        '&lang=' +
52        lang +
53        (theme ? '&theme=' + theme : '') +
54        (termUrl ? '&term_url=' + termUrl : '')
55    );
56    makeIframe.setAttribute('scrolling', 'no');
57    makeIframe.style.border = 'none';
58    makeIframe.style.width = width + 'px';
59    makeIframe.style.height = height + 'px';
60    makeIframe.style.backgroundColor = '#ffffff';
61    content.appendChild(makeIframe);
62
63    document.body.appendChild(overlay);
64
65    setTimeout(function () {
66      inner.classList.add('lpd-inner__open');
67    }, 0);
68  }
69
70  function setLPDURL(url) {
71    LPD_URL = url;
72  }
73
74  const eventMethod = window.addEventListener ? 'addEventListener' : 'attachEvent';
75  const eventer = window[eventMethod];
76  const messageEvent = eventMethod === 'attachEvent' ? 'onmessage' : 'message';
77  // listen message from dialog iframe
78  eventer(messageEvent, function (e) {
79    if (LPD_URL.indexOf(e.origin) < 0) return; // Si no está permitido, return
80    if (e.data === MESSAGE_CLOSE || e.message === MESSAGE_CLOSE) {
81      const dialog = document.getElementById('dialog-sso');
82      dialog && document.body.removeChild(dialog);
83    }
84  });
85
86  w.lpd = {};
87  w.lpd.openAuthLPD = openAuthLPD;
88  w.lpd.setLPDURL = setLPDURL;
89})(window);

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.