1//function checkWhatIsUrl() { 2// const url = window.location.href; 3// if (url.includes('http://localhost:8080/')) { 4// return 'http://localhost:8080'; 5// } else if (url.includes('https://www.iobonline.com.br/')) { 6// return 'https://www.iobonline.com.br'; 7// } else if (url.includes('https://preprod.iobonline.com.br/')) { 8// return 'https://preprod.iobonline.com.br'; 9// } else if (url.includes('https://dev-iobonline.iob.com.br/')) { 10// return 'https://dev-iobonline.iob.com.br'; 11// } else if (url.includes('https://app.iob.com.br/')) { 12// return 'https://app.iob.com.br'; 13// } else if (url.includes('https://dev-app.iob.com.br/')) { 14// return 'https://dev-app.iob.com.br'; 15// } else if (url.includes('https://iobonline.iob.com.br/')) { 16// return 'https://iobonline.iob.com.br'; 17// } else { 18// return 'https://feature.iobonline.com.br'; 19// } 20//} 21// 22//function sharedDocument() { 23// const urlAmbiente = checkWhatIsUrl(); 24// const socket = new SockJS(`${urlAmbiente}/ws`); 25// const stompClient = Stomp.over(socket); 26// 27// stompClient.connect({}, function (frame) { 28// const usuarioCompartilhado = document.getElementById("usuario"); 29// const toUser = usuarioCompartilhado.value.toLowerCase(); 30// const message = getDocumentInfo(toUser); 31// 32// stompClient.send(`/app/documentos_compartilhados:${toUser}`, {}, JSON.stringify(message)); 33// stompClient.send(`/topic/documentos_compartilhados:${toUser}`, {}, JSON.stringify(message)); 34// }); 35//} 36// 37//function getDocumentInfo(userName) { 38// const pathUrl = window.location.pathname; 39// const searchUrl = window.location.search; 40// const searchDocument = `${pathUrl}${searchUrl}`; 41// 42// const months = ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 43// 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro']; 44// 45// const date = new Date(); 46// const day = date.getDate();
47// const month = date.getMonth(); 48// const year = date.getFullYear(); 49// const nameMonth = months[month]; 50// const sharingDate = `${day} de ${nameMonth} de ${year}`; 51// 52// let newsTitle = ""; 53// let completeStrong = document.querySelector('.complete strong'); 54// let subject = document.getElementById('subject'); 55// let noticiaTitle = document.getElementById('noticia-title'); 56// let textoDescricaoDecisao = document.querySelector('.textoDescricaoDecisao'); 57// if (subject) { 58// newsTitle = subject.innerText; 59// } else if(noticiaTitle) { 60// newsTitle = document.getElementById('noticia-title').innerText; 61// } else if (completeStrong) { 62// newsTitle = document.querySelector('.complete strong').textContent; 63// } else if (textoDescricaoDecisao) { 64// newsTitle = document.querySelector('.textoDescricaoDecisao').textContent; 65// } else { 66// console.log('Não foi possÃvel capturar o tÃtulo da notÃcia'); 67// } 68// 69// const pathname = window.location.pathname; 70// const pathnameArray = pathname.split('/'); 71// let documentType = pathnameArray[pathnameArray.length - 1].substring(0, 2).toLowerCase(); 72// 73// switch (documentType) { 74// case 'n-': 75// documentType = 'Noticia'; 76// break; 77// case 'pc': 78// documentType = 'Procedimento'; 79// break; 80// case 'p-': 81// documentType = 'Perguntas e respostas'; 82// break; 83// case 'es': 84// documentType = 'Legislação'; 85// break; 86// case 'fe': 87// documentType = 'Legislação'; 88// break; 89// default: 90// documentType = 'Decisões Administrativas'; 91// } 92// 93// if (documentType === 'Legislação') { 94// const strongElement = document.querySelector('.complete strong'); 95// let textoCapturado = strongElement.textContent.trim(); 96// 97// if (textoCapturado === '') { 98// const div = document.querySelector('.complete'); 99// const strong = div.querySelector('p:nth-of-type(2) strong'); 100// textoCapturado = strong.textContent; 101// } 102// 103// newsTitle = textoCapturado; 104// } 105// 106// const message = { 107// userName, 108// doc: searchDocument, 109// documentType, 110// newsTitle, 111// sharingDate, 112// message: 'Novo documento recebido!' 113// }; 114// 115// return message; 116//} 117// 118//async function deleteDocument(name, pathNameUrl) { 119// try { 120// const jwt = $.cookie('jwt-token'); 121// if (jwt) { 122// const data = { 123// userName: name, 124// doc: pathNameUrl 125// }; 126// const response = await fetch("/delete-document", { 127// method: "POST", 128// headers: { 129// "Content-Type": "application/json; charset=utf-8" 130// }, 131// body: JSON.stringify(data) 132// }); 133// console.log(response); 134// } 135// } catch (error) { 136// console.error('Erro ao conectar ao WebSocket:', error); 137// } 138//} 139// 140//async function checkIfHasDocumentList(userName) { 141// const ifHasJwt = document.cookie.includes('jwt-token'); 142// if (ifHasJwt) { 143// const userKey = userName; 144// try { 145// const response = await axios.get(`/listDocuments?userKey=${userKey}`); 146// const data = response.data; 147// if (data && data.length > 0) { 148// createNotificationArticles(data); 149// setupDocumentClickHandlers(userName); 150// showAlert(); 151// } 152// } catch (error) { 153// console.log(error); 154// } 155// } 156//} 157// 158// 159//function createNotificationArticles(data) { 160// const parentElement = document.querySelector('.notification__content'); 161// const notificationTitulo = document.querySelector('.messenge-lenght'); 162// 163// const documentIds = new Set(); 164// 165// data.forEach(item => { 166// const obj = JSON.parse(item); 167// const doc = obj.doc; 168// 169// if (!documentIds.has(doc)) { 170// const documentType = obj.documentType; 171// const newsTitle = obj.newsTitle; 172// const sharingDate = obj.sharingDate; 173// 174// const dynamicContent = ` 175// <div class="notification__article welcome_read"> 176// <a class="documentId" href="${doc}" id="doc"> 177// <span class="color-primary" id="documentType">${documentType}</span> 178// <p id="newsTitle">${newsTitle}</p> 179// <div class="date__article"> 180// <div class="date__icon"> 181// <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"> 182// <path fill-rule="evenodd" clip-rule="evenodd" d="M3.29588 1.45679C4.3922 0.724245 5.68114 0.333252 6.99968
1820.333252C7.87516 0.333252 8.74206 0.50569 9.5509 0.840722C10.3597 1.17575 11.0947 1.66682 11.7137 2.28587C12.3328 2.90493 12.8238 3.63986 13.1589 4.4487C13.4939 5.25753 13.6663 6.12444 13.6663 6.99992C13.6663 8.31846 13.2754 9.60739 12.5428 10.7037C11.8103 11.8 10.7691 12.6545 9.5509 13.1591C8.33273 13.6637 6.99228 13.7957 5.69908 13.5385C4.40587 13.2813 3.21798 12.6463 2.28563 11.714C1.35328 10.7816 0.718344 9.59373 0.461109 8.30052C0.203874 7.00731 0.335896 5.66687 0.840481 4.4487C1.34506 3.23052 2.19955 2.18933 3.29588 1.45679ZM4.03664 11.4344C4.9137 12.0205 5.94484 12.3333 6.99968 12.3333C8.41417 12.3333 9.77072 11.7713 10.7709 10.7712C11.7711 9.77096 12.333 8.41441 12.333 6.99992C12.333 5.94509 12.0202 4.91394 11.4342 4.03688C10.8481 3.15982 10.0152 2.47623 9.04066 2.07256C8.06612 1.66889 6.99376 1.56328 5.9592 1.76906C4.92463 1.97485 3.97432 2.4828 3.22844 3.22868C2.48256 3.97456 1.97461 4.92487 1.76882 5.95944C1.56304 6.994 1.66865 8.06636 2.07232 9.0409C2.47599 10.0154 3.15957 10.8484 4.03664 11.4344ZM7.66634 6.33325H9.66634C9.84315 6.33325 10.0127 6.40349 10.1377 6.52851C10.2628 6.65354 10.333 6.82311 10.333 6.99992C10.333 7.17673 10.2628 7.3463 10.1377 7.47132C10.0127 7.59635 9.84315 7.66659 9.66634 7.66659H6.99967C6.82286 7.66659 6.65329 7.59635 6.52827 7.47132C6.40325 7.3463 6.33301 7.17673 6.33301 6.99992V4.33325C6.33301 4.15644 6.40325 3.98687 6.52827 3.86185C6.65329 3.73682 6.82286 3.66658 6.99967 3.66658C7.17649 3.66658 7.34605 3.73682 7.47108 3.86185C7.5961 3.98687 7.66634 4.15644 7.66634 4.33325V6.33325Z" fill="#979797" /> 183// </svg> 184// </div> 185// <div class="sharingDate">${sharingDate}</div> 186// </div> 187// </a> 188// </div>`; 189// 190// const div = document.createElement('div'); 191// div.innerHTML = dynamicContent; 192// const existingElement = parentElement.querySelector(`[href="${doc}"]`); 193// if (!existingElement) { 194// parentElement.insertBefore(div, parentElement.firstChild); 195// documentIds.add(doc); 196// } 197// } 198// }); 199// 200// contarDocumentosNaoLidas(parentElement, notificationTitulo); 201//} 202// 203//function setupDocumentClickHandlers(userName) { 204// const documentItems = document.querySelectorAll('.documentId'); 205// documentItems.forEach(element => { 206// element.addEventListener('click', handleDocumentClick); 207// }); 208// 209// function handleDocumentClick(event) { 210// const pathNameUrl = event.currentTarget.getAttribute('href'); 211// deleteDocument(userName, pathNameUrl); 212// } 213//} 214// 215//function showAlert() { 216// const welcomeAlert = document.querySelector('.welcome__alert'); 217// if (welcomeAlert) { 218// welcomeAlert.classList.add('active'); 219// } 220//} 221// 222//function addMessageToSessionStorage(message) { 223// localStorage.setItem('notificacao', message); 224//} 225// 226//const btnCompartilharDoc = document.getElementById('compartilha-conteudo'); 227//if (btnCompartilharDoc) { 228// btnCompartilharDoc.addEventListener('click', function () { 229// sharedDocument(); 230// }); 231//} 232// 233//function connectWebsocket() { 234// const userNameSessionStorage = sessionStorage.getItem('nomeUsuario'); 235// if (!userNameSessionStorage) { 236// return; 237// } 238// 239// checkIfHasDocumentList(userNameSessionStorage); 240// 241// const urlAmbiente = checkWhatIsUrl(); 242// const socket = new SockJS(`${urlAmbiente}/ws`); 243// const stompClient = Stomp.over(socket); 244// stompClient.connect({}, () => { 245// const toUser = sessionStorage.getItem('nomeUsuario').toLowerCase(); 246// checkIfHasDocumentList(toUser); 247// stompClient.subscribe(`/topic/documentos_compartilhados:${toUser}`, (message) => { 248// const mensagemRecebida = JSON.parse(message.body); 249// // const conteudoMensagem = mensagemRecebida.message; 250// // const userMensagem = mensagemRecebida.userName; 251// checkIfHasDocumentList(userNameSessionStorage); 252// }); 253// 254// stompClient.ws.onclose = (event) => { 255// console.log('WebSocket fechado:', event); 256// }; 257// stompClient.ws.onerror = (error) => { 258// console.error('WebSocket Erro:', error); 259// }; 260// }); 261//} 262// 263//function delay(ms) { 264// return new Promise((resolve) => setTimeout(resolve, ms)); 265//} 266// 267//async function fetchSessaoUsuario() { 268// await delay(1000); 269// 270// const jwt = $.cookie('jwt-token'); 271// 272// if (jwt) { 273// try { 274// const response = await axios.get("/sessaoUsuario", { 275// headers: { 276// 'Content-Type': 'application/json; charset=utf-8', 277// 'Authorization': `Bearer ${jwt}` 278// } 279// }); 280// 281// const userName = response.data; 282// sessionStorage.setItem('nomeUsuario', userName); 283// connectWebsocket(); 284// 285// } catch (error) { 286// console.error(error); 287// } 288// } 289//} 290// 291//fetchSessaoUsuario();
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.