// parseUri 1.2.2 // (c) Steven Levithan // MIT License // http://blog.stevenlevithan.com/archives/parseuri function parseUri (str) { var o = parseUri.options, m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), uri = {}, i = 14; while (i--) uri[o.key[i]] = m[i] || ""; uri[o.q.name] = {}; uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { if ($1) uri[o.q.name][$1] = $2; }); return uri; }; parseUri.options = { strictMode: false, key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], q: { name: "queryKey", parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, parser: { strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ } }; if (!String.prototype.trim) { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); }; } // Array Remove - By John Resig (MIT Licensed) // http://stackoverflow.com/questions/500606/javascript-array-delete-elements Array.prototype.remove = function(from, to) { var rest = this.slice((to || from) + 1 || this.length); this.length = from < 0 ? this.length + from : from; return this.push.apply(this, rest); }; Element.prototype.removeAllChilds = function() { while (this.hasChildNodes()) this.removeChild(this.childNodes[0]); }; function _generate_random(size, symbols) { forbidden = new Array('\\'); var res = ""; while (res.length < size) { a = Math.floor(Math.random() * (symbols.length/2)) * 2; diff = symbols[a+1] - symbols[a]; r = Math.floor(Math.random()*diff); if (isNaN(r+symbols[a])) continue; character = String.fromCharCode(r + symbols[a]); forbid = false; for (var j=0; j { button.value = old_value; }, 2000); } else alert("Entry updated"); }); } async function update_masterkey() { var url = ""; var login = ""; var password = ""; var mkey = ""; var ciphered_login; oldmkey = document.getElementById("oldmkey").value; newmkey = document.getElementById("newmkey").value; if (newmkey == "" || oldmkey == "") { alert("Cannot set an empty masterkey"); return; } if(!confirm("Are you sure want to update the masterkey ?")) return; oldmkey = derive_mkey(current_user, oldmkey); old_global_iv = global_iv; current_mkey = derive_mkey(current_user, newmkey); new_global_iv = global_iv; var found = 0; for(i=0; i { button.value = old_value; }, 2000); } else alert('Password copied into clipboard'); break; } } } function makeText(text) { var data = new Blob([text], {type: 'application/xml'}); textFile = window.URL.createObjectURL(data); // returns a URL you can use as a href return textFile; }; var text_link = null; function export_database() { startClearTimer(); link = document.getElementById("export_link"); if (text_link != null) window.URL.revokeObjectURL(text_link); text = "\n"; for(i=0; i\n"; text += "\t\t\n"; text += "\t\t", "]]\\>", "g") + "]]>\n"; text += "\t\n" } text += "\n"; text_link = makeText(text); link.href = text_link; link.style.display = "inline"; link.style.visibility = "visible"; alert_msg = "Click on download link to get all current unciphered passwords\n\n"; alert_msg += "\"]]>\" sequence has been replaced by \"]]\\>\""; alert(alert_msg); }