[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-11-02 Thread Per Cederberg

There is a new (hopefully working) version of the download page available now:

http://mochikit.com/pack.html

It only provides customized downloads from svn trunk at the moment.
And due to the default packed version not including all modules, some
modules are not available...

If you have time, please try this out a bit. And report any issues
here, so that I'll have them fixed to the final version.

Cheers,

/Per

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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-23 Thread Christoph Zwerschke

Great. Would be nice to have this on the MK homepage.

-- Christoph

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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-13 Thread Arnar Birgisson

On Mon, Oct 13, 2008 at 13:47, Per Cederberg [EMAIL PROTECTED] wrote:
 For version 1.5 I think we should consider having a nice little
 download web page where you can customize your packed version of
 MochiKit. I created a little dummy UI to show what I mean:

 http://www.percederberg.net/mochikit/pack.html

Yes, yes, excellent - +1 on that from me.

Minor usability pointer: When unselecting a module, instead of
unselecting everything that depends on it - highlight the relevant
part of uses XXX of those in some /error/ color.

cheers,
Arnar

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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-13 Thread Bob Ippolito

I had intended to build exactly that years ago, but never got around
to it... mostly because it's hard to do client side and I didn't want
that feature to be dependent on some server-side script.

My thinking was that we'd keep packed versions of every module (so
that we could continue to use the Java based packer, instead of
implementing a JavaScript version)[1] and some client-side could could
XHR them all down and concatenate them in the correct order, but the
problem is allowing the user to actually download that text. Using the
pasteboard would work I guess, but that's not a nice solution.

I suppose we could set something up where the client just does a POST
to some URL (maybe an app engine service or something) and the server
simply echos it back with a Content-Disposition header that forces
download.

[1] But maybe it would be reasonable to write an entirely JS based
packer with Narcissus
http://mxr.mozilla.org/mozilla/source/js/narcissus/ -- are there any
other projects like this that I'm not aware of?

-bob

On Mon, Oct 13, 2008 at 4:47 AM, Per Cederberg [EMAIL PROTECTED] wrote:

 Seeing that this wasn't just an omission, I won't change it for the 1.4 
 version.

 For version 1.5 I think we should consider having a nice little
 download web page where you can customize your packed version of
 MochiKit. I created a little dummy UI to show what I mean:

 http://www.percederberg.net/mochikit/pack.html

 If we plunge forward and start adding more extension modules (as
 suggested here before), I think such a UI would be important to keep
 all users happy.

 Cheers,

 /Per

 On Wed, Oct 8, 2008 at 3:44 PM, Arnar Birgisson [EMAIL PROTECTED] wrote:
 Hi Per,

 On Wed, Oct 8, 2008 at 15:38, Per Cederberg [EMAIL PROTECTED] wrote:
 The packed version of MochiKit still doesn't include the modules
 DragAndDrop and Sortable. I found a previous discussion of that in
 this thread:

 http://groups.google.com/group/mochikit/browse_thread/thread/9d3a82cd7b165e73/70b954863b717c99

 None of the two modules have been much modified lately, so perhaps
 they are now stable? Otherwise, I think we should make the docs
 clearer regarding their status and how to use them.

 Including them is fine with me, but for my own purposes I don't use
 that.. since for me MochiKit serves purely as a utility library rather
 than one of UI elements. I suspect there are others in a similar
 situation.

 What we really should do, and it should not be too hard, is make
 several packed versions. Basically for every module we'd provide a
 dependency-closed packed version - i.e. one that includes that
 module and all of its dependencies. Modifying the packed script to
 perform this should be doable.

 If people don't like the idea of so many packed versions, perhaps we
 could decide on two or three feature-sets and provide packed
 versions of these. I know MochiKit is not that big, and download time
 is not really the issue - but bandwidth can be an issue for the host.

 cheers,
 Arnar


 


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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-13 Thread Per Cederberg

Seeing that this wasn't just an omission, I won't change it for the 1.4 version.

For version 1.5 I think we should consider having a nice little
download web page where you can customize your packed version of
MochiKit. I created a little dummy UI to show what I mean:

http://www.percederberg.net/mochikit/pack.html

If we plunge forward and start adding more extension modules (as
suggested here before), I think such a UI would be important to keep
all users happy.

Cheers,

/Per

