1isSafari(); 2 3$sidebar = $('.sidebar'); 4window_width = $(window).width(); 5 6/** 7 * Abrir menu lateral 8 */ 9$(document).on('click', '.navbar-toggle', function () { 10 $toggle = $(this); 11 12 div = '<div id="bodyClick"></div>'; 13 $(div).appendTo('body').click(function () { 14 $('html').removeClass('nav-open'); 15 mobile_menu_visible = 0; 16 setTimeout(function () { 17 $toggle.removeClass('toggled'); 18 $('#bodyClick').remove(); 19 }, 550); 20 }); 21 22 $('html').addClass('nav-open'); 23}); 24 25function validarFundoLogin() { 26 let container_login = $('#app:has(.app-login)'); 27 28 if (container_login.length === 1) { 29 $('#app').css("background-image", "linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)"); 30 } else { 31 $('#app').css("background", "#e2e2e2"); 32 } 33} 34 35/** 36 * Instancia força da senha 37 */ 38function forcaSenha() { 39 var senha = $('#senha'); 40 41 if (senha) { 42 senha.strength({ 43 strengthClass: 'strength', 44 strengthMeterClass: 'strength_meter', 45 strengthButtonClass: 'button_strength' 46 }); 47 } 48} 49 50function validaActiveClass(el) { 51 $(document).ready(function () { 52 $('.menu-item').removeClass('active'); 53 $(el).addClass('active'); 54 $('html').removeClass('nav-open'); 55 $('.navbar-toggle').removeClass('toggled'); 56 $('#bodyClick').remove(); 57 }); 58} 59 60function ativaSwipe() { 61 $(document).ready(function () { 62 $('.main-panel').on('swipeleft', function (e) { 63 new HotsiteWeb().getDadosServidor(); 64 if (app.assinando === false) { 65 div = '<div id="bodyClick"></div>'; 66 $('html').addClass('nav-open'); 67 mobile_menu_visible = 0; 68 69 $(div).appendTo('body').click(function () { 70 $('.navbar-toggle').removeClass('toggled'); 71 $('html').removeClass('nav-open'); 72 $('#bodyClick').remove(); 73 mobile_menu_visible = 1; 74 }); 75 } 76 }); 77 78 $('body').on('swiperight', function (e) { 79 if (app.assinando === false) { 80 $('.navbar-toggle').removeClass('toggled'); 81 $('html').removeClass('nav-open'); 82 $('#bodyClick').remove(); 83 mobile_menu_visible = 1; 84 } 85 }); 86 }); 87} 88 89function swipeLeftSidebar() { 90 $(document).ready(function () { 91 $('.sidebar-wrapper').on('swiperight', function (e) { 92 $('.sidebar').removeClass('minimizado').addClass('maximizado'); 93 $('.sidebar-wrapper').removeClass('minimizado').addClass('maximizado'); 94 $('.main-panel').removeClass('maximizado').addClass('minimizado'); 95 $('button.maximizar').removeClass('maximizar').addClass('minimizar'); 96 $('.gesture-icon').text('chevron_left'); 97 maximizado = false; 98 }); 99 100 $('.sidebar-wrapper').on('swipeleft', function (e) { 101 $('.sidebar').removeClass('maximizado').addClass('minimizado'); 102 $('.sidebar-wrapper').removeClass('maximizado').addClass('minimizado'); 103 $('.main-panel').removeClass('minimizado').addClass('maximizado'); 104 $('button.maximizar').removeClass('minimizar').addClass('maximizar'); 105 $('.gesture-icon').text('chevron_right'); 106 maximizado = true; 107 }); 108 }); 109} 110 111function iniciaFirebase() { 112 $(document).ready(function () { 113 if (typeof window.ReactNativeWebView != 'undefined') { 114 const hs_web = new HotsiteWeb(); 115 hs_web.updateFirebaseToken(); 116 } else if (app.cordova_app){ 117 window.FirebasePlugin.getToken(function(token) { 118 // save this server-side and use it to push notifications to this device 119 console.log(token); 120 }, function(error) { 121 console.error(error); 122 }); 123 } 124 125 }); 126} 127 128$(window).resize(function () { 129 var hs_web = new HotsiteWeb(); 130 if (ROTA == "/central_assinante_web/") { 131 hs_web.validaResizeHome(); 132 } else if (ROTA == "/central_assinante_web/atendimentos") { 133 hs_web.validaResizeAtendimentos(); 134 } else if (ROTA == "/central_assinante_web/faturas") { 135 hs_web.validaResizeFaturas(); 136 } else if (ROTA == "/central_assinante_web/planos") { 137 hs_web.validaResizePlanos(); 138 } else if (ROTA == "/central_assinante_web/notas") { 139 hs_web.validaResizeNotas(); 140 } 141}); 142 143function isSafari() { 144 var ios = navigator.userAgent.match(/ipad|ipod|iphone/i); 145 var safari = navigator.userAgent.match(/^((?!chrome|android).)*safari/i); 146 147 if (ios || safari) { 148 IS_SAFARI = true; 149 } else { 150 IS_SAFARI = false;
151 } 152} 153 154function setarPermissaoHome() { 155 router.history.current.matched[0].instances.default.mostrar_franquia = app.pg_consumo; 156 router.history.current.matched[0].instances.default.mostrar_fatura = app.pg_fatura; 157 router.history.current.matched[0].instances.default.mostrar_plano = app.pg_plano; 158 router.history.current.matched[0].instances.default.mostrar_atendimento = app.pg_atendimento; 159 router.history.current.matched[0].instances.default.sms_fatura = app.sms_fatura; 160 router.history.current.matched[0].instances.default.email_fatura = app.email_fatura; 161 router.history.current.matched[0].instances.default.imprime_venda_fatura = app.imprime_venda_fatura; 162} 163 164function buttonFileClick(id_button) { 165 if (id_button) { 166 $(id_button).click(); 167 } 168} 169 170function isFirefox() { 171 var isFirefox = typeof InstallTrigger !== 'undefined'; 172 173 if (isFirefox && !IS_REMOVED) { 174 document.getElementById('animate_link').remove() 175 IS_REMOVED = true; 176 } 177} 178 179(function ($, window, document) { 180 181 var $html = $('html'); 182 183 $html.on('click.ui.dropdown', '.js-dropdown', function (e) { 184 $('.js-dropdown ul').show(); 185 $('.js-dropdown ul').not($(this).find('ul')).hide(); 186 }); 187 188 $html.on('click.ui.dropdown', function (e) { 189 var $target = $(e.target); 190 if (!$target.parents().hasClass('js-dropdown')) { 191 $('.js-dropdown ul').hide(); 192 } 193 }); 194 195})(jQuery, window, document); 196 197$(function () { 198 if(typeof Origami !== 'undefined') { 199 var attachFastClick = Origami.fastclick; 200 attachFastClick(document.body); 201 } 202}); 203 204$(document).click(function (document) { 205 $(document).ready(function () { 206 if (!$(document.target).hasClass('options') && !$(document.target).hasClass('cidades') && (ROTA == "/central_assinante_web/dados_cliente" || ROTA == "/central_assinante_web/dados_cliente/")) { 207 router.history.current.matched[0].instances.default.mostra_autocomplete = false; 208 }else if($(document.target).hasClass('options') && $(document.target).hasClass('cidades') && (ROTA == "/central_assinante_web/dados_cliente" || ROTA == "/central_assinante_web/dados_cliente/")){ 209 router.history.current.matched[0].instances.default.mostra_autocomplete = true; 210 } 211 }) 212}); 213 214function openLink(link){ 215 window.open(link['link'], '_system', 'location=no'); 216} 217 218function generateApp(el) { 219 validaActiveClass(el); 220 openBuilder(); 221} 222function openBuilder() { 223 try { 224 const item = $.cookie('manter_conectado') === 'S' ? localStorage.getItem('dados') : sessionStorage.getItem('dados'); 225 const parsedData = JSON.parse(item); 226 const { id, fantasia, razao } = parsedData; 227 228 const form = document.createElement('form'); 229 form.setAttribute('method', 'post'); 230 form.setAttribute('action', app.url_generate_app); 231 form.setAttribute('target', '_blank'); 232 233 const idInput = document.createElement('input'); 234 idInput.setAttribute('name', 'ID'); 235 idInput.setAttribute('value', id); 236 237 const fantasiaInput = document.createElement('input'); 238 fantasiaInput.setAttribute('name', 'FANTASIA'); 239 fantasiaInput.setAttribute('value', fantasia); 240 241 const razaoInput = document.createElement('input'); 242 razaoInput.setAttribute('name', 'RAZAO'); 243 razaoInput.setAttribute('value', razao); 244 245 form.appendChild(idInput); 246 form.appendChild(fantasiaInput); 247 form.appendChild(razaoInput); 248 249 document.body.appendChild(form); 250 form.submit(); 251 document.body.removeChild(form); 252 } catch (e) { 253 console.log(e); 254 } 255}
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.