You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Alexandru Objelean (JIRA)" <ji...@apache.org> on 2007/08/28 09:27:34 UTC

[jira] Updated: (WICKET-898) JS namespace pollution in wicket-extensions

     [ https://issues.apache.org/jira/browse/WICKET-898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandru Objelean updated WICKET-898:
--------------------------------------

    Description: 
1. Any widget (javascript file) from wicket-extension should not pollute the window namespace (do not create simple function with fancy long names). For instance, palette.js contains paletteResolve, paletteChoicesOnFocus, paletteAdd, etc.. which is not recommended for best practices. I suggest to use closures for this and use namespace for each widget. 
    As a result, you will have something like this: Wicket.Extensions.Palette.paletteAdd() etc.. for public js methods, while private methods would not be visible due to closure scope. (Module Pattern: http://yuiblog.com/blog/2007/06/12/module-pattern/)

2. Have some sort of convention for namespacing widgets. For instance, 
* modal.js use:  Wicket.Iframe
* progressbar.js use: wupb
* palette.js do not use at all namespace...

I propose to use it the same way for all widgets. And the most suitable namespace would be: Wicket.Extensions....

Thank you!


  was:
1. Any widget (javascript file) from wicket-extension should not pollute the window namespace (do not create simple function with fancy long names). For instance, palette.js contains paletteResolve, paletteChoicesOnFocus, paletteAdd, etc.. which is not recommended for best practices. I suggest to use closures for this and use namespace for each widget. 
    As a result, you will have something like this: Wicket.Extensions.Palette.paletteAdd() etc.. for public js methods, while private methods would not be visible due to closure scope. (Module Pattern: http://yuiblog.com/blog/2007/06/12/module-pattern/)

2. Have some sort of convention for namespacing widgets. For instance, 
* modal.js use:  Wicket.Iframe
* progressbar.js use: wupb
* palette.js do not use at all namespace...

I propose to use it the same way for all widgets. And the most suitable namespace would be: Wicket.Extension.....

Thank you!



> JS namespace pollution in wicket-extensions 
> --------------------------------------------
>
>                 Key: WICKET-898
>                 URL: https://issues.apache.org/jira/browse/WICKET-898
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.3.0-final
>            Reporter: Alexandru Objelean
>             Fix For: 1.3.0-final
>
>
> 1. Any widget (javascript file) from wicket-extension should not pollute the window namespace (do not create simple function with fancy long names). For instance, palette.js contains paletteResolve, paletteChoicesOnFocus, paletteAdd, etc.. which is not recommended for best practices. I suggest to use closures for this and use namespace for each widget. 
>     As a result, you will have something like this: Wicket.Extensions.Palette.paletteAdd() etc.. for public js methods, while private methods would not be visible due to closure scope. (Module Pattern: http://yuiblog.com/blog/2007/06/12/module-pattern/)
> 2. Have some sort of convention for namespacing widgets. For instance, 
> * modal.js use:  Wicket.Iframe
> * progressbar.js use: wupb
> * palette.js do not use at all namespace...
> I propose to use it the same way for all widgets. And the most suitable namespace would be: Wicket.Extensions....
> Thank you!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.