},
// Lazy:Comments
commentsHidderWidget: function(){
if (!OD._commentsHidderWidget) OD._commentsHidderWidget = OD.e('cmtHiddder');
return OD._commentsHidderWidget;
},
commentsWidget: function(){
if (!OD._commentsWidget) OD._commentsWidget = OD.e('postComments');
return OD._commentsWidget;
},
commentsInit: function(){
var script, head = document.head;
OD.commentsOK = true;
script = document.createElement("script");
script.setAttribute("src", "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6");
script.setAttribute("async", "false");
script.setAttribute("onload", "FB.XFBML.parse();");
head.insertBefore(script, head.firstElementChild);
},
// Lazy:openWeb
openWebWidget: function(){
if (!OD._openWebWidget) OD._openWebWidget = OD.e('widgetOpenWeb');
return OD._openWebWidget;
},
openWebInit: function(){
if (OD.openWebOK === true) return;
OD.openWebOK = true;
// 3rd tag
!function (e, f, u, i) {
if (!document.getElementById(i)){e.async = 1; e.src = u; e.setAttribute('data-spotim-module', 'spotim-launcher'); e.id = i;f.parentNode.insertBefore(e, f);}
}(document.createElement('script'), document.getElementsByTagName('script')[0], '//launcher.spot.im/spot/sp_ScWcqqRz', 'scriptOpenWeb');
if(window.performance && typeof window.performance.mark == 'function') {window.performance.mark('oweb_prfmrk');}
},
// Ajax
getJSON: function(url, data, success, error, complete){
success = success||function(){};
OD.getHTML(url, data, function(responseText){
success(JSON.parse(xhr.responseText));
}, error, complete);
},
getHTML:function(url, data, success, error, complete) {
var xhr = new XMLHttpRequest(),
serialize = function(obj){
var p, str=[];
for (p in obj) {
if (!obj.hasOwnProperty(p)) continue;
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
}
return str.join("&");
};
xhr.withCredentials = true;
success = success || function() {};
complete = complete || function() {};
error = error || function() {}
xhr.onreadystatechange = function() {
if (xhr.readyState != 4) return;
if (xhr.status == 200) success(xhr.responseText);
else error(xhr.status, xhr.responseText);
complete();
}
xhr.open('GET', url+'&'+serialize(data),true);
xhr.send();
},
// Util
e: function(id){
return document.getElementById(id);
},
isInViewPort: function(element){
var rect, top, bottom;
if (!element) return false;
rect=element.getBoundingClientRect();
top=rect.top;
bottom=rect.bottom;
return (top>=0 && bottom<=window.innerHeight);
},
toggleClass: function(id, className){
var e = OD.e(id);
if (e.classList.contains(className)) {e.classList.remove(className); return false;}
else {e.classList.add(className); return true;}
},
toggleSearch: function(){
if (OD.toggleClass('mainSearch', 'show')) OD.e('mainSearchInput').focus();
},
getUrlParameter: function(name) {
var url = window.location.href.split('?'), vars, upar, i;
url.shift();
vars = unescape(url.join('?')).split('&');
for (i = 0; i < vars.length; i++) {
upar = vars[i].split('=');
if (upar[0] === name) {
if (upar[1] === undefined) return '';
return upar[1].replace(/+/g, ' ');
}
}
return '';
},
// Resfresh
setupPageRefresh: function(){
var seconds = parseInt(OD.e('body').getAttribute('data-refresh'), 10);
if (seconds<=0) return;
window.setTimeout(function(){location.reload();}, Math.max(30,seconds)*1000);
},
// Behaviors
linkTargetPopup: function(e){
var path=e.path||e.composedPath(), link=false, i, w=600, h=600,l,t,coords="";
if (!path) return;
for (i=0; i
////////////////////////////////////////////////
// OpenWeb
////////////////////////////////////////////////
window.OD.addOnLoad(function(){
// Apenas matérias
if (!OD.postID) return;
// Callbacks
window.openWeb_onNewUnseen = function(count) {
var e = document.getElementById('openWebBellBadge');
if (e){e.innerText = count; e.setAttribute('data-unseen', (count>0 ? 'yes' : 'no'));}
}
window.openWeb_openNotifications = function(){
var payload = {postId: OD.postID, instanceId: "EmbeddedNotifications"};
if (typeof window.__OW_OPEN_NOTIFICATIONS__ === 'function') {
window.__OW_OPEN_NOTIFICATIONS__(payload);
window.openWeb_onNewUnseen(0);
return;
}
document.addEventListener('ow-notifications-sdk-ready', function() {
window.__OW_OPEN_NOTIFICATIONS__(payload);
window.openWeb_onNewUnseen(0);
});
// clicked but not loaded, load now if available
window.OD.openWebInit();
};
// Init
if (typeof window.__OW_SUBSCRIBE_TO_NOTIFICATIONS__ === 'function') {
window.__OW_SUBSCRIBE_TO_NOTIFICATIONS__(OD.postID, window.openWeb_onNewUnseen);
return;
}
document.addEventListener('ow-notifications-sdk-ready', function(){
window.__OW_SUBSCRIBE_TO_NOTIFICATIONS__(OD.postID, window.openWeb_onNewUnseen);
});
});
Atenção: Oportunidade Única!
Você gostaria de ser atendido pela nossa equipe?
Sem precisar ficar o dia inteiro aguardando por uma resposta ou não ter a solução que você procura?
Entre em contato com a nossa Equipe de atendimento agora mesmo pelo WhatsApp agora mesmo e descubra como podemos ajudar você.



Comentários