PDA

View Full Version : Ext.ux.Domino.LoginMenu



galdaka
25 Feb 2008, 3:46 AM
Hi,

Version 1.0b2 is up.

View video: http://rapidshare.com/files/94873269/test06.swf.html

Other widget: OutlinePlugin: http://extjs.com/forum/showthread.php?t=24813&highlight=outlineplugin

Greetings,

mdm-adph
25 Feb 2008, 8:18 AM
Neat code -- my test server requires you to be logged in to view anything, though, so all it does on my app is show an item that says "Cerrar sesi

galdaka
25 Feb 2008, 11:20 AM
The component detect If you are connected (Sessions enabled in Administrator - Domino Web Engine). If you have a sessionID cookie the component shows "Cerrar sesi

mdm-adph
25 Feb 2008, 11:58 AM
I'm ashamed to say that I sat there and watched that video for about 2 full minutes before I noticed that it was on a loop.

Makes sense -- it's a pretty good script.

galdaka
26 Feb 2008, 7:31 AM
Hi,

new versi

galdaka
27 Feb 2008, 8:28 AM
Hi,

Ext.ux.Domino.LoginMenu 1.0b1 in first post.

Greetings,

RWaters
27 Feb 2008, 9:30 AM
Hey, thanks for the contribution, definitely looks like a good start.

A couple of recommendations.

I like that you pulled out all of the text to separate variables, makes for dealing with mutliple languages a lot easier. Though pulling out all of the text strings to a separate file would be nice (like ext does). That way you could include the loginmenu.js and loginmenu-language-en.js or whatever and easily swap languages. You'd probably need to refer to them as Ext.ux.Domino.LoginMenu.someText rather than referring to the specific instance values.

The regex stuff for validation would make a perfect case for a custom VType, something like:


Ext.apply(Ext.form.VTypes, {
'loginusername': function(v) {
var re = /^[a-zA-Z0-9_ ]{5,16}$/;
return v.test(re);
},
'loginusernameText': Ext.ux.Domino.LoginMenu.loginUserNameText
});


In your listeners config sections, you can pass an additional param, 'scope: this' rather than wrap everything in createDelegate.


listeners: {
tabchange: function(tp, p) {
// stuff
},
scope: this
}



Thanks again for your contribution.

galdaka
27 Feb 2008, 1:31 PM
The regex stuff for validation would make a perfect case for a custom VType, something like:


Ext.apply(Ext.form.VTypes, {
'loginusername': function(v) {
var re = /^[a-zA-Z0-9_ ]{5,16}$/;
return v.test(re);
},
'loginusernameText': Ext.ux.Domino.LoginMenu.loginUserNameText
});


I will study how to do this. I have no experience in this case, but i will work in this for 1.1


In your listeners config sections, you can pass an additional param, 'scope: this' rather than wrap everything in createDelegate.


listeners: {
tabchange: function(tp, p) {
// stuff
},
scope: this
}


OK. tomorrow will change this question.

If you have any question, please post in this thread for make changes.

Greetings,

galdaka
28 Feb 2008, 6:51 AM
I

RWaters
28 Feb 2008, 7:23 AM
Good Point. Perhaps following the way ext locale files are set up, in the language file define the actual loginUserNameText property. Here's a snip from Ext and how they define the VTypes that come built-in.


if(Ext.form.VTypes){
Ext.apply(Ext.form.VTypes, {
emailText : 'Este campo debe ser una dirección de correo electrónico con el formato "usuario@dominio.com"',
urlText : 'Este campo debe ser una URL con el formato "http:/'+'/www.dominio.com"',
alphaText : 'Este campo sólo debe contener letras y _',
alphanumText : 'Este campo sólo debe contener letras, números y _'
});
}


So this way you could actually create the loginUserNameText section in the locale file and leave it out of the main loginmenu file.

galdaka
28 Feb 2008, 11:23 AM
OK. Thanks Rich.

New version with Multilanguage support and best code.

View ZIP file in first post.

Greetings,

dot.Scott
6 Mar 2008, 10:17 AM
Sorry for the noob question but how do you implement this code? I'm assuming that it goes in the extnd.nsf but where? At what point do you declare it? Again I'm sorry for the questions but I'm trying to generate a quick proof-of-concept and I need this done quickly. Also is this for extnd 2 only?

Any help would be greatly appreciated.

