Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright 2022 Ahmad Amarullah (https://amarullz.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
- window.DQHACK=function(){
- window.disqus_shortname='amarullz';
- window.DQTOK=[];
- window.DQEL={};
- var dqc_holder=document.createElement('span');
- document.body.appendChild(dqc_holder);
- window.DQUP=function(){
- dqc_holder.innerHTML='';
- var urls=[[]];
- var n=0;
- var p=0;
- for (var k in window.DQEL){
- if (!window.DQEL[k].DQLOADED){
- if (n>3){
- p++;
- n=0;
- urls[p]=[];
- }
- urls[p].push("2="+encodeURIComponent(k));
- n++;
- window.DQEL[k].DQLOADED=true;
- }
- }
- for (var i=0;i<urls.length;i++){
- var quri=(urls[i].join('&'));
- var sc=document.createElement('script');
- sc.src='https://amarullz.disqus.com/count-data.js?'+quri;
- dqc_holder.appendChild(sc);
- }
- };
- window.DQFIND=function(){
- var hasNew=false;
- var f=document.getElementsByTagName('a');
- for (var i=0;i<f.length;i++){
- var n=f[i].getAttribute('href');
- if (n&&(!f[i].DQSET)&&(n.indexOf('https://')==0)&&((n.indexOf('#respond')>0)||(n.indexOf('#comments')>0))){
- if (!(f[i] in window.DQTOK)){
- window.DQTOK.push(f[i]);
- }
- }
- }
- for (var i=0;i<window.DQTOK.length;i++){
- var v=window.DQTOK[i];
- if (!v.DQSET){
- var n=v.getAttribute('href');
- var hr=n.split('#');
- var l=document.createElement('a');
- l.setAttribute('href',hr[0]+'#disqus_thread');
- l.innerHTML='<span class="fa fw fa-comments"></span> 0';
- l.setAttribute('title','Forum Diskusi');
- var s=document.createElement('span');
- s.className='post-meta-separator';
- s.innerHTML=' — ';
- v.parentNode.appendChild(s);
- v.parentNode.appendChild(l);
- v.DQSET=true;
- if (!(hr[0] in window.DQEL)) window.DQEL[hr[0]]={DQLOADED:false,l:[]};
- window.DQEL[hr[0]].l.push(l);
- hasNew=true;
- }
- }
- if (hasNew){
- window.DQUP();
- }
- setTimeout(window.DQFIND,2000);
- };
- window.DISQUSWIDGETS={
- displayCount:function(v){
- if ('counts' in v){
- var c=v.counts;
- for (var i=0;i<c.length;i++){
- var d=c[i].id;
- var n=c[i].comments;
- if (d in window.DQEL){
- for (var j=0;j<window.DQEL[d].l.length;j++){
- window.DQEL[d].l[j].innerHTML='<span class="fa fw fa-comments"></span> '+n;
- }
- }
- }
- }
- }
- };
- window.DQFIND();
- };
- document.addEventListener("DOMContentLoaded",window.DQHACK);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement