I put framework related files into one directory under /js/
Like jquery + all the plugins i use.

I name the folder usually after the frameworks name: yui, prototype, etc..

/js/jquery/jquery.core.js
/js/jquery/jquery.cookie.js
/js/jquery/jquery.tooltips.js

So the top folder is usually empty, but i put there my .htacces for
handling all JS requests  and redirect them to my php script for gzip
compression and cache settings.

There is only one javascript file on the app/webroot/js/ root,
and thats the one with my custom code.

It is usually named after the projectname.

/js/.htaccess
/js/compression.php
/js/myproject.js
/js/prototype/prototoype_version.js
/js/prototype/event-selectors.js
/js/prototype/datepicker.js

For your described case of using js-files outside: I never work this
way. I put everything there that i need for the app. If i need it
outside, i just copy it.

The other way around is: If there is a vendor-app that i include and
it has own javascript files i move them to the cake app/webroot/js
directory for consitency. But i never had it that way either.

Lets say i have javascript functions that i only need on the profile
action of my users controller i simply extend the filename like so:

/js/myproject-userprofile.js
/js/myproject-eventcalendar.js
etc..

For me, this is perfect to manage.

On 4/6/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
> I know that many Cakephpers  use frameworks/libraries like  Prototype
> and JQuery.
>
>  What about if you come across some general purpose Javascript
> functoin and you add those to a "common.js" file that you keep
> accumulating to ?
>
> And I'm talking about a common.js type file that you might use even
> *outside* of your CakePHP websites.
>
> If you keep this general purpose common.js file inside you app/js
> directory, but you also use *elsewhere*, then pretty soon they become
> un-Synchronized, like if you forget to make a copy of one to the other
> location after making changes to only one of them.
>
> I think it's a common challenge some of us face -- or not.
>
> Wondering what you guys do.
>
> Steve
>
>
> >
>


-- 
Regards, Kjell
www.m3nt0r.de

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to