// ==UserScript==
// @name dA_quick_img_pop
// @namespace dA_quick_img_pop
// @description Displays buttons beneath each deviationon its submission site, so you can easily see how much resonance a picture got!
// @include http://*.deviantart.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @include http://fav.me/*
// @version 1.36
// @grant GM_getValue
// ==/UserScript==
(function(){
// var $=unsafeWindow.jQuery,holder,query,offset,fPage,pPage,lPage;
var imgblF="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABmJLR0QA%2FwD%2FAP%2BgvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QEIFwwoGsn2DQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAFj0lEQVRIx7WXy28b1xWHv3vnzoMcDilSpC0pstM4id2GaRdJ4QRI0X%2BgQIEsuyq66bbZ%2BB%2FI1osEBdouuzS86gtoFgW6yaIOkBZtYsULw6lhW5JLmZT4nPe9WWjIjAhastGEwAGJ4dz5zjlz7jm%2FK3i%2Bjzjjf%2FOsD1LPCRNPccA8rxPqGaBzkyUTJbgpTJfMnAVXZ0QpAKu4zy5MFddkcY8GciAD0sKy4tpToxenQOdAB%2FCASmFe4YBV3JcXsAgIC4uAZMkBc1rEZahdQGpA%2Fdg614VIuzAMhBALsDH1sTH2DhxcA0aFTQoH5s6JMlycAq0CDaCJ2Pq1oPeWlMaybRvXdVFKIYQgz3OSJCFJEvKcXJvOLczer4BDYAjMioyciHwZLAtoBWgCbdSlP0h9f8txHBqNBu12m06nQxAESCmJoojBYMDBwQH9fp8wDMnFxT2Tfvku8KRwICzgehksSoVUKSI9h%2Fvan0Vyd8vzKmxsbHD58mVeffUVLlzYptFoLMC9Xo97977kzp07PHjwkNFoSGZd2iP%2B4qdAr4g8LKI2gLFWROsDLVHp%2FkbE%2Fa7jrNPpvMTrr%2F%2BQN964ypUrr7G5uU2jsU6ttkat1qReX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2BXtn8A3686NU%2B4g2oAAAAASUVORK5CYII%3D";
var gfavcount=100; //>100favourites
var gcomcount=20;//>20 comments
var gtimetick1=1;//< 1 day
var gtimetick2=60;//>60 days
var mulsticom=true;//two input fields, even with few/no comments
function start(){
var titlel=document.getElementsByClassName("dev-view-about-content");
if(typeof titlel[0]=="undefined" || titlel[0].getElementsByTagName("h3").length==0)
titlel=document.getElementsByClassName("dev-view-about-content")[0];
else
titlel=titlel[0].getElementsByTagName("h3")[0];
if(typeof titlel == "undefined"){return;}
// if(!document.getElementsByClassName("dev-view-about-content")[0].getElementsByTagName("h3")[0]){return;}
if(mulsticom)multicomm();
var styl=document.createElement("style");
styl.innerHTML=".dA_quick_img_pop_but{margin: 0 -3px;}";
document.body.appendChild(styl);
highcomm();
// var titlel=document.getElementsByTagName("h1");
// var setz=false;
// for(var i=0;i<titlel.length;i++){
// if(titlel[i].getAttribute("dA_quick_img_pop")!="1"&&titlel[i].innerHTML.match(/<small><span class="by">by<\/span>.*?class="u"/i)){
// titlel=titlel[i];
// setz=true;
// break;
// }
// }
// if(!setz)return;
if(typeof titlel=="undefined")titlel=document.getElementsByClassName("dev-title-container")[0];
if(titlel.getAttribute("dA_quick_img_pop")=="1")return;
// var counts=document.getElementsByClassName("resview7-meta");
var counts=document.getElementsByClassName("dev-page-details");
console.log(counts);
if(counts.length==0){
counts=document.getElementsByClassName("dev-view-meta-content");
console.log("s",counts);
}
counts=counts[counts.length-1];
var favcount=parseInt(counts.innerHTML.replace(/\.|,/g,"").match(/<dt>Favourites<\/dt><dd>\D*?(\d+)/)[1]);
var comcount=parseInt(counts.innerHTML.replace(/\.|,/g,"").match(/<dt>Comments<\/dt><dd>\D*?(\d+)/)[1]);
var timemat=counts.innerHTML.replace(/\.|,/g,"").match(/ts="(\d+)"[^>]*?>([^<]*?)</);
var timetick=parseInt(new Date().getTime()/1000 - parseInt(timemat[1]));
// if(!counts.innerHTML.replace(/\.|,/g,"").match(/<span class="favourites">\D*?(\d+)/))return;
// var favcount=parseInt(counts.innerHTML.replace(/\.|,/g,"").match(/<span class="favourites">\D*?(\d+)/)[1]);
// var comcount=parseInt(counts.innerHTML.replace(/\.|,/g,"").match(/<span class="comments">\D*?(\d+)/)[1]);
// var favcount=parseInt(counts.innerHTML.replace(/\.|,/g,"").match(/<dt>Favourites<\/dt><dd>\D*?(\d+)/)[1]);
// var comcount=parseInt(counts.innerHTML.replace(/\.|,/g,"").match(/<dt>Comments<\/dt><dd>\D*?(\d+)/)[1]);
// var timemat=counts.innerHTML.replace(/\.|,/g,"").match(/ts="(\d+)"[^>]*?>([^<]*?)</);
// var timetick=parseInt(new Date().getTime()/1000 - parseInt(timemat[1]));
titlel.setAttribute("dA_quick_img_pop","1");
// var ins="<div id='dA_quick_img_pop_cont' style='float: right;'>";
var ins=document.createElement("div");
ins.id="dA_quick_img_pop_cont";
ins.style="position: absolute;right: 0;top: 0;";
ins.innerHTML="";
if(favcount>gfavcount)
ins.innerHTML+="<img class='dA_quick_img_pop_but' src='"+imgblF+"' alt='over "+gfavcount+" favourites: "+favcount+"' title='over "+gfavcount+" favourites: "+favcount+"' style='float: right;'/>";
if(comcount>gcomcount)
ins.innerHTML+="<img class='dA_quick_img_pop_but' src='"+imggrC+"' alt='over "+gcomcount+" comments: "+comcount+"' title='over "+gcomcount+" comments: "+comcount+"' style='float: right;'/>";
if(timetick<(60*60*24*gtimetick1))//1 day
ins.innerHTML+="<img class='dA_quick_img_pop_but' src='"+imgtuT+"' alt='younger than "+gtimetick1+" days: "+timemat[2]+"' title='younger than "+gtimetick1+" days: "+timemat[2]+"' style='float: right;'/>";
if(timetick>(60*60*24*gtimetick2))//60 day
ins.innerHTML+="<img class='dA_quick_img_pop_but' src='"+imgroT+"' alt='older than "+gtimetick2+" days: "+timemat[2]+"' title='older than "+gtimetick2+" days: "+timemat[2]+"' style='float: right;'/>";
titlel.appendChild(ins);
var buts=document.getElementsByClassName("dA_quick_img_pop_but");
for(var i=0;i<buts.length;i++)
buts[i].addEventListener("click", confmenu, true);
}
function multicomm(){
var tower=document.getElementsByClassName("talk-tower");
for(var i=0;i<tower.length;i++){
if(!tower||tower.length<=i){continue;}
if(!tower[i].getElementsByTagName("form")||tower[i].getElementsByTagName("form").length==0){continue;}
if(tower[i].getElementsByTagName("textarea").length>1){continue;}
if(tower[i].getElementsByTagName("textarea").length==0){continue;}
if(tower[i].parentNode.getAttribute("dA_quick_img_pop")=="on"){continue;}
tower=tower[i];
if(!tower.firstChild.getElementsByTagName("textarea")){continue;}
if(tower.firstChild.getElementsByTagName("textarea").length>0){continue;}
var forms=tower.getElementsByTagName("form");
tower.insertBefore(forms[forms.length-1].cloneNode(true),tower.firstChild);
}
}
function highcomm(){
var coms =document.getElementsByClassName("mcb-commentcount");
for(var i=0;i<coms.length;i++){
if(parseInt(coms[i].innerHTML.match(/span>(\d+) Comment/i)[1])<gcomcount){
coms[i].getElementsByTagName("A")[0].style.color="#ff0000";
}
}
}
function confmenu(){
if(!document.getElementById("deviantART-v7")){setTimeout(confmenu,1000);return;}
if(!document.getElementById("dA_quick_img_pop_conf")){
var conf =document.createElement("div");
conf.className="loading modal modal-rounded";
conf.id="dA_quick_img_pop_conf";
var checked="";
if(mulsticom)checked=" checked='checked'";
conf.innerHTML="<img src='"+imgblF+"' alt='over how many favourites' title='over how many favourites' style='vertical-align: middle;display: inline-block;'/><div style='display: inline-block;width:150px;'>How many Favourites:</div><input type='text' value="+gfavcount+" style='display: inline-block;width:30px;'/>"+
"<img src='"+imggrC+"' alt='over how many comments' title='over how many comments' style='vertical-align: middle;display: inline-block;'/><div style='display: inline-block;width:150px;'>How many comments:</div><input type='text' value="+gcomcount+" style='display: inline-block;width:30px;'/>"+
"<img src='"+imgtuT+"' alt='before which time' title='before which time' style='vertical-align: middle;display: inline-block;'/><div style='display: inline-block;width:150px;'>Younger than (days):</div><input type='text' value="+gtimetick1+" style='display: inline-block;width:30px;'/>"+
"<img src='"+imgroT+"' alt='after which time' title='after which time' style='vertical-align: middle;display: inline-block;'/><div style='display: inline-block;width:150px;'>Older than (days):</div><input type='text' value="+gtimetick2+" style='display: inline-block;width:30px;'/>"+
"<input type='checkbox'"+checked+" id='dA_quick_img_pop_conf_che'/><label style='display:inline-block;vertical-align:middle;width:195px;' for='dA_quick_img_pop_conf_che'>Should two commenting inputs be displayed, even at submissions with low comment count?</label>"+
"<a href='#' id='dA_quick_img_pop_conf_acc' style='width:80px;display:inline-block; margin: 10px auto;' onclick='return false;' class='gmbutton2 gmbutton2c'>Save<b></b></a><a style='width:80px;display:inline-block; margin: 10px 10px auto;' href='#' id='dA_quick_img_pop_conf_can' onclick='return false;' class='gmbutton2 gmbutton2c'>Cancel<b></b></a>";
conf.setAttribute("style","width:220px;height:220px;position:absolute;top:50%;left:50%;margin-left:-130px;margin-top:-130px;padding:20px");
document.getElementById("deviantART-v7").appendChild(conf);
// document.getElementById("deviantART-v7").appendChild(conf);
document.getElementById("dA_quick_img_pop_conf_acc").addEventListener("click", function(){
var wind=document.getElementById("dA_quick_img_pop_conf");
wind.style.display="none";
gfavcount= parseFloat(wind.getElementsByTagName("INPUT")[0].value);
gcomcount= parseFloat(wind.getElementsByTagName("INPUT")[1].value);
gtimetick1= parseFloat(wind.getElementsByTagName("INPUT")[2].value);
gtimetick2= parseFloat(wind.getElementsByTagName("INPUT")[3].value);
mulsticom= wind.getElementsByTagName("INPUT")[4].checked;
saver();
setTimeout(function(){window.location.reload();},0);
}, true);
document.getElementById("dA_quick_img_pop_conf_can").addEventListener("click", function(){
document.getElementById("dA_quick_img_pop_conf").style.display="none";
}, true);
}else{
document.getElementById("dA_quick_img_pop_conf").style.display="block";
}
}
function saver(){
if(GM_setValue){
GM_setValue("gfavcount",gfavcount);
GM_setValue("gcomcount",gcomcount);
GM_setValue("gtimetick1",gtimetick1);
GM_setValue("gtimetick2",gtimetick2);
GM_setValue("mulsticom",mulsticom);
}else{
console.log("cookie!");
document.cookie = "gfavcount="+gfavcount+";gcomcount="+gcomcount+";gtimetick1="+gtimetick1+";gtimetick2="+gtimetick2+";mulsticom="+mulsticom+";";
}
}
function load(){
if(typeof GM_getValue !="undefined"){
if(GM_getValue("mulsticom")==""||typeof GM_getValue("mulsticom")=="undefined")return;
gfavcount= parseFloat(GM_getValue("gfavcount"));
gcomcount= parseFloat(GM_getValue("gcomcount"));
gtimetick1= parseFloat(GM_getValue("gtimetick1"));
gtimetick2= parseFloat(GM_getValue("gtimetick2"));
mulsticom= GM_getValue("mulsticom");
}else{
console.log("cookie!");
a=document.cookie;
if(a.search('gfavcount=')==-1)return;
gfavcount = parseFloat(a.substr(a.search('gfavcount=')+1,a.search(';')));
gcomcount = parseFloat(a.substr(a.search('gcomcount=')+1,a.search(';')));
gtimetick1 = parseFloat(a.substr(a.search('gtimetick1=')+1,a.search(';')));
gtimetick2 = parseFloat(a.substr(a.search('gtimetick2=')+1,a.search(';')));
mulsticom = (a.substr(a.search('mulsticom=')+1,a.search(';'))=="true");
}
}
load();
confmenu();
setInterval(start,1000);
})();