resources + tinymce popus

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

resources + tinymce popus

Jakob Munih
resources + tinymce popus

I have a strange situation with resources plugin and before reporting a bug I would like to ask other developers if is actually a bug or just a wrong approach or a same question was already asked.

TinyMce uses pop-up providing different functionalities (table edition etc.) In combination with resources plug-in this leads to a problem.  The tinymce editor bottom opens an pop-up with html thate references JS and CSS relative to its apth (with ../js/ or and css  ./tabler/default.css). The resources plug-in send an 404 for this resources and they are not created on the fly. If you specify the resources in *Resoures.groovy, in the run-app process the JS is recognised and then available for the pop up. Is there a way to overcome this without specifying each tinymce resource?

The funny thing that the popups are opened correctly if the tiny-me is included in the first level. If the tinymce is included by another plugin the resources are 404. To be clearer:
my-plugin project > requirens:TinyMCE = works
application > requieres:my-plugin > requires:TinyMCE = 404

Jakob

Reply | Threaded
Open this post in threaded view
|

Re: resources + tinymce popus

Marc Palmer Local

On 28 Mar 2012, at 10:20, Jakob Munih wrote:

>
> I have a strange situation with resources plugin and before reporting a bug I would like to ask other developers if is actually a bug or just a wrong approach or a same question was already asked.
>
> TinyMce uses pop-up providing different functionalities (table edition etc.) In combination with resources plug-in this leads to a problem.  The tinymce editor bottom opens an pop-up with html thate references JS and CSS relative to its apth (with ../js/ or and css  ./tabler/default.css). The resources plug-in send an 404 for this resources and they are not created on the fly. If you specify the resources in *Resoures.groovy, in the run-app process the JS is recognised and then available for the pop up. Is there a way to overcome this without specifying each tinymce resource?
>
> The funny thing that the popups are opened correctly if the tiny-me is included in the first level. If the tinymce is included by another plugin the resources are 404. To be clearer:
> my-plugin project > requirens:TinyMCE = works
> application > requieres:my-plugin > requires:TinyMCE = 404

Hi,

I never considered this before but I suspect adhoc (undeclared) resources simply cannot work for plugins in the way you are hoping.

The reason is that there's no way for Resources to know that a relative request for ../js/something.js comes from the Tiny MCE plugin or the app or any of your other plugins. It *could* brute force it but this is probably not appropriate.

Tip: declare the resources, or exclude TinyMCE from processing. As previously discussed on another thread, JS libs that load content relative to themselves do not lend themselves well to optimisation.

Marc
~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java/UX)

I offer commercial support for Grails plugins from as low as $50/mo.
For details see: http://grailsrocks.com

Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc
Contributor @ http://grails.org |  Founder @ http://noticelocal.com
Developer @ http://weceem.org | Member @ http://spottymushroom.com
Twitter: http://twitter.com/wangjammer5 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: resources + tinymce popus

olivertynes
When you're already on the horn here...

How do you do this exclusion? I couldn't get it to work for the life
of me, even after digging through half the source code.
I just looked at the docs and nothing major has changed...

The problem as I described it the last time:
http://grails.1312388.n4.nabble.com/Disabling-url-rewriting-completely-in-the-resource-plugin-td4266248.html

This question was left unanswered and I reverted to making the
r:require functionality manually in a taglib instead of wasting more
hours.
If there is any possibility that you could chime in, it would be
awesome as I love the idea of bundle declaring but I do not want
rewriting/auto-bundling.
Not sure of the mailing-list ethics of piggybacking another question,
but I am more or less asking for an elaboration of your answer so..

Cheers!
-Oliver

On Wed, Mar 28, 2012 at 12:01 PM, Marc Palmer <[hidden email]> wrote:

