yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.23k stars 6.91k forks source link

Masked Input Upgrade #3196

Closed kartik-v closed 10 years ago

kartik-v commented 10 years ago

Upgrade masked input JQuery plugin to use this upgraded variant from Robin Herbots instead of Bush's version, as Robin's implementation allows more features including optional characters in the middle of the input. If needed I can submit a PR.

qiangxue commented 10 years ago

Could you help with a PR? Thanks!

kartik-v commented 10 years ago

Will work on a PR.

Wondering if this should be created as a separate yii2 extension - or retained in the widgets folder? Asking this because the newer plugin has more other options (and additional optional assets including extensions for date, time, phone etc.).

qiangxue commented 10 years ago

hmm, please hold on a moment. I think we need more discussion about this. @yiisoft/core-developers We are facing with this issue again: some core code depends on external js libs whose dependency is not managed by composer. Should we embrace bower?

pmoust commented 10 years ago

@qiangxue I worked a bit on adding a solution on that, the core devs did not like adding Bowerphp so I have 've come up with using packages via Composer from VCS tree. I don't like it though I believe the Bower solution would be much better. Check my closed PR on Bower, it is made that way that nodejs/bower is not needed, bowerphp is used instead.

pmoust commented 10 years ago

Link to the bowerphp PR https://github.com/yiisoft/yii2/pull/2965

kartik-v commented 10 years ago

+1 for bower support, if we can address dependency management with the composer packages.

pmoust commented 10 years ago

@kartik-v you could pull #3209 and work from there having by adding jquery.inputmask in your bower.json. Let's see how it would look like. Just my two cents.

kartik-v commented 10 years ago

@pmoust thanks ... will wait for an update from @yiisoft/core-developers on how they want to include this - before I start.

yudilee commented 10 years ago

I hope it could replace current masked input because current masked input have limited feature especially optional character in the middle of input

kartik-v commented 10 years ago

@qiangxue / @yiisoft/core-developers I have the extension created and ready. Currently the plugin assets were used locally to create the extension. Let me know how I should submit a PR

  1. with extension classes included within yii/widgets and all assets included within yii/assets
  2. or as a separate yii2 extension.
  3. or wait for decision on embracing bower
nkostadinov commented 10 years ago

+1 for bower. It will complete the dependency management with composer. They are not conflicting.

kartik-v commented 10 years ago

I submitted the PR #3225 with just ONE asset file jquery.inputmask.bundle.min.js replaced in the assets folder and exactly the same names for the MaskedInput and MaskedInputAsset classes. A demo of the upgraded plugin can be viewed HERE for review/test and merge.

If we decide on using bower or any other change to generating assets... will change the asset dependency accordingly.

kartik-v commented 10 years ago

Let know if this is ready for adoption. A few examples on the new widget to get started

samdark commented 10 years ago

@kartik-v is it a fork of original one we were using or totally new one? How stable it is? How supported i.e. is it updated often?

kartik-v commented 10 years ago

Its a new plugin. But its actually a fork and rewrite of Bush's version. It is updated periodically and till recently (as I see on github). I have not interacted with the plugin author personally though.