cl("starting stafforg app ...");
// idb
+ //idb.name='stafforg';
+ //idb.del();
+ //return;
var stores={
'admin': db_admin_store
}
});
}
else {
+ $('#adminset').css('display','none');
+ $('#adminauth').css('display','block');
+ $('#adminmain').css('display','none');
+ $('#adminpw').each(function() {
+ cl("yep ...");
+ });
+ $('#adminpw').keyup(function() {
+ stafforg.verifypw(item.passwd);
+ });
}
});
},
if(pw1=='') {
$('#adminpw1').css('border-color','red');
- return
+ return;
}
else {
$('#adminpw1').css('border-color','black');
if(pw2=='') {
$('#adminpw2').css('border-color','grey');
- return
+ return;
}
if(pw1!=pw2) {
$('#adminpw2').css('border-color','red');
- return
+ return;
}
if(pw1==pw2) {
- alert("yep, i will store this password!");
+ var nitem={
+ passwd: pw1
+ };
+ idb.update_store_item('admin',1,nitem,function() {
+ cl("password '"+nitem.passwd+"' set!");
+ setTimeout(function() {
+ stafforg.admin_init();
+ },200);
+ });
+ return;
+ }
+ },
+ verifypw: function(passwd) {
+ cl("verify called!");
+ if($('#adminpw').val()!=passwd) {
+ $('#adminpw').css('border-color','red');
+ }
+ else {
+ alert("Thanks!");
}
+ return;
}
};