密码强度实现 ExtJS
我正在研究 ExtJS 的密码强度实现,并遇到了这个特定的实现,
这是使用 ExtJS 4 实现的,我希望将其与 ExtJS 3 一起使用。 我尝试了几种选择,但无法弄清楚太多。
请告诉我是否需要做一些特定的事情才能使其与 ExtJS 3 一起工作。
这是 此插件的 Github 链接(如果有帮助的话)。
I was looking at password strength implementations with ExtJS and came across this particular implementation,
A password strength meter for passwords for ExtJS4.
This is implemented using ExtJS 4 and i was looking to use it with ExtJS 3.
I tried a few options, but couldn't figure out much.
Please let me know if there is something specific i need to do in order to get it working with ExtJS 3.
Here is the Github link for this plugin if that would help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来很容易。您要做的就是使用相同的逻辑扩展 Ext.form.TextField 类。他们正在使用
onFieldChange
事件处理实际的“强度”,从我在文档中看到的内容来看,该事件在 Ext 3 中并不存在,但您可以轻松地使用keyup 执行相同操作: ( Ext.form.TextField this, Ext.EventObject e )
事件。查看源代码,发现它们定义了 2 个函数,
processValue
和scorePassword
。您可以直接复制这些函数,然后实现 keyup 函数来使用它们。您将创建该类:
这应该足以让您开始。
Seems easy enough. All you would do is extend the
Ext.form.TextField
class with that same logic. They are processing the actual 'strength' with theonFieldChange
event, which in Ext 3 doesn't exist from what I can see in the docs, but you could easily do the same with thekeyup : ( Ext.form.TextField this, Ext.EventObject e )
event.Take a look at the source and see that they define 2 functions,
processValue
andscorePassword
. You could copy those functions directly, and then implement the keyup function to use those.You would create the class:
That should be enough to get you started.
我将 Ext.ux.PasswordMeter 修改为与 Ext JS 4 兼容。这是代码:我的博客
请随时给我反馈。
I modified the Ext.ux.PasswordMeter to be Ext JS 4 compatible. Here is the code: my blog
please feel free to give me feedback.
在我的几个项目中我使用了这个小部件:
Ext.ux.PasswordMeter
效果很好,所以我想你也可以回顾一下。
In several my projects I used this widget:
Ext.ux.PasswordMeter
It worked well, so I think you can review it too.