Re: [Proto-Scripty] upload plugin and photo(image) gallery plugin
Your first port of call should be http://scripteka.com for all of your ProtoScripty extras love. As far as uploads go, you realize that Ajax can't upload files (except in Safari 5 and Chrome.latest), so any of these systems must fake an in-page upload using a dynamically created iframe. As far as the progress meter goes, the only other issue there is that you usually also have to have a Perl module on your server to monitor the upload progress. PHP won't do it, not sure about Ruby or Python. It depends a LOT on your server whether you get a realistic idea how much of the file is actually there, and you generally need another process pinging the server periodically for updates. I personally just put a spinner or barber pole up and call it done. One project you might want to look at (it doesn't use Prototype, but it is compatible) is NoSwfUpload. It's a gnarly bit of fairly spaghetti code, but it does a true Ajax upload in the one or two browsers that can do that, and fakes it with an iframe for the rest. It does do something to make a progress bar, and it seems to actually work or at least it fooled me. Walter On Jan 12, 2011, at 4:14 PM, Ivan Polak wrote: Hi!, please, is there any plugin in prototype (scriptaculous) to upload file (with progress bar, with posibility to upload two or more files) for example like in facebook image gallery upload. and the second question is, is there any image(photo) gallery plugin with drag&drop feature, like in facebook (too :-). thanks! Ivan -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: help me, about Class.create
Hi, The properties you pass into `Class.create` are put on the prototype of the resulting constructor function ("class", for lack of a better term). That means those properties are *shared* by all instances created by that constructor function. So when either the `ChildA` or `ChildB` constructor function writes to the properties on `this.intro`, they're writing to properties on the *same object*. It's shared between them. That's why you see the behavior you see. To fix it, just change Parent to create a separate `intro` for each instance; this is most easily done in the constructor. Separately, your ChildA and ChildB need to call the superclass's constructor, and there's a typo in your code in `ChildB` code ("introl" instead of "intro"). Finally, any code using `document.write` will only work during the main page load. Corrected example: http://jsbin.com/evada4 This all comes down to how prototypes sit behind instances. Consider: var Foo = Class.create({ bar: "I'm bar", show: function() { alert(this.bar); } }); // Let's create an instance var f = new Foo(); // `f` does *not* have a `bar` property, but `Foo.prototype` does f.show(); // alerts "I'm bar" alert(f.hasOwnProperty("bar")); // alerts "false" // Now let's give `f` its *own* `bar` property f.bar = "I'm the updated bar"; f.show(); // alerts "I'm the updated bar" alert(f.hasOwnProperty("bar")); // alerts "true" // Now let's remove `f`'s own `bar` delete f.bar; f.show(); // alerts "I'm bar" -- it's falling back to using the prototype again alert(f.hasOwnProperty("bar")); // alerts "false" When you go to look up a property on an instance, if the instance *itself* has that property, then that value is used. If not, we look to the prototype and use its value if there is one. An instance gets its *own* property if you assign to that property (`f.bar = ...;` above). If you don't, it keeps using its prototype's property (if any). The thing with your `intro` property is that nothing is ever assigned to it, and so no instance had its own `intro` property, and they were all falling back on the one on `Parent.prototype`. All you ever did in the `ChildA` and `ChildB` constructors was write to property *on* that object; you never wrote to the `intro` property itself, and so you never created a separate `intro` property for each instance. HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Jan 12, 1:08 pm, 쏘주망태 wrote: > // my code : > > var Parent = Class.create({ > intro:{ > name:'', > age:0 > }, > initialize:function(){}, > show:function(){ > document.write(this.intro.name); > } > > }); > > var ChildA = Class.create(Parent, { > initialize:function(){ > this.intro.name = 'A'; > this.intro.age = 10; > } > > }); > > var ChildB = Class.create(Parent, { > initialize:function(){ > this.intro.name = 'B'; > this.introl.age = 20; > } > > }); > > ex1) > var a = new ChildA(); > var b = new ChildB(); > > a.show(); // => print 'B' I can't understand..:( > b.show(); // => print 'B' > > ex2) > var b = new ChildB(); > var a = new ChildA(); > > a.show(); // print 'A' > b.show(); // print 'A' I can't understand..:( > > //= > Why do these problems occur? -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] upload plugin and photo(image) gallery plugin
Hi!, please, is there any plugin in prototype (scriptaculous) to upload file (with progress bar, with posibility to upload two or more files) for example like in facebook image gallery upload. and the second question is, is there any image(photo) gallery plugin with drag&drop feature, like in facebook (too :-). thanks! Ivan -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] help me, about Class.create
// my code : var Parent = Class.create({ intro:{ name:'', age:0 }, initialize:function(){}, show:function(){ document.write(this.intro.name); } }); var ChildA = Class.create(Parent, { initialize:function(){ this.intro.name = 'A'; this.intro.age = 10; } }); var ChildB = Class.create(Parent, { initialize:function(){ this.intro.name = 'B'; this.introl.age = 20; } }); ex1) var a = new ChildA(); var b = new ChildB(); a.show(); // => print 'B' I can't understand..:( b.show(); // => print 'B' ex2) var b = new ChildB(); var a = new ChildA(); a.show(); // print 'A' b.show(); // print 'A' I can't understand..:( //= Why do these problems occur? -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: I wrote a dropdown multiselect also
nice! -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: License link on main page not working
Hey, thanx a lot. That was fast! On Wed, Jan 12, 2011 at 10:03 AM, Tobie Langel wrote: > Fixed the link. > > FWIW, the license is included in the src code. > > Best, > > Tobie > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: License link on main page not working
Fixed the link. FWIW, the license is included in the src code. Best, Tobie -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.