On Wed, Oct 8, 2008 at 3:44 PM, Arnar Birgisson [EMAIL PROTECTED] wrote:
 Hi Per,

 On Wed, Oct 8, 2008 at 15:38, Per Cederberg [EMAIL PROTECTED] wrote:
 The packed version of MochiKit still doesn't include the modules
 DragAndDrop and Sortable. I found a previous discussion of that in
 this thread:

 http://groups.google.com/group/mochikit/browse_thread/thread/9d3a82cd7b165e73/70b954863b717c99

 None of the two modules have been much modified lately, so perhaps
 they are now stable? Otherwise, I think we should make the docs
 clearer regarding their status and how to use them.

 Including them is fine with me, but for my own purposes I don't use
 that.. since for me MochiKit serves purely as a utility library rather
 than one of UI elements. I suspect there are others in a similar
 situation.

 What we really should do, and it should not be too hard, is make
 several packed versions. Basically for every module we'd provide a
 dependency-closed packed version - i.e. one that includes that
 module and all of its dependencies. Modifying the packed script to
 perform this should be doable.

 If people don't like the idea of so many packed versions, perhaps we
 could decide on two or three feature-sets and provide packed
 versions of these. I know MochiKit is not that big, and download time
 is not really the issue - but bandwidth can be an issue for the host.

 cheers,
 Arnar


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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-13 Thread Bob Ippolito

AFAIK Flash can't save to disk in that manner either.

You can build Flash content with free tools though (Adobe Flex 2 SDK,
MTASC, haXe, etc.).

-bob

On Mon, Oct 13, 2008 at 11:51 AM, Per Cederberg [EMAIL PROTECTED] wrote:

 Scary stuff. JS in JS... :-)

 I also gave the download issue some thought. Seems it would be
 possible to spoof a download in IE and Firefox (with privilege
 escalation warning). But not on Safari. And anyway, it would be an
 ugly and messy hack.

 So my next thought would be to create something in Flash that could
 save a file locally. We can even supply it with the actual text file
 content from JS just like Bob explained. Is that doable? I don't have
 a license for that stuff and have never worked in Flash myself, so
 perhaps I'm just dead wrong here.

 Third option would be to just open a window with the packed text and
 ask the user to do Ctrl-S. Perhaps by setting the window title or
 something.

 Cheers,

 /Per

 On Mon, Oct 13, 2008 at 6:29 PM, Bob Ippolito [EMAIL PROTECTED] wrote:
 I had intended to build exactly that years ago, but never got around
 to it... mostly because it's hard to do client side and I didn't want
 that feature to be dependent on some server-side script.

 My thinking was that we'd keep packed versions of every module (so
 that we could continue to use the Java based packer, instead of
 implementing a JavaScript version)[1] and some client-side could could
 XHR them all down and concatenate them in the correct order, but the
 problem is allowing the user to actually download that text. Using the
 pasteboard would work I guess, but that's not a nice solution.

 I suppose we could set something up where the client just does a POST
 to some URL (maybe an app engine service or something) and the server
 simply echos it back with a Content-Disposition header that forces
 download.

 [1] But maybe it would be reasonable to write an entirely JS based
 packer with Narcissus
 http://mxr.mozilla.org/mozilla/source/js/narcissus/ -- are there any
 other projects like this that I'm not aware of?

 -bob

 


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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-13 Thread Per Cederberg

On Mon, Oct 13, 2008 at 2:24 PM, Arnar Birgisson [EMAIL PROTECTED] wrote:
 Minor usability pointer: When unselecting a module, instead of
 unselecting everything that depends on it - highlight the relevant
 part of uses XXX of those in some /error/ color.

I fooled around a bit with the visual effects instead...

http://www.percederberg.net/mochikit/pack.html

Cheers,

/Per

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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-13 Thread Arnar Birgisson

On Mon, Oct 13, 2008 at 22:09, Per Cederberg [EMAIL PROTECTED] wrote:
 I fooled around a bit with the visual effects instead...
 http://www.percederberg.net/mochikit/pack.html

Ah, nice, very nice.

As for the other thing (generating the pack) - I don't think there is
a good, clean way to do it on the client side and probably something
server side (it can be dead-simple) is the way to go.

Although, there is one outrageous possibility: We could pregenerate
all possible combinations of modules. Now, before you call me crazy,
note that even if 14 modules could potentially mean 2^14~=16k
different combinations, the dependency graph puts severe restrictions
on that. So for fun, I decided to see how many there really are. Given
the dependency specs Per used in the above html file, there are
exactly 1952 possible combinations such that all dependencies are
included :D

