Minifying. See #24
Minifying. See #24

--- /dev/null
+++ b/Resources/Entropy.min.css
@@ -1,1 +1,1 @@
-
+.EntropyDiv{width:100%;height:400px;border-radius:5px;border:1px black solid;background:red;margin-bottom:20px}.EntropyGenerated{border:1px green solid;background:green}.EntropyDivClicking{background:white}

--- /dev/null
+++ b/Resources/main.min.js
@@ -1,1 +1,14 @@
+/* ************************************************************
+Author:  Ben Tasker - BenTasker.co.uk
+Description: Main Javascript functions for PHPCredLocker. Most 
+  functions currently quick and dirty, will improve in future releases!
 
+License: GNU GPL V2 -  See http://www.gnu.org/licenses/gpl-2.0.html
+
+Repo: https://github.com/bentasker/PHPCredLocker/
+---------------------------------------------------------------
+Copyright (c) 2012 Ben Tasker
+
+*/
+
+var counter=false,cancel="",dispcred,interval;function genPwd(c,b){var e,f="",d="(=?)+.,abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(e=0;e<b;e++){f+=d.charAt(Math.floor(Math.random()*d.length))}if(c=="r"){return f}document.getElementById(c).value=f}function resizebkgrnd(){var width=document.documentElement.clientHeight,height=width,img;img=document.getElementById("ContentWrap");img.style.minHeight=eval(height*0.8)+"px"}function CreateMenuContent(b,i,f,j,e,k){var g,d,m,h,c=0,b=document.getElementById(b),l=document.getElementById(f);if(!l){return false}for(var a=0;a<l.rows.length;a++){if(c==e){break}d=l.rows[a].cells[3].innerHTML;if(d==i){m=document.createElement("li");m.id=k+l.rows[a].cells[2].innerHTML;m.innerHTML="<a href='index.php?option="+l.rows[a].cells[5].innerHTML+"&id="+l.rows[a].cells[2].innerHTML+"'>"+l.rows[a].cells[j].innerHTML+"</a>";b.appendChild(m);c=c+1}}}function Credtimer(d){var b,a=document.getElementById("PassCount"+d),c=document.getElementById("retrievePassword"+d);b=a.value-1;a.value=b;if(b<=0||cancel==1){clearInterval(counter);c.innerHTML="Display Password";document.getElementById("Address"+d).innerHTML="";document.getElementById("UserName"+d).innerHTML="";document.getElementById("Password"+d).innerHTML="";document.getElementById("CredPluginOutput"+d).innerHTML="";document.getElementById("clickCount"+d).value=0;return}c.innerHTML="Displaying Password for "+b+" seconds"}function noCredTypes(){$(document).ready(function(){var a;if(document.getElementById("AddCredBtnTop")){a=document.getElementById("AddCredBtnTop");a.parentNode.removeChild(a)}if(document.getElementById("AddCredBtnBottom")){a=document.getElementById("AddCredBtnBottom");a.parentNode.removeChild(a)}})}function loginReqProcess(){var c,b="",e=document.getElementById("FrmPassPlace"),d=document.getElementById("FrmPass");if(!enabledEncryption()){d.value=e.value;return true}d.value=Base64.encode(xorestr(e.value,retAuthKey()));for(c=0;c<e.length;c++){b+="a"}e.value=b;return true}function checkNewCust(){var d=document.getElementById("FrmName"),b=document.getElementById("frmGroup"),c=document.getElementById("FrmEmail");if(c.value.indexOf("@")==-1){c.className+=" frmEntryMissed";return false}if(b.options[b.selectedIndex].value=="null"){b.className+=" frmEntryMissed";return false}if(d.value==""){d.className+=" frmEntryMissed";return false}if(enabledEncryption()){var e=document.getElementById("FrmconName"),a=document.getElementById("FrmSurname");d.value=Base64.encode(xorestr(d.value,retKey()));c.value=Base64.encode(xorestr(c.value,retKey()));e.value=Base64.encode(xorestr(e.value,retKey()));a.value=Base64.encode(xorestr(a.value,retKey()))}return true}function checkNewCred(){var c=document.getElementById("frmCredential"),b=document.getElementById("frmUser"),d=document.getElementById("frmAddress"),a=document.getElementById("frmGroup");if(a.options[a.selectedIndex].value=="null"){a.className+=" frmEntryMissed";return false}if(c.value.indexOf("http")!==-1){if(confirm("Click OK to make this credential a hyperlink in the database, click cancel to set not clicky")){document.getElementById("frmClicky").value=1}}if(enabledEncryption()){c.value=Base64.encode(xorestr(c.value,retKey()));b.value=Base64.encode(xorestr(b.value,retKey()));d.value=Base64.encode(xorestr(d.value,retKey()))}return true}function checkEditCred(){var c=document.getElementById("frmCredential"),b=document.getElementById("frmUser"),d=document.getElementById("frmAddress"),a=document.getElementById("frmGroup");if(a.options[a.selectedIndex].value=="null"){a.className+=" frmEntryMissed";return false}if(c.value.indexOf("http")!==-1){if(confirm("Click OK to make this credential a hyperlink in the database, click cancel to set not clicky")){document.getElementById("frmClicky").value=1}}if(c.value==null||c.value==""){c.value=" "}if(b.value==null||b.value==""){b.value=" "}if(d.value==null||d.value==""){d.value=" "}if(enabledEncryption()){c.value=Base64.encode(xorestr(c.value,retKey()));b.value=Base64.encode(xorestr(b.value,retKey()));d.value=Base64.encode(xorestr(d.value,retKey()))}return true}function checkChngPwds(){if(!comparePwds()){return false}if(!enabledEncryption()){return true}var a=document.getElementById("frmPass"),b=document.getElementById("frmPassConf");a.value=Base64.encode(xorestr(a.value,retKey()));b.value=Base64.encode(xorestr(b.value,retKey()));return true}function comparePwds(){var f,g,d,c=document.getElementById("frmPass"),b=document.getElementById("PassNoMatch"),e=document.getElementById("passScore"),a=document.getElementById("minpassStrength");if(a){f=a.value;if(f.indexOf("+")>=0){if(parseInt(passScore.value)>45){g=true}else{g=false}}else{d=f.split("-");if((parseInt(passScore.value)>d[0])){g=true}else{g=false}}if(!g){b.innerHTML="Password is too weak";b.style.display="inline-block";return false}}if(c.value!=document.getElementById("frmPassConf").value){b.innerHTML="Passwords don't match";b.style.display="inline-block";return false}if(c.value==null||c.value==""){document.getElementById("PassNoMatch").innerHTML="You must set a password";b.style.display="inline-block";return false}b.style.display="none";return true}function getCreds(a){var b,e,f,d,i,g,k=document.getElementById("retrievePassword"+a),h=document.getElementById("Address"+a),l=document.getElementById("UserName"+a),c=document.getElementById("Password"+a),n=document.getElementById("CredPluginOutput"+a),m=retKey(),j=document.getElementById("clickCount"+a);if(j.value!=0){return}j.value=1;k.innerHTML="<i>Retrieving.....</i>";if(window.XMLHttpRequest){b=new XMLHttpRequest()}else{b=new ActiveXObject("Microsoft.XMLHTTP")}b.onreadystatechange=function(){if(b.readyState==4&&b.status==200){e=decryptAPIResp(b.responseText,m).split(getDivider());if(e[1]==2){return unknownAPICommand()}if(e[1]==0){k.innerHTML="Failed to retrieve credentials. Click to try again";return false}f=document.getElementById("defaultInterval").value;d=document.getElementById("PassCount"+a);d.value=f;i=f;h.innerHTML=e[3];c.innerHTML=e[2];l.innerHTML=e[4];n.innerHTML=e[5];k.innerHTML="Displaying Password for "+i+" seconds";if(counter){cancel=1;document.getElementById("clickCount"+dispcred).value=0;dispcred=a;setTimeout(function(){cancel=false;counter=setInterval("Credtimer('"+a+"')",1000)},1000);return}dispcred=a;counter=setInterval("Credtimer('"+a+"')",1000)}};g=cryptReq("retCred");b.open("POST","api.php",true);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.send("option="+g+"&id="+a)}function checkSession(){var b,e,d,c,a=retKey();if(window.XMLHttpRequest){b=new XMLHttpRequest()}else{b=new ActiveXObject("Microsoft.XMLHTTP")}b.onreadystatechange=function(){if(b.readyState==4&&b.status==200){e=decryptAPIResp(b.responseText,a).split(getDivider());if(e[1]==2){return unknownAPICommand()}if(e[1]==0){d=document.cookie.split(";");for(var f=0;f<d.length;f++){KillCookie(d[f].split("=")[0])}window.location.href="index.php?notif=InvalidSession";return false}}};c=cryptReq("checkSess");b.open("POST","api.php",true);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.send("option="+c+"&id="+Math.floor((Math.random()*100)+1))}function DelCust(h){var c,f,g,b,d,a=retKey();if(!confirm("Are you sure you want to delete this customer and all associated credentials?")){return false}g=document.getElementById("CustDisp"+h);b=document.getElementById("NotificationArea");if(document.getElementById("Custmenu"+h)){var e=document.getElementById("Custmenu"+h)}if(window.XMLHttpRequest){c=new XMLHttpRequest()}else{c=new ActiveXObject("Microsoft.XMLHTTP")}c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){f=decryptAPIResp(c.responseText,a).split(getDivider());if(f[1]==2){return unknownAPICommand()}if(f[1]==0||f[2]==0){b.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}g.parentNode.removeChild(g);b.innerHTML+='<div class="alert alert-success">Customer and all associated credentials Deleted</div>';if(e){e.parentNode.removeChild(e)}}};d=cryptReq("delCust");c.open("POST","api.php",true);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.send("option="+d+"&id="+h)}function DelCred(g){var c,e,f,b,d,a=retKey();if(!confirm("Are you sure you want to delete this credential?")){return false}f=document.getElementById("CredDisp"+g);b=document.getElementById("NotificationArea");if(window.XMLHttpRequest){c=new XMLHttpRequest()}else{c=new ActiveXObject("Microsoft.XMLHTTP")}c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){e=decryptAPIResp(c.responseText,a).split(getDivider());if(e[1]==2){return unknownAPICommand()}if(e[1]==0||e[2]==0){b.innerHTML+='<div class="alert alert-error">Failed to Delete</div>';return false}f.parentNode.removeChild(f);b.innerHTML+='<div class="alert alert-success">Credential Deleted</div>'}};d=cryptReq("delCred");c.open("POST","api.php",true);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.send("option="+d+"&id="+g)}function positionResults(SearchBox,ResBox){var search=document.getElementById(SearchBox),res=document.getElementById(ResBox);res.style.left=search.offsetLeft+"px";res.style.top=eval(search.offsetTop+search.offsetHeight+6)+"px";res.style.width=search.offsetWidth+"px"}function SearchTable(c,f,d,k,i){var l,g,o,j,h=0,b,p,n,a,m=0;if(window.event){m=window.event.keyCode}else{if(i.which){m=i.which}}if(m===38){selectResult("up");return}if(m===40){selectResult("down");return}l=document.getElementById(d);l.innerHTML="";if(c.length<3){return}document.getElementById("SelectedValue").value=0;positionResults("SearchBox",d);g=c.toLowerCase();o=document.getElementById(f);for(a=0;a<o.rows.length;a++){p=o.rows[a].cells[k].innerHTML.replace(/<[^>]+>/g,"");if((p.toLowerCase().indexOf(g)>=0)||((g.indexOf(":")>=0)&&(o.rows[a].cells[1].innerHTML.toLowerCase().indexOf(g)>=0))){h=h+1;j=document.createElement("div");j.id="SearchResult"+h;j.className="SearchResult";j.setAttribute("link",o.rows[a].cells[5].innerHTML);j.setAttribute("entID",o.rows[a].cells[2].innerHTML);if(o.rows[a].cells[4].innerHTML!=null&&o.rows[a].cells[4].innerHTML!=""){b=o.rows[a].cells[4].innerHTML}else{b="id"}if(o.rows[a].cells[6]){n="&"+o.rows[a].cells[6].innerHTML}else{n=""}j.setAttribute("onclick","window.location.href = 'index.php?option="+o.rows[a].cells[5].innerHTML+"&"+b+"="+o.rows[a].cells[2].innerHTML+n+"';");j.setAttribute("frmName",b);j.innerHTML=o.rows[a].cells[1].innerHTML+" "+o.rows[a].cells[k].innerHTML;l.appendChild(j);l.style.display="block"}}}function selectResult(dir){var ind,SearchResult,SelIndex=document.getElementById("SelectedValue"),SearchLength=document.getElementById("SearchResBox").childNodes.length;if(dir=="down"){if(SelIndex.value!=0){document.getElementById("SearchResult"+parseInt(SelIndex.value)).className="SearchResult"}if(SearchLength==SelIndex.value){SelIndex.value=0}ind=eval(parseInt(SelIndex.value)+1)}else{document.getElementById("SearchResult"+parseInt(SelIndex.value)).className="SearchResult";if(SelIndex.value==1){ind=SearchLength}else{ind=eval(parseInt(SelIndex.value)-1)}}SearchResult=document.getElementById("SearchResult"+ind);SearchResult.className="SearchResult SearchResultActive";SelIndex.value=ind;document.getElementById("SrchOpt").value=SearchResult.getAttribute("link");document.getElementById("SrchID").name=SearchResult.getAttribute("frmName");document.getElementById("SrchID").value=SearchResult.getAttribute("entID");document.getElementById("SearchBox").focus()}function hideSearchDiv(a){var b=document.getElementById(a);for(opacity=10;opacity>0;opacity--){b.style.opacity="0."+opacity}b.style.display="none";b.style.opacity="1"}function checkExistingSearch(a,b){if(a.length>3){document.getElementById(b).style.display="block"}}function setUpMenus(){jQuery(document).ready(function(){if(!document.getElementById("SearchListing")){return}var b,a;CreateMenuContent("TypeDropDownMenu",2,"SearchListing",0,100,"TypeMenu");CreateMenuContent("CustDropDownMenu",1,"SearchListing",0,5,"Custmenu");b=document.getElementById("CustDropDownMenu");a=document.createElement("li");a.className="divider";b.appendChild(a);a=document.createElement("li");a.className="viewAll";a.innerHTML="<a href='index.php?option=viewCustomers'>View All</a></li>";b.appendChild(a)})}function xorestr(j,g){if(!enabledEncryption()){return j}var d,c,e="",h=0;for(var f=0;f<j.length;f++){d=j.charCodeAt(f);c=d^g.charCodeAt(h);e+=c.toString()+" ";h++;if(h>=g.length){h=0}}return e}function xordstr(j,g){if(!enabledEncryption()){return j}var d,c,e="",h=0,j=j.split(" ");for(var f=0;f<j.length;f++){if(j[f].length==0){continue}d=j[f];c=d^g.charCodeAt(h);e+=String.fromCharCode(c);h++;if(h>=g.length){h=0}}return e}function unknownAPICommand(){var a,d,c,e,b;a=document.getElementById("kFile");d=a.getAttribute("src");c=a.parentNode;b=document.getElementById("NotificationArea");clearInterval(sesscheck);b.innerHTML+="<div id='apiError' class='alert alert-error'>API Error Detected</div>";if(!enabledEncryption()){return}if(!confirm("The API reported an error, attempting to rectify. Click OK to try and rectify")){return}b.removeChild(document.getElementById("apiError"));b.innerHTML="<div id='apiError' class='alert alert-info'>Attempting to rectify API issue. Window will refresh when ready</div>";destroyKeys();c.removeChild(a);e=document.createElement("iframe");e.setAttribute("id","kfile");e.setAttribute("src",d);e.style.width="0px";e.style.height="0px";e.style.border="0px";document.body.appendChild(e);interval=setInterval("reloadKeyf('"+d+"')",500)}function reloadKeyf(c){var d,a,b;clearInterval(interval);d=document.getElementById("kfile");d.contentWindow.document.cookie="PHPCredLockerKeySet=0;";d.parentNode.removeChild(d);a=new Date();d=document.createElement("script");d.setAttribute("id","kFile");d.setAttribute("src",c+a.getTime());document.getElementsByTagName("head")[0].appendChild(d);if(window.getKey!=""){b=document.getElementById("apiError");b.parentNode.removeChild(b);sesscheck=setInterval("checkSession()",120000)}}function decryptAPIResp(b,a){if(!enabledEncryption()){return b}return Base64.decode(xordstr(Base64.decode(b),a))}function getDivider(){return getDelimiter()}function getTerms(b){return Base64.decode(getTerminology(b))}function cryptReq(c){var a,b=retKey(),d=getDivider();a=genPadding()+d+getTerms(c)+d+genPadding();if(!enabledEncryption()){return a}return encodeURIComponent(Base64.encode(xorestr(Base64.encode(a),b)))}function genPadding(){if(!enabledEncryption()){return"a"}var d,e,b="";e=Math.random().toString(10).substring(2,3);for(d=0;d<e;d++){b+=Math.random().toString(10).substring(Math.random().toString(10).substring(2,3))}return b}function retAuthKey(){return Base64.decode(getAuthKey())}function retKey(){return Base64.decode(getKey())}function checkKeyAvailable(){if(typeof getKey!="function"){if(confirm("Key retrieval failed - Attempting to rectify, Click OK to continue - Screen will refresh")){var a,b=document.cookie.split(";");for(a=0;a<b.length;a++){KillCookie(b[a].split("=")[0])}window.location.href=location.reload();return false}}return true}function KillCookie(a){createCookie(a,"",-1)}function createCookie(d,e,b){var a,c;if(b){c=new Date();c.setTime(c.getTime()+(b*24*60*60*1000));a="; expires="+c.toGMTString()}else{a=""}document.cookie=d+"="+e+a+"; path=/"};