[JBoss JIRA] (RF-12936) Use jQuery in non-conflicting way
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/RF-12936?page=com.atlassian.jira.plugin.s... ]
Lukáš Fryč commented on RF-12936:
---------------------------------
Note that all occurences of jQuery reference would need to be replaced,
and this does not count with external libraries (e.g. jQuery UI).
> Use jQuery in non-conflicting way
> ---------------------------------
>
> Key: RF-12936
> URL: https://issues.jboss.org/browse/RF-12936
> Project: RichFaces
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: core
> Affects Versions: 4.3.1
> Reporter: Lukáš Fryč
>
> The {{richfaces.js}} references both, {{jQuery}} from closure and global {{$}} - this issue is addressed in RF-12833.
> However jQuery should not be used directly, rather from closures - prefered way is to use {{$}} but its naming now conflicts with {{RichFaces.$}} for component references.
> I suggest to use following trick:
> {code:title=richfaces.js}
> RichFaces.jQuery = RichFaces.jQuery || jQuery;
> //encapsulation
> (function($, RichFaces) {
> // free to use $ here
> }(RichFaces.jQuery, RichFaces));
> {code}
> It will allow:
> * provide own jQuery for RichFaces
> * use libraries which make use of {{$}} (prototype, other jQuery versions) in no-conflicting way
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] (RF-12936) Use jQuery in non-conflicting way
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/RF-12936?page=com.atlassian.jira.plugin.s... ]
Lukáš Fryč updated RF-12936:
----------------------------
Description:
The {{richfaces.js}} references both, {{jQuery}} from closure and global {{$}} - this issue is addressed in RF-12833.
However jQuery should not be used directly, rather from closures - prefered way is to use {{$}} but its naming now conflicts with {{RichFaces.$}} for component references.
I suggest to use following trick:
{code:title=richfaces.js}
RichFaces.jQuery = RichFaces.jQuery || jQuery;
//encapsulation
(function($, RichFaces) {
// free to use $ here
}(RichFaces.jQuery, RichFaces));
{code}
It will allow:
* provide own jQuery for RichFaces
* use libraries which make use of {{$}} (prototype, other jQuery versions) in no-conflicting way
was:
The {{richfaces.js}} references both, {{jQuery}} from closure and global {{$}} - this issue is addressed in Rf-12833.
However jQuery should not be used directly, rather from closures - prefered way is to use {{$}} but its naming now conflicts with {{RichFaces.$}} for component references.
I suggest to use following trick:
{code:title=richfaces.js}
RichFaces.jQuery = RichFaces.jQuery || jQuery;
//encapsulation
(function($, RichFaces) {
}(RichFaces.jQuery, RichFaces));
{code}
It will allow:
* provide own jQuery for RichFaces
* use libraries which make use of {{$}} (prototype, other jQuery versions) in no-conflicting way
> Use jQuery in non-conflicting way
> ---------------------------------
>
> Key: RF-12936
> URL: https://issues.jboss.org/browse/RF-12936
> Project: RichFaces
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: core
> Affects Versions: 4.3.1
> Reporter: Lukáš Fryč
>
> The {{richfaces.js}} references both, {{jQuery}} from closure and global {{$}} - this issue is addressed in RF-12833.
> However jQuery should not be used directly, rather from closures - prefered way is to use {{$}} but its naming now conflicts with {{RichFaces.$}} for component references.
> I suggest to use following trick:
> {code:title=richfaces.js}
> RichFaces.jQuery = RichFaces.jQuery || jQuery;
> //encapsulation
> (function($, RichFaces) {
> // free to use $ here
> }(RichFaces.jQuery, RichFaces));
> {code}
> It will allow:
> * provide own jQuery for RichFaces
> * use libraries which make use of {{$}} (prototype, other jQuery versions) in no-conflicting way
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] (RF-12833) richfaces.js conflicts with prototype.js
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/RF-12833?page=com.atlassian.jira.plugin.s... ]
Lukáš Fryč updated RF-12833:
----------------------------
Description:
Getting some javascript errors on richfaces.js.
Upon inspection, it is using
{code}
(function(jQuery, richfaces) {
...
{code}
instead of
{code}
(function($, richfaces) {
...
{code}
was:
Getting some javascript errors on richfaces.js.
Upon inspection, it is using
(function(jQuery, richfaces) {
...
instead of
(function($, richfaces) {
...
> richfaces.js conflicts with prototype.js
> ----------------------------------------
>
> Key: RF-12833
> URL: https://issues.jboss.org/browse/RF-12833
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-a4j-core
> Affects Versions: 4.3.1
> Reporter: Mark Torres
> Fix For: 5-Tracking
>
> Attachments: RF-12833.patch
>
>
> Getting some javascript errors on richfaces.js.
> Upon inspection, it is using
> {code}
> (function(jQuery, richfaces) {
> ...
> {code}
> instead of
> {code}
> (function($, richfaces) {
> ...
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] (RF-12936) Use jQuery in non-conflicting way
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/RF-12936?page=com.atlassian.jira.plugin.s... ]
Lukáš Fryč updated RF-12936:
----------------------------
Description:
The {{richfaces.js}} references both, {{jQuery}} from closure and global {{$}} - this issue is addressed in Rf-12833.
However jQuery should not be used directly, rather from closures - prefered way is to use {{$}} but its naming now conflicts with {{RichFaces.$}} for component references.
I suggest to use following trick:
{code:title=richfaces.js}
RichFaces.jQuery = RichFaces.jQuery || jQuery;
//encapsulation
(function($, RichFaces) {
}(RichFaces.jQuery, RichFaces));
{code}
It will allow:
* provide own jQuery for RichFaces
* use libraries which make use of {{$}} (prototype, other jQuery versions) in no-conflicting way
> Use jQuery in non-conflicting way
> ---------------------------------
>
> Key: RF-12936
> URL: https://issues.jboss.org/browse/RF-12936
> Project: RichFaces
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: core
> Affects Versions: 4.3.1
> Reporter: Lukáš Fryč
>
> The {{richfaces.js}} references both, {{jQuery}} from closure and global {{$}} - this issue is addressed in Rf-12833.
> However jQuery should not be used directly, rather from closures - prefered way is to use {{$}} but its naming now conflicts with {{RichFaces.$}} for component references.
> I suggest to use following trick:
> {code:title=richfaces.js}
> RichFaces.jQuery = RichFaces.jQuery || jQuery;
> //encapsulation
> (function($, RichFaces) {
> }(RichFaces.jQuery, RichFaces));
> {code}
> It will allow:
> * provide own jQuery for RichFaces
> * use libraries which make use of {{$}} (prototype, other jQuery versions) in no-conflicting way
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months