[Grok-dev] megrok.yui released
Martijn Faassen
faassen at startifact.com
Tue Aug 12 13:45:53 EDT 2008
Hey,
Michael Haubenwallner wrote:
> Jasper Spaans wrote:
>> Op 7 aug 2008, om 19:08 heeft Martijn Faassen het volgende geschreven:
>>
>>> Today I've wrapped up and released megrok.yui. This is a packaging
>>> of the YUI javascript and CSS library for easy installation into a
>>> Grok application. It uses megrok.resourcelibrary. To install
>>> megrok.yui, simply add this in the dependencies to your setup.py and
>>> rerun buildout.
>> I'm trying to use megrok.yui, but can't get it to work in my grok-0.13
>> application: I added megrok.yui as a dependency, ran buildout and then
>> modified the page templates like this:
>>
>> - <script type="text/javascript" tal:attributes="src static/yui/
>> build/yahoo/yahoo.js"></script>
>> + <script type="text/javascript" tal:attributes="src context/@@/YUI/
>> yahoo/yahoo.js"></script>
>>
>> This somehow makes my pages disappear; is something wrong with that
>> path or should I do something else to make this work?
>>
>
> I had a similar problem with megrok.tinymce.
> I'm now using
> <script type="text/javascript" tal:attributes="src
> string:${view/application_url}/@@/TinyMCE/tiny_mce.js">
> as a workaround to get the the js loaded.
That's odd as well!
> I am still not sure why
> TinyMCE.need()
> does not work as expected or why
This doesn't work as expected as megrok.tinymce doesn't actually declare
any files it needs directly. I started thinking about doing so, but then
tiny_mce.js isn't the only resource that it declares; there is also a
tiny_mce_popup.js and the source version, tiny_mce_src.js. This scared
me into not defining any policy at all, but this is of course not right
either.
In my reply to Jasper earlier I talked about some possible new
implementation of resource requirements which could allow such cases.
When I started to realize all this stuff I sort of stopped dead in my
tracks...
> <tal:block replace="resource_library:TinyMCE"/>
> throws an error
> <class 'zope.tal.taldefs.TALError'>: Unrecognized expression type
> "resource_library". in expression u'resource_library:TinyMCE', at line ...
This one is mysterious to me as well, and seems unrelated to the
TinyMCE.need() problem above. I could see this as a symptom of the
zc.rseourcelibrary ZCML not being loaded somehow and thus not
registering the expression...
(though fixing this error would still not result in TinyMCE being loaded)
Regards,
Martijn
More information about the Grok-dev
mailing list