>
> On 28 Mar 2012, at 10:20, Jakob Munih wrote:
>
>>
>> I have a strange situation with resources plugin and before reporting a bug I would like to ask other developers if is actually a bug or just a wrong approach or a same question was already asked.
>>
>> TinyMce uses pop-up providing different functionalities (table edition etc.) In combination with resources plug-in this leads to a problem.  The tinymce editor bottom opens an pop-up with html thate references JS and CSS relative to its apth (with ../js/ or and css  ./tabler/default.css). The resources plug-in send an 404 for this resources and they are not created on the fly. If you specify the resources in *Resoures.groovy, in the run-app process the JS is recognised and then available for the pop up. Is there a way to overcome this without specifying each tinymce resource?
>>
>> The funny thing that the popups are opened correctly if the tiny-me is included in the first level. If the tinymce is included by another plugin the resources are 404. To be clearer:
>> my-plugin project > requirens:TinyMCE = works
>> application > requieres:my-plugin > requires:TinyMCE = 404
>
> Hi,
>
> I never considered this before but I suspect adhoc (undeclared) resources simply cannot work for plugins in the way you are hoping.
>
> The reason is that there's no way for Resources to know that a relative request for ../js/something.js comes from the Tiny MCE plugin or the app or any of your other plugins. It *could* brute force it but this is probably not appropriate.
>
> Tip: declare the resources, or exclude TinyMCE from processing. As previously discussed on another thread, JS libs that load content relative to themselves do not lend themselves well to optimisation.
>
> Marc
> ~ ~ ~
> Marc Palmer
> Freelancer (Grails/Groovy/Java/UX)
>
> I offer commercial support for Grails plugins from as low as $50/mo.
> For details see: http://grailsrocks.com
>
> Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc
> Contributor @ http://grails.org |  Founder @ http://noticelocal.com
> Developer @ http://weceem.org | Member @ http://spottymushroom.com
> Twitter: http://twitter.com/wangjammer5
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

--
*****
Oliver Tynes
Developer
Uni CIPR -- www.cipr.uni.no
55588266
*****

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: resources + tinymce popus

Marc Palmer Local

On 28 Mar 2012, at 22:38, Oliver Severin Tynes wrote:

> When you're already on the horn here...
>
> How do you do this exclusion? I couldn't get it to work for the life
> of me, even after digging through half the source code.
> I just looked at the docs and nothing major has changed...
>
> The problem as I described it the last time:
> http://grails.1312388.n4.nabble.com/Disabling-url-rewriting-completely-in-the-resource-plugin-td4266248.html
>
> This question was left unanswered and I reverted to making the
> r:require functionality manually in a taglib instead of wasting more
> hours.
> If there is any possibility that you could chime in, it would be
> awesome as I love the idea of bundle declaring but I do not want
> rewriting/auto-bundling.
> Not sure of the mailing-list ethics of piggybacking another question,
> but I am more or less asking for an elaboration of your answer so..


This was covered here on the mailing list just last week:

http://grails.1312388.n4.nabble.com/Grails-2-0-and-Resources-1-1-6-TinyMCE-not-loading-td4489466.html

Cheers

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java/UX)

I offer commercial support for Grails plugins from as low as $50/mo.
For details see: http://grailsrocks.com

Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc
Contributor @ http://grails.org |  Founder @ http://noticelocal.com
Developer @ http://weceem.org | Member @ http://spottymushroom.com
Twitter: http://twitter.com/wangjammer5 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: resources + tinymce popus

Jakob Munih
So to solve this issue globaly it should be legal to add an TinyMceDefaultConfig.groovy to TinyMce Plugin

if (grails.resources.adhoc.excludes) {
    grails.resources.adhoc.excludes << '/js/tiny_mce/**/*.*'
} else {
    grails.resources.adhoc.excludes = ['/js/tiny_mce/**/*.*']
}

Jakob


-----Original Message-----
From: Marc Palmer [mailto:[hidden email]]
Sent: Thu 29.3.2012 8:49
To: [hidden email]
Subject: Re: [grails-user] resources + tinymce popus
 

On 28 Mar 2012, at 22:38, Oliver Severin Tynes wrote:

> When you're already on the horn here...
>
> How do you do this exclusion? I couldn't get it to work for the life
> of me, even after digging through half the source code.
> I just looked at the docs and nothing major has changed...
>
> The problem as I described it the last time:
> http://grails.1312388.n4.nabble.com/Disabling-url-rewriting-completely-in-the-resource-plugin-td4266248.html
>
> This question was left unanswered and I reverted to making the
> r:require functionality manually in a taglib instead of wasting more
> hours.
> If there is any possibility that you could chime in, it would be
> awesome as I love the idea of bundle declaring but I do not want
> rewriting/auto-bundling.
> Not sure of the mailing-list ethics of piggybacking another question,
> but I am more or less asking for an elaboration of your answer so..

This was covered here on the mailing list just last week:

http://grails.1312388.n4.nabble.com/Grails-2-0-and-Resources-1-1-6-TinyMCE-not-loading-td4489466.html

Cheers

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java/UX)

I offer commercial support for Grails plugins from as low as $50/mo.
For details see: http://grailsrocks.com

Blog: http://www.anyware.co.uk | Resum�: http://www.anyware.co.uk/marc
Contributor @ http://grails.org |  Founder @ http://noticelocal.com
Developer @ http://weceem.org | Member @ http://spottymushroom.com
Twitter: http://twitter.com/wangjammer5 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

winmail.dat (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: resources + tinymce popus

Marc Palmer Local

On 29 Mar 2012, at 08:22, Jakob Munih wrote:

> So to solve this issue globaly it should be legal to add an TinyMceDefaultConfig.groovy to TinyMce Plugin
>
> if (grails.resources.adhoc.excludes) {
>    grails.resources.adhoc.excludes << '/js/tiny_mce/**/*.*'
> } else {
>    grails.resources.adhoc.excludes = ['/js/tiny_mce/**/*.*']
> }


The newly released Platform Core 1.0.M1 plugin may make this cleaner, just use the doWithConfig block:

http://grailsrocks.github.com/grails-platform-core/guide/configuration.html#changing_config

Marc
~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java/UX)

I offer commercial support for Grails plugins from as low as $50/mo.
For details see: http://grailsrocks.com

Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc
Contributor @ http://grails.org |  Founder @ http://noticelocal.com
Developer @ http://weceem.org | Member @ http://spottymushroom.com
Twitter: http://twitter.com/wangjammer5 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: resources + tinymce popus

Mike Powers

I have run into a similar issue with TinyMCE and resources in the past. By default, TinyMCE does not handle this sort of setup very well...after staring at the source code for a while, I found a undocumented TinyMCE feature to work around this issue. Adding the following to your page BEFORE you include your compressed/bundled TinyMCE, will allow you to rename / combine the main TinyMCE js file however you would like. (The path should point to your tiny_mce *install* directory). You could also make use of the <g:resources> tag so the /path/to/tinymce is not hard coded.

<script> 
  /* support for compressing the tiny_mce libary..... */
  var tinyMCEPreInit = { base: '/some/path/to/js/tiny_mce', suffix: '' };
</script>

Hope this helps,
Mike


On Thu, Mar 29, 2012 at 3:38 AM, Marc Palmer <[hidden email]> wrote:

On 29 Mar 2012, at 08:22, Jakob Munih wrote:

> So to solve this issue globaly it should be legal to add an TinyMceDefaultConfig.groovy to TinyMce Plugin
>
> if (grails.resources.adhoc.excludes) {
>    grails.resources.adhoc.excludes << '/js/tiny_mce/**/*.*'
> } else {
>    grails.resources.adhoc.excludes = ['/js/tiny_mce/**/*.*']
> }


The newly released Platform Core 1.0.M1 plugin may make this cleaner, just use the doWithConfig block:

http://grailsrocks.github.com/grails-platform-core/guide/configuration.html#changing_config

Marc
~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java/UX)

I offer commercial support for Grails plugins from as low as $50/mo.
For details see: http://grailsrocks.com

Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc
Contributor @ http://grails.org |  Founder @ http://noticelocal.com
Developer @ http://weceem.org | Member @ http://spottymushroom.com
Twitter: http://twitter.com/wangjammer5


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email