This project is archived and is in readonly mode.

#737 ✓wontfix
josh vermette

Request.HTML/stripScripts and remote JS script loading - have fix

Reported by josh vermette | August 26th, 2009 @ 01:22 AM | in 1.3.0 rc2 (closed)

Request.HTML, even with evalScripts=true, strips out the load of remote scripts from the html response. I changed stripScripts to accept a variable "useAssets" which will cause it to extract src="..." from

I then changed Request.HTML to take an option "useAssets" which will pass this through to stripScripts and handles the assets via the function it passes as "option".

I did basic testing of this in FF on Mac and Win, and IE7, looks like it works perfectly. It requires that Assets be loaded, but only if useAssets is set to true in the options.

Attached are the two mootools files from my codebase that I altered to do this. Note that they are collections of MooTools parts that I put together to work in our system, but the code is unchanged except for this fix. I have surrounded the changes with a "CALYDONIAN FIX" block which pairs the changed code with the commented-out original code directly following.

thanks,
j.

Comments and changes to this ticket

  • Scott Kyle

    Scott Kyle August 26th, 2009 @ 09:47 PM

    • State changed from “new” to “open”
    • Assigned user set to “Scott Kyle”

    Thank you for you code suggestions. While we can't make a part of -core dependent on something from -more, this is an issue that does need to get addressed. We're open to other suggestions, such as expanding stripScripts in Assets.js using a decorator.

  • josh vermette

    josh vermette August 26th, 2009 @ 09:53 PM

    Thanks for recognizing the problem! I understand not being able to make Core dependent on More, though I believe if you expand stripScripts in Assets.js you'd also have to somehow change the bahavior of Request.HTML in Assets.js since it needs to know about the difference between inline scripts and loaded assets.

    Maybe it's a stupid suggestion, but... make Assets part of Core? Seems like it's a pretty core feature from where I sit, though I'm unaware of what struggles you face behind the veil on your side.

    cheers,
    j.

  • Scott Kyle

    Scott Kyle August 26th, 2009 @ 10:11 PM

    You're right about that in Request.HTML, that's why it's a problem that requires some consideration. It isn't a stupid suggestion to move Assets into -core, it just most probably is not going to happen. :-) Above all, -core should remain lean and we must constantly fight the urge to add things into it.

  • josh vermette

    josh vermette August 26th, 2009 @ 10:15 PM

    Just as a last suggestion then...

    If you can't move Assets into Core, could you separate that code in Request.HTML into a separate class function and have Assets.js overwrite that function on load with a version that uses Assets?

    j.

  • Christoph Pojer

    Christoph Pojer September 5th, 2010 @ 01:58 PM

    • Milestone changed from 2.0 to 1.3.0 rc2
    • Assigned user changed from “Scott Kyle” to “w00fz”
    • Milestone order changed from “0” to “0”
  • w00fz

    w00fz September 5th, 2010 @ 02:31 PM

    • State changed from “open” to “wontfix”

    We discussed more about this and we really think these are 2 separates tasks that we can't really restrict in MooTools the way you are proposing.
    We understand the issue but we think it's a too specific scenario that should be handled by the developer, like the way you did, and not as part of MooTools.
    We'd like to keep Assets.javascript and Request.HTML independent of each other.

    Cheers.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Attachments

Pages