Thanks

juljupy
7 Mar 2008, 11:49 AM
Hi,

this is an example of how to use it:

new Ext.Toolbar[{
items:[{
text:'Login',
menu: new Ext.ux.Domino.LoginMenu()
}]
}];

Mike Amberg
7 Mar 2008, 12:05 PM
Stupid Question 2 ... were do we put that code ? ... in the main.html forms HTMLHeadContent?

mdm-adph
7 Mar 2008, 12:53 PM
You'd put it wherever you'd need that particular Ext component.

A good read: http://extjs.com/learn/Ext_1_to_2_Migration_Guide -- even if you're not upgrading to ExtJS 2 (what Extnd is built on) from version 1, this guide tells you all about how the "component" system of Ext 2.0 works. Once you've got it down, sticking things like Galdaka's login menu anywhere you want is trivial.

galdaka
7 Mar 2008, 12:57 PM
I don

ruso
8 Mar 2008, 6:11 AM
Hi there, I think that at the password vtype def where it reads "loginUserNameText" it should read "loginPasswordText"!


//DEFINE VTYPES
if (Ext.ux.Domino.LoginMenu){
Ext.apply(Ext.form.VTypes,{


loginUserNameText: Ext.ux.Domino.LoginMenu.prototype.loginUserNameText,
loginUserNameMask: /[a-z0-9_ ]/,
loginUserNameVal: /^[a-zA-Z0-9_ ]{5,16}$/,
loginUserName: function(v){
return this.loginUserNameVal.test(v);
},

loginPasswordText: Ext.ux.Domino.LoginMenu.prototype.loginUserNameText,
loginPasswordMask: /[a-zA-Z0-9]/,
loginPasswordVal: /^[a-zA-Z0-9_ ]{5,16}$/,
loginPassword: function(v){
return this.loginPasswordVal.test(v);
},

Muy bueno... Un saludo desde Argentina!

Mike Amberg
8 Mar 2008, 12:39 PM
Galdaka,

In your first post, I cannot see the Image (code section). Can you post a larger screenshot of the implementation code.

Thanks

galdaka
9 Mar 2008, 8:25 AM
Galdaka,

In your first post, I cannot see the Image (code section). Can you post a larger screenshot of the implementation code.

Thanks


menu: new Ext.ux.Domino.loginMenu(),

;)

galdaka
9 Mar 2008, 8:26 AM
Hi there, I think that at the password vtype def where it reads "loginUserNameText" it should read "loginPasswordText"!


//DEFINE VTYPES
if (Ext.ux.Domino.LoginMenu){
Ext.apply(Ext.form.VTypes,{


loginUserNameText: Ext.ux.Domino.LoginMenu.prototype.loginUserNameText,
loginUserNameMask: /[a-z0-9_ ]/,
loginUserNameVal: /^[a-zA-Z0-9_ ]{5,16}$/,
loginUserName: function(v){
return this.loginUserNameVal.test(v);
},

loginPasswordText: Ext.ux.Domino.LoginMenu.prototype.loginUserNameText,
loginPasswordMask: /[a-zA-Z0-9]/,
loginPasswordVal: /^[a-zA-Z0-9_ ]{5,16}$/,
loginPassword: function(v){
return this.loginPasswordVal.test(v);
},

Muy bueno... Un saludo desde Argentina!

Ei!! gracias por la correcci

bhaidaya
17 Mar 2008, 8:11 AM
Galdaka,
Nice plugin.. Please keep up the good work!

I finally got around to testing your plugin on one of my apps and it works great! i had one minor problem though with it.

I had to remove the .focus() in the showLoginWindow function... for some reason it would reset my window.

showLoginWindow: function(){
if (!this.userWindow){
this.init();
}
this.userWindow.show();
if(!this.showRegisterTab){Ext.getCmp('domino-login-tabPanel').hideTabStripItem(Ext.getCmp('domino-register-tab'))};
Ext.getCmp('domino-user-form').getForm().reset();
Ext.getCmp('domino-submit-button').setDisabled(true);
Ext.getCmp('domino-login-tabPanel').setActiveTab(Ext.getCmp('domino-login-tab'));
//Ext.getCmp('domino-login-userName').focus();
},

Some other feedback... you should make this work without so many .nsf references..
ieg. in connect: success:

url: window.location.href.toLowerCase().split('.nsf')[0] + '.nsf?OpenDatabase',
this bombs when looking for a connect response if it is '.html' or if the url doesn't have .nsf in it... (eg. http://www.example.com/)

Perhaps some config variables in the prototype for the .nsf stuff.

The only reason I mention it is because it is nice to have login capabilities without having .nsf in the url anywhere.. eg. when the site url never changes from http://www.example.com

also it should be optional to refresh the entire app after login/logout... and/or call a function specified

hope this helps...

bloon
3 Apr 2008, 6:47 PM
sorry for my english,

you've done great jobs for this. i already try the extension and it's authenticate to the domino server. what i am suggesting is:
this extension should have a cross domain ajax support. if this extension under the domino server itself, i think many domino developer would use the plain login form. cause it's simple and smaller in size. :D

so, what i've try is:

- add a cross domain ajax support in the extension from animal: http://extjs.com/forum/showthread.php?t=17691&highlight=cross+domain+ajax

- i change the connect method


urlconnect: function(){
Ext.Ajax.request({
url: 'http://dominoserver/names.nsf?login&RedirectTo=/mail/user.nsf/($inbox)?readviewentries',
last one, my suggestion is how to add config options like:
- domino server field
- RedirectTo field
to make this extension complete.

or anybody can help me.
keep the good works.

galdaka
4 Apr 2008, 4:58 AM
sorry for my english,

you've done great jobs for this. i already try the extension and it's authenticate to the domino server. what i am suggesting is:
this extension should have a cross domain ajax support. if this extension under the domino server itself, i think many domino developer would use the plain login form. cause it's simple and smaller in size. :D

so, what i've try is:

- add a cross domain ajax support in the extension from animal: http://extjs.com/forum/showthread.php?t=17691&highlight=cross+domain+ajax

- i change the connect method


urlconnect: function(){
Ext.Ajax.request({
url: 'http://dominoserver/names.nsf?login&RedirectTo=/mail/user.nsf/($inbox)?readviewentries',
last one, my suggestion is how to add config options like:
- domino server field
- RedirectTo field
to make this extension complete.

or anybody can help me.
keep the good works.

Is not a clean method for make. Read: http://extjs.com/forum/showthread.php?p=87194#post87194 (the response will have to be scripted to pass your XML...)

balungka
26 May 2008, 3:59 AM
Hi,

Version 1.0b2 is up.

View video: http://rapidshare.com/files/94873269/test06.swf.html

Other widget: OutlinePlugin: http://extjs.com/forum/showthread.php?t=24813&highlight=outlineplugin

Greetings,



thank

Sherri Taylor
9 Oct 2008, 5:04 PM
Is anyone reporting problem with downloading your zip file? I am getting message that the file is corrupted. Ideas? Thank you so much for this post!

galdaka
9 Oct 2008, 10:41 PM
Is anyone reporting problem with downloading your zip file? I am getting message that the file is corrupted. Ideas? Thank you so much for this post!

http://extjs.com/forum/showthread.php?p=204449#post204449

Greetings,

knarz
3 Dec 2008, 12:34 PM
Hi,

this is an example of how to use it:

new Ext.Toolbar[{
items:[{
text:'Login',
menu: new Ext.ux.Domino.LoginMenu()
}]
}];

this doenst work for me :(

Firebug tells me:
Ext.Toolbar[{items: [{text: "Login", menu: new (Ext.ux.Domino.LoginMenu)}]}] is not a constructor

but i included the js files correctly
<script src="js/ext/Ext.ux.Domino.LoginMenu.js" type="text/javascript" language="javascript"></script>
<script src="js/ext/Ext.ux.Domino.LoginMenu-fr.js" type="text/javascript" language="javascript"></script>

any ideas?

galdaka
3 Dec 2008, 3:08 PM
this doenst work for me :(

Firebug tells me:
Ext.Toolbar[{items: [{text: "Login", menu: new (Ext.ux.Domino.LoginMenu)}]}] is not a constructor

but i included the js files correctly
<script src="js/ext/Ext.ux.Domino.LoginMenu.js" type="text/javascript" language="javascript"></script>
<script src="js/ext/Ext.ux.Domino.LoginMenu-fr.js" type="text/javascript" language="javascript"></script>

any ideas?

Try:



menu: new Ext.ux.Domino.loginMenu(),



l in lowercase.

Greetings,