Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem including Prototype Library
Problem including Prototype Library [message #546236] Mon, 12 July 2010 09:14 Go to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi,

to simplify working in JS, I want to include the Prototype JS Library in
our project.
Before you tell me, I can use qooxdoo for all the stuff prototype can
do, let me say, I have been using prototype for quite some time now and
I want to keep using it.

The Problem is, as soon as I include it (using an IResource), I get an
JS-error "$ is not a function element = $(element);" in the
Firebug-console and I cannot use prototype.
The strange thing is, when I start my application with
"-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone and
prototype works.
Maybe the minimized qooxdoo-version messes around with $ ?

Any experience with that?

Regards,
Philipp
Re: Problem including Prototype Library [message #546261 is a reply to message #546236] Mon, 12 July 2010 10:32 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Philipp,

you could try to include the prototype library without compression:
public final RegisterOptions getOptions() {
return RegisterOptions.VERSION;
}

HTH,
Ivan

On 07/12/2010 12:14 PM, Philipp Leusmann wrote:
> Hi,
>
> to simplify working in JS, I want to include the Prototype JS Library
> in our project.
> Before you tell me, I can use qooxdoo for all the stuff prototype can
> do, let me say, I have been using prototype for quite some time now
> and I want to keep using it.
>
> The Problem is, as soon as I include it (using an IResource), I get an
> JS-error "$ is not a function element = $(element);" in the
> Firebug-console and I cannot use prototype.
> The strange thing is, when I start my application with
> "-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone
> and prototype works.
> Maybe the minimized qooxdoo-version messes around with $ ?
>
> Any experience with that?
>
> Regards,
> Philipp
Re: Problem including Prototype Library [message #546265 is a reply to message #546261] Mon, 12 July 2010 10:42 Go to previous messageGo to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi Ivan,

this does not help.

Maybe I should add, that I declared prototype as an external library,
because I also need it in a custom widget running in an iframe.

So I decided, to add prototype.js as a
org.eclipse.equinox.http.registry.resources and than used the resulting
url in the IResouce as an external library, since I guess when using it
as an internal resource, I cannot access it from within the iframe and I
didn't want to declare it twice.

And from a quick check if declaring as an internal library helps, I can
state that I observe the same behaviour.

Is there any chance to have a look at the minimized version of qooxdoo
from within eclipse, or is it minimized on the fly?

Regards,
Philipp

Am 12.07.2010 12:32, schrieb Ivan Furnadjiev:
> Hi Philipp,
>
> you could try to include the prototype library without compression:
> public final RegisterOptions getOptions() {
> return RegisterOptions.VERSION;
> }
>
> HTH,
> Ivan
>
> On 07/12/2010 12:14 PM, Philipp Leusmann wrote:
>> Hi,
>>
>> to simplify working in JS, I want to include the Prototype JS Library
>> in our project.
>> Before you tell me, I can use qooxdoo for all the stuff prototype can
>> do, let me say, I have been using prototype for quite some time now
>> and I want to keep using it.
>>
>> The Problem is, as soon as I include it (using an IResource), I get an
>> JS-error "$ is not a function element = $(element);" in the
>> Firebug-console and I cannot use prototype.
>> The strange thing is, when I start my application with
>> "-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone
>> and prototype works.
>> Maybe the minimized qooxdoo-version messes around with $ ?
>>
>> Any experience with that?
>>
>> Regards,
>> Philipp
Re: Problem including Prototype Library [message #546290 is a reply to message #546265] Mon, 12 July 2010 11:49 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Philipp,

both debug and standard versions of qooxdoo library used by RAP can be
found in org.eclipse.rap.rwt.q07 bundle:
org.eclipse.rap.rwt.q07\js\qx-debug.js
org.eclipse.rap.rwt.q07\js\qx.js

Best,
Ivan

On 07/12/2010 1:42 PM, Philipp Leusmann wrote:
> Hi Ivan,
>
> this does not help.
>
> Maybe I should add, that I declared prototype as an external library,
> because I also need it in a custom widget running in an iframe.
>
> So I decided, to add prototype.js as a
> org.eclipse.equinox.http.registry.resources and than used the
> resulting url in the IResouce as an external library, since I guess
> when using it as an internal resource, I cannot access it from within
> the iframe and I didn't want to declare it twice.
>
> And from a quick check if declaring as an internal library helps, I
> can state that I observe the same behaviour.
>
> Is there any chance to have a look at the minimized version of qooxdoo
> from within eclipse, or is it minimized on the fly?
>
> Regards,
> Philipp
>
> Am 12.07.2010 12:32, schrieb Ivan Furnadjiev:
>> Hi Philipp,
>>
>> you could try to include the prototype library without compression:
>> public final RegisterOptions getOptions() {
>> return RegisterOptions.VERSION;
>> }
>>
>> HTH,
>> Ivan
>>
>> On 07/12/2010 12:14 PM, Philipp Leusmann wrote:
>>> Hi,
>>>
>>> to simplify working in JS, I want to include the Prototype JS Library
>>> in our project.
>>> Before you tell me, I can use qooxdoo for all the stuff prototype can
>>> do, let me say, I have been using prototype for quite some time now
>>> and I want to keep using it.
>>>
>>> The Problem is, as soon as I include it (using an IResource), I get an
>>> JS-error "$ is not a function element = $(element);" in the
>>> Firebug-console and I cannot use prototype.
>>> The strange thing is, when I start my application with
>>> "-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone
>>> and prototype works.
>>> Maybe the minimized qooxdoo-version messes around with $ ?
>>>
>>> Any experience with that?
>>>
>>> Regards,
>>> Philipp
>
Re: Problem including Prototype Library [message #546292 is a reply to message #546236] Mon, 12 July 2010 11:58 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi Philipp,

I guess the problem is that "$" is globally defined in RAP and in
Prototype:

See first line in qx.js and

function $(element) {
if (arguments.length > 1) {
for (var i = 0, elements = [], length = arguments.length; i <
length; i++)
elements.push($(arguments[i]));
return elements;
}
if (Object.isString(element))
element = document.getElementById(element);
return Element.extend(element);
}

in Prototype.

You could try to replace "$" in qx.js with a different char...

That's one of the reasons I prefer strongly typed languages with
namespaces :-)

Regards,
Stefan.

Philipp Leusmann schrieb:
> Hi,
>
> to simplify working in JS, I want to include the Prototype JS Library in
> our project.
> Before you tell me, I can use qooxdoo for all the stuff prototype can
> do, let me say, I have been using prototype for quite some time now and
> I want to keep using it.
>
> The Problem is, as soon as I include it (using an IResource), I get an
> JS-error "$ is not a function element = $(element);" in the
> Firebug-console and I cannot use prototype.
> The strange thing is, when I start my application with
> "-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone and
> prototype works.
> Maybe the minimized qooxdoo-version messes around with $ ?
>
> Any experience with that?
>
> Regards,
> Philipp
Re: Problem including Prototype Library [message #546325 is a reply to message #546292] Mon, 12 July 2010 13:16 Go to previous messageGo to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi Stefan,

thanks for your comment.

Because I really wouldn't like to go with a custom version of qx.js, I
filed a feature request to change the variable name
(<https://bugs.eclipse.org/bugs/show_bug.cgi?id=319554>)

Is there any chance to get this change? What/who generates the minimized
version?

Regards,
Philipp


Am 12.07.2010 13:58, schrieb Stefan Roeck:
> Hi Philipp,
>
> I guess the problem is that "$" is globally defined in RAP and in
> Prototype:
>
> See first line in qx.js and
>
> function $(element) {
> if (arguments.length > 1) {
> for (var i = 0, elements = [], length = arguments.length; i < length; i++)
> elements.push($(arguments[i]));
> return elements;
> }
> if (Object.isString(element))
> element = document.getElementById(element);
> return Element.extend(element);
> }
>
> in Prototype.
>
> You could try to replace "$" in qx.js with a different char...
>
> That's one of the reasons I prefer strongly typed languages with
> namespaces :-)
>
> Regards,
> Stefan.
>
> Philipp Leusmann schrieb:
>> Hi,
>>
>> to simplify working in JS, I want to include the Prototype JS Library
>> in our project.
>> Before you tell me, I can use qooxdoo for all the stuff prototype can
>> do, let me say, I have been using prototype for quite some time now
>> and I want to keep using it.
>>
>> The Problem is, as soon as I include it (using an IResource), I get an
>> JS-error "$ is not a function element = $(element);" in the
>> Firebug-console and I cannot use prototype.
>> The strange thing is, when I start my application with
>> "-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone
>> and prototype works.
>> Maybe the minimized qooxdoo-version messes around with $ ?
>>
>> Any experience with that?
>>
>> Regards,
>> Philipp
Re: Problem including Prototype Library [message #546382 is a reply to message #546325] Mon, 12 July 2010 15:26 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Philipp,

the qooxdoo minimized version used by RAP is generated by us (RAP team),
but with the original qooxdoo 0.7.4 tooling (pyton based).
As long as we do it in that way I doubt that we can fix your issue.
BTW for me, using two javascript frameworks together is like using two
antivirus programs on the same computer - the chance to run into
conflict is very high (like your case).

Best,
Ivan

On 07/12/2010 4:16 PM, Philipp Leusmann wrote:
> Hi Stefan,
>
> thanks for your comment.
>
> Because I really wouldn't like to go with a custom version of qx.js, I
> filed a feature request to change the variable name
> (<https://bugs.eclipse.org/bugs/show_bug.cgi?id=319554>)
>
> Is there any chance to get this change? What/who generates the
> minimized version?
>
> Regards,
> Philipp
>
>
> Am 12.07.2010 13:58, schrieb Stefan Roeck:
>> Hi Philipp,
>>
>> I guess the problem is that "$" is globally defined in RAP and in
>> Prototype:
>>
>> See first line in qx.js and
>>
>> function $(element) {
>> if (arguments.length > 1) {
>> for (var i = 0, elements = [], length = arguments.length; i < length;
>> i++)
>> elements.push($(arguments[i]));
>> return elements;
>> }
>> if (Object.isString(element))
>> element = document.getElementById(element);
>> return Element.extend(element);
>> }
>>
>> in Prototype.
>>
>> You could try to replace "$" in qx.js with a different char...
>>
>> That's one of the reasons I prefer strongly typed languages with
>> namespaces :-)
>>
>> Regards,
>> Stefan.
>>
>> Philipp Leusmann schrieb:
>>> Hi,
>>>
>>> to simplify working in JS, I want to include the Prototype JS Library
>>> in our project.
>>> Before you tell me, I can use qooxdoo for all the stuff prototype can
>>> do, let me say, I have been using prototype for quite some time now
>>> and I want to keep using it.
>>>
>>> The Problem is, as soon as I include it (using an IResource), I get an
>>> JS-error "$ is not a function element = $(element);" in the
>>> Firebug-console and I cannot use prototype.
>>> The strange thing is, when I start my application with
>>> "-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone
>>> and prototype works.
>>> Maybe the minimized qooxdoo-version messes around with $ ?
>>>
>>> Any experience with that?
>>>
>>> Regards,
>>> Philipp
>
Re: Problem including Prototype Library [message #546391 is a reply to message #546382] Mon, 12 July 2010 15:37 Go to previous messageGo to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi Ivan,

sure you are right about using two frameworks, but in this case I guess
the problem could easily be fixed, by removing the obvious $ variable name.
Why do you think this would not fix my problem? Modifying the
python-script to use something other than $ shouldn't be too hard.

Philipp

Am 12.07.2010 17:26, schrieb Ivan Furnadjiev:
> Hi Philipp,
>
> the qooxdoo minimized version used by RAP is generated by us (RAP team),
> but with the original qooxdoo 0.7.4 tooling (pyton based).
> As long as we do it in that way I doubt that we can fix your issue.
> BTW for me, using two javascript frameworks together is like using two
> antivirus programs on the same computer - the chance to run into
> conflict is very high (like your case).
>
> Best,
> Ivan
>
> On 07/12/2010 4:16 PM, Philipp Leusmann wrote:
>> Hi Stefan,
>>
>> thanks for your comment.
>>
>> Because I really wouldn't like to go with a custom version of qx.js, I
>> filed a feature request to change the variable name
>> (<https://bugs.eclipse.org/bugs/show_bug.cgi?id=319554>)
>>
>> Is there any chance to get this change? What/who generates the
>> minimized version?
>>
>> Regards,
>> Philipp
>>
>>
>> Am 12.07.2010 13:58, schrieb Stefan Roeck:
>>> Hi Philipp,
>>>
>>> I guess the problem is that "$" is globally defined in RAP and in
>>> Prototype:
>>>
>>> See first line in qx.js and
>>>
>>> function $(element) {
>>> if (arguments.length > 1) {
>>> for (var i = 0, elements = [], length = arguments.length; i < length;
>>> i++)
>>> elements.push($(arguments[i]));
>>> return elements;
>>> }
>>> if (Object.isString(element))
>>> element = document.getElementById(element);
>>> return Element.extend(element);
>>> }
>>>
>>> in Prototype.
>>>
>>> You could try to replace "$" in qx.js with a different char...
>>>
>>> That's one of the reasons I prefer strongly typed languages with
>>> namespaces :-)
>>>
>>> Regards,
>>> Stefan.
>>>
>>> Philipp Leusmann schrieb:
>>>> Hi,
>>>>
>>>> to simplify working in JS, I want to include the Prototype JS Library
>>>> in our project.
>>>> Before you tell me, I can use qooxdoo for all the stuff prototype can
>>>> do, let me say, I have been using prototype for quite some time now
>>>> and I want to keep using it.
>>>>
>>>> The Problem is, as soon as I include it (using an IResource), I get an
>>>> JS-error "$ is not a function element = $(element);" in the
>>>> Firebug-console and I cannot use prototype.
>>>> The strange thing is, when I start my application with
>>>> "-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone
>>>> and prototype works.
>>>> Maybe the minimized qooxdoo-version messes around with $ ?
>>>>
>>>> Any experience with that?
>>>>
>>>> Regards,
>>>> Philipp
>>
Re: Problem including Prototype Library [message #546418 is a reply to message #546391] Mon, 12 July 2010 17:08 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Philipp,

maybe you could try to build qooxdoo yourself:
1. Grab build project from CVS: releng\org.eclipse.rap.qx.build
2. Grab qooxdoo 0.7.4 SDK from
http://sourceforge.net/projects/qooxdoo/files/qooxdoo-legacy /0.7.4/qooxdoo-0.7.4-sdk.zip/download
3. Use build-custom.sh to build your qooxdoo (change TOOL variable to
point to your qooxdoo sdk location).

Best,
Ivan


On 07/12/2010 6:37 PM, Philipp Leusmann wrote:
> Hi Ivan,
>
> sure you are right about using two frameworks, but in this case I
> guess the problem could easily be fixed, by removing the obvious $
> variable name.
> Why do you think this would not fix my problem? Modifying the
> python-script to use something other than $ shouldn't be too hard.
>
> Philipp
>
> Am 12.07.2010 17:26, schrieb Ivan Furnadjiev:
>> Hi Philipp,
>>
>> the qooxdoo minimized version used by RAP is generated by us (RAP team),
>> but with the original qooxdoo 0.7.4 tooling (pyton based).
>> As long as we do it in that way I doubt that we can fix your issue.
>> BTW for me, using two javascript frameworks together is like using two
>> antivirus programs on the same computer - the chance to run into
>> conflict is very high (like your case).
>>
>> Best,
>> Ivan
>>
>> On 07/12/2010 4:16 PM, Philipp Leusmann wrote:
>>> Hi Stefan,
>>>
>>> thanks for your comment.
>>>
>>> Because I really wouldn't like to go with a custom version of qx.js, I
>>> filed a feature request to change the variable name
>>> (<https://bugs.eclipse.org/bugs/show_bug.cgi?id=319554>)
>>>
>>> Is there any chance to get this change? What/who generates the
>>> minimized version?
>>>
>>> Regards,
>>> Philipp
>>>
>>>
>>> Am 12.07.2010 13:58, schrieb Stefan Roeck:
>>>> Hi Philipp,
>>>>
>>>> I guess the problem is that "$" is globally defined in RAP and in
>>>> Prototype:
>>>>
>>>> See first line in qx.js and
>>>>
>>>> function $(element) {
>>>> if (arguments.length > 1) {
>>>> for (var i = 0, elements = [], length = arguments.length; i < length;
>>>> i++)
>>>> elements.push($(arguments[i]));
>>>> return elements;
>>>> }
>>>> if (Object.isString(element))
>>>> element = document.getElementById(element);
>>>> return Element.extend(element);
>>>> }
>>>>
>>>> in Prototype.
>>>>
>>>> You could try to replace "$" in qx.js with a different char...
>>>>
>>>> That's one of the reasons I prefer strongly typed languages with
>>>> namespaces :-)
>>>>
>>>> Regards,
>>>> Stefan.
>>>>
>>>> Philipp Leusmann schrieb:
>>>>> Hi,
>>>>>
>>>>> to simplify working in JS, I want to include the Prototype JS Library
>>>>> in our project.
>>>>> Before you tell me, I can use qooxdoo for all the stuff prototype can
>>>>> do, let me say, I have been using prototype for quite some time now
>>>>> and I want to keep using it.
>>>>>
>>>>> The Problem is, as soon as I include it (using an IResource), I
>>>>> get an
>>>>> JS-error "$ is not a function element = $(element);" in the
>>>>> Firebug-console and I cannot use prototype.
>>>>> The strange thing is, when I start my application with
>>>>> "-Dorg.eclipse.rwt.clientLibraryVariant=DEBUG", the JS-error is gone
>>>>> and prototype works.
>>>>> Maybe the minimized qooxdoo-version messes around with $ ?
>>>>>
>>>>> Any experience with that?
>>>>>
>>>>> Regards,
>>>>> Philipp
>>>
>
Previous Topic:RAP and GWT
Next Topic:[Display].timerExec() not executed when expected (as RCP does)
Goto Forum:
  


Current Time: Mon Apr 22 03:32:09 GMT 2024

Powered by FUDForum. Page generated in 0.04352 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top