|
|
|
@@ -1,6 +1,8 @@
|
|
|
|
|
(function(){
|
|
|
|
|
var ns = __namespace( "Astro.Blog.Layout.Login" );
|
|
|
|
|
|
|
|
|
|
/** @type {System.Cycle} */
|
|
|
|
|
var Cycle = __import( "System.Cycle" );
|
|
|
|
|
/** @type {System.utils.IKey} */
|
|
|
|
|
var IKey = __import( "System.utils.IKey" );
|
|
|
|
|
/** @type {Components.MessageBox} */
|
|
|
|
@@ -19,6 +21,7 @@
|
|
|
|
|
var conf = config.get( "Login" );
|
|
|
|
|
|
|
|
|
|
var sHeat = conf.sHeat || "";
|
|
|
|
|
var sTTR = conf.sTTR || 0;
|
|
|
|
|
var formAction = conf.formAct || "./";
|
|
|
|
|
|
|
|
|
|
var field_username = new IKey( "name", "username" );
|
|
|
|
@@ -27,24 +30,34 @@
|
|
|
|
|
var init = function ()
|
|
|
|
|
{
|
|
|
|
|
var username;
|
|
|
|
|
var form = Dand.wrapne('form'
|
|
|
|
|
var sTTRe;
|
|
|
|
|
var form = Dand.wrapne("form"
|
|
|
|
|
, [
|
|
|
|
|
// Basic login and password fields
|
|
|
|
|
, Dand.wrapc("flsf", "Name:")
|
|
|
|
|
, username = Dand.wrapna('input', [ field_username, new IKey("type", "text") ] )
|
|
|
|
|
, username = Dand.wrapna("input", [ field_username, new IKey("type", "text") ] )
|
|
|
|
|
|
|
|
|
|
, Dand.wrapc("flsf", "Password:")
|
|
|
|
|
, Dand.wrapna('input', [ field_password, new IKey("type", "password") ] )
|
|
|
|
|
, Dand.wrapna("input", [ field_password, new IKey("type", "password") ] )
|
|
|
|
|
|
|
|
|
|
, Dand.wrapc('msg', Dand.wrap('sub', null, sHeat.toLowerCase(), sHeat))
|
|
|
|
|
, sTTRe = Dand.wrap( "span", null, "sttr", PrintTTR( sTTR ) )
|
|
|
|
|
, Dand.wrapc( "msg", Dand.wrap("sub", null, sHeat.toLowerCase(), sHeat ) )
|
|
|
|
|
]
|
|
|
|
|
, [
|
|
|
|
|
// Form attributes
|
|
|
|
|
new IKey('action', formAction)
|
|
|
|
|
, new IKey('method', 'POST')
|
|
|
|
|
new IKey("action", formAction)
|
|
|
|
|
, new IKey("method", "POST")
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if( 0 < sTTR )
|
|
|
|
|
{
|
|
|
|
|
Cycle.perma( "STTR", function()
|
|
|
|
|
{
|
|
|
|
|
if( 0 < sTTR -- ) sTTRe.innerHTML = PrintTTR( sTTR );
|
|
|
|
|
}, 1000 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var mbox = new MessageBox( "Blog.Astro", form, "Login", false, submitForm.bind( form ) ).show();
|
|
|
|
|
|
|
|
|
|
username.focus();
|
|
|
|
@@ -59,6 +72,13 @@
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var PrintTTR = function ( s )
|
|
|
|
|
{
|
|
|
|
|
if( s <= 0 ) return "";
|
|
|
|
|
|
|
|
|
|
return "You are locked for " + s + "s, further login attempts will result in time-reset until the lock is released";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var submitForm = function (bool) {
|
|
|
|
|
if ( bool )
|
|
|
|
|
{
|
|
|
|
|