Now, generating these 1952 files every time there is a commit might
seem stupid, but it is actually doable :)

Ok, now feel free to call me crazy.

Below this message is a Haskell program to find all legal combinations.

cheers,
Arnar


module Main where

import Control.Concurrent (forkIO)
import Control.Concurrent.MVar
import Data.Maybe (fromJust)
import Data.List (nub)

-- Modules in topological order, i.e.
-- a module must appear after all of its
-- dependencies
dependencies = [
 (Base,[]),
 (DateTime,[Base]),
 (Format,[Base]),
 (Iter,[Base]),
 (Async,[Base]),
 (DOM,[Base]),
 (Style,[Base]),
 (Color,[DOM, Style]),
 (Logging,[Base]),
 (LoggingPane,[Logging]),
 (Selector,[DOM, Style]),
 (Signal,[DOM, Style]),
 (Visual,[Color]),
 (DragAndDrop,[Iter,Signal,Visual]),
 (Sortable,[DragAndDrop])
 ]

modules = map fst dependencies


antichains :: MVar (Maybe [String]) - IO ()
antichains channel = antichains' [] modules  putMVar channel Nothing
where
  antichains' :: [String] - [String] - IO ()
  antichains' ac [] = putMVar channel (Just ac)  return ()
  antichains' ac (candidate:rest) =
  do if ac `accepts` candidate
then antichains' (candidate:ac) rest
else return ()
 antichains' ac rest
  chain `accepts` candidate =
  all (\c - not . elem c
 $ fromJust
 $ lookup candidate dependencies) chain

closure :: [String] - [String]
closure ms =
let missing = nub $ filter (not . flip elem ms)
  $ concatMap (fromJust . flip lookup dependencies) ms
in
  if null missing
 then ms
 else closure (ms ++ missing)

printer :: MVar () - MVar (Maybe [String]) - IO ()
printer stop in_ =
do v - takeMVar in_
   case v of
 Just xs - putStrLn $ show $ closure xs
 Nothing - putMVar stop ()
   printer stop in_

main :: IO ()
main = do chan - newEmptyMVar
  stop - newEmptyMVar
  forkIO $ printer stop chan
  forkIO $ antichains chan
  takeMVar stop
  return ()

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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-13 Thread Arnar Birgisson

Hi again,

On Mon, Oct 13, 2008 at 22:23, Arnar Birgisson [EMAIL PROTECTED] wrote:
 Although, there is one outrageous possibility: We could pregenerate
 all possible combinations of modules. Now, before you call me crazy,
 note that even if 14 modules could potentially mean 2^14~=16k
 different combinations, the dependency graph puts severe restrictions
 on that. So for fun, I decided to see how many there really are. Given
 the dependency specs Per used in the above html file, there are
 exactly 1952 possible combinations such that all dependencies are
 included :D

While I should probably point out that my last message was
tongue-in-cheek, there was also a glaring bug in my algorithm. After
fixing that and rerunning, the possible combinations are *merely* 817
:)

The correct code will appear on my blog in a few minutes.
http://www.hvergi.net/

cheers,
Arnar

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



[mochikit] Re: Including MochiKit.DragAndDrop and MochiKit.Sortable in the packed version?

2008-10-08 Thread Arnar Birgisson

Hi Per,

On Wed, Oct 8, 2008 at 15:38, Per Cederberg [EMAIL PROTECTED] wrote:
 The packed version of MochiKit still doesn't include the modules
 DragAndDrop and Sortable. I found a previous discussion of that in
 this thread:

 http://groups.google.com/group/mochikit/browse_thread/thread/9d3a82cd7b165e73/70b954863b717c99

 None of the two modules have been much modified lately, so perhaps
 they are now stable? Otherwise, I think we should make the docs
 clearer regarding their status and how to use them.

Including them is fine with me, but for my own purposes I don't use
that.. since for me MochiKit serves purely as a utility library rather
than one of UI elements. I suspect there are others in a similar
situation.

What we really should do, and it should not be too hard, is make
several packed versions. Basically for every module we'd provide a
dependency-closed packed version - i.e. one that includes that
module and all of its dependencies. Modifying the packed script to
perform this should be doable.

If people don't like the idea of so many packed versions, perhaps we
could decide on two or three feature-sets and provide packed
versions of these. I know MochiKit is not that big, and download time
is not really the issue - but bandwidth can be an issue for the host.

cheers,
Arnar

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